haikuwebkit/LayoutTests/js/setPrototypeOf-expected.txt

568 lines
28 KiB
Plaintext
Raw Permalink Normal View History

ES6: Implement Object.setPrototypeOf https://bugs.webkit.org/show_bug.cgi?id=145202 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-05-20 Reviewed by Darin Adler. Source/JavaScriptCore: * runtime/JSGlobalObjectFunctions.h: * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncProtoSetter): (JSC::checkProtoSetterAccessAllowed): Extract a helper to share this code between __proto__ setter and setPrototypeOf. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): Implementation is very similiar to __proto__ setter. LayoutTests: * http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt: Added. * http/tests/security/cross-frame-access-object-setPrototypeOf.html: Added. * http/tests/security/resources/cross-frame-iframe-for-object-setPrototypeOf-test.html: Added. Test covering cross origin restriction behavior. * js/Object-getOwnPropertyNames-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: Updated for the new exposed property. * js/cyclic-prototypes-expected.txt: * js/script-tests/cyclic-prototypes.js: Extend this test to include setPrototypeOf cyclic checks. Note that setPrototypeOf can still change the prototype where __proto__ cannot. * js/prototypes-expected.txt: * js/script-tests/prototypes.js: Extend this test to cover more types previously overlooked. * js/script-tests/setPrototypeOf.js: Added. (debugEval): (getObjectDescriptions.myFunction): (getObjectDescriptions): * js/setPrototypeOf-expected.txt: Added. * js/setPrototypeOf.html: Added. Test coverage for all the different object / prototype combinations. This is modeled after the other browser tests with coverage of a few more basic functionality tests and object types. Canonical link: https://commits.webkit.org/163221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-20 17:23:03 +00:00
Test Object.setPrototypeOf.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Basics
PASS Object.setPrototypeOf.name is 'setPrototypeOf'
PASS Object.setPrototypeOf.length is 2
Coercible value
value = 0
PASS Object.getPrototypeOf(value) did not throw exception.
PASS Object.setPrototypeOf(value, {}) is value
PASS Object.getPrototypeOf(value) is (value).__proto__
value = true
PASS Object.getPrototypeOf(value) did not throw exception.
PASS Object.setPrototypeOf(value, {}) is value
PASS Object.getPrototypeOf(value) is (value).__proto__
value = false
PASS Object.getPrototypeOf(value) did not throw exception.
PASS Object.setPrototypeOf(value, {}) is value
PASS Object.getPrototypeOf(value) is (value).__proto__
value = 'string'
PASS Object.getPrototypeOf(value) did not throw exception.
PASS Object.setPrototypeOf(value, {}) is value
PASS Object.getPrototypeOf(value) is (value).__proto__
value = Symbol()
PASS Object.getPrototypeOf(value) did not throw exception.
PASS Object.setPrototypeOf(value, {}) is value
PASS Object.getPrototypeOf(value) is (value).__proto__
Non-Coercible value
Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec. https://bugs.webkit.org/show_bug.cgi?id=165227 <rdar://problem/29442665> Reviewed by Saam Barati. JSTests: * stress/get-from-scope-dynamic-onto-proxy.js: - Updated error message. * stress/proxy-dont-infinite-loop.js: Removed. * stress/proxy-json-path.js: Removed. * stress/rest-parameter-allocation-elimination-watchpoints-6.js: Removed. - Removed these tests because the issue they are testing relies on being able to set Object.prototype.__proto__ to something else (which is now not possible). Source/JavaScriptCore: * runtime/JSObject.cpp: (JSC::JSObject::setPrototypeWithCycleCheck): - This is where we check for immutable prototype exotic objects and refuse to set the prototype if needed. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. * runtime/JSTypeInfo.h: (JSC::TypeInfo::isImmutablePrototypeExoticObject): * runtime/Structure.h: - Add flag for declaring immutable prototype exotic objects. * runtime/ObjectPrototype.h: - Declare that Object.prototype is an immutable prototype exotic object. See https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): - Use better error messages. Source/WebCore: Make all objects in window.__proto__'s prototype chain immutable prototype exotic objects. This gives us roughly equivalent behavior to other browsers. Firefox's behavior differ slightly in that Firefox will fail any attempted assignment their __proto__, while the immutable prototype exotic objects will only fail if the assignment is of a different value. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. Chrome differs in that assignment to window.__proto__ is also handled like an immutable prototype exotic object. Instead we adhere to the current HTML spec that says that the assignment should fail unconditionally. See https://html.spec.whatwg.org/#the-windowproxy-exotic-object and https://html.spec.whatwg.org/#windowproxy-setprototypeof. If the HTML spec is changed to make the WindowProxy and Location objects into immutable prototype exotic objects later, we can update to match the spec then. Test: js/prototype-assignment.html * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePrototypeDeclaration): * bindings/scripts/IDLAttributes.txt: * dom/EventTarget.idl: * page/DOMWindow.idl: LayoutTests: The new prototype-assignment.js test is currently only enabled for LLInt only run in the JSC tests until webkit.org/b/165401 is fixed. * TestExpectations: - Skip js/prototype-assignment.html for now until webkit.org/b/165401 is fixed. * http/tests/security/window-named-valueOf-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain.html: - Updated error messages. * js/prototype-assignment-expected.txt: Added. * js/prototype-assignment.html: Added. * js/script-tests/prototype-assignment.js: Added. (else): (reportError): (shouldEqual): (shouldThrow): (stringify): (makeTestID): (doInternalSetPrototypeOf): (ordinarySetPrototypeOf): (setImmutablePrototype): (windowProxySetPrototypeOf): (initSetterExpectation): (throwIfNoExceptionPending): (objectSetPrototypeOf): (setUnderscoreProto): (reflectSetPrototypeOf): (newObjectProto.toString): (this.testObject.targets.push.value): (this.testProxy.targets.push.setPrototypeOf): (Symbol): (test): (runTests): * js/setPrototypeOf-expected.txt: Canonical link: https://commits.webkit.org/183091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 22:43:16 +00:00
PASS Object.setPrototypeOf(undefined, {}) threw exception TypeError: Cannot set prototype of undefined or null.
PASS Object.setPrototypeOf(null, {}) threw exception TypeError: Cannot set prototype of undefined or null.
ES6: Implement Object.setPrototypeOf https://bugs.webkit.org/show_bug.cgi?id=145202 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-05-20 Reviewed by Darin Adler. Source/JavaScriptCore: * runtime/JSGlobalObjectFunctions.h: * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncProtoSetter): (JSC::checkProtoSetterAccessAllowed): Extract a helper to share this code between __proto__ setter and setPrototypeOf. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): Implementation is very similiar to __proto__ setter. LayoutTests: * http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt: Added. * http/tests/security/cross-frame-access-object-setPrototypeOf.html: Added. * http/tests/security/resources/cross-frame-iframe-for-object-setPrototypeOf-test.html: Added. Test covering cross origin restriction behavior. * js/Object-getOwnPropertyNames-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: Updated for the new exposed property. * js/cyclic-prototypes-expected.txt: * js/script-tests/cyclic-prototypes.js: Extend this test to include setPrototypeOf cyclic checks. Note that setPrototypeOf can still change the prototype where __proto__ cannot. * js/prototypes-expected.txt: * js/script-tests/prototypes.js: Extend this test to cover more types previously overlooked. * js/script-tests/setPrototypeOf.js: Added. (debugEval): (getObjectDescriptions.myFunction): (getObjectDescriptions): * js/setPrototypeOf-expected.txt: Added. * js/setPrototypeOf.html: Added. Test coverage for all the different object / prototype combinations. This is modeled after the other browser tests with coverage of a few more basic functionality tests and object types. Canonical link: https://commits.webkit.org/163221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-20 17:23:03 +00:00
Non-Object/Null proto
object (Function)
Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec. https://bugs.webkit.org/show_bug.cgi?id=165227 <rdar://problem/29442665> Reviewed by Saam Barati. JSTests: * stress/get-from-scope-dynamic-onto-proxy.js: - Updated error message. * stress/proxy-dont-infinite-loop.js: Removed. * stress/proxy-json-path.js: Removed. * stress/rest-parameter-allocation-elimination-watchpoints-6.js: Removed. - Removed these tests because the issue they are testing relies on being able to set Object.prototype.__proto__ to something else (which is now not possible). Source/JavaScriptCore: * runtime/JSObject.cpp: (JSC::JSObject::setPrototypeWithCycleCheck): - This is where we check for immutable prototype exotic objects and refuse to set the prototype if needed. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. * runtime/JSTypeInfo.h: (JSC::TypeInfo::isImmutablePrototypeExoticObject): * runtime/Structure.h: - Add flag for declaring immutable prototype exotic objects. * runtime/ObjectPrototype.h: - Declare that Object.prototype is an immutable prototype exotic object. See https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): - Use better error messages. Source/WebCore: Make all objects in window.__proto__'s prototype chain immutable prototype exotic objects. This gives us roughly equivalent behavior to other browsers. Firefox's behavior differ slightly in that Firefox will fail any attempted assignment their __proto__, while the immutable prototype exotic objects will only fail if the assignment is of a different value. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. Chrome differs in that assignment to window.__proto__ is also handled like an immutable prototype exotic object. Instead we adhere to the current HTML spec that says that the assignment should fail unconditionally. See https://html.spec.whatwg.org/#the-windowproxy-exotic-object and https://html.spec.whatwg.org/#windowproxy-setprototypeof. If the HTML spec is changed to make the WindowProxy and Location objects into immutable prototype exotic objects later, we can update to match the spec then. Test: js/prototype-assignment.html * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePrototypeDeclaration): * bindings/scripts/IDLAttributes.txt: * dom/EventTarget.idl: * page/DOMWindow.idl: LayoutTests: The new prototype-assignment.js test is currently only enabled for LLInt only run in the JSC tests until webkit.org/b/165401 is fixed. * TestExpectations: - Skip js/prototype-assignment.html for now until webkit.org/b/165401 is fixed. * http/tests/security/window-named-valueOf-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain.html: - Updated error messages. * js/prototype-assignment-expected.txt: Added. * js/prototype-assignment.html: Added. * js/script-tests/prototype-assignment.js: Added. (else): (reportError): (shouldEqual): (shouldThrow): (stringify): (makeTestID): (doInternalSetPrototypeOf): (ordinarySetPrototypeOf): (setImmutablePrototype): (windowProxySetPrototypeOf): (initSetterExpectation): (throwIfNoExceptionPending): (objectSetPrototypeOf): (setUnderscoreProto): (reflectSetPrototypeOf): (newObjectProto.toString): (this.testObject.targets.push.value): (this.testProxy.targets.push.setPrototypeOf): (Symbol): (test): (runTests): * js/setPrototypeOf-expected.txt: Canonical link: https://commits.webkit.org/183091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 22:43:16 +00:00
PASS Object.setPrototypeOf(object, 0) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, true) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, false) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, 'string') threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, Symbol()) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, undefined) threw exception TypeError: Prototype value can only be an object or null.
ES6: Implement Object.setPrototypeOf https://bugs.webkit.org/show_bug.cgi?id=145202 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-05-20 Reviewed by Darin Adler. Source/JavaScriptCore: * runtime/JSGlobalObjectFunctions.h: * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncProtoSetter): (JSC::checkProtoSetterAccessAllowed): Extract a helper to share this code between __proto__ setter and setPrototypeOf. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): Implementation is very similiar to __proto__ setter. LayoutTests: * http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt: Added. * http/tests/security/cross-frame-access-object-setPrototypeOf.html: Added. * http/tests/security/resources/cross-frame-iframe-for-object-setPrototypeOf-test.html: Added. Test covering cross origin restriction behavior. * js/Object-getOwnPropertyNames-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: Updated for the new exposed property. * js/cyclic-prototypes-expected.txt: * js/script-tests/cyclic-prototypes.js: Extend this test to include setPrototypeOf cyclic checks. Note that setPrototypeOf can still change the prototype where __proto__ cannot. * js/prototypes-expected.txt: * js/script-tests/prototypes.js: Extend this test to cover more types previously overlooked. * js/script-tests/setPrototypeOf.js: Added. (debugEval): (getObjectDescriptions.myFunction): (getObjectDescriptions): * js/setPrototypeOf-expected.txt: Added. * js/setPrototypeOf.html: Added. Test coverage for all the different object / prototype combinations. This is modeled after the other browser tests with coverage of a few more basic functionality tests and object types. Canonical link: https://commits.webkit.org/163221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-20 17:23:03 +00:00
object (Function2)
Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec. https://bugs.webkit.org/show_bug.cgi?id=165227 <rdar://problem/29442665> Reviewed by Saam Barati. JSTests: * stress/get-from-scope-dynamic-onto-proxy.js: - Updated error message. * stress/proxy-dont-infinite-loop.js: Removed. * stress/proxy-json-path.js: Removed. * stress/rest-parameter-allocation-elimination-watchpoints-6.js: Removed. - Removed these tests because the issue they are testing relies on being able to set Object.prototype.__proto__ to something else (which is now not possible). Source/JavaScriptCore: * runtime/JSObject.cpp: (JSC::JSObject::setPrototypeWithCycleCheck): - This is where we check for immutable prototype exotic objects and refuse to set the prototype if needed. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. * runtime/JSTypeInfo.h: (JSC::TypeInfo::isImmutablePrototypeExoticObject): * runtime/Structure.h: - Add flag for declaring immutable prototype exotic objects. * runtime/ObjectPrototype.h: - Declare that Object.prototype is an immutable prototype exotic object. See https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): - Use better error messages. Source/WebCore: Make all objects in window.__proto__'s prototype chain immutable prototype exotic objects. This gives us roughly equivalent behavior to other browsers. Firefox's behavior differ slightly in that Firefox will fail any attempted assignment their __proto__, while the immutable prototype exotic objects will only fail if the assignment is of a different value. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. Chrome differs in that assignment to window.__proto__ is also handled like an immutable prototype exotic object. Instead we adhere to the current HTML spec that says that the assignment should fail unconditionally. See https://html.spec.whatwg.org/#the-windowproxy-exotic-object and https://html.spec.whatwg.org/#windowproxy-setprototypeof. If the HTML spec is changed to make the WindowProxy and Location objects into immutable prototype exotic objects later, we can update to match the spec then. Test: js/prototype-assignment.html * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePrototypeDeclaration): * bindings/scripts/IDLAttributes.txt: * dom/EventTarget.idl: * page/DOMWindow.idl: LayoutTests: The new prototype-assignment.js test is currently only enabled for LLInt only run in the JSC tests until webkit.org/b/165401 is fixed. * TestExpectations: - Skip js/prototype-assignment.html for now until webkit.org/b/165401 is fixed. * http/tests/security/window-named-valueOf-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain.html: - Updated error messages. * js/prototype-assignment-expected.txt: Added. * js/prototype-assignment.html: Added. * js/script-tests/prototype-assignment.js: Added. (else): (reportError): (shouldEqual): (shouldThrow): (stringify): (makeTestID): (doInternalSetPrototypeOf): (ordinarySetPrototypeOf): (setImmutablePrototype): (windowProxySetPrototypeOf): (initSetterExpectation): (throwIfNoExceptionPending): (objectSetPrototypeOf): (setUnderscoreProto): (reflectSetPrototypeOf): (newObjectProto.toString): (this.testObject.targets.push.value): (this.testProxy.targets.push.setPrototypeOf): (Symbol): (test): (runTests): * js/setPrototypeOf-expected.txt: Canonical link: https://commits.webkit.org/183091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 22:43:16 +00:00
PASS Object.setPrototypeOf(object, 0) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, true) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, false) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, 'string') threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, Symbol()) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, undefined) threw exception TypeError: Prototype value can only be an object or null.
ES6: Implement Object.setPrototypeOf https://bugs.webkit.org/show_bug.cgi?id=145202 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-05-20 Reviewed by Darin Adler. Source/JavaScriptCore: * runtime/JSGlobalObjectFunctions.h: * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncProtoSetter): (JSC::checkProtoSetterAccessAllowed): Extract a helper to share this code between __proto__ setter and setPrototypeOf. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): Implementation is very similiar to __proto__ setter. LayoutTests: * http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt: Added. * http/tests/security/cross-frame-access-object-setPrototypeOf.html: Added. * http/tests/security/resources/cross-frame-iframe-for-object-setPrototypeOf-test.html: Added. Test covering cross origin restriction behavior. * js/Object-getOwnPropertyNames-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: Updated for the new exposed property. * js/cyclic-prototypes-expected.txt: * js/script-tests/cyclic-prototypes.js: Extend this test to include setPrototypeOf cyclic checks. Note that setPrototypeOf can still change the prototype where __proto__ cannot. * js/prototypes-expected.txt: * js/script-tests/prototypes.js: Extend this test to cover more types previously overlooked. * js/script-tests/setPrototypeOf.js: Added. (debugEval): (getObjectDescriptions.myFunction): (getObjectDescriptions): * js/setPrototypeOf-expected.txt: Added. * js/setPrototypeOf.html: Added. Test coverage for all the different object / prototype combinations. This is modeled after the other browser tests with coverage of a few more basic functionality tests and object types. Canonical link: https://commits.webkit.org/163221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-20 17:23:03 +00:00
object (Object)
Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec. https://bugs.webkit.org/show_bug.cgi?id=165227 <rdar://problem/29442665> Reviewed by Saam Barati. JSTests: * stress/get-from-scope-dynamic-onto-proxy.js: - Updated error message. * stress/proxy-dont-infinite-loop.js: Removed. * stress/proxy-json-path.js: Removed. * stress/rest-parameter-allocation-elimination-watchpoints-6.js: Removed. - Removed these tests because the issue they are testing relies on being able to set Object.prototype.__proto__ to something else (which is now not possible). Source/JavaScriptCore: * runtime/JSObject.cpp: (JSC::JSObject::setPrototypeWithCycleCheck): - This is where we check for immutable prototype exotic objects and refuse to set the prototype if needed. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. * runtime/JSTypeInfo.h: (JSC::TypeInfo::isImmutablePrototypeExoticObject): * runtime/Structure.h: - Add flag for declaring immutable prototype exotic objects. * runtime/ObjectPrototype.h: - Declare that Object.prototype is an immutable prototype exotic object. See https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): - Use better error messages. Source/WebCore: Make all objects in window.__proto__'s prototype chain immutable prototype exotic objects. This gives us roughly equivalent behavior to other browsers. Firefox's behavior differ slightly in that Firefox will fail any attempted assignment their __proto__, while the immutable prototype exotic objects will only fail if the assignment is of a different value. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. Chrome differs in that assignment to window.__proto__ is also handled like an immutable prototype exotic object. Instead we adhere to the current HTML spec that says that the assignment should fail unconditionally. See https://html.spec.whatwg.org/#the-windowproxy-exotic-object and https://html.spec.whatwg.org/#windowproxy-setprototypeof. If the HTML spec is changed to make the WindowProxy and Location objects into immutable prototype exotic objects later, we can update to match the spec then. Test: js/prototype-assignment.html * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePrototypeDeclaration): * bindings/scripts/IDLAttributes.txt: * dom/EventTarget.idl: * page/DOMWindow.idl: LayoutTests: The new prototype-assignment.js test is currently only enabled for LLInt only run in the JSC tests until webkit.org/b/165401 is fixed. * TestExpectations: - Skip js/prototype-assignment.html for now until webkit.org/b/165401 is fixed. * http/tests/security/window-named-valueOf-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain.html: - Updated error messages. * js/prototype-assignment-expected.txt: Added. * js/prototype-assignment.html: Added. * js/script-tests/prototype-assignment.js: Added. (else): (reportError): (shouldEqual): (shouldThrow): (stringify): (makeTestID): (doInternalSetPrototypeOf): (ordinarySetPrototypeOf): (setImmutablePrototype): (windowProxySetPrototypeOf): (initSetterExpectation): (throwIfNoExceptionPending): (objectSetPrototypeOf): (setUnderscoreProto): (reflectSetPrototypeOf): (newObjectProto.toString): (this.testObject.targets.push.value): (this.testProxy.targets.push.setPrototypeOf): (Symbol): (test): (runTests): * js/setPrototypeOf-expected.txt: Canonical link: https://commits.webkit.org/183091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 22:43:16 +00:00
PASS Object.setPrototypeOf(object, 0) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, true) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, false) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, 'string') threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, Symbol()) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, undefined) threw exception TypeError: Prototype value can only be an object or null.
ES6: Implement Object.setPrototypeOf https://bugs.webkit.org/show_bug.cgi?id=145202 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-05-20 Reviewed by Darin Adler. Source/JavaScriptCore: * runtime/JSGlobalObjectFunctions.h: * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncProtoSetter): (JSC::checkProtoSetterAccessAllowed): Extract a helper to share this code between __proto__ setter and setPrototypeOf. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): Implementation is very similiar to __proto__ setter. LayoutTests: * http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt: Added. * http/tests/security/cross-frame-access-object-setPrototypeOf.html: Added. * http/tests/security/resources/cross-frame-iframe-for-object-setPrototypeOf-test.html: Added. Test covering cross origin restriction behavior. * js/Object-getOwnPropertyNames-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: Updated for the new exposed property. * js/cyclic-prototypes-expected.txt: * js/script-tests/cyclic-prototypes.js: Extend this test to include setPrototypeOf cyclic checks. Note that setPrototypeOf can still change the prototype where __proto__ cannot. * js/prototypes-expected.txt: * js/script-tests/prototypes.js: Extend this test to cover more types previously overlooked. * js/script-tests/setPrototypeOf.js: Added. (debugEval): (getObjectDescriptions.myFunction): (getObjectDescriptions): * js/setPrototypeOf-expected.txt: Added. * js/setPrototypeOf.html: Added. Test coverage for all the different object / prototype combinations. This is modeled after the other browser tests with coverage of a few more basic functionality tests and object types. Canonical link: https://commits.webkit.org/163221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-20 17:23:03 +00:00
object (Object2)
Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec. https://bugs.webkit.org/show_bug.cgi?id=165227 <rdar://problem/29442665> Reviewed by Saam Barati. JSTests: * stress/get-from-scope-dynamic-onto-proxy.js: - Updated error message. * stress/proxy-dont-infinite-loop.js: Removed. * stress/proxy-json-path.js: Removed. * stress/rest-parameter-allocation-elimination-watchpoints-6.js: Removed. - Removed these tests because the issue they are testing relies on being able to set Object.prototype.__proto__ to something else (which is now not possible). Source/JavaScriptCore: * runtime/JSObject.cpp: (JSC::JSObject::setPrototypeWithCycleCheck): - This is where we check for immutable prototype exotic objects and refuse to set the prototype if needed. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. * runtime/JSTypeInfo.h: (JSC::TypeInfo::isImmutablePrototypeExoticObject): * runtime/Structure.h: - Add flag for declaring immutable prototype exotic objects. * runtime/ObjectPrototype.h: - Declare that Object.prototype is an immutable prototype exotic object. See https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): - Use better error messages. Source/WebCore: Make all objects in window.__proto__'s prototype chain immutable prototype exotic objects. This gives us roughly equivalent behavior to other browsers. Firefox's behavior differ slightly in that Firefox will fail any attempted assignment their __proto__, while the immutable prototype exotic objects will only fail if the assignment is of a different value. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. Chrome differs in that assignment to window.__proto__ is also handled like an immutable prototype exotic object. Instead we adhere to the current HTML spec that says that the assignment should fail unconditionally. See https://html.spec.whatwg.org/#the-windowproxy-exotic-object and https://html.spec.whatwg.org/#windowproxy-setprototypeof. If the HTML spec is changed to make the WindowProxy and Location objects into immutable prototype exotic objects later, we can update to match the spec then. Test: js/prototype-assignment.html * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePrototypeDeclaration): * bindings/scripts/IDLAttributes.txt: * dom/EventTarget.idl: * page/DOMWindow.idl: LayoutTests: The new prototype-assignment.js test is currently only enabled for LLInt only run in the JSC tests until webkit.org/b/165401 is fixed. * TestExpectations: - Skip js/prototype-assignment.html for now until webkit.org/b/165401 is fixed. * http/tests/security/window-named-valueOf-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain.html: - Updated error messages. * js/prototype-assignment-expected.txt: Added. * js/prototype-assignment.html: Added. * js/script-tests/prototype-assignment.js: Added. (else): (reportError): (shouldEqual): (shouldThrow): (stringify): (makeTestID): (doInternalSetPrototypeOf): (ordinarySetPrototypeOf): (setImmutablePrototype): (windowProxySetPrototypeOf): (initSetterExpectation): (throwIfNoExceptionPending): (objectSetPrototypeOf): (setUnderscoreProto): (reflectSetPrototypeOf): (newObjectProto.toString): (this.testObject.targets.push.value): (this.testProxy.targets.push.setPrototypeOf): (Symbol): (test): (runTests): * js/setPrototypeOf-expected.txt: Canonical link: https://commits.webkit.org/183091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 22:43:16 +00:00
PASS Object.setPrototypeOf(object, 0) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, true) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, false) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, 'string') threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, Symbol()) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, undefined) threw exception TypeError: Prototype value can only be an object or null.
ES6: Implement Object.setPrototypeOf https://bugs.webkit.org/show_bug.cgi?id=145202 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-05-20 Reviewed by Darin Adler. Source/JavaScriptCore: * runtime/JSGlobalObjectFunctions.h: * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncProtoSetter): (JSC::checkProtoSetterAccessAllowed): Extract a helper to share this code between __proto__ setter and setPrototypeOf. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): Implementation is very similiar to __proto__ setter. LayoutTests: * http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt: Added. * http/tests/security/cross-frame-access-object-setPrototypeOf.html: Added. * http/tests/security/resources/cross-frame-iframe-for-object-setPrototypeOf-test.html: Added. Test covering cross origin restriction behavior. * js/Object-getOwnPropertyNames-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: Updated for the new exposed property. * js/cyclic-prototypes-expected.txt: * js/script-tests/cyclic-prototypes.js: Extend this test to include setPrototypeOf cyclic checks. Note that setPrototypeOf can still change the prototype where __proto__ cannot. * js/prototypes-expected.txt: * js/script-tests/prototypes.js: Extend this test to cover more types previously overlooked. * js/script-tests/setPrototypeOf.js: Added. (debugEval): (getObjectDescriptions.myFunction): (getObjectDescriptions): * js/setPrototypeOf-expected.txt: Added. * js/setPrototypeOf.html: Added. Test coverage for all the different object / prototype combinations. This is modeled after the other browser tests with coverage of a few more basic functionality tests and object types. Canonical link: https://commits.webkit.org/163221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-20 17:23:03 +00:00
object (RegExp)
Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec. https://bugs.webkit.org/show_bug.cgi?id=165227 <rdar://problem/29442665> Reviewed by Saam Barati. JSTests: * stress/get-from-scope-dynamic-onto-proxy.js: - Updated error message. * stress/proxy-dont-infinite-loop.js: Removed. * stress/proxy-json-path.js: Removed. * stress/rest-parameter-allocation-elimination-watchpoints-6.js: Removed. - Removed these tests because the issue they are testing relies on being able to set Object.prototype.__proto__ to something else (which is now not possible). Source/JavaScriptCore: * runtime/JSObject.cpp: (JSC::JSObject::setPrototypeWithCycleCheck): - This is where we check for immutable prototype exotic objects and refuse to set the prototype if needed. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. * runtime/JSTypeInfo.h: (JSC::TypeInfo::isImmutablePrototypeExoticObject): * runtime/Structure.h: - Add flag for declaring immutable prototype exotic objects. * runtime/ObjectPrototype.h: - Declare that Object.prototype is an immutable prototype exotic object. See https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): - Use better error messages. Source/WebCore: Make all objects in window.__proto__'s prototype chain immutable prototype exotic objects. This gives us roughly equivalent behavior to other browsers. Firefox's behavior differ slightly in that Firefox will fail any attempted assignment their __proto__, while the immutable prototype exotic objects will only fail if the assignment is of a different value. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. Chrome differs in that assignment to window.__proto__ is also handled like an immutable prototype exotic object. Instead we adhere to the current HTML spec that says that the assignment should fail unconditionally. See https://html.spec.whatwg.org/#the-windowproxy-exotic-object and https://html.spec.whatwg.org/#windowproxy-setprototypeof. If the HTML spec is changed to make the WindowProxy and Location objects into immutable prototype exotic objects later, we can update to match the spec then. Test: js/prototype-assignment.html * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePrototypeDeclaration): * bindings/scripts/IDLAttributes.txt: * dom/EventTarget.idl: * page/DOMWindow.idl: LayoutTests: The new prototype-assignment.js test is currently only enabled for LLInt only run in the JSC tests until webkit.org/b/165401 is fixed. * TestExpectations: - Skip js/prototype-assignment.html for now until webkit.org/b/165401 is fixed. * http/tests/security/window-named-valueOf-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain.html: - Updated error messages. * js/prototype-assignment-expected.txt: Added. * js/prototype-assignment.html: Added. * js/script-tests/prototype-assignment.js: Added. (else): (reportError): (shouldEqual): (shouldThrow): (stringify): (makeTestID): (doInternalSetPrototypeOf): (ordinarySetPrototypeOf): (setImmutablePrototype): (windowProxySetPrototypeOf): (initSetterExpectation): (throwIfNoExceptionPending): (objectSetPrototypeOf): (setUnderscoreProto): (reflectSetPrototypeOf): (newObjectProto.toString): (this.testObject.targets.push.value): (this.testProxy.targets.push.setPrototypeOf): (Symbol): (test): (runTests): * js/setPrototypeOf-expected.txt: Canonical link: https://commits.webkit.org/183091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 22:43:16 +00:00
PASS Object.setPrototypeOf(object, 0) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, true) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, false) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, 'string') threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, Symbol()) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, undefined) threw exception TypeError: Prototype value can only be an object or null.
ES6: Implement Object.setPrototypeOf https://bugs.webkit.org/show_bug.cgi?id=145202 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-05-20 Reviewed by Darin Adler. Source/JavaScriptCore: * runtime/JSGlobalObjectFunctions.h: * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncProtoSetter): (JSC::checkProtoSetterAccessAllowed): Extract a helper to share this code between __proto__ setter and setPrototypeOf. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): Implementation is very similiar to __proto__ setter. LayoutTests: * http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt: Added. * http/tests/security/cross-frame-access-object-setPrototypeOf.html: Added. * http/tests/security/resources/cross-frame-iframe-for-object-setPrototypeOf-test.html: Added. Test covering cross origin restriction behavior. * js/Object-getOwnPropertyNames-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: Updated for the new exposed property. * js/cyclic-prototypes-expected.txt: * js/script-tests/cyclic-prototypes.js: Extend this test to include setPrototypeOf cyclic checks. Note that setPrototypeOf can still change the prototype where __proto__ cannot. * js/prototypes-expected.txt: * js/script-tests/prototypes.js: Extend this test to cover more types previously overlooked. * js/script-tests/setPrototypeOf.js: Added. (debugEval): (getObjectDescriptions.myFunction): (getObjectDescriptions): * js/setPrototypeOf-expected.txt: Added. * js/setPrototypeOf.html: Added. Test coverage for all the different object / prototype combinations. This is modeled after the other browser tests with coverage of a few more basic functionality tests and object types. Canonical link: https://commits.webkit.org/163221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-20 17:23:03 +00:00
object (Array)
Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec. https://bugs.webkit.org/show_bug.cgi?id=165227 <rdar://problem/29442665> Reviewed by Saam Barati. JSTests: * stress/get-from-scope-dynamic-onto-proxy.js: - Updated error message. * stress/proxy-dont-infinite-loop.js: Removed. * stress/proxy-json-path.js: Removed. * stress/rest-parameter-allocation-elimination-watchpoints-6.js: Removed. - Removed these tests because the issue they are testing relies on being able to set Object.prototype.__proto__ to something else (which is now not possible). Source/JavaScriptCore: * runtime/JSObject.cpp: (JSC::JSObject::setPrototypeWithCycleCheck): - This is where we check for immutable prototype exotic objects and refuse to set the prototype if needed. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. * runtime/JSTypeInfo.h: (JSC::TypeInfo::isImmutablePrototypeExoticObject): * runtime/Structure.h: - Add flag for declaring immutable prototype exotic objects. * runtime/ObjectPrototype.h: - Declare that Object.prototype is an immutable prototype exotic object. See https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): - Use better error messages. Source/WebCore: Make all objects in window.__proto__'s prototype chain immutable prototype exotic objects. This gives us roughly equivalent behavior to other browsers. Firefox's behavior differ slightly in that Firefox will fail any attempted assignment their __proto__, while the immutable prototype exotic objects will only fail if the assignment is of a different value. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. Chrome differs in that assignment to window.__proto__ is also handled like an immutable prototype exotic object. Instead we adhere to the current HTML spec that says that the assignment should fail unconditionally. See https://html.spec.whatwg.org/#the-windowproxy-exotic-object and https://html.spec.whatwg.org/#windowproxy-setprototypeof. If the HTML spec is changed to make the WindowProxy and Location objects into immutable prototype exotic objects later, we can update to match the spec then. Test: js/prototype-assignment.html * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePrototypeDeclaration): * bindings/scripts/IDLAttributes.txt: * dom/EventTarget.idl: * page/DOMWindow.idl: LayoutTests: The new prototype-assignment.js test is currently only enabled for LLInt only run in the JSC tests until webkit.org/b/165401 is fixed. * TestExpectations: - Skip js/prototype-assignment.html for now until webkit.org/b/165401 is fixed. * http/tests/security/window-named-valueOf-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain.html: - Updated error messages. * js/prototype-assignment-expected.txt: Added. * js/prototype-assignment.html: Added. * js/script-tests/prototype-assignment.js: Added. (else): (reportError): (shouldEqual): (shouldThrow): (stringify): (makeTestID): (doInternalSetPrototypeOf): (ordinarySetPrototypeOf): (setImmutablePrototype): (windowProxySetPrototypeOf): (initSetterExpectation): (throwIfNoExceptionPending): (objectSetPrototypeOf): (setUnderscoreProto): (reflectSetPrototypeOf): (newObjectProto.toString): (this.testObject.targets.push.value): (this.testProxy.targets.push.setPrototypeOf): (Symbol): (test): (runTests): * js/setPrototypeOf-expected.txt: Canonical link: https://commits.webkit.org/183091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 22:43:16 +00:00
PASS Object.setPrototypeOf(object, 0) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, true) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, false) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, 'string') threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, Symbol()) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, undefined) threw exception TypeError: Prototype value can only be an object or null.
ES6: Implement Object.setPrototypeOf https://bugs.webkit.org/show_bug.cgi?id=145202 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-05-20 Reviewed by Darin Adler. Source/JavaScriptCore: * runtime/JSGlobalObjectFunctions.h: * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncProtoSetter): (JSC::checkProtoSetterAccessAllowed): Extract a helper to share this code between __proto__ setter and setPrototypeOf. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): Implementation is very similiar to __proto__ setter. LayoutTests: * http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt: Added. * http/tests/security/cross-frame-access-object-setPrototypeOf.html: Added. * http/tests/security/resources/cross-frame-iframe-for-object-setPrototypeOf-test.html: Added. Test covering cross origin restriction behavior. * js/Object-getOwnPropertyNames-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: Updated for the new exposed property. * js/cyclic-prototypes-expected.txt: * js/script-tests/cyclic-prototypes.js: Extend this test to include setPrototypeOf cyclic checks. Note that setPrototypeOf can still change the prototype where __proto__ cannot. * js/prototypes-expected.txt: * js/script-tests/prototypes.js: Extend this test to cover more types previously overlooked. * js/script-tests/setPrototypeOf.js: Added. (debugEval): (getObjectDescriptions.myFunction): (getObjectDescriptions): * js/setPrototypeOf-expected.txt: Added. * js/setPrototypeOf.html: Added. Test coverage for all the different object / prototype combinations. This is modeled after the other browser tests with coverage of a few more basic functionality tests and object types. Canonical link: https://commits.webkit.org/163221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-20 17:23:03 +00:00
object (Error)
Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec. https://bugs.webkit.org/show_bug.cgi?id=165227 <rdar://problem/29442665> Reviewed by Saam Barati. JSTests: * stress/get-from-scope-dynamic-onto-proxy.js: - Updated error message. * stress/proxy-dont-infinite-loop.js: Removed. * stress/proxy-json-path.js: Removed. * stress/rest-parameter-allocation-elimination-watchpoints-6.js: Removed. - Removed these tests because the issue they are testing relies on being able to set Object.prototype.__proto__ to something else (which is now not possible). Source/JavaScriptCore: * runtime/JSObject.cpp: (JSC::JSObject::setPrototypeWithCycleCheck): - This is where we check for immutable prototype exotic objects and refuse to set the prototype if needed. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. * runtime/JSTypeInfo.h: (JSC::TypeInfo::isImmutablePrototypeExoticObject): * runtime/Structure.h: - Add flag for declaring immutable prototype exotic objects. * runtime/ObjectPrototype.h: - Declare that Object.prototype is an immutable prototype exotic object. See https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): - Use better error messages. Source/WebCore: Make all objects in window.__proto__'s prototype chain immutable prototype exotic objects. This gives us roughly equivalent behavior to other browsers. Firefox's behavior differ slightly in that Firefox will fail any attempted assignment their __proto__, while the immutable prototype exotic objects will only fail if the assignment is of a different value. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. Chrome differs in that assignment to window.__proto__ is also handled like an immutable prototype exotic object. Instead we adhere to the current HTML spec that says that the assignment should fail unconditionally. See https://html.spec.whatwg.org/#the-windowproxy-exotic-object and https://html.spec.whatwg.org/#windowproxy-setprototypeof. If the HTML spec is changed to make the WindowProxy and Location objects into immutable prototype exotic objects later, we can update to match the spec then. Test: js/prototype-assignment.html * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePrototypeDeclaration): * bindings/scripts/IDLAttributes.txt: * dom/EventTarget.idl: * page/DOMWindow.idl: LayoutTests: The new prototype-assignment.js test is currently only enabled for LLInt only run in the JSC tests until webkit.org/b/165401 is fixed. * TestExpectations: - Skip js/prototype-assignment.html for now until webkit.org/b/165401 is fixed. * http/tests/security/window-named-valueOf-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain.html: - Updated error messages. * js/prototype-assignment-expected.txt: Added. * js/prototype-assignment.html: Added. * js/script-tests/prototype-assignment.js: Added. (else): (reportError): (shouldEqual): (shouldThrow): (stringify): (makeTestID): (doInternalSetPrototypeOf): (ordinarySetPrototypeOf): (setImmutablePrototype): (windowProxySetPrototypeOf): (initSetterExpectation): (throwIfNoExceptionPending): (objectSetPrototypeOf): (setUnderscoreProto): (reflectSetPrototypeOf): (newObjectProto.toString): (this.testObject.targets.push.value): (this.testProxy.targets.push.setPrototypeOf): (Symbol): (test): (runTests): * js/setPrototypeOf-expected.txt: Canonical link: https://commits.webkit.org/183091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 22:43:16 +00:00
PASS Object.setPrototypeOf(object, 0) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, true) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, false) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, 'string') threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, Symbol()) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, undefined) threw exception TypeError: Prototype value can only be an object or null.
ES6: Implement Object.setPrototypeOf https://bugs.webkit.org/show_bug.cgi?id=145202 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-05-20 Reviewed by Darin Adler. Source/JavaScriptCore: * runtime/JSGlobalObjectFunctions.h: * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncProtoSetter): (JSC::checkProtoSetterAccessAllowed): Extract a helper to share this code between __proto__ setter and setPrototypeOf. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): Implementation is very similiar to __proto__ setter. LayoutTests: * http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt: Added. * http/tests/security/cross-frame-access-object-setPrototypeOf.html: Added. * http/tests/security/resources/cross-frame-iframe-for-object-setPrototypeOf-test.html: Added. Test covering cross origin restriction behavior. * js/Object-getOwnPropertyNames-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: Updated for the new exposed property. * js/cyclic-prototypes-expected.txt: * js/script-tests/cyclic-prototypes.js: Extend this test to include setPrototypeOf cyclic checks. Note that setPrototypeOf can still change the prototype where __proto__ cannot. * js/prototypes-expected.txt: * js/script-tests/prototypes.js: Extend this test to cover more types previously overlooked. * js/script-tests/setPrototypeOf.js: Added. (debugEval): (getObjectDescriptions.myFunction): (getObjectDescriptions): * js/setPrototypeOf-expected.txt: Added. * js/setPrototypeOf.html: Added. Test coverage for all the different object / prototype combinations. This is modeled after the other browser tests with coverage of a few more basic functionality tests and object types. Canonical link: https://commits.webkit.org/163221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-20 17:23:03 +00:00
object (Date)
Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec. https://bugs.webkit.org/show_bug.cgi?id=165227 <rdar://problem/29442665> Reviewed by Saam Barati. JSTests: * stress/get-from-scope-dynamic-onto-proxy.js: - Updated error message. * stress/proxy-dont-infinite-loop.js: Removed. * stress/proxy-json-path.js: Removed. * stress/rest-parameter-allocation-elimination-watchpoints-6.js: Removed. - Removed these tests because the issue they are testing relies on being able to set Object.prototype.__proto__ to something else (which is now not possible). Source/JavaScriptCore: * runtime/JSObject.cpp: (JSC::JSObject::setPrototypeWithCycleCheck): - This is where we check for immutable prototype exotic objects and refuse to set the prototype if needed. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. * runtime/JSTypeInfo.h: (JSC::TypeInfo::isImmutablePrototypeExoticObject): * runtime/Structure.h: - Add flag for declaring immutable prototype exotic objects. * runtime/ObjectPrototype.h: - Declare that Object.prototype is an immutable prototype exotic object. See https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): - Use better error messages. Source/WebCore: Make all objects in window.__proto__'s prototype chain immutable prototype exotic objects. This gives us roughly equivalent behavior to other browsers. Firefox's behavior differ slightly in that Firefox will fail any attempted assignment their __proto__, while the immutable prototype exotic objects will only fail if the assignment is of a different value. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. Chrome differs in that assignment to window.__proto__ is also handled like an immutable prototype exotic object. Instead we adhere to the current HTML spec that says that the assignment should fail unconditionally. See https://html.spec.whatwg.org/#the-windowproxy-exotic-object and https://html.spec.whatwg.org/#windowproxy-setprototypeof. If the HTML spec is changed to make the WindowProxy and Location objects into immutable prototype exotic objects later, we can update to match the spec then. Test: js/prototype-assignment.html * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePrototypeDeclaration): * bindings/scripts/IDLAttributes.txt: * dom/EventTarget.idl: * page/DOMWindow.idl: LayoutTests: The new prototype-assignment.js test is currently only enabled for LLInt only run in the JSC tests until webkit.org/b/165401 is fixed. * TestExpectations: - Skip js/prototype-assignment.html for now until webkit.org/b/165401 is fixed. * http/tests/security/window-named-valueOf-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain.html: - Updated error messages. * js/prototype-assignment-expected.txt: Added. * js/prototype-assignment.html: Added. * js/script-tests/prototype-assignment.js: Added. (else): (reportError): (shouldEqual): (shouldThrow): (stringify): (makeTestID): (doInternalSetPrototypeOf): (ordinarySetPrototypeOf): (setImmutablePrototype): (windowProxySetPrototypeOf): (initSetterExpectation): (throwIfNoExceptionPending): (objectSetPrototypeOf): (setUnderscoreProto): (reflectSetPrototypeOf): (newObjectProto.toString): (this.testObject.targets.push.value): (this.testProxy.targets.push.setPrototypeOf): (Symbol): (test): (runTests): * js/setPrototypeOf-expected.txt: Canonical link: https://commits.webkit.org/183091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 22:43:16 +00:00
PASS Object.setPrototypeOf(object, 0) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, true) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, false) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, 'string') threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, Symbol()) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, undefined) threw exception TypeError: Prototype value can only be an object or null.
ES6: Implement Object.setPrototypeOf https://bugs.webkit.org/show_bug.cgi?id=145202 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-05-20 Reviewed by Darin Adler. Source/JavaScriptCore: * runtime/JSGlobalObjectFunctions.h: * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncProtoSetter): (JSC::checkProtoSetterAccessAllowed): Extract a helper to share this code between __proto__ setter and setPrototypeOf. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): Implementation is very similiar to __proto__ setter. LayoutTests: * http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt: Added. * http/tests/security/cross-frame-access-object-setPrototypeOf.html: Added. * http/tests/security/resources/cross-frame-iframe-for-object-setPrototypeOf-test.html: Added. Test covering cross origin restriction behavior. * js/Object-getOwnPropertyNames-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: Updated for the new exposed property. * js/cyclic-prototypes-expected.txt: * js/script-tests/cyclic-prototypes.js: Extend this test to include setPrototypeOf cyclic checks. Note that setPrototypeOf can still change the prototype where __proto__ cannot. * js/prototypes-expected.txt: * js/script-tests/prototypes.js: Extend this test to cover more types previously overlooked. * js/script-tests/setPrototypeOf.js: Added. (debugEval): (getObjectDescriptions.myFunction): (getObjectDescriptions): * js/setPrototypeOf-expected.txt: Added. * js/setPrototypeOf.html: Added. Test coverage for all the different object / prototype combinations. This is modeled after the other browser tests with coverage of a few more basic functionality tests and object types. Canonical link: https://commits.webkit.org/163221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-20 17:23:03 +00:00
object (Number)
Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec. https://bugs.webkit.org/show_bug.cgi?id=165227 <rdar://problem/29442665> Reviewed by Saam Barati. JSTests: * stress/get-from-scope-dynamic-onto-proxy.js: - Updated error message. * stress/proxy-dont-infinite-loop.js: Removed. * stress/proxy-json-path.js: Removed. * stress/rest-parameter-allocation-elimination-watchpoints-6.js: Removed. - Removed these tests because the issue they are testing relies on being able to set Object.prototype.__proto__ to something else (which is now not possible). Source/JavaScriptCore: * runtime/JSObject.cpp: (JSC::JSObject::setPrototypeWithCycleCheck): - This is where we check for immutable prototype exotic objects and refuse to set the prototype if needed. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. * runtime/JSTypeInfo.h: (JSC::TypeInfo::isImmutablePrototypeExoticObject): * runtime/Structure.h: - Add flag for declaring immutable prototype exotic objects. * runtime/ObjectPrototype.h: - Declare that Object.prototype is an immutable prototype exotic object. See https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): - Use better error messages. Source/WebCore: Make all objects in window.__proto__'s prototype chain immutable prototype exotic objects. This gives us roughly equivalent behavior to other browsers. Firefox's behavior differ slightly in that Firefox will fail any attempted assignment their __proto__, while the immutable prototype exotic objects will only fail if the assignment is of a different value. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. Chrome differs in that assignment to window.__proto__ is also handled like an immutable prototype exotic object. Instead we adhere to the current HTML spec that says that the assignment should fail unconditionally. See https://html.spec.whatwg.org/#the-windowproxy-exotic-object and https://html.spec.whatwg.org/#windowproxy-setprototypeof. If the HTML spec is changed to make the WindowProxy and Location objects into immutable prototype exotic objects later, we can update to match the spec then. Test: js/prototype-assignment.html * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePrototypeDeclaration): * bindings/scripts/IDLAttributes.txt: * dom/EventTarget.idl: * page/DOMWindow.idl: LayoutTests: The new prototype-assignment.js test is currently only enabled for LLInt only run in the JSC tests until webkit.org/b/165401 is fixed. * TestExpectations: - Skip js/prototype-assignment.html for now until webkit.org/b/165401 is fixed. * http/tests/security/window-named-valueOf-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain.html: - Updated error messages. * js/prototype-assignment-expected.txt: Added. * js/prototype-assignment.html: Added. * js/script-tests/prototype-assignment.js: Added. (else): (reportError): (shouldEqual): (shouldThrow): (stringify): (makeTestID): (doInternalSetPrototypeOf): (ordinarySetPrototypeOf): (setImmutablePrototype): (windowProxySetPrototypeOf): (initSetterExpectation): (throwIfNoExceptionPending): (objectSetPrototypeOf): (setUnderscoreProto): (reflectSetPrototypeOf): (newObjectProto.toString): (this.testObject.targets.push.value): (this.testProxy.targets.push.setPrototypeOf): (Symbol): (test): (runTests): * js/setPrototypeOf-expected.txt: Canonical link: https://commits.webkit.org/183091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 22:43:16 +00:00
PASS Object.setPrototypeOf(object, 0) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, true) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, false) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, 'string') threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, Symbol()) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, undefined) threw exception TypeError: Prototype value can only be an object or null.
ES6: Implement Object.setPrototypeOf https://bugs.webkit.org/show_bug.cgi?id=145202 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-05-20 Reviewed by Darin Adler. Source/JavaScriptCore: * runtime/JSGlobalObjectFunctions.h: * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncProtoSetter): (JSC::checkProtoSetterAccessAllowed): Extract a helper to share this code between __proto__ setter and setPrototypeOf. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): Implementation is very similiar to __proto__ setter. LayoutTests: * http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt: Added. * http/tests/security/cross-frame-access-object-setPrototypeOf.html: Added. * http/tests/security/resources/cross-frame-iframe-for-object-setPrototypeOf-test.html: Added. Test covering cross origin restriction behavior. * js/Object-getOwnPropertyNames-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: Updated for the new exposed property. * js/cyclic-prototypes-expected.txt: * js/script-tests/cyclic-prototypes.js: Extend this test to include setPrototypeOf cyclic checks. Note that setPrototypeOf can still change the prototype where __proto__ cannot. * js/prototypes-expected.txt: * js/script-tests/prototypes.js: Extend this test to cover more types previously overlooked. * js/script-tests/setPrototypeOf.js: Added. (debugEval): (getObjectDescriptions.myFunction): (getObjectDescriptions): * js/setPrototypeOf-expected.txt: Added. * js/setPrototypeOf.html: Added. Test coverage for all the different object / prototype combinations. This is modeled after the other browser tests with coverage of a few more basic functionality tests and object types. Canonical link: https://commits.webkit.org/163221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-20 17:23:03 +00:00
object (Boolean)
Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec. https://bugs.webkit.org/show_bug.cgi?id=165227 <rdar://problem/29442665> Reviewed by Saam Barati. JSTests: * stress/get-from-scope-dynamic-onto-proxy.js: - Updated error message. * stress/proxy-dont-infinite-loop.js: Removed. * stress/proxy-json-path.js: Removed. * stress/rest-parameter-allocation-elimination-watchpoints-6.js: Removed. - Removed these tests because the issue they are testing relies on being able to set Object.prototype.__proto__ to something else (which is now not possible). Source/JavaScriptCore: * runtime/JSObject.cpp: (JSC::JSObject::setPrototypeWithCycleCheck): - This is where we check for immutable prototype exotic objects and refuse to set the prototype if needed. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. * runtime/JSTypeInfo.h: (JSC::TypeInfo::isImmutablePrototypeExoticObject): * runtime/Structure.h: - Add flag for declaring immutable prototype exotic objects. * runtime/ObjectPrototype.h: - Declare that Object.prototype is an immutable prototype exotic object. See https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): - Use better error messages. Source/WebCore: Make all objects in window.__proto__'s prototype chain immutable prototype exotic objects. This gives us roughly equivalent behavior to other browsers. Firefox's behavior differ slightly in that Firefox will fail any attempted assignment their __proto__, while the immutable prototype exotic objects will only fail if the assignment is of a different value. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. Chrome differs in that assignment to window.__proto__ is also handled like an immutable prototype exotic object. Instead we adhere to the current HTML spec that says that the assignment should fail unconditionally. See https://html.spec.whatwg.org/#the-windowproxy-exotic-object and https://html.spec.whatwg.org/#windowproxy-setprototypeof. If the HTML spec is changed to make the WindowProxy and Location objects into immutable prototype exotic objects later, we can update to match the spec then. Test: js/prototype-assignment.html * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePrototypeDeclaration): * bindings/scripts/IDLAttributes.txt: * dom/EventTarget.idl: * page/DOMWindow.idl: LayoutTests: The new prototype-assignment.js test is currently only enabled for LLInt only run in the JSC tests until webkit.org/b/165401 is fixed. * TestExpectations: - Skip js/prototype-assignment.html for now until webkit.org/b/165401 is fixed. * http/tests/security/window-named-valueOf-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain.html: - Updated error messages. * js/prototype-assignment-expected.txt: Added. * js/prototype-assignment.html: Added. * js/script-tests/prototype-assignment.js: Added. (else): (reportError): (shouldEqual): (shouldThrow): (stringify): (makeTestID): (doInternalSetPrototypeOf): (ordinarySetPrototypeOf): (setImmutablePrototype): (windowProxySetPrototypeOf): (initSetterExpectation): (throwIfNoExceptionPending): (objectSetPrototypeOf): (setUnderscoreProto): (reflectSetPrototypeOf): (newObjectProto.toString): (this.testObject.targets.push.value): (this.testProxy.targets.push.setPrototypeOf): (Symbol): (test): (runTests): * js/setPrototypeOf-expected.txt: Canonical link: https://commits.webkit.org/183091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 22:43:16 +00:00
PASS Object.setPrototypeOf(object, 0) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, true) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, false) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, 'string') threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, Symbol()) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, undefined) threw exception TypeError: Prototype value can only be an object or null.
ES6: Implement Object.setPrototypeOf https://bugs.webkit.org/show_bug.cgi?id=145202 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-05-20 Reviewed by Darin Adler. Source/JavaScriptCore: * runtime/JSGlobalObjectFunctions.h: * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncProtoSetter): (JSC::checkProtoSetterAccessAllowed): Extract a helper to share this code between __proto__ setter and setPrototypeOf. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): Implementation is very similiar to __proto__ setter. LayoutTests: * http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt: Added. * http/tests/security/cross-frame-access-object-setPrototypeOf.html: Added. * http/tests/security/resources/cross-frame-iframe-for-object-setPrototypeOf-test.html: Added. Test covering cross origin restriction behavior. * js/Object-getOwnPropertyNames-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: Updated for the new exposed property. * js/cyclic-prototypes-expected.txt: * js/script-tests/cyclic-prototypes.js: Extend this test to include setPrototypeOf cyclic checks. Note that setPrototypeOf can still change the prototype where __proto__ cannot. * js/prototypes-expected.txt: * js/script-tests/prototypes.js: Extend this test to cover more types previously overlooked. * js/script-tests/setPrototypeOf.js: Added. (debugEval): (getObjectDescriptions.myFunction): (getObjectDescriptions): * js/setPrototypeOf-expected.txt: Added. * js/setPrototypeOf.html: Added. Test coverage for all the different object / prototype combinations. This is modeled after the other browser tests with coverage of a few more basic functionality tests and object types. Canonical link: https://commits.webkit.org/163221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-20 17:23:03 +00:00
object (String)
Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec. https://bugs.webkit.org/show_bug.cgi?id=165227 <rdar://problem/29442665> Reviewed by Saam Barati. JSTests: * stress/get-from-scope-dynamic-onto-proxy.js: - Updated error message. * stress/proxy-dont-infinite-loop.js: Removed. * stress/proxy-json-path.js: Removed. * stress/rest-parameter-allocation-elimination-watchpoints-6.js: Removed. - Removed these tests because the issue they are testing relies on being able to set Object.prototype.__proto__ to something else (which is now not possible). Source/JavaScriptCore: * runtime/JSObject.cpp: (JSC::JSObject::setPrototypeWithCycleCheck): - This is where we check for immutable prototype exotic objects and refuse to set the prototype if needed. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. * runtime/JSTypeInfo.h: (JSC::TypeInfo::isImmutablePrototypeExoticObject): * runtime/Structure.h: - Add flag for declaring immutable prototype exotic objects. * runtime/ObjectPrototype.h: - Declare that Object.prototype is an immutable prototype exotic object. See https://tc39.github.io/ecma262/#sec-properties-of-the-object-prototype-object. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): - Use better error messages. Source/WebCore: Make all objects in window.__proto__'s prototype chain immutable prototype exotic objects. This gives us roughly equivalent behavior to other browsers. Firefox's behavior differ slightly in that Firefox will fail any attempted assignment their __proto__, while the immutable prototype exotic objects will only fail if the assignment is of a different value. See https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects. Chrome differs in that assignment to window.__proto__ is also handled like an immutable prototype exotic object. Instead we adhere to the current HTML spec that says that the assignment should fail unconditionally. See https://html.spec.whatwg.org/#the-windowproxy-exotic-object and https://html.spec.whatwg.org/#windowproxy-setprototypeof. If the HTML spec is changed to make the WindowProxy and Location objects into immutable prototype exotic objects later, we can update to match the spec then. Test: js/prototype-assignment.html * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePrototypeDeclaration): * bindings/scripts/IDLAttributes.txt: * dom/EventTarget.idl: * page/DOMWindow.idl: LayoutTests: The new prototype-assignment.js test is currently only enabled for LLInt only run in the JSC tests until webkit.org/b/165401 is fixed. * TestExpectations: - Skip js/prototype-assignment.html for now until webkit.org/b/165401 is fixed. * http/tests/security/window-named-valueOf-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain-expected.txt: * js/dom/proxy-is-not-allowed-in-global-prototype-chain.html: - Updated error messages. * js/prototype-assignment-expected.txt: Added. * js/prototype-assignment.html: Added. * js/script-tests/prototype-assignment.js: Added. (else): (reportError): (shouldEqual): (shouldThrow): (stringify): (makeTestID): (doInternalSetPrototypeOf): (ordinarySetPrototypeOf): (setImmutablePrototype): (windowProxySetPrototypeOf): (initSetterExpectation): (throwIfNoExceptionPending): (objectSetPrototypeOf): (setUnderscoreProto): (reflectSetPrototypeOf): (newObjectProto.toString): (this.testObject.targets.push.value): (this.testProxy.targets.push.setPrototypeOf): (Symbol): (test): (runTests): * js/setPrototypeOf-expected.txt: Canonical link: https://commits.webkit.org/183091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 22:43:16 +00:00
PASS Object.setPrototypeOf(object, 0) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, true) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, false) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, 'string') threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, Symbol()) threw exception TypeError: Prototype value can only be an object or null.
PASS Object.setPrototypeOf(object, undefined) threw exception TypeError: Prototype value can only be an object or null.
ES6: Implement Object.setPrototypeOf https://bugs.webkit.org/show_bug.cgi?id=145202 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-05-20 Reviewed by Darin Adler. Source/JavaScriptCore: * runtime/JSGlobalObjectFunctions.h: * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncProtoSetter): (JSC::checkProtoSetterAccessAllowed): Extract a helper to share this code between __proto__ setter and setPrototypeOf. * runtime/ObjectConstructor.cpp: (JSC::objectConstructorSetPrototypeOf): Implementation is very similiar to __proto__ setter. LayoutTests: * http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt: Added. * http/tests/security/cross-frame-access-object-setPrototypeOf.html: Added. * http/tests/security/resources/cross-frame-iframe-for-object-setPrototypeOf-test.html: Added. Test covering cross origin restriction behavior. * js/Object-getOwnPropertyNames-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: Updated for the new exposed property. * js/cyclic-prototypes-expected.txt: * js/script-tests/cyclic-prototypes.js: Extend this test to include setPrototypeOf cyclic checks. Note that setPrototypeOf can still change the prototype where __proto__ cannot. * js/prototypes-expected.txt: * js/script-tests/prototypes.js: Extend this test to cover more types previously overlooked. * js/script-tests/setPrototypeOf.js: Added. (debugEval): (getObjectDescriptions.myFunction): (getObjectDescriptions): * js/setPrototypeOf-expected.txt: Added. * js/setPrototypeOf.html: Added. Test coverage for all the different object / prototype combinations. This is modeled after the other browser tests with coverage of a few more basic functionality tests and object types. Canonical link: https://commits.webkit.org/163221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-20 17:23:03 +00:00
Object and object proto
object (Function) proto (Function)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function) proto (Function2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function) proto (Object)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function) proto (Object2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function) proto (RegExp)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function) proto (Array)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function) proto (Error)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function) proto (Date)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function) proto (Number)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function) proto (Boolean)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function) proto (String)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function2) proto (Function)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function2) proto (Function2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function2) proto (Object)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function2) proto (Object2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function2) proto (RegExp)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function2) proto (Array)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function2) proto (Error)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function2) proto (Date)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function2) proto (Number)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function2) proto (Boolean)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Function2) proto (String)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object) proto (Function)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object) proto (Function2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object) proto (Object)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object) proto (Object2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object) proto (RegExp)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object) proto (Array)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object) proto (Error)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object) proto (Date)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object) proto (Number)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object) proto (Boolean)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object) proto (String)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object2) proto (Function)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object2) proto (Function2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object2) proto (Object)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object2) proto (Object2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object2) proto (RegExp)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object2) proto (Array)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object2) proto (Error)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object2) proto (Date)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object2) proto (Number)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object2) proto (Boolean)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Object2) proto (String)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (RegExp) proto (Function)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (RegExp) proto (Function2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (RegExp) proto (Object)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (RegExp) proto (Object2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (RegExp) proto (RegExp)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (RegExp) proto (Array)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (RegExp) proto (Error)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (RegExp) proto (Date)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (RegExp) proto (Number)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (RegExp) proto (Boolean)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (RegExp) proto (String)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Array) proto (Function)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Array) proto (Function2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Array) proto (Object)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Array) proto (Object2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Array) proto (RegExp)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Array) proto (Array)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Array) proto (Error)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Array) proto (Date)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Array) proto (Number)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Array) proto (Boolean)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Array) proto (String)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Error) proto (Function)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Error) proto (Function2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Error) proto (Object)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Error) proto (Object2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Error) proto (RegExp)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Error) proto (Array)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Error) proto (Error)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Error) proto (Date)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Error) proto (Number)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Error) proto (Boolean)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Error) proto (String)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Date) proto (Function)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Date) proto (Function2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Date) proto (Object)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Date) proto (Object2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Date) proto (RegExp)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Date) proto (Array)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Date) proto (Error)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Date) proto (Date)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Date) proto (Number)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Date) proto (Boolean)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Date) proto (String)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Number) proto (Function)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Number) proto (Function2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Number) proto (Object)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Number) proto (Object2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Number) proto (RegExp)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Number) proto (Array)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Number) proto (Error)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Number) proto (Date)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Number) proto (Number)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Number) proto (Boolean)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Number) proto (String)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Boolean) proto (Function)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Boolean) proto (Function2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Boolean) proto (Object)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Boolean) proto (Object2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Boolean) proto (RegExp)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Boolean) proto (Array)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Boolean) proto (Error)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Boolean) proto (Date)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Boolean) proto (Number)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Boolean) proto (Boolean)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (Boolean) proto (String)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (String) proto (Function)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (String) proto (Function2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (String) proto (Object)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (String) proto (Object2)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (String) proto (RegExp)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (String) proto (Array)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (String) proto (Error)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (String) proto (Date)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (String) proto (Number)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (String) proto (Boolean)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
object (String) proto (String)
PASS Object.setPrototypeOf(object, proto) is object
PASS Object.getPrototypeOf(object) is proto
Object and null proto
object (Function)
PASS Object.setPrototypeOf(object, null) is object
PASS Object.getPrototypeOf(object) is null
object (Function2)
PASS Object.setPrototypeOf(object, null) is object
PASS Object.getPrototypeOf(object) is null
object (Object)
PASS Object.setPrototypeOf(object, null) is object
PASS Object.getPrototypeOf(object) is null
object (Object2)
PASS Object.setPrototypeOf(object, null) is object
PASS Object.getPrototypeOf(object) is null
object (RegExp)
PASS Object.setPrototypeOf(object, null) is object
PASS Object.getPrototypeOf(object) is null
object (Array)
PASS Object.setPrototypeOf(object, null) is object
PASS Object.getPrototypeOf(object) is null
object (Error)
PASS Object.setPrototypeOf(object, null) is object
PASS Object.getPrototypeOf(object) is null
object (Date)
PASS Object.setPrototypeOf(object, null) is object
PASS Object.getPrototypeOf(object) is null
object (Number)
PASS Object.setPrototypeOf(object, null) is object
PASS Object.getPrototypeOf(object) is null
object (Boolean)
PASS Object.setPrototypeOf(object, null) is object
PASS Object.getPrototypeOf(object) is null
object (String)
PASS Object.setPrototypeOf(object, null) is object
PASS Object.getPrototypeOf(object) is null
Non-extensible object
object (Function) with extensions prevented
PASS Object.setPrototypeOf(object, {}) threw exception TypeError: Attempted to assign to readonly property..
PASS Object.getPrototypeOf(object) is oldProto
object (Function2) with extensions prevented
PASS Object.setPrototypeOf(object, {}) threw exception TypeError: Attempted to assign to readonly property..
PASS Object.getPrototypeOf(object) is oldProto
object (Object) with extensions prevented
PASS Object.setPrototypeOf(object, {}) threw exception TypeError: Attempted to assign to readonly property..
PASS Object.getPrototypeOf(object) is oldProto
object (Object2) with extensions prevented
PASS Object.setPrototypeOf(object, {}) threw exception TypeError: Attempted to assign to readonly property..
PASS Object.getPrototypeOf(object) is oldProto
object (RegExp) with extensions prevented
PASS Object.setPrototypeOf(object, {}) threw exception TypeError: Attempted to assign to readonly property..
PASS Object.getPrototypeOf(object) is oldProto
object (Array) with extensions prevented
PASS Object.setPrototypeOf(object, {}) threw exception TypeError: Attempted to assign to readonly property..
PASS Object.getPrototypeOf(object) is oldProto
object (Error) with extensions prevented
PASS Object.setPrototypeOf(object, {}) threw exception TypeError: Attempted to assign to readonly property..
PASS Object.getPrototypeOf(object) is oldProto
object (Date) with extensions prevented
PASS Object.setPrototypeOf(object, {}) threw exception TypeError: Attempted to assign to readonly property..
PASS Object.getPrototypeOf(object) is oldProto
object (Number) with extensions prevented
PASS Object.setPrototypeOf(object, {}) threw exception TypeError: Attempted to assign to readonly property..
PASS Object.getPrototypeOf(object) is oldProto
object (Boolean) with extensions prevented
PASS Object.setPrototypeOf(object, {}) threw exception TypeError: Attempted to assign to readonly property..
PASS Object.getPrototypeOf(object) is oldProto
object (String) with extensions prevented
PASS Object.setPrototypeOf(object, {}) threw exception TypeError: Attempted to assign to readonly property..
PASS Object.getPrototypeOf(object) is oldProto
Test prototype lookup
PASS 'x' in object is false
PASS 'y' in object is false
PASS Object.setPrototypeOf(object, oldProto) is object
PASS object.x is 'old x'
PASS object.y is 'old y'
PASS Object.setPrototypeOf(object, newProto) is object
PASS object.x is 'new x'
PASS 'y' in object is false
Test other behavior
PASS object = {}; Object.setPrototypeOf(object, Array.prototype); object instanceof Array is true
PASS object = {}; Object.setPrototypeOf(object, Array.prototype); object.__proto__ === Array.prototype is true
PASS object = {}; Object.setPrototypeOf(object, Array.prototype); Array.prototype.isPrototypeOf(object) is true
PASS successfullyParsed is true
TEST COMPLETE