[Webkit-unassigned] [Bug 23771] New: JSObjectHasProperty freezes on global class without kJSClassAttributeNoAutomaticPrototype

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 5 14:08:01 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=23771

           Summary: JSObjectHasProperty freezes on global class without
                    kJSClassAttributeNoAutomaticPrototype
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: laurent.calburtin at free.fr


JSObjectHasProperty is stuck in an infinite loop with following code:

static JSValueRef fn(JSContextRef ctx, JSObjectRef function, JSObjectRef
thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef*
exception)
{
    return 0;
}

static JSStaticFunction globalObject_staticFunctions[] = {  { "fn", fn,
kJSPropertyAttributeNone },  { 0, 0, 0 } };

static void freeze()
{
   JSClassDefinition globalObjectClassDefinition = kJSClassDefinitionEmpty;
   globalObjectClassDefinition.staticFunctions = globalObject_staticFunctions;
   JSClassRef globalObjectClass = JSClassCreate( &globalObjectClassDefinition);
   JSGlobalContextRef context = JSGlobalContextCreateInGroup(NULL,
globalObjectClass);
   JSStringRef propName = JSStringCreateWithUTF8CString("name");
   JSObjectHasProperty( context, JSContextGetGlobalObject(context), propName);
}

Adding the attribute kJSClassAttributeNoAutomaticPrototype to the global class
definition solves the problem.

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.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list