Changeset 92618 in webkit
- Timestamp:
- Aug 8, 2011 12:09:51 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r92616 r92618 1 2011-08-08 Oliver Hunt <oliver@apple.com> 2 3 Non-extensibility does not prevent mutating [[Prototype]] 4 https://bugs.webkit.org/show_bug.cgi?id=65832 5 6 Reviewed by Gavin Barraclough. 7 8 Add tests to ensure we can't assign to __proto__ when an object 9 is not extensible. 10 11 * fast/js/preventExtensions-expected.txt: 12 * fast/js/script-tests/preventExtensions.js: 13 1 14 2011-08-08 Jian Li <jianli@chromium.org> 2 15 -
trunk/LayoutTests/fast/js/preventExtensions-expected.txt
r90402 r92618 12 12 PASS test(freeze(obj())) is "(a:1)(b:2)SF" 13 13 PASS Object.preventExtensions(Math.sin) is Math.sin 14 PASS var o = {}; Object.preventExtensions(o); o.__proto__ = { newProp: "Should not see this" }; o.newProp; is undefined. 15 PASS "use strict"; var o = {}; Object.preventExtensions(o); o.__proto__ = { newProp: "Should not see this" }; threw exception TypeError: Attempted to assign to readonly property.. 14 16 PASS successfullyParsed is true 15 17 -
trunk/LayoutTests/fast/js/script-tests/preventExtensions.js
r90402 r92618 69 69 shouldBe('Object.preventExtensions(Math.sin)', 'Math.sin'); 70 70 71 shouldBeUndefined('var o = {}; Object.preventExtensions(o); o.__proto__ = { newProp: "Should not see this" }; o.newProp;'); 72 shouldThrow('"use strict"; var o = {}; Object.preventExtensions(o); o.__proto__ = { newProp: "Should not see this" };'); 73 71 74 successfullyParsed = true; -
trunk/Source/JavaScriptCore/ChangeLog
r92593 r92618 1 2011-08-08 Oliver Hunt <oliver@apple.com> 2 3 Non-extensibility does not prevent mutating [[Prototype]] 4 https://bugs.webkit.org/show_bug.cgi?id=65832 5 6 Reviewed by Gavin Barraclough. 7 8 Disallow mutation of __proto__ on objects that are not extensible. 9 10 * runtime/JSObject.cpp: 11 (JSC::JSObject::put): 12 1 13 2011-08-08 Filip Pizlo <fpizlo@apple.com> 2 14 -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r91194 r92618 111 111 if (!value.isObject() && !value.isNull()) 112 112 return; 113 114 if (!isExtensible()) { 115 if (slot.isStrictMode()) 116 throwTypeError(exec, StrictModeReadonlyPropertyWriteError); 117 return; 118 } 119 113 120 if (!setPrototypeWithCycleCheck(exec->globalData(), value)) 114 121 throwError(exec, createError(exec, "cyclic __proto__ value"));
Note: See TracChangeset
for help on using the changeset viewer.