propertyhelper-verifywritable-writable.js (491B)
1 // Copyright (C) 2015 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 description: > 6 Objects whose specified property is writable satisfy the assertion. 7 includes: [propertyHelper.js] 8 ---*/ 9 var obj = {}; 10 11 Object.defineProperty(obj, 'a', { 12 writable: true, 13 value: 123 14 }); 15 16 verifyWritable(obj, 'a'); 17 18 if (obj.a !== 123) { 19 throw new Error('`verifyWritable` should be non-destructive.'); 20 } 21 22 reportCompare(0, 0);