Changeset 202832 in webkit
- Timestamp:
- Jul 5, 2016 2:08:38 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r202829 r202832 1 2016-07-05 Benjamin Poulain <bpoulain@apple.com> 2 3 [JSC] The prototype cycle checks throws the wrong error type 4 https://bugs.webkit.org/show_bug.cgi?id=159393 5 6 Reviewed by Geoffrey Garen. 7 8 * js/cyclic-prototypes-expected.txt: 9 * js/script-tests/cyclic-prototypes.js: 10 (catch): 11 1 12 2016-07-05 Jer Noble <jer.noble@apple.com> 2 13 -
trunk/LayoutTests/fast/dom/Window/script-tests/window-custom-prototype.js
r108259 r202832 5 5 var anotherObject = { }; 6 6 7 shouldThrow("__proto__ = window; __proto", "' Error: cyclic __proto__ value'");8 shouldThrow("__proto__ = chainPointingBackToWindow; __proto__", "' Error: cyclic __proto__ value'");7 shouldThrow("__proto__ = window; __proto", "'TypeError: cyclic __proto__ value'"); 8 shouldThrow("__proto__ = chainPointingBackToWindow; __proto__", "'TypeError: cyclic __proto__ value'"); 9 9 shouldBe("__proto__ = 1; __proto__", "originalWindowPrototype"); 10 10 shouldBe("__proto__ = 'a string'; __proto__", "originalWindowPrototype"); 11 11 shouldBe("__proto__ = anotherObject; __proto__", "anotherObject"); 12 shouldThrow("anotherObject.__proto__ = window; __proto__", "' Error: cyclic __proto__ value'");12 shouldThrow("anotherObject.__proto__ = window; __proto__", "'TypeError: cyclic __proto__ value'"); 13 13 shouldBe("__proto__ = 1; __proto__", "anotherObject"); 14 14 shouldBe("__proto__ = 'a string'; __proto__", "anotherObject"); -
trunk/LayoutTests/fast/dom/Window/window-custom-prototype-expected.txt
r108259 r202832 4 4 5 5 6 PASS __proto__ = window; __proto threw exception Error: cyclic __proto__ value.7 PASS __proto__ = chainPointingBackToWindow; __proto__ threw exception Error: cyclic __proto__ value.6 PASS __proto__ = window; __proto threw exception TypeError: cyclic __proto__ value. 7 PASS __proto__ = chainPointingBackToWindow; __proto__ threw exception TypeError: cyclic __proto__ value. 8 8 PASS __proto__ = 1; __proto__ is originalWindowPrototype 9 9 PASS __proto__ = 'a string'; __proto__ is originalWindowPrototype 10 10 PASS __proto__ = anotherObject; __proto__ is anotherObject 11 PASS anotherObject.__proto__ = window; __proto__ threw exception Error: cyclic __proto__ value.11 PASS anotherObject.__proto__ = window; __proto__ threw exception TypeError: cyclic __proto__ value. 12 12 PASS __proto__ = 1; __proto__ is anotherObject 13 13 PASS __proto__ = 'a string'; __proto__ is anotherObject -
trunk/LayoutTests/js/cyclic-prototypes-expected.txt
r184642 r202832 4 4 5 5 6 PASS o1.__proto__ = o3; threw exception Error: cyclic __proto__ value. 7 PASS Object.setPrototypeOf(o1, o3) threw exception Error: cyclic __proto__ value. 6 PASS o1.__proto__ = o3; threw exception TypeError: cyclic __proto__ value. 7 PASS Object.setPrototypeOf(o1, o3) threw exception TypeError: cyclic __proto__ value. 8 PASS globalException.constructor is TypeError 9 PASS globalException.constructor is TypeError 8 10 PASS ({}).hasOwnProperty.call(o1, '__proto__') is false 9 11 PASS ({}).hasOwnProperty.call(o1, '__proto__') is true 10 12 PASS Object.getPrototypeOf(o1) is null 11 PASS Object.setPrototypeOf(o1, o3) threw exception Error: cyclic __proto__ value.13 PASS Object.setPrototypeOf(o1, o3) threw exception TypeError: cyclic __proto__ value. 12 14 PASS successfullyParsed is true 13 15 -
trunk/LayoutTests/js/dom/cyclic-proto-expected.txt
r156066 r202832 4 4 5 5 6 PASS x.__proto__ = x; threw exception Error: cyclic __proto__ value.6 PASS x.__proto__ = x; threw exception TypeError: cyclic __proto__ value. 7 7 PASS x.__proto__ is originalProto 8 8 PASS successfullyParsed is true -
trunk/LayoutTests/js/script-tests/cyclic-prototypes.js
r184642 r202832 8 8 9 9 // Try to create a cyclical prototype chain. 10 shouldThrow("o1.__proto__ = o3;"); 11 shouldThrow("Object.setPrototypeOf(o1, o3)"); 10 shouldThrow("o1.__proto__ = o3;", "'TypeError: cyclic __proto__ value'"); 11 shouldThrow("Object.setPrototypeOf(o1, o3)", "'TypeError: cyclic __proto__ value'"); 12 var globalException; 13 try { 14 o1.__proto__ = o3; 15 } catch (e) { 16 globalException = e; 17 } 18 shouldBe("globalException.constructor", "TypeError"); 19 20 globalException = undefined; 21 try { 22 Object.setPrototypeOf(o1, o3); 23 } catch (e) { 24 globalException = e; 25 } 26 shouldBe("globalException.constructor", "TypeError"); 12 27 13 28 // This changes __proto__ setter behaviour, since __proto__ is an accessor on Object.prototype. -
trunk/Source/JavaScriptCore/ChangeLog
r202828 r202832 1 2016-07-05 Benjamin Poulain <bpoulain@apple.com> 2 3 [JSC] The prototype cycle checks throws the wrong error type 4 https://bugs.webkit.org/show_bug.cgi?id=159393 5 6 Reviewed by Geoffrey Garen. 7 8 We were supposed to throw the TypeError: 9 -https://tc39.github.io/ecma262/#sec-set-object.prototype.__proto__ 10 11 * runtime/JSObject.cpp: 12 (JSC::JSObject::setPrototypeWithCycleCheck): 13 1 14 2016-07-05 Saam Barati <sbarati@apple.com> 2 15 -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r202125 r202832 1367 1367 if (nextPrototype == this) { 1368 1368 if (shouldThrowIfCantSet) 1369 vm.throwException(exec, createError(exec, ASCIILiteral("cyclic __proto__ value")));1369 throwTypeError(exec, ASCIILiteral("cyclic __proto__ value")); 1370 1370 return false; 1371 1371 }
Note: See TracChangeset
for help on using the changeset viewer.