Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSArray initialize problem #15

Closed
GoogleCodeExporter opened this issue Aug 5, 2015 · 2 comments
Closed

JSArray initialize problem #15

GoogleCodeExporter opened this issue Aug 5, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

[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
Copy link
Author

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

  • Changed state: Accepted
  • Added labels: OpSys-All

@GoogleCodeExporter
Copy link
Author

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

  • Changed state: Fixed

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant