Changeset 195460 in webkit
- Timestamp:
- Jan 22, 2016 10:44:46 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r195457 r195460 1 2016-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 1 13 2016-01-22 Chris Fleizach <cfleizach@apple.com> 2 14 -
trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt
r194248 r195460 62 62 PASS 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'] 63 63 PASS getSortedOwnPropertyNames(JSON) is ['parse', 'stringify'] 64 PASS getSortedOwnPropertyNames(Symbol) is ['for', 'hasInstance', 'iterator', 'keyFor', 'length', 'name', 'prototype', ' toStringTag', 'unscopables']64 PASS getSortedOwnPropertyNames(Symbol) is ['for', 'hasInstance', 'iterator', 'keyFor', 'length', 'name', 'prototype', 'species', 'toStringTag', 'unscopables'] 65 65 PASS getSortedOwnPropertyNames(Symbol.prototype) is ['constructor', 'toString', 'valueOf'] 66 66 PASS globalPropertyNames.indexOf('NaN') != -1 is true -
trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js
r194248 r195460 71 71 "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']", 72 72 "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']", 74 74 "Symbol.prototype": "['constructor', 'toString', 'valueOf']" 75 75 }; -
trunk/Source/JavaScriptCore/ChangeLog
r195446 r195460 1 2016-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 1 68 2016-01-21 Benjamin Poulain <benjamin@webkit.org> 2 69 -
trunk/Source/JavaScriptCore/builtins/GlobalObject.js
r192464 r195460 65 65 return typeof object === "undefined" || object == null || typeof object === "object"; 66 66 } 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 70 function speciesGetter() 71 { 72 return this; 73 } -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
r194869 r195460 30 30 #include "Error.h" 31 31 #include "ExceptionHelpers.h" 32 #include "GetterSetter.h" 32 33 #include "JSArray.h" 33 34 #include "JSFunction.h" … … 62 63 } 63 64 64 void ArrayConstructor::finishCreation(VM& vm, ArrayPrototype* arrayPrototype )65 void ArrayConstructor::finishCreation(VM& vm, ArrayPrototype* arrayPrototype, GetterSetter* speciesSymbol) 65 66 { 66 67 Base::finishCreation(vm, arrayPrototype->classInfo()->className); 67 68 putDirectWithoutTransition(vm, vm.propertyNames->prototype, arrayPrototype, DontEnum | DontDelete | ReadOnly); 68 69 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete); 70 putDirectNonIndexAccessor(vm, vm.propertyNames->speciesSymbol, speciesSymbol, Accessor | ReadOnly | DontEnum | DontDelete); 69 71 } 70 72 -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h
r194612 r195460 29 29 class ArrayPrototype; 30 30 class JSArray; 31 class GetterSetter; 31 32 32 33 class ArrayConstructor : public InternalFunction { … … 35 36 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags; 36 37 37 static ArrayConstructor* create(VM& vm, Structure* structure, ArrayPrototype* arrayPrototype )38 static ArrayConstructor* create(VM& vm, Structure* structure, ArrayPrototype* arrayPrototype, GetterSetter* speciesSymbol) 38 39 { 39 40 ArrayConstructor* constructor = new (NotNull, allocateCell<ArrayConstructor>(vm.heap)) ArrayConstructor(vm, structure); 40 constructor->finishCreation(vm, arrayPrototype );41 constructor->finishCreation(vm, arrayPrototype, speciesSymbol); 41 42 return constructor; 42 43 } … … 50 51 51 52 protected: 52 void finishCreation(VM&, ArrayPrototype* );53 void finishCreation(VM&, ArrayPrototype*, GetterSetter* speciesSymbol); 53 54 54 55 private: -
trunk/Source/JavaScriptCore/runtime/BooleanConstructor.h
r194643 r195460 27 27 28 28 class BooleanPrototype; 29 class GetterSetter; 29 30 30 31 class BooleanConstructor : public InternalFunction { … … 32 33 typedef InternalFunction Base; 33 34 34 static BooleanConstructor* create(VM& vm, Structure* structure, BooleanPrototype* booleanPrototype )35 static BooleanConstructor* create(VM& vm, Structure* structure, BooleanPrototype* booleanPrototype, GetterSetter*) 35 36 { 36 37 BooleanConstructor* constructor = new (NotNull, allocateCell<BooleanConstructor>(vm.heap)) BooleanConstructor(vm, structure); -
trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h
r195138 r195460 269 269 macro(replace) \ 270 270 macro(search) \ 271 macro(species) \272 271 macro(split) \ 273 272 macro(toPrimitive) … … 276 275 macro(hasInstance) \ 277 276 macro(iterator) \ 278 macro(unscopables) \ 279 macro(toStringTag) 277 macro(species) \ 278 macro(toStringTag) \ 279 macro(unscopables) 280 280 281 281 #define JSC_COMMON_BYTECODE_INTRINSICS_EACH_NAME(macro) \ -
trunk/Source/JavaScriptCore/runtime/DateConstructor.h
r194863 r195460 27 27 28 28 class DatePrototype; 29 class GetterSetter; 29 30 30 31 class DateConstructor : public InternalFunction { … … 33 34 static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot; 34 35 35 static DateConstructor* create(VM& vm, Structure* structure, DatePrototype* datePrototype )36 static DateConstructor* create(VM& vm, Structure* structure, DatePrototype* datePrototype, GetterSetter*) 36 37 { 37 38 DateConstructor* constructor = new (NotNull, allocateCell<DateConstructor>(vm.heap)) DateConstructor(vm, structure); -
trunk/Source/JavaScriptCore/runtime/ErrorConstructor.h
r173269 r195460 28 28 29 29 class ErrorPrototype; 30 class GetterSetter; 30 31 31 32 class ErrorConstructor : public InternalFunction { … … 33 34 typedef InternalFunction Base; 34 35 35 static ErrorConstructor* create(VM& vm, Structure* structure, ErrorPrototype* errorPrototype )36 static ErrorConstructor* create(VM& vm, Structure* structure, ErrorPrototype* errorPrototype, GetterSetter*) 36 37 { 37 38 ErrorConstructor* constructor = new (NotNull, allocateCell<ErrorConstructor>(vm.heap)) ErrorConstructor(vm, structure); -
trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp
r194863 r195460 29 29 #include "Error.h" 30 30 #include "ExceptionHelpers.h" 31 #include "GetterSetter.h" 31 32 #include "JSArrayBuffer.h" 32 33 #include "JSArrayBufferPrototype.h" … … 48 49 } 49 50 50 void JSArrayBufferConstructor::finishCreation(VM& vm, JSArrayBufferPrototype* prototype )51 void JSArrayBufferConstructor::finishCreation(VM& vm, JSArrayBufferPrototype* prototype, GetterSetter* speciesSymbol) 51 52 { 52 53 Base::finishCreation(vm, ASCIILiteral("ArrayBuffer")); 53 54 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly); 54 55 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), DontEnum | DontDelete | ReadOnly); 56 putDirectNonIndexAccessor(vm, vm.propertyNames->speciesSymbol, speciesSymbol, Accessor | ReadOnly | DontEnum | DontDelete); 55 57 56 58 JSGlobalObject* globalObject = this->globalObject(); … … 58 60 } 59 61 60 JSArrayBufferConstructor* JSArrayBufferConstructor::create(VM& vm, Structure* structure, JSArrayBufferPrototype* prototype )62 JSArrayBufferConstructor* JSArrayBufferConstructor::create(VM& vm, Structure* structure, JSArrayBufferPrototype* prototype, GetterSetter* speciesSymbol) 61 63 { 62 64 JSArrayBufferConstructor* result = 63 65 new (NotNull, allocateCell<JSArrayBufferConstructor>(vm.heap)) 64 66 JSArrayBufferConstructor(vm, structure); 65 result->finishCreation(vm, prototype );67 result->finishCreation(vm, prototype, speciesSymbol); 66 68 return result; 67 69 } -
trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.h
r156624 r195460 32 32 33 33 class JSArrayBufferPrototype; 34 class GetterSetter; 34 35 35 36 class JSArrayBufferConstructor : public InternalFunction { … … 39 40 protected: 40 41 JSArrayBufferConstructor(VM&, Structure*); 41 void finishCreation(VM&, JSArrayBufferPrototype* );42 void finishCreation(VM&, JSArrayBufferPrototype*, GetterSetter* speciesSymbol); 42 43 43 44 public: 44 static JSArrayBufferConstructor* create(VM&, Structure*, JSArrayBufferPrototype* );45 static JSArrayBufferConstructor* create(VM&, Structure*, JSArrayBufferPrototype*, GetterSetter* speciesSymbol); 45 46 46 47 DECLARE_INFO; -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r195138 r195460 394 394 395 395 // Constructors 396 396 397 GetterSetter* speciesGetterSetter = GetterSetter::create(vm, this); 398 speciesGetterSetter->setGetter(vm, this, JSFunction::createBuiltinFunction(vm, globalObjectSpeciesGetterCodeGenerator(vm), this)); 399 397 400 ObjectConstructor* objectConstructor = ObjectConstructor::create(vm, this, ObjectConstructor::createStructure(vm, this, m_functionPrototype.get()), m_objectPrototype.get()); 398 401 m_objectConstructor.set(vm, this, objectConstructor); … … 402 405 403 406 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)); 407 410 408 411 #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() ); \412 capitalName ## Constructor* lowerName ## Constructor = capitalName ## Constructor::create(vm, capitalName ## Constructor::createStructure(vm, this, m_functionPrototype.get()), m_ ## lowerName ## Prototype.get(), speciesGetterSetter); \ 410 413 m_ ## lowerName ## Prototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, lowerName ## Constructor, DontEnum); \ 411 414 … … 471 474 putDirectWithoutTransition(vm, vm.propertyNames->Reflect, ReflectObject::create(vm, this, ReflectObject::createStructure(vm, this, m_objectPrototype.get())), DontEnum); 472 475 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); 474 477 typedArrayProto->putDirectWithoutTransition(vm, vm.propertyNames->constructor, typedArraySuperConstructor, DontEnum); 475 478 -
trunk/Source/JavaScriptCore/runtime/JSInternalPromiseConstructor.cpp
r192204 r195460 48 48 */ 49 49 50 JSInternalPromiseConstructor* JSInternalPromiseConstructor::create(VM& vm, Structure* structure, JSInternalPromisePrototype* promisePrototype )50 JSInternalPromiseConstructor* JSInternalPromiseConstructor::create(VM& vm, Structure* structure, JSInternalPromisePrototype* promisePrototype, GetterSetter* speciesSymbol) 51 51 { 52 52 JSInternalPromiseConstructor* constructor = new (NotNull, allocateCell<JSInternalPromiseConstructor>(vm.heap)) JSInternalPromiseConstructor(vm, structure); 53 constructor->finishCreation(vm, promisePrototype );53 constructor->finishCreation(vm, promisePrototype, speciesSymbol); 54 54 return constructor; 55 55 } -
trunk/Source/JavaScriptCore/runtime/JSInternalPromiseConstructor.h
r188681 r195460 39 39 static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot; 40 40 41 static JSInternalPromiseConstructor* create(VM&, Structure*, JSInternalPromisePrototype* );41 static JSInternalPromiseConstructor* create(VM&, Structure*, JSInternalPromisePrototype*, GetterSetter*); 42 42 static Structure* createStructure(VM&, JSGlobalObject*, JSValue); 43 43 -
trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp
r194863 r195460 30 30 #include "Error.h" 31 31 #include "Exception.h" 32 #include "GetterSetter.h" 32 33 #include "IteratorOperations.h" 33 34 #include "JSCBuiltins.h" … … 62 63 */ 63 64 64 JSPromiseConstructor* JSPromiseConstructor::create(VM& vm, Structure* structure, JSPromisePrototype* promisePrototype )65 JSPromiseConstructor* JSPromiseConstructor::create(VM& vm, Structure* structure, JSPromisePrototype* promisePrototype, GetterSetter* speciesSymbol) 65 66 { 66 67 JSPromiseConstructor* constructor = new (NotNull, allocateCell<JSPromiseConstructor>(vm.heap)) JSPromiseConstructor(vm, structure); 67 constructor->finishCreation(vm, promisePrototype );68 constructor->finishCreation(vm, promisePrototype, speciesSymbol); 68 69 constructor->addOwnInternalSlots(vm, structure->globalObject()); 69 70 return constructor; … … 80 81 } 81 82 82 void JSPromiseConstructor::finishCreation(VM& vm, JSPromisePrototype* promisePrototype )83 void JSPromiseConstructor::finishCreation(VM& vm, JSPromisePrototype* promisePrototype, GetterSetter* speciesSymbol) 83 84 { 84 85 Base::finishCreation(vm, ASCIILiteral("Promise")); 85 86 putDirectWithoutTransition(vm, vm.propertyNames->prototype, promisePrototype, DontEnum | DontDelete | ReadOnly); 86 87 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete); 88 putDirectNonIndexAccessor(vm, vm.propertyNames->speciesSymbol, speciesSymbol, Accessor | ReadOnly | DontEnum | DontDelete); 87 89 } 88 90 -
trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.h
r194863 r195460 33 33 class JSPromise; 34 34 class JSPromisePrototype; 35 class GetterSetter; 35 36 36 37 class JSPromiseConstructor : public InternalFunction { … … 39 40 static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot; 40 41 41 static JSPromiseConstructor* create(VM&, Structure*, JSPromisePrototype* );42 static JSPromiseConstructor* create(VM&, Structure*, JSPromisePrototype*, GetterSetter* speciesSymbol); 42 43 static Structure* createStructure(VM&, JSGlobalObject*, JSValue); 43 44 … … 48 49 protected: 49 50 JSPromiseConstructor(VM&, Structure*); 50 void finishCreation(VM&, JSPromisePrototype* );51 void finishCreation(VM&, JSPromisePrototype*, GetterSetter*); 51 52 52 53 private: -
trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewConstructor.cpp
r191059 r195460 29 29 #include "CallFrame.h" 30 30 #include "Error.h" 31 #include "GetterSetter.h" 31 32 #include "JSCBuiltins.h" 32 33 #include "JSCellInlines.h" 33 34 #include "JSGenericTypedArrayViewConstructorInlines.h" 34 35 #include "JSObject.h" 36 #include "JSTypedArrayViewPrototype.h" 35 37 #include "JSTypedArrays.h" 36 38 … … 44 46 const ClassInfo JSTypedArrayViewConstructor::s_info = { "Function", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTypedArrayViewConstructor) }; 45 47 46 void JSTypedArrayViewConstructor::finishCreation(VM& vm, JSGlobalObject* globalObject, JS Object* prototype)48 void JSTypedArrayViewConstructor::finishCreation(VM& vm, JSGlobalObject* globalObject, JSTypedArrayViewPrototype* prototype, GetterSetter* speciesSymbol) 47 49 { 48 50 Base::finishCreation(vm, "TypedArray"); 49 51 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly); 50 52 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(3), DontEnum | DontDelete | ReadOnly); 53 putDirectNonIndexAccessor(vm, vm.propertyNames->speciesSymbol, speciesSymbol, Accessor | ReadOnly | DontEnum | DontDelete); 51 54 52 55 JSC_BUILTIN_FUNCTION(vm.propertyNames->of, typedArrayConstructorOfCodeGenerator, DontEnum); 53 56 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;63 57 } 64 58 -
trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewConstructor.h
r191059 r195460 31 31 namespace JSC { 32 32 33 class JSTypedArrayViewPrototype; 34 class GetterSetter; 35 33 36 class JSTypedArrayViewConstructor : public InternalFunction { 34 37 public: … … 37 40 protected: 38 41 JSTypedArrayViewConstructor(VM&, Structure*); 39 void finishCreation(VM&, JSGlobalObject*, JS Object* prototype);42 void finishCreation(VM&, JSGlobalObject*, JSTypedArrayViewPrototype*, GetterSetter* speciesSymbol); 40 43 41 44 public: 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 } 43 51 44 52 DECLARE_INFO; -
trunk/Source/JavaScriptCore/runtime/MapConstructor.cpp
r194863 r195460 28 28 29 29 #include "Error.h" 30 #include "GetterSetter.h" 30 31 #include "IteratorOperations.h" 31 32 #include "JSCJSValueInlines.h" … … 40 41 const ClassInfo MapConstructor::s_info = { "Function", &Base::s_info, 0, CREATE_METHOD_TABLE(MapConstructor) }; 41 42 42 void MapConstructor::finishCreation(VM& vm, MapPrototype* mapPrototype )43 void MapConstructor::finishCreation(VM& vm, MapPrototype* mapPrototype, GetterSetter* speciesSymbol) 43 44 { 44 45 Base::finishCreation(vm, mapPrototype->classInfo()->className); 45 46 putDirectWithoutTransition(vm, vm.propertyNames->prototype, mapPrototype, DontEnum | DontDelete | ReadOnly); 46 47 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum | DontDelete); 48 putDirectNonIndexAccessor(vm, vm.propertyNames->speciesSymbol, speciesSymbol, Accessor | ReadOnly | DontEnum | DontDelete); 47 49 } 48 50 -
trunk/Source/JavaScriptCore/runtime/MapConstructor.h
r156624 r195460 32 32 33 33 class MapPrototype; 34 class GetterSetter; 34 35 35 36 class MapConstructor : public InternalFunction { … … 37 38 typedef InternalFunction Base; 38 39 39 static MapConstructor* create(VM& vm, Structure* structure, MapPrototype* mapPrototype )40 static MapConstructor* create(VM& vm, Structure* structure, MapPrototype* mapPrototype, GetterSetter* speciesSymbol) 40 41 { 41 42 MapConstructor* constructor = new (NotNull, allocateCell<MapConstructor>(vm.heap)) MapConstructor(vm, structure); 42 constructor->finishCreation(vm, mapPrototype );43 constructor->finishCreation(vm, mapPrototype, speciesSymbol); 43 44 return constructor; 44 45 } … … 56 57 { 57 58 } 58 void finishCreation(VM&, MapPrototype* );59 void finishCreation(VM&, MapPrototype*, GetterSetter* speciesSymbol); 59 60 static ConstructType getConstructData(JSCell*, ConstructData&); 60 61 static CallType getCallData(JSCell*, CallData&); -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.h
r194369 r195460 27 27 28 28 class NumberPrototype; 29 class GetterSetter; 29 30 30 31 class NumberConstructor : public InternalFunction { … … 33 34 static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | ImplementsHasInstance | ImplementsDefaultHasInstance; 34 35 35 static NumberConstructor* create(VM& vm, Structure* structure, NumberPrototype* numberPrototype )36 static NumberConstructor* create(VM& vm, Structure* structure, NumberPrototype* numberPrototype, GetterSetter*) 36 37 { 37 38 NumberConstructor* constructor = new (NotNull, allocateCell<NumberConstructor>(vm.heap)) NumberConstructor(vm, structure); -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
r194863 r195460 24 24 25 25 #include "Error.h" 26 #include "GetterSetter.h" 26 27 #include "JSCInlines.h" 27 28 #include "RegExpMatchesArray.h" … … 91 92 } 92 93 93 void RegExpConstructor::finishCreation(VM& vm, RegExpPrototype* regExpPrototype )94 void RegExpConstructor::finishCreation(VM& vm, RegExpPrototype* regExpPrototype, GetterSetter* speciesSymbol) 94 95 { 95 96 Base::finishCreation(vm, regExpPrototype->classInfo()->className); … … 101 102 // no. of arguments for constructor 102 103 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(2), ReadOnly | DontDelete | DontEnum); 104 105 putDirectNonIndexAccessor(vm, vm.propertyNames->speciesSymbol, speciesSymbol, Accessor | ReadOnly | DontEnum | DontDelete); 103 106 } 104 107 -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h
r194863 r195460 30 30 31 31 class RegExpPrototype; 32 class GetterSetter; 32 33 33 34 class RegExpConstructor : public InternalFunction { … … 36 37 static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot; 37 38 38 static RegExpConstructor* create(VM& vm, Structure* structure, RegExpPrototype* regExpPrototype )39 static RegExpConstructor* create(VM& vm, Structure* structure, RegExpPrototype* regExpPrototype, GetterSetter* species) 39 40 { 40 41 RegExpConstructor* constructor = new (NotNull, allocateCell<RegExpConstructor>(vm.heap)) RegExpConstructor(vm, structure, regExpPrototype); 41 constructor->finishCreation(vm, regExpPrototype );42 constructor->finishCreation(vm, regExpPrototype, species); 42 43 return constructor; 43 44 } … … 69 70 70 71 protected: 71 void finishCreation(VM&, RegExpPrototype* );72 void finishCreation(VM&, RegExpPrototype*, GetterSetter* species); 72 73 73 74 private: -
trunk/Source/JavaScriptCore/runtime/SetConstructor.cpp
r194863 r195460 28 28 29 29 #include "Error.h" 30 #include "GetterSetter.h" 30 31 #include "IteratorOperations.h" 31 32 #include "JSCJSValueInlines.h" … … 41 42 const ClassInfo SetConstructor::s_info = { "Function", &Base::s_info, 0, CREATE_METHOD_TABLE(SetConstructor) }; 42 43 43 void SetConstructor::finishCreation(VM& vm, SetPrototype* setPrototype )44 void SetConstructor::finishCreation(VM& vm, SetPrototype* setPrototype, GetterSetter* speciesSymbol) 44 45 { 45 46 Base::finishCreation(vm, setPrototype->classInfo()->className); 46 47 putDirectWithoutTransition(vm, vm.propertyNames->prototype, setPrototype, DontEnum | DontDelete | ReadOnly); 47 48 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum | DontDelete); 49 putDirectNonIndexAccessor(vm, vm.propertyNames->speciesSymbol, speciesSymbol, Accessor | ReadOnly | DontEnum | DontDelete); 48 50 } 49 51 -
trunk/Source/JavaScriptCore/runtime/SetConstructor.h
r156624 r195460 32 32 33 33 class SetPrototype; 34 class GetterSetter; 34 35 35 36 class SetConstructor : public InternalFunction { … … 37 38 typedef InternalFunction Base; 38 39 39 static SetConstructor* create(VM& vm, Structure* structure, SetPrototype* setPrototype )40 static SetConstructor* create(VM& vm, Structure* structure, SetPrototype* setPrototype, GetterSetter* speciesSymbol) 40 41 { 41 42 SetConstructor* constructor = new (NotNull, allocateCell<SetConstructor>(vm.heap)) SetConstructor(vm, structure); 42 constructor->finishCreation(vm, setPrototype );43 constructor->finishCreation(vm, setPrototype, speciesSymbol); 43 44 return constructor; 44 45 } … … 56 57 { 57 58 } 58 void finishCreation(VM&, SetPrototype* );59 void finishCreation(VM&, SetPrototype*, GetterSetter* speciesSymbol); 59 60 static ConstructType getConstructData(JSCell*, ConstructData&); 60 61 static CallType getCallData(JSCell*, CallData&); -
trunk/Source/JavaScriptCore/runtime/StringConstructor.h
r194770 r195460 27 27 28 28 class StringPrototype; 29 class GetterSetter; 29 30 30 31 class StringConstructor : public InternalFunction { … … 33 34 static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot; 34 35 35 static StringConstructor* create(VM& vm, Structure* structure, StringPrototype* stringPrototype )36 static StringConstructor* create(VM& vm, Structure* structure, StringPrototype* stringPrototype, GetterSetter*) 36 37 { 37 38 StringConstructor* constructor = new (NotNull, allocateCell<StringConstructor>(vm.heap)) StringConstructor(vm, structure); -
trunk/Source/JavaScriptCore/runtime/SymbolConstructor.h
r182921 r195460 34 34 35 35 class SymbolPrototype; 36 class GetterSetter; 36 37 37 38 class SymbolConstructor : public InternalFunction { … … 40 41 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | Base::StructureFlags; 41 42 42 static SymbolConstructor* create(VM& vm, Structure* structure, SymbolPrototype* prototype )43 static SymbolConstructor* create(VM& vm, Structure* structure, SymbolPrototype* prototype, GetterSetter*) 43 44 { 44 45 SymbolConstructor* constructor = new (NotNull, allocateCell<SymbolConstructor>(vm.heap)) SymbolConstructor(vm, structure); -
trunk/Source/JavaScriptCore/runtime/WeakMapConstructor.h
r156624 r195460 32 32 33 33 class WeakMapPrototype; 34 class GetterSetter; 34 35 35 36 class WeakMapConstructor : public InternalFunction { … … 37 38 typedef InternalFunction Base; 38 39 39 static WeakMapConstructor* create(VM& vm, Structure* structure, WeakMapPrototype* prototype )40 static WeakMapConstructor* create(VM& vm, Structure* structure, WeakMapPrototype* prototype, GetterSetter*) 40 41 { 41 42 WeakMapConstructor* constructor = new (NotNull, allocateCell<WeakMapConstructor>(vm.heap)) WeakMapConstructor(vm, structure); -
trunk/Source/JavaScriptCore/runtime/WeakSetConstructor.h
r182994 r195460 32 32 33 33 class WeakSetPrototype; 34 class GetterSetter; 34 35 35 36 class WeakSetConstructor : public InternalFunction { … … 37 38 typedef InternalFunction Base; 38 39 39 static WeakSetConstructor* create(VM& vm, Structure* structure, WeakSetPrototype* prototype )40 static WeakSetConstructor* create(VM& vm, Structure* structure, WeakSetPrototype* prototype, GetterSetter*) 40 41 { 41 42 WeakSetConstructor* constructor = new (NotNull, allocateCell<WeakSetConstructor>(vm.heap)) WeakSetConstructor(vm, structure);
Note: See TracChangeset
for help on using the changeset viewer.