marylinh / pyv8

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

Reference Error Setting Property on Non Global Object #70

Closed GoogleCodeExporter closed 9 years ago

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

import PyV8

class Obj(PyV8.JSClass):

    def __init__(self):
        pass

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
        x.y = 10
    """)

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

Expected:  (Using Spider Monkey Shell as Reference)

js> function x() {}
js> z = new x()     
[object Object]
js> z.y = 10        
10
js> 

Saw:

ReferenceError: ReferenceError: y (  @ 3 : 12 )  ->         x.y = 10

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

PyV8: Release 328 
OS: Linux x64

Please provide any additional information below.

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

GoogleCodeExporter commented 9 years ago
Fix it, the root cause is that the property support code made a wrong 
assumption, please verify the issue with SVN trunk after r332

Thanks

Original comment by flier...@gmail.com on 26 Jan 2011 at 3:59

GoogleCodeExporter commented 9 years ago
Hi.  The fix works for me.  It also seems to have fixed issue 69.

Thanks.

Original comment by ATM1...@gmail.com on 26 Jan 2011 at 9:49

GoogleCodeExporter commented 9 years ago
Sure, I think the root cause is same, thanks :)

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

GoogleCodeExporter commented 9 years ago
Issue 69 has been merged into this issue.

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