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

'pure virtual method called' while trying to convert list of lists #25

Closed
GoogleCodeExporter opened this issue May 2, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

-begin script-
import PyV8

class Global(PyV8.JSClass):
    pass

script = """ 
({ 
    'abla': function(){ 
        return  [ 
            [ 1, 'abla' ], 
            [ 2, 'ajkss' ], 
        ] 
    } 
}) 
"""

with PyV8.JSContext(Global()) as ctxt:
    obj = ctxt.eval(script)
    print PyV8.convert(obj.abla())
-end script-


Original issue reported on code.google.com by gauss...@gmail.com on 10 Jan 2010 at 12:10

@GoogleCodeExporter
Copy link
Author

Sorry, forgot:

gauss@pmain:~/Projects/pyv8test$ ./helloworld.py
pure virtual method called
terminate called without an active exception
Aborted

Original comment by gauss...@gmail.com on 10 Jan 2010 at 12:11

@GoogleCodeExporter
Copy link
Author

latest svn, python 2.6 on ubuntu 9.04 with v8 2.0.5.4 static

Original comment by gauss...@gmail.com on 10 Jan 2010 at 12:13

@GoogleCodeExporter
Copy link
Author

It is strange, the iterator will crash when we use nested array, you could use 
subscript as 
workaroud, like

for i in xrange(len(array))

Original comment by flier...@gmail.com on 10 Jan 2010 at 3:51

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

@GoogleCodeExporter
Copy link
Author

The root cause is the iterator of JSArray return a temporary object. To fix it, 
I force the 
iterator::dereference method return value instead of reference to a temporary 
object. 

Please check out the source code from SVN after r201, and verify it, thanks

Original comment by flier...@gmail.com on 11 Jan 2010 at 4:24

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Thank you, it's ok now.

Original comment by gauss...@gmail.com on 12 Jan 2010 at 6:01

@GoogleCodeExporter
Copy link
Author

Thanks :)

Original comment by flier...@gmail.com on 13 Jan 2010 at 2:22

  • Changed state: Verified

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