mapped-arguments-nonconfigurable-delete-3.js (870B)
1 // Copyright (C) 2015 André Bargull. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 info: Mapped arguments object with non-configurable property 6 description: > 7 Mapping works when property is non-configurable, arguments property 8 was not deleted. Arguments property is changed with 9 [[DefineOwnProperty]]. 10 flags: [noStrict] 11 ---*/ 12 13 function argumentsAndDeleteDefineOwnProperty(a) { 14 Object.defineProperty(arguments, "0", {configurable: false}); 15 16 // Precondition: Delete is unsuccessful and doesn't affect mapping. 17 assert.sameValue(delete arguments[0], false); 18 assert.sameValue(a, 1); 19 assert.sameValue(arguments[0], 1); 20 21 Object.defineProperty(arguments, "0", {value: 2}); 22 assert.sameValue(a, 2); 23 assert.sameValue(arguments[0], 2); 24 } 25 argumentsAndDeleteDefineOwnProperty(1); 26 27 reportCompare(0, 0);