[webkit-dev] JSObjectSetProperty & JSObjectHasProperty stuck in an infinite loop

Laurent Calburtin laurent.calburtin at free.fr
Wed Feb 4 13:55:21 PST 2009


With the trunk version of javascriptcore, JSObjectHasProperty is stuck  
in an infinite loop with following code:

     JSClassDefinition globalObjectClassDefinition =  
     globalObjectClassDefinition.staticFunctions =  
globalObject_staticFunctions; // not null
     JSClassRef globalObjectClass =  
JSClassCreate( &globalObjectClassDefinition);
     JSGlobalContextRef context = JSGlobalContextCreateInGroup(NULL,  
     JSStringRef propName = JSStringCreateWithUTF8CString("name");
     JSObjectHasProperty( context, JSContextGetGlobalObject(context),  

By comparing my code to testapi.c I found that adding the attribute  
kJSClassAttributeNoAutomaticPrototype to my global class definition  
solved the problem.

Is this a bug or an expected behavior?
If kJSClassAttributeNoAutomaticPrototype is mandatory in such a  
situation, may I suggest to state it in the header file?
Are there other situations I should use  

Note that JSObjectSetProperty is also stuck without the attribute  
because it internally calls the same code as JSObjectHasProperty.
Also note that JSObjectHasProperty from MacOSX10.5 webkit framework  
doesn't get stuck.


More information about the webkit-dev mailing list