marylinh / pyv8

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

Error passing undefined values to functions declared in Python #67

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I found an error trying to execute the EXT library in my project. When I call a 
function declared in the GlobalObject with an undefined value, an error is 
raised after returning from the function.

Example 1 :
 var pf = function(test){
     python_function(test);
 }();

Example 2:
 var test;
 python_function(test);

(assuming that 'python_function' is declared in the GlobalObject)

What steps will reproduce the problem?
1. Run attached test

What is the expected output? What do you see instead?
- `None` is printed twice, the script ends gracefully

What version of the product are you using? On what operating system?
- PyV8: r262
- V8: 2.2.18

Please provide any additional information below.
- I really sorry but I couldn't test this in trunk because of some problems in 
my building environment. I'm opening this ticket while I'm trying to fix it. 
I'm attaching some code to make it easy to test. Thanks for your help!

Original issue reported on code.google.com by mmuradas...@gtempaccount.com on 7 Jan 2011 at 9:55

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by flier...@gmail.com on 9 Jan 2011 at 6:17

GoogleCodeExporter commented 9 years ago
The root cause is Python doesn't have a special type to correspond to 
Javascript's undefined. To fix the issue, I change the strategy to map 
undefined to None by default.

Please verify the issue with SVN trunk after r317.

Thanks

Original comment by flier...@gmail.com on 9 Jan 2011 at 6:38

GoogleCodeExporter commented 9 years ago
Verified. Thanks again for all your help!

Original comment by mmuradas...@gtempaccount.com on 10 Jan 2011 at 10:09

GoogleCodeExporter commented 9 years ago
You are welcome :)

Original comment by flier...@gmail.com on 11 Jan 2011 at 2:00