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

AST can't visit object properties: No to_python (by-value) converter found for C++ type: v8::internal::ObjectLiteralProperty* #235

Open
GoogleCodeExporter opened this issue May 22, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

    import PyV8 as v8

    ctx = v8.JSContext()
    ctx.enter()

    class Visitor:
        def onProgram(self, prog):
            for stmt in prog.body:
                stmt.visit(self)

        def onExpressionStatement(self, stmt):
            stmt.expression.visit(self)

        def onObjectLiteral(self, obj):
            print obj.properties

    x = v8.JSEngine().compile("({ a: b })")
    x.visit(Visitor())


What is the expected output? What do you see instead?
The expected output is a list of object properties.
The sample errors:

    Traceback (most recent call last):
      File "pyv8-bug.py", line 18, in <module>
        x.visit(Visitor())
      File "pyv8-bug.py", line 9, in onProgram
        stmt.visit(self)
      File "pyv8-bug.py", line 12, in onExpressionStatement
        stmt.expression.visit(self)
      File "pyv8-bug.py", line 15, in onObjectLiteral
        print obj.properties
    TypeError: No to_python (by-value) converter found for C++ type: v8::internal::ObjectLiteralProperty*


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

Revision 19632 on Ubuntu 12.04 x86_64


Please provide any additional information below.

There's a test case that covers this, but it isn't run because the according 
assignment node is never visited. I attached a patch to fix the test case.

Original issue reported on code.google.com by fab...@lastline.com on 5 Aug 2014 at 11:42

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