#32 ✓hold
seb

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

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.

New-ticket Create new ticket

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.

People watching this ticket

Pages