Ignore:
Timestamp:
Jul 23, 2008, 3:15:16 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Geoff Garen.

JSClassRef is created context-free, but gets infatuated with the first context it sees.

The implicit API contract is that JSClassRef can be used with any context on any thread.
This no longer worked, because UStrings in the class were turned into per-context
identifiers, and the cached JSObject prototype was tied to JSGlobalData, too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSContextRef.cpp

    r35159 r35293  
    5252
    5353    JSGlobalObject* globalObject = new (sharedGlobalData) JSCallbackObject<JSGlobalObject>(globalObjectClass);
    54     JSGlobalContextRef ctx = toGlobalRef(globalObject->globalExec());
    55     JSValue* prototype = globalObjectClass->prototype(ctx);
     54    ExecState* exec = globalObject->globalExec();
     55    JSValue* prototype = globalObjectClass->prototype(exec);
    5656    if (!prototype)
    5757        prototype = jsNull();
    5858    globalObject->reset(prototype);
    59     return JSGlobalContextRetain(ctx);
     59    return JSGlobalContextRetain(toGlobalRef(exec));
    6060}
    6161
Note: See TracChangeset for help on using the changeset viewer.