#25 new
Paul J. Davis

Keyword arguments to Context.execute as globals

Reported by Paul J. Davis | July 6th, 2009 @ 01:47 PM

The current Context.execute(script) is a bit limited in terms of user friendliness of passing Python values to the JS interpreter. The current approach is to define a set of global values using Context.add_global().

I should update Context.execute to apply any keyword arguments as globals in the JavaScript interpreter. Something like:

assert cx.execute("var f = 2 * bar + omega; f;", bar=10, omega=13) == 33

No comments found

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