marylinh / pyv8

Automatically exported from code.google.com/p/pyv8
0 stars 0 forks source link

Modify Python Objects from JavaScript #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

class Obj(PyV8.JSClass):

    def __init__(self):
        self.num = 10

class Global(PyV8.JSClass):

    def __init__(self):
        self.obj = Obj()

    def write(self, val):
        print val

with PyV8.JSContext(Global()) as ctx:

    ctx.eval("x = obj.num")
    print ctx.locals.x

    ctx.eval("obj.num = 11")

    ctx.eval("x = obj.num")
    print ctx.locals.x

What is the expected output? What do you see instead?

Expected:
10
11

Saw:
10
10

What version of the product are you using? On what operating system?

PyV8 Revision 328

Original issue reported on code.google.com by ATM1...@gmail.com on 24 Jan 2011 at 7:26

GoogleCodeExporter commented 9 years ago

Original comment by flier...@gmail.com on 25 Jan 2011 at 1:00

GoogleCodeExporter commented 9 years ago

Original comment by flier...@gmail.com on 27 Jan 2011 at 1:40