Ignore:
Timestamp:
Mar 1, 2016, 1:45:16 PM (9 years ago)
Author:
[email protected]
Message:

IsExtensible should be a virtual method in the method table
https://bugs.webkit.org/show_bug.cgi?id=154799

Reviewed by Mark Lam.

This patch makes us more consistent with how the ES6 specification models the
IsExtensible trap. Moving this method into ClassInfo::methodTable
is a prerequisite for implementing Proxy.IsExtensible.

  • runtime/ClassInfo.h:
  • runtime/JSCell.cpp:

(JSC::JSCell::preventExtensions):
(JSC::JSCell::isExtensible):

  • runtime/JSCell.h:
  • runtime/JSGlobalObjectFunctions.cpp:

(JSC::globalFuncProtoSetter):

  • runtime/JSObject.cpp:

(JSC::JSObject::preventExtensions):
(JSC::JSObject::isExtensible):
(JSC::JSObject::reifyAllStaticProperties):
(JSC::JSObject::defineOwnIndexedProperty):
(JSC::JSObject::putByIndexBeyondVectorLengthWithArrayStorage):
(JSC::JSObject::putDirectIndexBeyondVectorLengthWithArrayStorage):
(JSC::JSObject::defineOwnNonIndexProperty):
(JSC::JSObject::defineOwnProperty):

  • runtime/JSObject.h:

(JSC::JSObject::isSealed):
(JSC::JSObject::isFrozen):
(JSC::JSObject::isExtensibleImpl):
(JSC::JSObject::isStructureExtensible):
(JSC::JSObject::isExtensibleInline):
(JSC::JSObject::indexingShouldBeSparse):
(JSC::JSObject::putDirectInternal):
(JSC::JSObject::isExtensible): Deleted.

  • runtime/ObjectConstructor.cpp:

(JSC::objectConstructorSetPrototypeOf):
(JSC::objectConstructorIsSealed):
(JSC::objectConstructorIsFrozen):
(JSC::objectConstructorIsExtensible):
(JSC::objectConstructorIs):

  • runtime/ProxyObject.cpp:

(JSC::ProxyObject::performInternalMethodGetOwnProperty):
(JSC::ProxyObject::performHasProperty):

  • runtime/ReflectObject.cpp:

(JSC::reflectObjectIsExtensible):
(JSC::reflectObjectSetPrototypeOf):

  • runtime/SparseArrayValueMap.cpp:

(JSC::SparseArrayValueMap::putEntry):
(JSC::SparseArrayValueMap::putDirect):

  • runtime/StringObject.cpp:

(JSC::StringObject::defineOwnProperty):

  • runtime/Structure.cpp:

(JSC::Structure::isSealed):
(JSC::Structure::isFrozen):

  • runtime/Structure.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/ReflectObject.cpp

    r197391 r197412  
    169169    if (!target.isObject())
    170170        return JSValue::encode(throwTypeError(exec, ASCIILiteral("Reflect.isExtensible requires the first argument be an object")));
    171     return JSValue::encode(jsBoolean(asObject(target)->isExtensible()));
     171
     172    bool isExtensible = asObject(target)->isExtensibleInline(exec);
     173    if (exec->hadException())
     174        return JSValue::encode(JSValue());
     175    return JSValue::encode(jsBoolean(isExtensible));
    172176}
    173177
     
    212216        return JSValue::encode(jsBoolean(true));
    213217
    214     if (!object->isExtensible())
     218    bool isExtensible = object->isExtensibleInline(exec);
     219    if (exec->hadException())
     220        return JSValue::encode(JSValue());
     221    if (!isExtensible)
    215222        return JSValue::encode(jsBoolean(false));
    216223
Note: See TracChangeset for help on using the changeset viewer.