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

multiple native JSExtensions #16

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

multiple native JSExtensions #16

GoogleCodeExporter opened this issue May 2, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. register two different native JSExtension

---
firstSrc = "native function hello();"
firstPy = JSExtension("hello/python", firstSrc, lambda firstfunc: lambda 
name: "[HELLO] [" + name + "]", register=False)
firstPy.register()


secondSrc = "native function test();"
secondPy = JSExtension("test/python", secondSrc, lambda secondfunc: lambda 
name: "[TEST] [" + name + "]", register=False)
secondPy.register()


with JSContext(extensions=['test/python', 'hello/python']) as ctx: 
    res = ctx.eval("hello('flier')")

print 'RES:  '+ res

---


What is the expected output? What do you see instead?
RES:  [HELLO] [flier]

instead i get

---
Traceback (most recent call last):
  File "testjs.py", line 20, in <module>
    with JSContext(extensions=['test/python', 'hello/python']) as ctx:
  File "C:\Python26\lib\site-packages\PyV8.py", line 411, in __init__
    _PyV8.JSContext.__init__(self, obj, extensions)
PyV8.JSError: JSError: <v8::Context::New()> Cannot find required extension

---

What version of the product are you using? On what operating system?
the build attached here: http://code.google.com/p/pyv8/issues/detail?
id=12&can=1&q=__doc__#c2

OS: win 7 x86 32 bit

Please provide any additional information below.
registering two _javascript_ extensions works

Original issue reported on code.google.com by dimo...@gmail.com on 25 Dec 2009 at 10:23

@GoogleCodeExporter
Copy link
Author

Original comment by flier...@gmail.com on 26 Dec 2009 at 3:25

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

The root cause it I used a wrong pointer to the extension name, which cause 
only the last 
name could be found by v8

Please check out the source code from SVN after revision #176 or use the 
private build in 
attachment to verify it

Thanks

Original comment by flier...@gmail.com on 27 Dec 2009 at 2:22

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

Attachments:

@GoogleCodeExporter
Copy link
Author

now it works perfectly :)

thanks 

Original comment by dimo...@gmail.com on 27 Dec 2009 at 11:57

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