On Thu, Jan 31, 2013 at 3:47 PM, Robert Newson <rnew...@apache.org> wrote:

> Jason,
>
> I don't mean to be deliberately dense, but how could we, even in
> principle, write a test that asserts that a map function can't open a
> socket when there's no method to do so?
>

It's a good point. But, for example, we never even *look* at the global
namespace from the JS environment. We know the entire set of allowed
functions to be called. So, confirm that exactly those and none other is
visible?

Obviously tests like this were not so helpful with the one couchjs
implementation. I'm not complaining that the test is missing. I am saying I
will start to write tests like that.

But you are right. Mostly we will have to build confidence in a view server
the same way as the existing couchs, by code inspection.

Also, part of the sandbox is unrelated to the runtime. There should be no
way to store state between (e.g.) map() calls. I am not sure the current
view server is 100% correct in this regard. Hopefully I can move some of
these unit tests upstream and we can fix some bugs.

-- 
Iris Couch

Reply via email to