Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Keyword arguments to Context.execute as globals

#25

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

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

State: new
Milestone: none
Assigned to: Paul J. Davis Paul J. Davis

Activity

No comments yet.

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.