nonconfigurable-descriptors-set-value-by-arguments.js (814B)
1 // Copyright (C) 2017 Caio Lima. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 description: Mapped arguments property descriptor change with non-configurable property 6 info: | 7 Mapping keep working when property is set to non-configurable and its 8 value is changed using arguments[i] where "i" is the argument index. 9 flags: [noStrict] 10 esid: sec-arguments-exotic-objects-defineownproperty-p-desc 11 includes: [propertyHelper.js] 12 ---*/ 13 14 function argumentsAndSetByIndex(a) { 15 Object.defineProperty(arguments, "0", {configurable: false}); 16 17 arguments[0] = 2; 18 19 assert.sameValue(a, 2); 20 21 verifyProperty(arguments, "0", { 22 value: 2, 23 writable: true, 24 enumerable: true, 25 configurable: false, 26 }); 27 } 28 argumentsAndSetByIndex(1); 29 30 31 reportCompare(0, 0);