tychota / pyv8

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

external python class can't be wrapped #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
got an obscure bug that could really use some outside help on, that used to
work (v8 from 4-6 months ago plus PyV8 0.4) and now doesn't (v8 from today
plus PyV8 0.5).
setup:
http://code.google.com/p/pyv8 you get from here
http://pyjs.org go to the sf.net svn get code from there.
do this:
cd pyjamas
python bootstrap.py
cd pyv8
./pyv8run.py test.py

if you get a segfault due to debugging, disable it:

@@ -119,7 +120,7 @@ $pyjs.trackstack.push($pyjs.track);
         fp.write(txt)
         fp.close()

-    PyV8.debugger.enabled = True
+    #PyV8.debugger.enabled = True

the error being shown is:

terminate called after throwing an instance of 'CJavascriptException'
  what():  <v8::External::Cast()> Could not convert to external
Aborted

the object involved is a python class.

Original issue reported on code.google.com by luke.lei...@gmail.com on 24 Jun 2009 at 9:06

GoogleCodeExporter commented 8 years ago
Could you reproduce the issue in the SVN build, or attach your test.py? Because 
I 
can't reproduce it with latest code.

D:\Python\pyjamas\pyv8>echo print "hello" > test.py

D:\Python\pyjamas\pyv8>pyv8run.py test.py
hello

Original comment by flier...@gmail.com on 25 Jun 2009 at 4:31

GoogleCodeExporter commented 8 years ago
test.py:
from fred import fred
fred()

fred.py:
class fred:
    def __init__(self):
        print "this doesn't work"

i'll try latest svn, it'll be later - i packed my 32-bit machine for the 
conference.

Original comment by luke.lei...@gmail.com on 25 Jun 2009 at 4:37

GoogleCodeExporter commented 8 years ago
It seems caused by a missing attribute :(

>>> ctxt.eval(code)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
PyV8.JSError: JSError: undefined ( @ 1055 : 4 ) -> throw e.__name__;

I think the root cause is that you guys using function prototype, but pyv8 
doesn't 
have a full feature unit tests cover it :(

pyjslib.StopIteration = function () { };
pyjslib.StopIteration.prototype = new Error();
pyjslib.StopIteration.__name__ = 'StopIteration';
pyjslib.StopIteration.message = 'StopIteration';

I will check it in weekend, wish it is not too complex :S

Original comment by flier...@gmail.com on 25 Jun 2009 at 5:06

GoogleCodeExporter commented 8 years ago
Fix a crash issue when exception doesn't include any message information

http://code.google.com/p/pyv8/source/detail?r=128

Original comment by flier...@gmail.com on 27 Jun 2009 at 9:13

Attachments: