Changeset [4d971051b2f223e6a68154a57f61a7024dad598b] by Paul Davis

May 10th, 2009 @ 05:25 PM

Support for global property handlers.

If you want to be able to global properties using some sort of active logic you can now pass an object that has getitem and setitem defined to Runtime.new_context(). Something like:

>>> rt = spidermonkey.Runtime()
>>> cx = rt.new_context({"foo": "bar"})
>>> cx.execute("foo;")
'bar'

[#9 state:resolved] http://github.com/davisp/python-...

Committed by Paul Davis

  • M spidermonkey/context.c
  • M spidermonkey/context.h
  • M spidermonkey/runtime.c
  • M tests/test-global.py
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.