tychota / pyv8

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

JSArray initialize problem #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
[b]What steps will reproduce the problem?[/b]
1. import PyV8
2. PyV8.JSArray([1,2,3])

This error does not occour when we first enter to a context;
1. import PyV8
2. context=PyV8.JSContext()
3. context.enter()
4. PyV8.JSArray([1,2,3])
<_PyV8.JSArray object at 0x0120A8A0>

The reason we might have to use JSArray before entering to a context would
be using a globals class;

import PyV8
class Globals(PyV8.JSClass):
    def __init__(self):
        self.test=PyV8.JSArray([1,2,3])

context=PyV8.JSContext(Globals())
//segfault

[b]What is the expected output? What do you see instead?[/b]
A JSArray object but I get a segfault.

[b]What version of the product are you using? On what operating system?[/b]
PyV8-0.7.1.win32-py2.6.exe

Python2.6.2, 
PyV8-0.7.1, 
Windows XP Professional

Thank you.

Original issue reported on code.google.com by funk...@gmail.com on 24 Dec 2009 at 8:37

GoogleCodeExporter commented 9 years ago

Original comment by flier...@gmail.com on 25 Dec 2009 at 1:51

GoogleCodeExporter commented 9 years ago
The root cause is that we need enter a context before use any v8 javascript 
object.

To support create JSArray before context, I added a ILazyObject to wrap such 
object that 
need be construct when use it first time.

Please check out the source code from SVN after revision #175 or use private 
build in 
attachment.

Thanks

Original comment by flier...@gmail.com on 27 Dec 2009 at 1:59

Attachments: