Changeset [ee6cfb8b67d11abb1f9f37dbd64ba3b64a032057] by Paul Davis
May 17th, 2009 @ 04:59 PM
Fixes global handling of "function foo() {}"
JavaScript acts a bit odd in this case in that the body of 'foo' is passed to JS_Class.add_property but not JS_Class.set_property. For now I added an add_prop method that special cases when the passed in value is a function and delegates to set_prop.
While I was at it, I went ahead and added support for deleting global properties as well. If your global handler has delitem defined, it will now get called for the JavaScript statement "delete foo;"
Thanks to Riccardo Pelizzi for the bug report. http://github.com/davisp/python-...
Committed by Paul Davis
- M THANKS
- M spidermonkey/context.c
- M tests/t.py
- M tests/test-global.py
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.