with statement is not supported
Reported by seb | November 19th, 2009 @ 06:56 AM
import spidermonkey
rt = spidermonkey.Runtime()
cx = rt.new_context()
cx.execute("""
function f(o) {
with (o) {
return test;
}
}
""");
print cx.execute("f({'test' : 'toto'});");
f = cx.execute("f");
print f({'test' : 'toto'})
Results in:
$ python test.py
toto
Traceback (most recent call last):
File "test.py", line 18, in <module>
print f({'test' : 'toto'})
RuntimeError: Failed to execute JS Function.
Comments and changes to this ticket
-
Paul J. Davis November 19th, 2009 @ 07:41 AM
- State changed from new to hold
Seb,
This won't get fixed until I upgrade to 1.8.1 or newer, which won't happen till I see some sort of official-ish release from Mozilla.
-
Paul J. Davis November 19th, 2009 @ 08:13 AM
It doesn't fix quite a few of the issues that will be solved when I move to 1.8.1, and come to think of it, I don't even know if it has with statements either.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Python/JavaScript bridge module, making use of Mozilla's spidermonkey JavaScript implementation. Allows implementation of JavaScript classes, objects and functions in Python, and evaluation and calling of JavaScript scripts and functions respectively. Borrows heavily from Claes Jacobssen's Javascript Perl module, in turn based on Mozilla's 'PerlConnect' Perl binding.