Hi,

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

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

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 kJSClassAttributeNoAutomaticPrototype?

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.

Laurent
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to