[TIP] [nose-users] Re: ANN: Nose Plugin to run JavaScript tests

John J Lee jjl at pobox.com
Tue Feb 17 17:15:33 PST 2009


On Tue, 17 Feb 2009, Kumar McMillan wrote:

> On Tue, Feb 17, 2009 at 3:42 PM, John J Lee <jjl at pobox.com> wrote:
>>> Hmm, actually, I think it was just my misunderstanding of the original
>>> docs when it said you can't call a method *in Python* that was defined
>>> in JavaScript.  But calling a method in JS defined in JS probably
>>> always worked.
>>
>> What docs say that?  Both should be possible.  I don't work on it, I'm
>> just curious.
>
> It was a doctest example on the page Atul posted:
> http://code.google.com/p/python-spidermonkey/
> under Limitations, this line:
>
>>>> cx.eval_script("function foo(x) { return x + 1; }; foo;")
> {'prototype': {}}
[...]

Ah, you couldn't *return* a function (though you could return an object 
and call a method on it).  I think you could *call* named functions in the 
global namespace with a method on the context, though.  Maybe that's what 
you originally said -- I see you've already updated your web page.

Anyway, according to the tests, returning functions is supported in Paul's 
code (tests/define_function_test.py).


John




More information about the testing-in-python mailing list