code-google-com / pyv8

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

_PyV8.JSFunction != None results in segmentation fault. #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
    def testFunction(self):
        with JSContext() as ctxt:
            func = ctxt.eval("""
                function()
                {
                    function a()
                    {
                        return "abc";    
                    }

                    return a();    
                };
                """)
            if func is not None: # ok
                pass
            if func != None: # segmentation fault
                pass
            self.assertEquals("abc", str(func()))

Original issue reported on code.google.com by epr...@muftor.com on 31 Aug 2009 at 12:51

GoogleCodeExporter commented 9 years ago

Original comment by flier...@gmail.com on 1 Sep 2009 at 1:24

GoogleCodeExporter commented 9 years ago
http://code.google.com/p/pyv8/source/detail?r=130

The root cause is the equals method of CJavascriptObject doesn't handle the 
None object 
when compare two Javascript objects.

Thanks

Original comment by flier...@gmail.com on 1 Sep 2009 at 1:47