Changeset 110521 in webkit
- Timestamp:
- Mar 12, 2012, 6:16:08 PM (14 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r110517 r110521 1 2012-03-12 Gavin Barraclough <barraclough@apple.com> 2 3 Object.defineProperty doesn't respect attributes when applied to the Global Object 4 https://bugs.webkit.org/show_bug.cgi?id=38636 5 Object.defineProperty doesn't create property on Global Object in the presence of a setter in the prototype chain 6 https://bugs.webkit.org/show_bug.cgi?id=48911 7 8 Rubber stamped by Michael Saboff. 9 10 * fast/js/Object-defineProperty-expected.txt: 11 * fast/js/script-tests/Object-defineProperty.js: 12 - Added test cases for bugs #38636 & #48911. 13 1 14 2012-03-12 Dirk Pranke <dpranke@chromium.org> 2 15 -
trunk/LayoutTests/fast/js/Object-defineProperty-expected.txt
r109866 r110521 126 126 PASS var a = Object.defineProperty([], '0', {set: undefined}); a[0] = 42; a[0]; is undefined. 127 127 PASS 'use strict'; var a = Object.defineProperty([], '0', {set: undefined}); a[0] = 42; a[0]; threw exception TypeError: Attempted to assign to readonly property.. 128 PASS anObj.slot1 is "foo" 129 PASS anObj.slot2 is "bar" 130 PASS anObj.propertyIsEnumerable('slot1') is true 131 PASS anObj.propertyIsEnumerable('slot2') is false 132 PASS anObj.slot4 is "goo" 133 PASS anObj.slot5 is 123 134 PASS anObj._Slot5 is 123 135 PASS Object.getOwnPropertyDescriptor(anObj, 'slot5') is undefined. 136 PASS anObj.slot5 is 456 137 PASS anObj._Slot5 is 123 138 PASS Object.getOwnPropertyDescriptor(anObj, 'slot5').value is 456 139 PASS anObj.slot1 is "foo" 140 PASS anObj.slot2 is "bar" 141 PASS anObj.propertyIsEnumerable('slot1') is true 142 PASS anObj.propertyIsEnumerable('slot2') is false 143 PASS anObj.slot4 is "goo" 144 PASS anObj.slot5 is 123 145 PASS anObj._Slot5 is 123 146 PASS Object.getOwnPropertyDescriptor(anObj, 'slot5') is undefined. 147 PASS anObj.slot5 is 456 148 PASS anObj._Slot5 is 123 149 PASS Object.getOwnPropertyDescriptor(anObj, 'slot5').value is 456 128 150 PASS successfullyParsed is true 129 151 -
trunk/LayoutTests/fast/js/script-tests/Object-defineProperty.js
r109866 r110521 184 184 shouldBeUndefined("var a = Object.defineProperty([], '0', {set: undefined}); a[0] = 42; a[0];"); 185 185 shouldThrow("'use strict'; var a = Object.defineProperty([], '0', {set: undefined}); a[0] = 42; a[0];"); 186 187 function testObject() 188 { 189 // Test case from https://bugs.webkit.org/show_bug.cgi?id=38636 190 Object.defineProperty(anObj, 'slot1', {value: 'foo', enumerable: true}); 191 Object.defineProperty(anObj, 'slot2', {value: 'bar', writable: true}); 192 Object.defineProperty(anObj, 'slot3', {value: 'baz', enumerable: false}); 193 Object.defineProperty(anObj, 'slot4', {value: 'goo', configurable: false}); 194 shouldBe("anObj.slot1", '"foo"'); 195 shouldBe("anObj.slot2", '"bar"'); 196 anObj.slot2 = 'bad value'; 197 shouldBeTrue("anObj.propertyIsEnumerable('slot1')"); 198 shouldBeFalse("anObj.propertyIsEnumerable('slot2')"); 199 delete anObj.slot4; 200 shouldBe("anObj.slot4", '"goo"'); 201 202 // Test case from https://bugs.webkit.org/show_bug.cgi?id=48911 203 Object.defineProperty(Object.getPrototypeOf(anObj), 'slot5', {get: function() { return this._Slot5; }, set: function(v) { this._Slot5 = v; }, configurable: false}); 204 anObj.slot5 = 123; 205 shouldBe("anObj.slot5", '123'); 206 shouldBe("anObj._Slot5", '123'); 207 shouldBeUndefined("Object.getOwnPropertyDescriptor(anObj, 'slot5')"); 208 Object.defineProperty(anObj, 'slot5', { value: 456 }); 209 shouldBe("anObj.slot5", '456'); 210 shouldBe("anObj._Slot5", '123'); 211 shouldBe("Object.getOwnPropertyDescriptor(anObj, 'slot5').value", '456'); 212 } 213 var anObj = {}; 214 testObject(); 215 var anObj = this; 216 testObject();
Note:
See TracChangeset
for help on using the changeset viewer.