haikuwebkit/LayoutTests/js/basic-set-expected.txt

215 lines
5.3 KiB
Plaintext
Raw Permalink Normal View History

Implement ES6 Set class https://bugs.webkit.org/show_bug.cgi?id=120549 Reviewed by Filip Pizlo. Source/JavaScriptCore: We simply reuse the MapData type from JSMap making the it much simpler. * JavaScriptCore.xcodeproj/project.pbxproj: * runtime/CommonIdentifiers.h: * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::reset): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::setStructure): * runtime/JSSet.cpp: Added. (JSC::JSSet::visitChildren): (JSC::JSSet::finishCreation): * runtime/JSSet.h: Added. (JSC::JSSet::createStructure): (JSC::JSSet::create): (JSC::JSSet::mapData): (JSC::JSSet::JSSet): * runtime/SetConstructor.cpp: Added. (JSC::SetConstructor::finishCreation): (JSC::callSet): (JSC::constructSet): (JSC::SetConstructor::getConstructData): (JSC::SetConstructor::getCallData): * runtime/SetConstructor.h: Added. (JSC::SetConstructor::create): (JSC::SetConstructor::createStructure): (JSC::SetConstructor::SetConstructor): * runtime/SetPrototype.cpp: Added. (JSC::SetPrototype::finishCreation): (JSC::getMapData): (JSC::setProtoFuncAdd): (JSC::setProtoFuncClear): (JSC::setProtoFuncDelete): (JSC::setProtoFuncForEach): (JSC::setProtoFuncHas): (JSC::setProtoFuncSize): * runtime/SetPrototype.h: Added. (JSC::SetPrototype::create): (JSC::SetPrototype::createStructure): (JSC::SetPrototype::SetPrototype): LayoutTests: Add tests * fast/js/basic-set-expected.txt: Added. * fast/js/basic-set.html: Added. * fast/js/script-tests/basic-set.js: Added. (set new): (otherString.string_appeared_here.set add): (try.set forEach): (set forEach): (set gc): Canonical link: https://commits.webkit.org/138542@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-08-30 22:55:25 +00:00
Tests basic correctness of ES Set object
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Set instanceof Set is false
PASS Set.prototype instanceof Set is false
Debug assertion failure while loading http://kangax.github.io/compat-table/es6/. https://bugs.webkit.org/show_bug.cgi?id=154542 Reviewed by Saam Barati. Source/JavaScriptCore: According to the spec, the constructors of the following types "are not intended to be called as a function and will throw an exception". These types are: TypedArrays - https://tc39.github.io/ecma262/#sec-typedarray-constructors Map - https://tc39.github.io/ecma262/#sec-map-constructor Set - https://tc39.github.io/ecma262/#sec-set-constructor WeakMap - https://tc39.github.io/ecma262/#sec-weakmap-constructor WeakSet - https://tc39.github.io/ecma262/#sec-weakset-constructor ArrayBuffer - https://tc39.github.io/ecma262/#sec-arraybuffer-constructor DataView - https://tc39.github.io/ecma262/#sec-dataview-constructor Promise - https://tc39.github.io/ecma262/#sec-promise-constructor Proxy - https://tc39.github.io/ecma262/#sec-proxy-constructor This patch does the foillowing: 1. Ensures that these constructors can be called but will throw a TypeError when called. 2. Makes all these objects use throwConstructorCannotBeCalledAsFunctionTypeError() in their implementation to be consistent. 3. Change the error message to "calling XXX constructor without new is invalid". This is clearer because the error is likely due to the user forgetting to use the new operator on these constructors. * runtime/Error.h: * runtime/Error.cpp: (JSC::throwConstructorCannotBeCalledAsFunctionTypeError): - Added a convenience function to throw the TypeError. * runtime/JSArrayBufferConstructor.cpp: (JSC::constructArrayBuffer): (JSC::callArrayBuffer): (JSC::JSArrayBufferConstructor::getCallData): * runtime/JSGenericTypedArrayViewConstructorInlines.h: (JSC::callGenericTypedArrayView): (JSC::JSGenericTypedArrayViewConstructor<ViewClass>::getCallData): * runtime/JSPromiseConstructor.cpp: (JSC::callPromise): * runtime/MapConstructor.cpp: (JSC::callMap): * runtime/ProxyConstructor.cpp: (JSC::callProxy): (JSC::ProxyConstructor::getCallData): * runtime/SetConstructor.cpp: (JSC::callSet): * runtime/WeakMapConstructor.cpp: (JSC::callWeakMap): * runtime/WeakSetConstructor.cpp: (JSC::callWeakSet): * tests/es6.yaml: - The typed_arrays_%TypedArray%[Symbol.species].js test now passes. * tests/stress/call-non-calleable-constructors-as-function.js: Added. (test): * tests/stress/map-constructor.js: (testCallTypeError): * tests/stress/promise-cannot-be-called.js: (shouldThrow): * tests/stress/proxy-basic.js: * tests/stress/set-constructor.js: * tests/stress/throw-from-ftl-call-ic-slow-path-cells.js: (i.catch): * tests/stress/throw-from-ftl-call-ic-slow-path-undefined.js: (i.catch): * tests/stress/throw-from-ftl-call-ic-slow-path.js: (i.catch): * tests/stress/weak-map-constructor.js: (testCallTypeError): * tests/stress/weak-set-constructor.js: - Updated error message string. LayoutTests: * js/Promise-types-expected.txt: * js/basic-map-expected.txt: * js/basic-set-expected.txt: * js/dom/basic-weakmap-expected.txt: * js/dom/basic-weakset-expected.txt: * js/script-tests/Promise-types.js: * js/typedarray-constructors-expected.txt: - Updated error message string. Canonical link: https://commits.webkit.org/172692@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196986 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-23 19:41:56 +00:00
PASS Set() instanceof Set threw exception TypeError: calling Set constructor without new is invalid.
Implement ES6 Set class https://bugs.webkit.org/show_bug.cgi?id=120549 Reviewed by Filip Pizlo. Source/JavaScriptCore: We simply reuse the MapData type from JSMap making the it much simpler. * JavaScriptCore.xcodeproj/project.pbxproj: * runtime/CommonIdentifiers.h: * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::reset): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::setStructure): * runtime/JSSet.cpp: Added. (JSC::JSSet::visitChildren): (JSC::JSSet::finishCreation): * runtime/JSSet.h: Added. (JSC::JSSet::createStructure): (JSC::JSSet::create): (JSC::JSSet::mapData): (JSC::JSSet::JSSet): * runtime/SetConstructor.cpp: Added. (JSC::SetConstructor::finishCreation): (JSC::callSet): (JSC::constructSet): (JSC::SetConstructor::getConstructData): (JSC::SetConstructor::getCallData): * runtime/SetConstructor.h: Added. (JSC::SetConstructor::create): (JSC::SetConstructor::createStructure): (JSC::SetConstructor::SetConstructor): * runtime/SetPrototype.cpp: Added. (JSC::SetPrototype::finishCreation): (JSC::getMapData): (JSC::setProtoFuncAdd): (JSC::setProtoFuncClear): (JSC::setProtoFuncDelete): (JSC::setProtoFuncForEach): (JSC::setProtoFuncHas): (JSC::setProtoFuncSize): * runtime/SetPrototype.h: Added. (JSC::SetPrototype::create): (JSC::SetPrototype::createStructure): (JSC::SetPrototype::SetPrototype): LayoutTests: Add tests * fast/js/basic-set-expected.txt: Added. * fast/js/basic-set.html: Added. * fast/js/script-tests/basic-set.js: Added. (set new): (otherString.string_appeared_here.set add): (try.set forEach): (set forEach): (set gc): Canonical link: https://commits.webkit.org/138542@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-08-30 22:55:25 +00:00
PASS new Set() instanceof Set is true
Debug assertion failure while loading http://kangax.github.io/compat-table/es6/. https://bugs.webkit.org/show_bug.cgi?id=154542 Reviewed by Saam Barati. Source/JavaScriptCore: According to the spec, the constructors of the following types "are not intended to be called as a function and will throw an exception". These types are: TypedArrays - https://tc39.github.io/ecma262/#sec-typedarray-constructors Map - https://tc39.github.io/ecma262/#sec-map-constructor Set - https://tc39.github.io/ecma262/#sec-set-constructor WeakMap - https://tc39.github.io/ecma262/#sec-weakmap-constructor WeakSet - https://tc39.github.io/ecma262/#sec-weakset-constructor ArrayBuffer - https://tc39.github.io/ecma262/#sec-arraybuffer-constructor DataView - https://tc39.github.io/ecma262/#sec-dataview-constructor Promise - https://tc39.github.io/ecma262/#sec-promise-constructor Proxy - https://tc39.github.io/ecma262/#sec-proxy-constructor This patch does the foillowing: 1. Ensures that these constructors can be called but will throw a TypeError when called. 2. Makes all these objects use throwConstructorCannotBeCalledAsFunctionTypeError() in their implementation to be consistent. 3. Change the error message to "calling XXX constructor without new is invalid". This is clearer because the error is likely due to the user forgetting to use the new operator on these constructors. * runtime/Error.h: * runtime/Error.cpp: (JSC::throwConstructorCannotBeCalledAsFunctionTypeError): - Added a convenience function to throw the TypeError. * runtime/JSArrayBufferConstructor.cpp: (JSC::constructArrayBuffer): (JSC::callArrayBuffer): (JSC::JSArrayBufferConstructor::getCallData): * runtime/JSGenericTypedArrayViewConstructorInlines.h: (JSC::callGenericTypedArrayView): (JSC::JSGenericTypedArrayViewConstructor<ViewClass>::getCallData): * runtime/JSPromiseConstructor.cpp: (JSC::callPromise): * runtime/MapConstructor.cpp: (JSC::callMap): * runtime/ProxyConstructor.cpp: (JSC::callProxy): (JSC::ProxyConstructor::getCallData): * runtime/SetConstructor.cpp: (JSC::callSet): * runtime/WeakMapConstructor.cpp: (JSC::callWeakMap): * runtime/WeakSetConstructor.cpp: (JSC::callWeakSet): * tests/es6.yaml: - The typed_arrays_%TypedArray%[Symbol.species].js test now passes. * tests/stress/call-non-calleable-constructors-as-function.js: Added. (test): * tests/stress/map-constructor.js: (testCallTypeError): * tests/stress/promise-cannot-be-called.js: (shouldThrow): * tests/stress/proxy-basic.js: * tests/stress/set-constructor.js: * tests/stress/throw-from-ftl-call-ic-slow-path-cells.js: (i.catch): * tests/stress/throw-from-ftl-call-ic-slow-path-undefined.js: (i.catch): * tests/stress/throw-from-ftl-call-ic-slow-path.js: (i.catch): * tests/stress/weak-map-constructor.js: (testCallTypeError): * tests/stress/weak-set-constructor.js: - Updated error message string. LayoutTests: * js/Promise-types-expected.txt: * js/basic-map-expected.txt: * js/basic-set-expected.txt: * js/dom/basic-weakmap-expected.txt: * js/dom/basic-weakset-expected.txt: * js/script-tests/Promise-types.js: * js/typedarray-constructors-expected.txt: - Updated error message string. Canonical link: https://commits.webkit.org/172692@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196986 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-23 19:41:56 +00:00
PASS Set(null) instanceof Set threw exception TypeError: calling Set constructor without new is invalid.
PASS Set(undefined) instanceof Set threw exception TypeError: calling Set constructor without new is invalid.
PASS Set(undefined, undefined) instanceof Set threw exception TypeError: calling Set constructor without new is invalid.
PASS Set(null, undefined) instanceof Set threw exception TypeError: calling Set constructor without new is invalid.
PASS new Set(null) instanceof Set is true
PASS new Set(undefined) instanceof Set is true
PASS new Set(undefined, undefined) instanceof Set is true
PASS new Set(null, undefined) instanceof Set is true
Debug assertion failure while loading http://kangax.github.io/compat-table/es6/. https://bugs.webkit.org/show_bug.cgi?id=154542 Reviewed by Saam Barati. Source/JavaScriptCore: According to the spec, the constructors of the following types "are not intended to be called as a function and will throw an exception". These types are: TypedArrays - https://tc39.github.io/ecma262/#sec-typedarray-constructors Map - https://tc39.github.io/ecma262/#sec-map-constructor Set - https://tc39.github.io/ecma262/#sec-set-constructor WeakMap - https://tc39.github.io/ecma262/#sec-weakmap-constructor WeakSet - https://tc39.github.io/ecma262/#sec-weakset-constructor ArrayBuffer - https://tc39.github.io/ecma262/#sec-arraybuffer-constructor DataView - https://tc39.github.io/ecma262/#sec-dataview-constructor Promise - https://tc39.github.io/ecma262/#sec-promise-constructor Proxy - https://tc39.github.io/ecma262/#sec-proxy-constructor This patch does the foillowing: 1. Ensures that these constructors can be called but will throw a TypeError when called. 2. Makes all these objects use throwConstructorCannotBeCalledAsFunctionTypeError() in their implementation to be consistent. 3. Change the error message to "calling XXX constructor without new is invalid". This is clearer because the error is likely due to the user forgetting to use the new operator on these constructors. * runtime/Error.h: * runtime/Error.cpp: (JSC::throwConstructorCannotBeCalledAsFunctionTypeError): - Added a convenience function to throw the TypeError. * runtime/JSArrayBufferConstructor.cpp: (JSC::constructArrayBuffer): (JSC::callArrayBuffer): (JSC::JSArrayBufferConstructor::getCallData): * runtime/JSGenericTypedArrayViewConstructorInlines.h: (JSC::callGenericTypedArrayView): (JSC::JSGenericTypedArrayViewConstructor<ViewClass>::getCallData): * runtime/JSPromiseConstructor.cpp: (JSC::callPromise): * runtime/MapConstructor.cpp: (JSC::callMap): * runtime/ProxyConstructor.cpp: (JSC::callProxy): (JSC::ProxyConstructor::getCallData): * runtime/SetConstructor.cpp: (JSC::callSet): * runtime/WeakMapConstructor.cpp: (JSC::callWeakMap): * runtime/WeakSetConstructor.cpp: (JSC::callWeakSet): * tests/es6.yaml: - The typed_arrays_%TypedArray%[Symbol.species].js test now passes. * tests/stress/call-non-calleable-constructors-as-function.js: Added. (test): * tests/stress/map-constructor.js: (testCallTypeError): * tests/stress/promise-cannot-be-called.js: (shouldThrow): * tests/stress/proxy-basic.js: * tests/stress/set-constructor.js: * tests/stress/throw-from-ftl-call-ic-slow-path-cells.js: (i.catch): * tests/stress/throw-from-ftl-call-ic-slow-path-undefined.js: (i.catch): * tests/stress/throw-from-ftl-call-ic-slow-path.js: (i.catch): * tests/stress/weak-map-constructor.js: (testCallTypeError): * tests/stress/weak-set-constructor.js: - Updated error message string. LayoutTests: * js/Promise-types-expected.txt: * js/basic-map-expected.txt: * js/basic-set-expected.txt: * js/dom/basic-weakmap-expected.txt: * js/dom/basic-weakset-expected.txt: * js/script-tests/Promise-types.js: * js/typedarray-constructors-expected.txt: - Updated error message string. Canonical link: https://commits.webkit.org/172692@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196986 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-23 19:41:56 +00:00
PASS Set(1) threw exception TypeError: calling Set constructor without new is invalid.
PASS Set(true) threw exception TypeError: calling Set constructor without new is invalid.
PASS Set([]) threw exception TypeError: calling Set constructor without new is invalid.
PASS Set({}) threw exception TypeError: calling Set constructor without new is invalid.
PASS Set(undefined, null) threw exception TypeError: calling Set constructor without new is invalid.
PASS Set(undefined, {}) threw exception TypeError: calling Set constructor without new is invalid.
PASS new Set(1) threw exception TypeError: Type error.
PASS new Set(true) threw exception TypeError: Type error.
PASS new Set([]) did not throw exception.
PASS new Set({}) threw exception TypeError: Type error.
PASS new Set(undefined, null) did not throw exception.
PASS new Set(undefined, {}) did not throw exception.
Implement ES6 Set class https://bugs.webkit.org/show_bug.cgi?id=120549 Reviewed by Filip Pizlo. Source/JavaScriptCore: We simply reuse the MapData type from JSMap making the it much simpler. * JavaScriptCore.xcodeproj/project.pbxproj: * runtime/CommonIdentifiers.h: * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::reset): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::setStructure): * runtime/JSSet.cpp: Added. (JSC::JSSet::visitChildren): (JSC::JSSet::finishCreation): * runtime/JSSet.h: Added. (JSC::JSSet::createStructure): (JSC::JSSet::create): (JSC::JSSet::mapData): (JSC::JSSet::JSSet): * runtime/SetConstructor.cpp: Added. (JSC::SetConstructor::finishCreation): (JSC::callSet): (JSC::constructSet): (JSC::SetConstructor::getConstructData): (JSC::SetConstructor::getCallData): * runtime/SetConstructor.h: Added. (JSC::SetConstructor::create): (JSC::SetConstructor::createStructure): (JSC::SetConstructor::SetConstructor): * runtime/SetPrototype.cpp: Added. (JSC::SetPrototype::finishCreation): (JSC::getMapData): (JSC::setProtoFuncAdd): (JSC::setProtoFuncClear): (JSC::setProtoFuncDelete): (JSC::setProtoFuncForEach): (JSC::setProtoFuncHas): (JSC::setProtoFuncSize): * runtime/SetPrototype.h: Added. (JSC::SetPrototype::create): (JSC::SetPrototype::createStructure): (JSC::SetPrototype::SetPrototype): LayoutTests: Add tests * fast/js/basic-set-expected.txt: Added. * fast/js/basic-set.html: Added. * fast/js/script-tests/basic-set.js: Added. (set new): (otherString.string_appeared_here.set add): (try.set forEach): (set forEach): (set gc): Canonical link: https://commits.webkit.org/138542@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-08-30 22:55:25 +00:00
1
undefined
true
6
1
0
[object Object]
PASS Object.hasOwnProperty(set, 'size') is false
PASS Set.prototype.hasOwnProperty('size') is true
PASS Set.prototype.size threw exception TypeError: Set operation called on non-Set object.
PASS Set.prototype.add.length is 1
PASS Set.prototype.has.length is 1
PASS Set.prototype.clear.length is 0
PASS Set.prototype.keys.length is 0
PASS Set.prototype.values.length is 0
PASS Set.prototype.entries.length is 0
Implement ES6 Set class https://bugs.webkit.org/show_bug.cgi?id=120549 Reviewed by Filip Pizlo. Source/JavaScriptCore: We simply reuse the MapData type from JSMap making the it much simpler. * JavaScriptCore.xcodeproj/project.pbxproj: * runtime/CommonIdentifiers.h: * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::reset): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::setStructure): * runtime/JSSet.cpp: Added. (JSC::JSSet::visitChildren): (JSC::JSSet::finishCreation): * runtime/JSSet.h: Added. (JSC::JSSet::createStructure): (JSC::JSSet::create): (JSC::JSSet::mapData): (JSC::JSSet::JSSet): * runtime/SetConstructor.cpp: Added. (JSC::SetConstructor::finishCreation): (JSC::callSet): (JSC::constructSet): (JSC::SetConstructor::getConstructData): (JSC::SetConstructor::getCallData): * runtime/SetConstructor.h: Added. (JSC::SetConstructor::create): (JSC::SetConstructor::createStructure): (JSC::SetConstructor::SetConstructor): * runtime/SetPrototype.cpp: Added. (JSC::SetPrototype::finishCreation): (JSC::getMapData): (JSC::setProtoFuncAdd): (JSC::setProtoFuncClear): (JSC::setProtoFuncDelete): (JSC::setProtoFuncForEach): (JSC::setProtoFuncHas): (JSC::setProtoFuncSize): * runtime/SetPrototype.h: Added. (JSC::SetPrototype::create): (JSC::SetPrototype::createStructure): (JSC::SetPrototype::SetPrototype): LayoutTests: Add tests * fast/js/basic-set-expected.txt: Added. * fast/js/basic-set.html: Added. * fast/js/script-tests/basic-set.js: Added. (set new): (otherString.string_appeared_here.set add): (try.set forEach): (set forEach): (set gc): Canonical link: https://commits.webkit.org/138542@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-08-30 22:55:25 +00:00
PASS set.size is 0
PASS set.add(-0) is set
PASS set.add(0) is set
PASS set.size is 1
Implement ES6 Set class https://bugs.webkit.org/show_bug.cgi?id=120549 Reviewed by Filip Pizlo. Source/JavaScriptCore: We simply reuse the MapData type from JSMap making the it much simpler. * JavaScriptCore.xcodeproj/project.pbxproj: * runtime/CommonIdentifiers.h: * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::reset): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::setStructure): * runtime/JSSet.cpp: Added. (JSC::JSSet::visitChildren): (JSC::JSSet::finishCreation): * runtime/JSSet.h: Added. (JSC::JSSet::createStructure): (JSC::JSSet::create): (JSC::JSSet::mapData): (JSC::JSSet::JSSet): * runtime/SetConstructor.cpp: Added. (JSC::SetConstructor::finishCreation): (JSC::callSet): (JSC::constructSet): (JSC::SetConstructor::getConstructData): (JSC::SetConstructor::getCallData): * runtime/SetConstructor.h: Added. (JSC::SetConstructor::create): (JSC::SetConstructor::createStructure): (JSC::SetConstructor::SetConstructor): * runtime/SetPrototype.cpp: Added. (JSC::SetPrototype::finishCreation): (JSC::getMapData): (JSC::setProtoFuncAdd): (JSC::setProtoFuncClear): (JSC::setProtoFuncDelete): (JSC::setProtoFuncForEach): (JSC::setProtoFuncHas): (JSC::setProtoFuncSize): * runtime/SetPrototype.h: Added. (JSC::SetPrototype::create): (JSC::SetPrototype::createStructure): (JSC::SetPrototype::SetPrototype): LayoutTests: Add tests * fast/js/basic-set-expected.txt: Added. * fast/js/basic-set.html: Added. * fast/js/script-tests/basic-set.js: Added. (set new): (otherString.string_appeared_here.set add): (try.set forEach): (set forEach): (set gc): Canonical link: https://commits.webkit.org/138542@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-08-30 22:55:25 +00:00
PASS set.add(Infinity) is set
PASS set.add(-Infinity) is set
PASS set.add(NaN) is set
PASS set.add('0') is set
PASS set.add(0.1) is set
PASS set.size is 6
Implement ES6 Set class https://bugs.webkit.org/show_bug.cgi?id=120549 Reviewed by Filip Pizlo. Source/JavaScriptCore: We simply reuse the MapData type from JSMap making the it much simpler. * JavaScriptCore.xcodeproj/project.pbxproj: * runtime/CommonIdentifiers.h: * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::reset): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::setStructure): * runtime/JSSet.cpp: Added. (JSC::JSSet::visitChildren): (JSC::JSSet::finishCreation): * runtime/JSSet.h: Added. (JSC::JSSet::createStructure): (JSC::JSSet::create): (JSC::JSSet::mapData): (JSC::JSSet::JSSet): * runtime/SetConstructor.cpp: Added. (JSC::SetConstructor::finishCreation): (JSC::callSet): (JSC::constructSet): (JSC::SetConstructor::getConstructData): (JSC::SetConstructor::getCallData): * runtime/SetConstructor.h: Added. (JSC::SetConstructor::create): (JSC::SetConstructor::createStructure): (JSC::SetConstructor::SetConstructor): * runtime/SetPrototype.cpp: Added. (JSC::SetPrototype::finishCreation): (JSC::getMapData): (JSC::setProtoFuncAdd): (JSC::setProtoFuncClear): (JSC::setProtoFuncDelete): (JSC::setProtoFuncForEach): (JSC::setProtoFuncHas): (JSC::setProtoFuncSize): * runtime/SetPrototype.h: Added. (JSC::SetPrototype::create): (JSC::SetPrototype::createStructure): (JSC::SetPrototype::SetPrototype): LayoutTests: Add tests * fast/js/basic-set-expected.txt: Added. * fast/js/basic-set.html: Added. * fast/js/script-tests/basic-set.js: Added. (set new): (otherString.string_appeared_here.set add): (try.set forEach): (set forEach): (set gc): Canonical link: https://commits.webkit.org/138542@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-08-30 22:55:25 +00:00
PASS set.has(-0) is true
PASS set.has(0) is true
PASS set.has(Infinity) is true
PASS set.has(-Infinity) is true
PASS set.has(NaN) is true
PASS set.has('0') is true
PASS set.has(0.1) is true
PASS set.delete(-0) is true
PASS set.delete(0) is false
Implement ES6 Set class https://bugs.webkit.org/show_bug.cgi?id=120549 Reviewed by Filip Pizlo. Source/JavaScriptCore: We simply reuse the MapData type from JSMap making the it much simpler. * JavaScriptCore.xcodeproj/project.pbxproj: * runtime/CommonIdentifiers.h: * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::reset): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::setStructure): * runtime/JSSet.cpp: Added. (JSC::JSSet::visitChildren): (JSC::JSSet::finishCreation): * runtime/JSSet.h: Added. (JSC::JSSet::createStructure): (JSC::JSSet::create): (JSC::JSSet::mapData): (JSC::JSSet::JSSet): * runtime/SetConstructor.cpp: Added. (JSC::SetConstructor::finishCreation): (JSC::callSet): (JSC::constructSet): (JSC::SetConstructor::getConstructData): (JSC::SetConstructor::getCallData): * runtime/SetConstructor.h: Added. (JSC::SetConstructor::create): (JSC::SetConstructor::createStructure): (JSC::SetConstructor::SetConstructor): * runtime/SetPrototype.cpp: Added. (JSC::SetPrototype::finishCreation): (JSC::getMapData): (JSC::setProtoFuncAdd): (JSC::setProtoFuncClear): (JSC::setProtoFuncDelete): (JSC::setProtoFuncForEach): (JSC::setProtoFuncHas): (JSC::setProtoFuncSize): * runtime/SetPrototype.h: Added. (JSC::SetPrototype::create): (JSC::SetPrototype::createStructure): (JSC::SetPrototype::SetPrototype): LayoutTests: Add tests * fast/js/basic-set-expected.txt: Added. * fast/js/basic-set.html: Added. * fast/js/script-tests/basic-set.js: Added. (set new): (otherString.string_appeared_here.set add): (try.set forEach): (set forEach): (set gc): Canonical link: https://commits.webkit.org/138542@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-08-30 22:55:25 +00:00
PASS set.delete(Infinity) is true
PASS set.delete(-Infinity) is true
PASS set.delete(NaN) is true
PASS set.delete('0') is true
PASS set.delete(0.1) is true
PASS set.delete(-0) is false
PASS set.delete(0) is false
PASS set.delete(Infinity) is false
PASS set.delete(-Infinity) is false
PASS set.delete(NaN) is false
PASS set.delete('0') is false
PASS set.delete(0.1) is false
PASS set.has(simpleString) is true
PASS set.has(otherString) is true
PASS set.clear() is undefined.
PASS set.size is 0
PASS set.add(0) is set
PASS set.add('0') is set
PASS set.add(1) is set
PASS set.add('1') is set
PASS set.add(2) is set
PASS set.add('2') is set
PASS set.add(3) is set
PASS set.add('3') is set
PASS set.add(4) is set
PASS set.add('4') is set
PASS set.add(5) is set
PASS set.add('5') is set
PASS set.add(6) is set
PASS set.add('6') is set
PASS set.size is 14
forEach #0
PASS testThis is undefined.
0
forEach #1
PASS testThis is thisValue
1
0
0
1
1
2
2
3
3
4
4
5
5
6
6
PASS set.forEach(debug) is undefined.
0 : number
0 : string
1 : number
1 : string
2 : number
2 : string
3 : string
4 : string
5 : number
5 : string
6 : number
6 : string
4 : number
PASS set.has(0) is true
PASS set.has("0") is true
PASS set.has(1) is true
PASS set.has("1") is true
PASS set.has("3") is true
PASS set.has("4") is true
PASS set.has(5) is true
PASS set.has("5") is true
PASS set.has(6) is true
PASS set.has("6") is true
PASS set.has(4) is true
Implement Set iterators https://bugs.webkit.org/show_bug.cgi?id=124129 Reviewed by Antti Koivisto. Source/JavaScriptCore: Add Set iterator classes and implementations * JavaScriptCore.xcodeproj/project.pbxproj: * runtime/CommonIdentifiers.h: * runtime/JSGlobalObject.cpp: * runtime/JSGlobalObject.h: * runtime/JSSetIterator.cpp: Added. (JSC::JSSetIterator::finishCreation): (JSC::JSSetIterator::visitChildren): (JSC::JSSetIterator::createPair): * runtime/JSSetIterator.h: Added. (JSC::JSSetIterator::createStructure): (JSC::JSSetIterator::create): (JSC::JSSetIterator::next): (JSC::JSSetIterator::JSSetIterator): * runtime/SetIteratorConstructor.cpp: Added. (JSC::SetIteratorConstructor::finishCreation): * runtime/SetIteratorConstructor.h: Added. (JSC::SetIteratorConstructor::create): (JSC::SetIteratorConstructor::createStructure): (JSC::SetIteratorConstructor::SetIteratorConstructor): * runtime/SetIteratorPrototype.cpp: Added. (JSC::SetIteratorPrototype::finishCreation): (JSC::SetIteratorPrototypeFuncIterator): (JSC::SetIteratorPrototypeFuncNext): * runtime/SetIteratorPrototype.h: Added. (JSC::SetIteratorPrototype::create): (JSC::SetIteratorPrototype::createStructure): (JSC::SetIteratorPrototype::SetIteratorPrototype): * runtime/SetPrototype.cpp: (JSC::SetPrototype::finishCreation): (JSC::setProtoFuncValues): (JSC::setProtoFuncEntries): (JSC::setProtoFuncKeys): LayoutTests: Move Set tests to more sensible location and add iterator tests * js/basic-set-expected.txt: Renamed from LayoutTests/js/dom/basic-set-expected.txt. * js/basic-set.html: Renamed from LayoutTests/js/dom/basic-set.html. * js/script-tests/basic-set.js: Renamed from LayoutTests/js/dom/script-tests/basic-set.js. (set new): (otherString.string_appeared_here.set add): (try.set forEach): (set forEach): (set gc): Canonical link: https://commits.webkit.org/142328@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-11-10 22:28:10 +00:00
set.@@iterator()
PASS key is 0
PASS key is '0'
PASS key is 1
PASS key is '1'
PASS key is 2
PASS key is '2'
PASS key is 3
PASS key is '3'
PASS key is 4
PASS key is '4'
PASS i is 10
set.entries()
PASS key is 0
PASS value is 0
PASS key is '0'
PASS value is '0'
PASS key is 1
PASS value is 1
PASS key is '1'
PASS value is '1'
PASS key is 2
PASS value is 2
PASS key is '2'
PASS value is '2'
PASS key is 3
PASS value is 3
PASS key is '3'
PASS value is '3'
PASS key is 4
PASS value is 4
PASS key is '4'
PASS value is '4'
PASS i is 10
set.keys()
PASS key is 0
PASS key is '0'
PASS key is 1
PASS key is '1'
PASS key is 2
PASS key is '2'
PASS key is 3
PASS key is '3'
PASS key is 4
PASS key is '4'
PASS i is 10
set.values()
PASS value is 0
PASS value is '0'
PASS value is 1
PASS value is '1'
PASS value is 2
PASS value is '2'
PASS value is 3
PASS value is '3'
PASS value is 4
PASS value is '4'
PASS i is 10
Set mutation with live iterator and GC
PASS key is 1
PASS key is 3
PASS key is 4
PASS key is 5
PASS key is 7
PASS i is 5
PASS set.size is 4
A dead iterator should remain dead
PASS count is 0
PASS count is 3
PASS count is 3
Implement ES6 Set class https://bugs.webkit.org/show_bug.cgi?id=120549 Reviewed by Filip Pizlo. Source/JavaScriptCore: We simply reuse the MapData type from JSMap making the it much simpler. * JavaScriptCore.xcodeproj/project.pbxproj: * runtime/CommonIdentifiers.h: * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::reset): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::setStructure): * runtime/JSSet.cpp: Added. (JSC::JSSet::visitChildren): (JSC::JSSet::finishCreation): * runtime/JSSet.h: Added. (JSC::JSSet::createStructure): (JSC::JSSet::create): (JSC::JSSet::mapData): (JSC::JSSet::JSSet): * runtime/SetConstructor.cpp: Added. (JSC::SetConstructor::finishCreation): (JSC::callSet): (JSC::constructSet): (JSC::SetConstructor::getConstructData): (JSC::SetConstructor::getCallData): * runtime/SetConstructor.h: Added. (JSC::SetConstructor::create): (JSC::SetConstructor::createStructure): (JSC::SetConstructor::SetConstructor): * runtime/SetPrototype.cpp: Added. (JSC::SetPrototype::finishCreation): (JSC::getMapData): (JSC::setProtoFuncAdd): (JSC::setProtoFuncClear): (JSC::setProtoFuncDelete): (JSC::setProtoFuncForEach): (JSC::setProtoFuncHas): (JSC::setProtoFuncSize): * runtime/SetPrototype.h: Added. (JSC::SetPrototype::create): (JSC::SetPrototype::createStructure): (JSC::SetPrototype::SetPrototype): LayoutTests: Add tests * fast/js/basic-set-expected.txt: Added. * fast/js/basic-set.html: Added. * fast/js/script-tests/basic-set.js: Added. (set new): (otherString.string_appeared_here.set add): (try.set forEach): (set forEach): (set gc): Canonical link: https://commits.webkit.org/138542@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-08-30 22:55:25 +00:00
PASS successfullyParsed is true
TEST COMPLETE