Changeset 41846 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
Mar 19, 2009, 5:03:57 PM (16 years ago)
Author:
[email protected]
Message:

2009-03-19 Cameron Zwarich <[email protected]>

Reviewed by Geoff Garen.

Bug 23771: REGRESSION (r36016): JSObjectHasProperty freezes on global class without kJSClassAttributeNoAutomaticPrototype
<https://bugs.webkit.org/show_bug.cgi?id=23771>
<rdar://problem/6561016>

  • API/tests/testapi.c: (main): Add a test for this bug.
  • runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::resetPrototype): Don't set the prototype of the last object in the prototype chain to the object prototype when the object prototype is already the last object in the prototype chain.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSGlobalObject.cpp

    r41126 r41846  
    342342{
    343343    setPrototype(prototype);
    344     lastInPrototypeChain(this)->setPrototype(d()->objectPrototype);
     344
     345    JSObject* oldLastInPrototypeChain = lastInPrototypeChain(this);
     346    JSObject* objectPrototype = d()->objectPrototype;
     347    if (oldLastInPrototypeChain != objectPrototype)
     348        oldLastInPrototypeChain->setPrototype(objectPrototype);
    345349}
    346350
Note: See TracChangeset for help on using the changeset viewer.