11.4.1-4.a-2.js (824B)
1 // Copyright (c) 2012 Ecma International. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 info: | 6 This test is actually testing the [[Delete]] internal method (8.12.8). Since the 7 language provides no way to directly exercise [[Delete]], the tests are placed here. 8 esid: sec-delete-operator-runtime-semantics-evaluation 9 description: > 10 delete operator returns true when deleting a configurable accessor 11 property 12 ---*/ 13 14 var o = {}; 15 16 // define an accessor 17 // dummy getter 18 var getter = function() { 19 return 1; 20 }; 21 var desc = { 22 get: getter, 23 configurable: true, 24 }; 25 Object.defineProperty(o, 'foo', desc); 26 27 var d = delete o.foo; 28 29 assert.sameValue(d, true, 'd'); 30 assert.sameValue(o.hasOwnProperty('foo'), false, 'o.hasOwnProperty("foo")'); 31 32 reportCompare(0, 0);