nonwritable-nonenumerable-nonconfigurable-descriptors-set-by-define-property.js (954B)
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 to non-writable, non-enumerable and non-configurable 6 info: | 7 Change the descriptor using [[DefineOwnProperty]] to 8 {writable: false, enumerable: false}, change argument[0] 9 value to 2 using [[DefineOwnProperty]] and then 10 change property descriptor to {configurable: false}. 11 The descriptor's enumerable property continues with its configured value. 12 flags: [noStrict] 13 esid: sec-arguments-exotic-objects-defineownproperty-p-desc 14 includes: [propertyHelper.js] 15 ---*/ 16 17 function fn(a) { 18 Object.defineProperty(arguments, "0", {writable: false, enumerable: false, value: 2, configurable: false}); 19 20 verifyProperty(arguments, "0", { 21 value: 2, 22 writable: false, 23 enumerable: false, 24 configurable: false, 25 }); 26 } 27 fn(1); 28 29 reportCompare(0, 0);