Fatal error on object creation with incorrect number of parameters.

3 views
Skip to first unread message

mcot

unread,
Dec 17, 2010, 9:45:01 PM12/17/10
to PyV8
import PyV8


class Test2(PyV8.JSClass):

def __init__(self, param):
self.param = param

class Global(PyV8.JSClass):

def __init__(self):
self.Test2 = Test2


with PyV8.JSContext(Global()) as ctx:

ctx.eval("""
x = new Test2();
""")

This is giving me:


terminate called after throwing an instance of
'boost::python::error_already_set'
Aborted

And terminating the entire process.

Looks like it should send JavaScript undefined, which translates to
Python None?? (I'm not sure) to each of the params instead but I am
not sure how doable that is. I think just a exception would be fine
here, but the boost error that terminates the process is killer.

Spidermonkey treats as undefined.

js> function x(arg) { this.arg = arg }
js> obj = new x()
[object Object]
js> print(obj)
[object Object]
js> print(obj.arg)
undefined


Flier Lu

unread,
Dec 17, 2010, 10:32:15 PM12/17/10
to PyV8
It caused by a NULL pointer, please verify the issue with SVN trunk
after r315.

And I have submitted a issue #65 to follow up it

http://code.google.com/p/pyv8/issues/list?cursor=65&updated=65&ts=1292643078

Thanks :)

Flier Lu

unread,
Dec 17, 2010, 10:37:03 PM12/17/10
to PyV8
sorry, paste a wrong URL, please use

http://code.google.com/p/pyv8/issues/detail?id=65

On Dec 18, 11:32 am, Flier Lu <flier...@gmail.com> wrote:
> It caused by a NULL pointer, please verify the issue with SVN trunk
> after r315.
>
> And I have submitted a issue #65 to follow up it
>
> http://code.google.com/p/pyv8/issues/list?cursor=65&updated=65&ts=129...
Reply all
Reply to author
Forward
0 new messages