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

external python class can't be wrapped #5

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

external python class can't be wrapped #5

GoogleCodeExporter opened this issue May 2, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

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

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

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

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

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

@GoogleCodeExporter
Copy link
Author

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

  • Changed state: Fixed
  • Added labels: Component-Logic

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