Changeset 195460 in webkit


Ignore:
Timestamp:
Jan 22, 2016 10:44:46 AM (8 years ago)
Author:
keith_miller@apple.com
Message:

[ES6] Add Symbol.species properties to the relevant constructors
https://bugs.webkit.org/show_bug.cgi?id=153339

Reviewed by Michael Saboff.

Source/JavaScriptCore:

This patch adds Symbol.species to the RegExp, Array, TypedArray, Map, Set, ArrayBuffer, and
Promise constructors. The functions that use these properties will be added in a later
patch.

  • builtins/GlobalObject.js:

(speciesGetter):

  • runtime/ArrayConstructor.cpp:

(JSC::ArrayConstructor::finishCreation):

  • runtime/ArrayConstructor.h:

(JSC::ArrayConstructor::create):

  • runtime/BooleanConstructor.h:

(JSC::BooleanConstructor::create):

  • runtime/CommonIdentifiers.h:
  • runtime/DateConstructor.h:

(JSC::DateConstructor::create):

  • runtime/ErrorConstructor.h:

(JSC::ErrorConstructor::create):

  • runtime/JSArrayBufferConstructor.cpp:

(JSC::JSArrayBufferConstructor::finishCreation):
(JSC::JSArrayBufferConstructor::create):

  • runtime/JSArrayBufferConstructor.h:
  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::init):

  • runtime/JSInternalPromiseConstructor.cpp:

(JSC::JSInternalPromiseConstructor::create):

  • runtime/JSInternalPromiseConstructor.h:
  • runtime/JSPromiseConstructor.cpp:

(JSC::JSPromiseConstructor::create):
(JSC::JSPromiseConstructor::finishCreation):

  • runtime/JSPromiseConstructor.h:
  • runtime/JSTypedArrayViewConstructor.cpp:

(JSC::JSTypedArrayViewConstructor::finishCreation):
(JSC::JSTypedArrayViewConstructor::create): Deleted.

  • runtime/JSTypedArrayViewConstructor.h:

(JSC::JSTypedArrayViewConstructor::create):

  • runtime/MapConstructor.cpp:

(JSC::MapConstructor::finishCreation):

  • runtime/MapConstructor.h:

(JSC::MapConstructor::create):

  • runtime/NumberConstructor.h:

(JSC::NumberConstructor::create):

  • runtime/RegExpConstructor.cpp:

(JSC::RegExpConstructor::finishCreation):

  • runtime/RegExpConstructor.h:

(JSC::RegExpConstructor::create):

  • runtime/SetConstructor.cpp:

(JSC::SetConstructor::finishCreation):

  • runtime/SetConstructor.h:

(JSC::SetConstructor::create):

  • runtime/StringConstructor.h:

(JSC::StringConstructor::create):

  • runtime/SymbolConstructor.h:

(JSC::SymbolConstructor::create):

  • runtime/WeakMapConstructor.h:

(JSC::WeakMapConstructor::create):

  • runtime/WeakSetConstructor.h:

(JSC::WeakSetConstructor::create):

  • tests/stress/symbol-species.js: Added.

(testSymbolSpeciesOnConstructor):

LayoutTests:

Add species to the list of property names on the Symbol object.

  • js/Object-getOwnPropertyNames-expected.txt:
  • js/script-tests/Object-getOwnPropertyNames.js:
Location:
trunk
Files:
1 added
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r195457 r195460  
     12016-01-22  Keith Miller  <keith_miller@apple.com>
     2
     3        [ES6] Add Symbol.species properties to the relevant constructors
     4        https://bugs.webkit.org/show_bug.cgi?id=153339
     5
     6        Reviewed by Michael Saboff.
     7
     8        Add species to the list of property names on the Symbol object.
     9
     10        * js/Object-getOwnPropertyNames-expected.txt:
     11        * js/script-tests/Object-getOwnPropertyNames.js:
     12
    1132016-01-22  Chris Fleizach  <cfleizach@apple.com>
    214
  • trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt

    r194248 r195460  
    6262PASS getSortedOwnPropertyNames(Math) is ['E','LN10','LN2','LOG10E','LOG2E','PI','SQRT1_2','SQRT2','abs','acos','acosh','asin','asinh','atan','atan2','atanh','cbrt','ceil','clz32','cos','cosh','exp','expm1','floor','fround','hypot','imul','log','log10','log1p','log2','max','min','pow','random','round','sign','sin','sinh','sqrt','tan','tanh','trunc']
    6363PASS getSortedOwnPropertyNames(JSON) is ['parse', 'stringify']
    64 PASS getSortedOwnPropertyNames(Symbol) is ['for', 'hasInstance', 'iterator', 'keyFor', 'length', 'name', 'prototype', 'toStringTag', 'unscopables']
     64PASS getSortedOwnPropertyNames(Symbol) is ['for', 'hasInstance', 'iterator', 'keyFor', 'length', 'name', 'prototype', 'species', 'toStringTag', 'unscopables']
    6565PASS getSortedOwnPropertyNames(Symbol.prototype) is ['constructor', 'toString', 'valueOf']
    6666PASS globalPropertyNames.indexOf('NaN') != -1 is true
  • trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js

    r194248 r195460  
    7171    "Math": "['E','LN10','LN2','LOG10E','LOG2E','PI','SQRT1_2','SQRT2','abs','acos','acosh','asin','asinh','atan','atan2','atanh','cbrt','ceil','clz32','cos','cosh','exp','expm1','floor','fround','hypot','imul','log','log10','log1p','log2','max','min','pow','random','round','sign','sin','sinh','sqrt','tan','tanh','trunc']",
    7272    "JSON": "['parse', 'stringify']",
    73     "Symbol": "['for', 'hasInstance', 'iterator', 'keyFor', 'length', 'name', 'prototype', 'toStringTag', 'unscopables']",
     73    "Symbol": "['for', 'hasInstance', 'iterator', 'keyFor', 'length', 'name', 'prototype', 'species', 'toStringTag', 'unscopables']",
    7474    "Symbol.prototype": "['constructor', 'toString', 'valueOf']"
    7575};
  • trunk/Source/JavaScriptCore/ChangeLog

    r195446 r195460  
     12016-01-22  Keith Miller  <keith_miller@apple.com>
     2
     3        [ES6] Add Symbol.species properties to the relevant constructors
     4        https://bugs.webkit.org/show_bug.cgi?id=153339
     5
     6        Reviewed by Michael Saboff.
     7
     8        This patch adds Symbol.species to the RegExp, Array, TypedArray, Map, Set, ArrayBuffer, and
     9        Promise constructors.  The functions that use these properties will be added in a later
     10        patch.
     11
     12        * builtins/GlobalObject.js:
     13        (speciesGetter):
     14        * runtime/ArrayConstructor.cpp:
     15        (JSC::ArrayConstructor::finishCreation):
     16        * runtime/ArrayConstructor.h:
     17        (JSC::ArrayConstructor::create):
     18        * runtime/BooleanConstructor.h:
     19        (JSC::BooleanConstructor::create):
     20        * runtime/CommonIdentifiers.h:
     21        * runtime/DateConstructor.h:
     22        (JSC::DateConstructor::create):
     23        * runtime/ErrorConstructor.h:
     24        (JSC::ErrorConstructor::create):
     25        * runtime/JSArrayBufferConstructor.cpp:
     26        (JSC::JSArrayBufferConstructor::finishCreation):
     27        (JSC::JSArrayBufferConstructor::create):
     28        * runtime/JSArrayBufferConstructor.h:
     29        * runtime/JSGlobalObject.cpp:
     30        (JSC::JSGlobalObject::init):
     31        * runtime/JSInternalPromiseConstructor.cpp:
     32        (JSC::JSInternalPromiseConstructor::create):
     33        * runtime/JSInternalPromiseConstructor.h:
     34        * runtime/JSPromiseConstructor.cpp:
     35        (JSC::JSPromiseConstructor::create):
     36        (JSC::JSPromiseConstructor::finishCreation):
     37        * runtime/JSPromiseConstructor.h:
     38        * runtime/JSTypedArrayViewConstructor.cpp:
     39        (JSC::JSTypedArrayViewConstructor::finishCreation):
     40        (JSC::JSTypedArrayViewConstructor::create): Deleted.
     41        * runtime/JSTypedArrayViewConstructor.h:
     42        (JSC::JSTypedArrayViewConstructor::create):
     43        * runtime/MapConstructor.cpp:
     44        (JSC::MapConstructor::finishCreation):
     45        * runtime/MapConstructor.h:
     46        (JSC::MapConstructor::create):
     47        * runtime/NumberConstructor.h:
     48        (JSC::NumberConstructor::create):
     49        * runtime/RegExpConstructor.cpp:
     50        (JSC::RegExpConstructor::finishCreation):
     51        * runtime/RegExpConstructor.h:
     52        (JSC::RegExpConstructor::create):
     53        * runtime/SetConstructor.cpp:
     54        (JSC::SetConstructor::finishCreation):
     55        * runtime/SetConstructor.h:
     56        (JSC::SetConstructor::create):
     57        * runtime/StringConstructor.h:
     58        (JSC::StringConstructor::create):
     59        * runtime/SymbolConstructor.h:
     60        (JSC::SymbolConstructor::create):
     61        * runtime/WeakMapConstructor.h:
     62        (JSC::WeakMapConstructor::create):
     63        * runtime/WeakSetConstructor.h:
     64        (JSC::WeakSetConstructor::create):
     65        * tests/stress/symbol-species.js: Added.
     66        (testSymbolSpeciesOnConstructor):
     67
    1682016-01-21  Benjamin Poulain  <benjamin@webkit.org>
    269
  • trunk/Source/JavaScriptCore/builtins/GlobalObject.js

    r192464 r195460  
    6565    return typeof object === "undefined" || object == null || typeof object === "object";
    6666}
     67
     68// FIXME: this needs to have it's name changed to "get [Symbol.species]".
     69// see: https://bugs.webkit.org/show_bug.cgi?id=151363
     70function speciesGetter()
     71{
     72    return this;
     73}
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp

    r194869 r195460  
    3030#include "Error.h"
    3131#include "ExceptionHelpers.h"
     32#include "GetterSetter.h"
    3233#include "JSArray.h"
    3334#include "JSFunction.h"
     
    6263}
    6364
    64 void ArrayConstructor::finishCreation(VM& vm, ArrayPrototype* arrayPrototype)
     65void ArrayConstructor::finishCreation(VM& vm, ArrayPrototype* arrayPrototype, GetterSetter* speciesSymbol)
    6566{
    6667    Base::finishCreation(vm, arrayPrototype->classInfo()->className);
    6768    putDirectWithoutTransition(vm, vm.propertyNames->prototype, arrayPrototype, DontEnum | DontDelete | ReadOnly);
    6869    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
     70    putDirectNonIndexAccessor(vm, vm.propertyNames->speciesSymbol, speciesSymbol, Accessor | ReadOnly | DontEnum | DontDelete);
    6971}
    7072
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h

    r194612 r195460  
    2929class ArrayPrototype;
    3030class JSArray;
     31class GetterSetter;
    3132
    3233class ArrayConstructor : public InternalFunction {
     
    3536    static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
    3637
    37     static ArrayConstructor* create(VM& vm, Structure* structure, ArrayPrototype* arrayPrototype)
     38    static ArrayConstructor* create(VM& vm, Structure* structure, ArrayPrototype* arrayPrototype, GetterSetter* speciesSymbol)
    3839    {
    3940        ArrayConstructor* constructor = new (NotNull, allocateCell<ArrayConstructor>(vm.heap)) ArrayConstructor(vm, structure);
    40         constructor->finishCreation(vm, arrayPrototype);
     41        constructor->finishCreation(vm, arrayPrototype, speciesSymbol);
    4142        return constructor;
    4243    }
     
    5051
    5152protected:
    52     void finishCreation(VM&, ArrayPrototype*);
     53    void finishCreation(VM&, ArrayPrototype*, GetterSetter* speciesSymbol);
    5354
    5455private:
  • trunk/Source/JavaScriptCore/runtime/BooleanConstructor.h

    r194643 r195460  
    2727
    2828class BooleanPrototype;
     29class GetterSetter;
    2930
    3031class BooleanConstructor : public InternalFunction {
     
    3233    typedef InternalFunction Base;
    3334
    34     static BooleanConstructor* create(VM& vm, Structure* structure, BooleanPrototype* booleanPrototype)
     35    static BooleanConstructor* create(VM& vm, Structure* structure, BooleanPrototype* booleanPrototype, GetterSetter*)
    3536    {
    3637        BooleanConstructor* constructor = new (NotNull, allocateCell<BooleanConstructor>(vm.heap)) BooleanConstructor(vm, structure);
  • trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h

    r195138 r195460  
    269269    macro(replace) \
    270270    macro(search) \
    271     macro(species) \
    272271    macro(split) \
    273272    macro(toPrimitive)
     
    276275    macro(hasInstance) \
    277276    macro(iterator) \
    278     macro(unscopables) \
    279     macro(toStringTag)
     277    macro(species) \
     278    macro(toStringTag) \
     279    macro(unscopables)
    280280
    281281#define JSC_COMMON_BYTECODE_INTRINSICS_EACH_NAME(macro) \
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.h

    r194863 r195460  
    2727
    2828class DatePrototype;
     29class GetterSetter;
    2930
    3031class DateConstructor : public InternalFunction {
     
    3334    static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot;
    3435
    35     static DateConstructor* create(VM& vm, Structure* structure, DatePrototype* datePrototype)
     36    static DateConstructor* create(VM& vm, Structure* structure, DatePrototype* datePrototype, GetterSetter*)
    3637    {
    3738        DateConstructor* constructor = new (NotNull, allocateCell<DateConstructor>(vm.heap)) DateConstructor(vm, structure);
  • trunk/Source/JavaScriptCore/runtime/ErrorConstructor.h

    r173269 r195460  
    2828
    2929class ErrorPrototype;
     30class GetterSetter;
    3031
    3132class ErrorConstructor : public InternalFunction {
     
    3334    typedef InternalFunction Base;
    3435
    35     static ErrorConstructor* create(VM& vm, Structure* structure, ErrorPrototype* errorPrototype)
     36    static ErrorConstructor* create(VM& vm, Structure* structure, ErrorPrototype* errorPrototype, GetterSetter*)
    3637    {
    3738        ErrorConstructor* constructor = new (NotNull, allocateCell<ErrorConstructor>(vm.heap)) ErrorConstructor(vm, structure);
  • trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp

    r194863 r195460  
    2929#include "Error.h"
    3030#include "ExceptionHelpers.h"
     31#include "GetterSetter.h"
    3132#include "JSArrayBuffer.h"
    3233#include "JSArrayBufferPrototype.h"
     
    4849}
    4950
    50 void JSArrayBufferConstructor::finishCreation(VM& vm, JSArrayBufferPrototype* prototype)
     51void JSArrayBufferConstructor::finishCreation(VM& vm, JSArrayBufferPrototype* prototype, GetterSetter* speciesSymbol)
    5152{
    5253    Base::finishCreation(vm, ASCIILiteral("ArrayBuffer"));
    5354    putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly);
    5455    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), DontEnum | DontDelete | ReadOnly);
     56    putDirectNonIndexAccessor(vm, vm.propertyNames->speciesSymbol, speciesSymbol, Accessor | ReadOnly | DontEnum | DontDelete);
    5557
    5658    JSGlobalObject* globalObject = this->globalObject();
     
    5860}
    5961
    60 JSArrayBufferConstructor* JSArrayBufferConstructor::create(VM& vm, Structure* structure, JSArrayBufferPrototype* prototype)
     62JSArrayBufferConstructor* JSArrayBufferConstructor::create(VM& vm, Structure* structure, JSArrayBufferPrototype* prototype, GetterSetter* speciesSymbol)
    6163{
    6264    JSArrayBufferConstructor* result =
    6365        new (NotNull, allocateCell<JSArrayBufferConstructor>(vm.heap))
    6466        JSArrayBufferConstructor(vm, structure);
    65     result->finishCreation(vm, prototype);
     67    result->finishCreation(vm, prototype, speciesSymbol);
    6668    return result;
    6769}
  • trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.h

    r156624 r195460  
    3232
    3333class JSArrayBufferPrototype;
     34class GetterSetter;
    3435
    3536class JSArrayBufferConstructor : public InternalFunction {
     
    3940protected:
    4041    JSArrayBufferConstructor(VM&, Structure*);
    41     void finishCreation(VM&, JSArrayBufferPrototype*);
     42    void finishCreation(VM&, JSArrayBufferPrototype*, GetterSetter* speciesSymbol);
    4243
    4344public:
    44     static JSArrayBufferConstructor* create(VM&, Structure*, JSArrayBufferPrototype*);
     45    static JSArrayBufferConstructor* create(VM&, Structure*, JSArrayBufferPrototype*, GetterSetter* speciesSymbol);
    4546   
    4647    DECLARE_INFO;
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r195138 r195460  
    394394
    395395    // Constructors
    396    
     396
     397    GetterSetter* speciesGetterSetter = GetterSetter::create(vm, this);
     398    speciesGetterSetter->setGetter(vm, this, JSFunction::createBuiltinFunction(vm, globalObjectSpeciesGetterCodeGenerator(vm), this));
     399
    397400    ObjectConstructor* objectConstructor = ObjectConstructor::create(vm, this, ObjectConstructor::createStructure(vm, this, m_functionPrototype.get()), m_objectPrototype.get());
    398401    m_objectConstructor.set(vm, this, objectConstructor);
     
    402405
    403406    JSCell* functionConstructor = FunctionConstructor::create(vm, FunctionConstructor::createStructure(vm, this, m_functionPrototype.get()), m_functionPrototype.get());
    404     JSCell* arrayConstructor = ArrayConstructor::create(vm, ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_arrayPrototype.get());
    405    
    406     m_regExpConstructor.set(vm, this, RegExpConstructor::create(vm, RegExpConstructor::createStructure(vm, this, m_functionPrototype.get()), m_regExpPrototype.get()));
     407    JSCell* arrayConstructor = ArrayConstructor::create(vm, ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_arrayPrototype.get(), speciesGetterSetter);
     408   
     409    m_regExpConstructor.set(vm, this, RegExpConstructor::create(vm, RegExpConstructor::createStructure(vm, this, m_functionPrototype.get()), m_regExpPrototype.get(), speciesGetterSetter));
    407410   
    408411#define CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
    409 capitalName ## Constructor* lowerName ## Constructor = capitalName ## Constructor::create(vm, capitalName ## Constructor::createStructure(vm, this, m_functionPrototype.get()), m_ ## lowerName ## Prototype.get()); \
     412capitalName ## Constructor* lowerName ## Constructor = capitalName ## Constructor::create(vm, capitalName ## Constructor::createStructure(vm, this, m_functionPrototype.get()), m_ ## lowerName ## Prototype.get(), speciesGetterSetter); \
    410413m_ ## lowerName ## Prototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, lowerName ## Constructor, DontEnum); \
    411414
     
    471474    putDirectWithoutTransition(vm, vm.propertyNames->Reflect, ReflectObject::create(vm, this, ReflectObject::createStructure(vm, this, m_objectPrototype.get())), DontEnum);
    472475
    473     JSTypedArrayViewConstructor* typedArraySuperConstructor = JSTypedArrayViewConstructor::create(vm, this, JSTypedArrayViewConstructor::createStructure(vm, this, m_functionPrototype.get()), typedArrayProto);
     476    JSTypedArrayViewConstructor* typedArraySuperConstructor = JSTypedArrayViewConstructor::create(vm, this, JSTypedArrayViewConstructor::createStructure(vm, this, m_functionPrototype.get()), typedArrayProto, speciesGetterSetter);
    474477    typedArrayProto->putDirectWithoutTransition(vm, vm.propertyNames->constructor, typedArraySuperConstructor, DontEnum);
    475478
  • trunk/Source/JavaScriptCore/runtime/JSInternalPromiseConstructor.cpp

    r192204 r195460  
    4848*/
    4949
    50 JSInternalPromiseConstructor* JSInternalPromiseConstructor::create(VM& vm, Structure* structure, JSInternalPromisePrototype* promisePrototype)
     50JSInternalPromiseConstructor* JSInternalPromiseConstructor::create(VM& vm, Structure* structure, JSInternalPromisePrototype* promisePrototype, GetterSetter* speciesSymbol)
    5151{
    5252    JSInternalPromiseConstructor* constructor = new (NotNull, allocateCell<JSInternalPromiseConstructor>(vm.heap)) JSInternalPromiseConstructor(vm, structure);
    53     constructor->finishCreation(vm, promisePrototype);
     53    constructor->finishCreation(vm, promisePrototype, speciesSymbol);
    5454    return constructor;
    5555}
  • trunk/Source/JavaScriptCore/runtime/JSInternalPromiseConstructor.h

    r188681 r195460  
    3939    static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot;
    4040
    41     static JSInternalPromiseConstructor* create(VM&, Structure*, JSInternalPromisePrototype*);
     41    static JSInternalPromiseConstructor* create(VM&, Structure*, JSInternalPromisePrototype*, GetterSetter*);
    4242    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
    4343
  • trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp

    r194863 r195460  
    3030#include "Error.h"
    3131#include "Exception.h"
     32#include "GetterSetter.h"
    3233#include "IteratorOperations.h"
    3334#include "JSCBuiltins.h"
     
    6263*/
    6364
    64 JSPromiseConstructor* JSPromiseConstructor::create(VM& vm, Structure* structure, JSPromisePrototype* promisePrototype)
     65JSPromiseConstructor* JSPromiseConstructor::create(VM& vm, Structure* structure, JSPromisePrototype* promisePrototype, GetterSetter* speciesSymbol)
    6566{
    6667    JSPromiseConstructor* constructor = new (NotNull, allocateCell<JSPromiseConstructor>(vm.heap)) JSPromiseConstructor(vm, structure);
    67     constructor->finishCreation(vm, promisePrototype);
     68    constructor->finishCreation(vm, promisePrototype, speciesSymbol);
    6869    constructor->addOwnInternalSlots(vm, structure->globalObject());
    6970    return constructor;
     
    8081}
    8182
    82 void JSPromiseConstructor::finishCreation(VM& vm, JSPromisePrototype* promisePrototype)
     83void JSPromiseConstructor::finishCreation(VM& vm, JSPromisePrototype* promisePrototype, GetterSetter* speciesSymbol)
    8384{
    8485    Base::finishCreation(vm, ASCIILiteral("Promise"));
    8586    putDirectWithoutTransition(vm, vm.propertyNames->prototype, promisePrototype, DontEnum | DontDelete | ReadOnly);
    8687    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
     88    putDirectNonIndexAccessor(vm, vm.propertyNames->speciesSymbol, speciesSymbol, Accessor | ReadOnly | DontEnum | DontDelete);
    8789}
    8890
  • trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.h

    r194863 r195460  
    3333class JSPromise;
    3434class JSPromisePrototype;
     35class GetterSetter;
    3536
    3637class JSPromiseConstructor : public InternalFunction {
     
    3940    static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot;
    4041
    41     static JSPromiseConstructor* create(VM&, Structure*, JSPromisePrototype*);
     42    static JSPromiseConstructor* create(VM&, Structure*, JSPromisePrototype*, GetterSetter* speciesSymbol);
    4243    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
    4344
     
    4849protected:
    4950    JSPromiseConstructor(VM&, Structure*);
    50     void finishCreation(VM&, JSPromisePrototype*);
     51    void finishCreation(VM&, JSPromisePrototype*, GetterSetter*);
    5152
    5253private:
  • trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewConstructor.cpp

    r191059 r195460  
    2929#include "CallFrame.h"
    3030#include "Error.h"
     31#include "GetterSetter.h"
    3132#include "JSCBuiltins.h"
    3233#include "JSCellInlines.h"
    3334#include "JSGenericTypedArrayViewConstructorInlines.h"
    3435#include "JSObject.h"
     36#include "JSTypedArrayViewPrototype.h"
    3537#include "JSTypedArrays.h"
    3638
     
    4446const ClassInfo JSTypedArrayViewConstructor::s_info = { "Function", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTypedArrayViewConstructor) };
    4547
    46 void JSTypedArrayViewConstructor::finishCreation(VM& vm, JSGlobalObject* globalObject, JSObject* prototype)
     48void JSTypedArrayViewConstructor::finishCreation(VM& vm, JSGlobalObject* globalObject, JSTypedArrayViewPrototype* prototype, GetterSetter* speciesSymbol)
    4749{
    4850    Base::finishCreation(vm, "TypedArray");
    4951    putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly);
    5052    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(3), DontEnum | DontDelete | ReadOnly);
     53    putDirectNonIndexAccessor(vm, vm.propertyNames->speciesSymbol, speciesSymbol, Accessor | ReadOnly | DontEnum | DontDelete);
    5154
    5255    JSC_BUILTIN_FUNCTION(vm.propertyNames->of, typedArrayConstructorOfCodeGenerator, DontEnum);
    5356    JSC_BUILTIN_FUNCTION(vm.propertyNames->from, typedArrayConstructorFromCodeGenerator, DontEnum);
    54 }
    55 
    56 JSTypedArrayViewConstructor* JSTypedArrayViewConstructor::create(
    57     VM& vm, JSGlobalObject* globalObject, Structure* structure,
    58     JSObject* prototype)
    59 {
    60     JSTypedArrayViewConstructor* result = new (NotNull, allocateCell<JSTypedArrayViewConstructor>(vm.heap)) JSTypedArrayViewConstructor(vm, structure);
    61     result->finishCreation(vm, globalObject, prototype);
    62     return result;
    6357}
    6458
  • trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewConstructor.h

    r191059 r195460  
    3131namespace JSC {
    3232
     33class JSTypedArrayViewPrototype;
     34class GetterSetter;
     35
    3336class JSTypedArrayViewConstructor : public InternalFunction {
    3437public:
     
    3740protected:
    3841    JSTypedArrayViewConstructor(VM&, Structure*);
    39     void finishCreation(VM&, JSGlobalObject*, JSObject* prototype);
     42    void finishCreation(VM&, JSGlobalObject*, JSTypedArrayViewPrototype*, GetterSetter* speciesSymbol);
    4043
    4144public:
    42     static JSTypedArrayViewConstructor* create(VM&, JSGlobalObject*, Structure*, JSObject* prototype);
     45    static JSTypedArrayViewConstructor* create(VM& vm, JSGlobalObject* globalObject, Structure* structure, JSTypedArrayViewPrototype* prototype, GetterSetter* speciesSymbol)
     46    {
     47        JSTypedArrayViewConstructor* result = new (NotNull, allocateCell<JSTypedArrayViewConstructor>(vm.heap)) JSTypedArrayViewConstructor(vm, structure);
     48        result->finishCreation(vm, globalObject, prototype, speciesSymbol);
     49        return result;
     50    }
    4351
    4452    DECLARE_INFO;
  • trunk/Source/JavaScriptCore/runtime/MapConstructor.cpp

    r194863 r195460  
    2828
    2929#include "Error.h"
     30#include "GetterSetter.h"
    3031#include "IteratorOperations.h"
    3132#include "JSCJSValueInlines.h"
     
    4041const ClassInfo MapConstructor::s_info = { "Function", &Base::s_info, 0, CREATE_METHOD_TABLE(MapConstructor) };
    4142
    42 void MapConstructor::finishCreation(VM& vm, MapPrototype* mapPrototype)
     43void MapConstructor::finishCreation(VM& vm, MapPrototype* mapPrototype, GetterSetter* speciesSymbol)
    4344{
    4445    Base::finishCreation(vm, mapPrototype->classInfo()->className);
    4546    putDirectWithoutTransition(vm, vm.propertyNames->prototype, mapPrototype, DontEnum | DontDelete | ReadOnly);
    4647    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum | DontDelete);
     48    putDirectNonIndexAccessor(vm, vm.propertyNames->speciesSymbol, speciesSymbol, Accessor | ReadOnly | DontEnum | DontDelete);
    4749}
    4850
  • trunk/Source/JavaScriptCore/runtime/MapConstructor.h

    r156624 r195460  
    3232
    3333class MapPrototype;
     34class GetterSetter;
    3435
    3536class MapConstructor : public InternalFunction {
     
    3738    typedef InternalFunction Base;
    3839
    39     static MapConstructor* create(VM& vm, Structure* structure, MapPrototype* mapPrototype)
     40    static MapConstructor* create(VM& vm, Structure* structure, MapPrototype* mapPrototype, GetterSetter* speciesSymbol)
    4041    {
    4142        MapConstructor* constructor = new (NotNull, allocateCell<MapConstructor>(vm.heap)) MapConstructor(vm, structure);
    42         constructor->finishCreation(vm, mapPrototype);
     43        constructor->finishCreation(vm, mapPrototype, speciesSymbol);
    4344        return constructor;
    4445    }
     
    5657    {
    5758    }
    58     void finishCreation(VM&, MapPrototype*);
     59    void finishCreation(VM&, MapPrototype*, GetterSetter* speciesSymbol);
    5960    static ConstructType getConstructData(JSCell*, ConstructData&);
    6061    static CallType getCallData(JSCell*, CallData&);
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.h

    r194369 r195460  
    2727
    2828class NumberPrototype;
     29class GetterSetter;
    2930
    3031class NumberConstructor : public InternalFunction {
     
    3334    static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | ImplementsHasInstance | ImplementsDefaultHasInstance;
    3435
    35     static NumberConstructor* create(VM& vm, Structure* structure, NumberPrototype* numberPrototype)
     36    static NumberConstructor* create(VM& vm, Structure* structure, NumberPrototype* numberPrototype, GetterSetter*)
    3637    {
    3738        NumberConstructor* constructor = new (NotNull, allocateCell<NumberConstructor>(vm.heap)) NumberConstructor(vm, structure);
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp

    r194863 r195460  
    2424
    2525#include "Error.h"
     26#include "GetterSetter.h"
    2627#include "JSCInlines.h"
    2728#include "RegExpMatchesArray.h"
     
    9192}
    9293
    93 void RegExpConstructor::finishCreation(VM& vm, RegExpPrototype* regExpPrototype)
     94void RegExpConstructor::finishCreation(VM& vm, RegExpPrototype* regExpPrototype, GetterSetter* speciesSymbol)
    9495{
    9596    Base::finishCreation(vm, regExpPrototype->classInfo()->className);
     
    101102    // no. of arguments for constructor
    102103    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(2), ReadOnly | DontDelete | DontEnum);
     104
     105    putDirectNonIndexAccessor(vm, vm.propertyNames->speciesSymbol, speciesSymbol, Accessor | ReadOnly | DontEnum | DontDelete);
    103106}
    104107
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h

    r194863 r195460  
    3030
    3131class RegExpPrototype;
     32class GetterSetter;
    3233
    3334class RegExpConstructor : public InternalFunction {
     
    3637    static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot;
    3738
    38     static RegExpConstructor* create(VM& vm, Structure* structure, RegExpPrototype* regExpPrototype)
     39    static RegExpConstructor* create(VM& vm, Structure* structure, RegExpPrototype* regExpPrototype, GetterSetter* species)
    3940    {
    4041        RegExpConstructor* constructor = new (NotNull, allocateCell<RegExpConstructor>(vm.heap)) RegExpConstructor(vm, structure, regExpPrototype);
    41         constructor->finishCreation(vm, regExpPrototype);
     42        constructor->finishCreation(vm, regExpPrototype, species);
    4243        return constructor;
    4344    }
     
    6970
    7071protected:
    71     void finishCreation(VM&, RegExpPrototype*);
     72    void finishCreation(VM&, RegExpPrototype*, GetterSetter* species);
    7273
    7374private:
  • trunk/Source/JavaScriptCore/runtime/SetConstructor.cpp

    r194863 r195460  
    2828
    2929#include "Error.h"
     30#include "GetterSetter.h"
    3031#include "IteratorOperations.h"
    3132#include "JSCJSValueInlines.h"
     
    4142const ClassInfo SetConstructor::s_info = { "Function", &Base::s_info, 0, CREATE_METHOD_TABLE(SetConstructor) };
    4243
    43 void SetConstructor::finishCreation(VM& vm, SetPrototype* setPrototype)
     44void SetConstructor::finishCreation(VM& vm, SetPrototype* setPrototype, GetterSetter* speciesSymbol)
    4445{
    4546    Base::finishCreation(vm, setPrototype->classInfo()->className);
    4647    putDirectWithoutTransition(vm, vm.propertyNames->prototype, setPrototype, DontEnum | DontDelete | ReadOnly);
    4748    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum | DontDelete);
     49    putDirectNonIndexAccessor(vm, vm.propertyNames->speciesSymbol, speciesSymbol, Accessor | ReadOnly | DontEnum | DontDelete);
    4850}
    4951
  • trunk/Source/JavaScriptCore/runtime/SetConstructor.h

    r156624 r195460  
    3232
    3333class SetPrototype;
     34class GetterSetter;
    3435
    3536class SetConstructor : public InternalFunction {
     
    3738    typedef InternalFunction Base;
    3839
    39     static SetConstructor* create(VM& vm, Structure* structure, SetPrototype* setPrototype)
     40    static SetConstructor* create(VM& vm, Structure* structure, SetPrototype* setPrototype, GetterSetter* speciesSymbol)
    4041    {
    4142        SetConstructor* constructor = new (NotNull, allocateCell<SetConstructor>(vm.heap)) SetConstructor(vm, structure);
    42         constructor->finishCreation(vm, setPrototype);
     43        constructor->finishCreation(vm, setPrototype, speciesSymbol);
    4344        return constructor;
    4445    }
     
    5657    {
    5758    }
    58     void finishCreation(VM&, SetPrototype*);
     59    void finishCreation(VM&, SetPrototype*, GetterSetter* speciesSymbol);
    5960    static ConstructType getConstructData(JSCell*, ConstructData&);
    6061    static CallType getCallData(JSCell*, CallData&);
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.h

    r194770 r195460  
    2727
    2828class StringPrototype;
     29class GetterSetter;
    2930
    3031class StringConstructor : public InternalFunction {
     
    3334    static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot;
    3435
    35     static StringConstructor* create(VM& vm, Structure* structure, StringPrototype* stringPrototype)
     36    static StringConstructor* create(VM& vm, Structure* structure, StringPrototype* stringPrototype, GetterSetter*)
    3637    {
    3738        StringConstructor* constructor = new (NotNull, allocateCell<StringConstructor>(vm.heap)) StringConstructor(vm, structure);
  • trunk/Source/JavaScriptCore/runtime/SymbolConstructor.h

    r182921 r195460  
    3434
    3535class SymbolPrototype;
     36class GetterSetter;
    3637
    3738class SymbolConstructor : public InternalFunction {
     
    4041    static const unsigned StructureFlags = OverridesGetOwnPropertySlot | Base::StructureFlags;
    4142
    42     static SymbolConstructor* create(VM& vm, Structure* structure, SymbolPrototype* prototype)
     43    static SymbolConstructor* create(VM& vm, Structure* structure, SymbolPrototype* prototype, GetterSetter*)
    4344    {
    4445        SymbolConstructor* constructor = new (NotNull, allocateCell<SymbolConstructor>(vm.heap)) SymbolConstructor(vm, structure);
  • trunk/Source/JavaScriptCore/runtime/WeakMapConstructor.h

    r156624 r195460  
    3232
    3333class WeakMapPrototype;
     34class GetterSetter;
    3435
    3536class WeakMapConstructor : public InternalFunction {
     
    3738    typedef InternalFunction Base;
    3839
    39     static WeakMapConstructor* create(VM& vm, Structure* structure, WeakMapPrototype* prototype)
     40    static WeakMapConstructor* create(VM& vm, Structure* structure, WeakMapPrototype* prototype, GetterSetter*)
    4041    {
    4142        WeakMapConstructor* constructor = new (NotNull, allocateCell<WeakMapConstructor>(vm.heap)) WeakMapConstructor(vm, structure);
  • trunk/Source/JavaScriptCore/runtime/WeakSetConstructor.h

    r182994 r195460  
    3232
    3333class WeakSetPrototype;
     34class GetterSetter;
    3435
    3536class WeakSetConstructor : public InternalFunction {
     
    3738    typedef InternalFunction Base;
    3839
    39     static WeakSetConstructor* create(VM& vm, Structure* structure, WeakSetPrototype* prototype)
     40    static WeakSetConstructor* create(VM& vm, Structure* structure, WeakSetPrototype* prototype, GetterSetter*)
    4041    {
    4142        WeakSetConstructor* constructor = new (NotNull, allocateCell<WeakSetConstructor>(vm.heap)) WeakSetConstructor(vm, structure);
Note: See TracChangeset for help on using the changeset viewer.