trap-is-undefined-strict-strict.js (732B)
1 'use strict'; 2 // Copyright (C) 2015 the V8 project authors. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 /*--- 5 es6id: 9.5.10 6 description: > 7 [[Delete]] (P) 8 9 8. If trap is undefined, then Return target.[[Delete]](P). 10 flags: [onlyStrict] 11 features: [Proxy, Reflect] 12 ---*/ 13 14 var target = { 15 attr: 1 16 }; 17 var p = new Proxy(target, {}); 18 19 assert.sameValue(delete p.attr, true); 20 assert.sameValue(delete p.notThere, true); 21 assert.sameValue( 22 Object.getOwnPropertyDescriptor(target, "attr"), 23 undefined 24 ); 25 26 Object.defineProperty(target, "attr", { 27 configurable: false, 28 enumerable: true, 29 value: 1 30 }); 31 32 assert.sameValue(Reflect.deleteProperty(p, "attr"), false); 33 34 reportCompare(0, 0);