Groups
Groups
Sign in
Groups
Groups
PyV8
Conversations
About
Send feedback
Help
Eval'ing code in non-global / user defined scope.
30 views
Skip to first unread message
mcot
unread,
Feb 28, 2011, 4:50:00 PM
2/28/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to PyV8
Would it be possible to add something to pyv8 such that the
JSContext.eval() could evaluate the code in a given scope?
I think the scope could either be a function defined in JavaScript or
Python. The best example I have to show this feature would be:
// JavaScript Example
function xyz() {
this.x = 5;
this.y = 10;
}
someObj = new xyz()
code = "this.x = 10; this.y = 20"
scopeObject = someObj // modifies x and y in xyz
// Python Example
class XYZ(PyV8.JSClass):
def __init__(self):
self.x = 5;
self.y = 10;
class Global(PyV8.JSClass):
def __init__(self):
self.someObj = XYZ()
code = "this.x = 10; this.y = 20"
scopeObject = someObj // modifies x and y in XYZ
Demolishun
unread,
Nov 27, 2012, 8:30:45 AM
11/27/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to py...@googlegroups.com
Isn't this how contexts work already?
Reply all
Reply to author
Forward
0 new messages