11.4.1-4-a-2-s-strict.js (595B)
1 'use strict'; 2 // Copyright (c) 2012 Ecma International. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 esid: sec-delete-operator-runtime-semantics-evaluation 7 description: > 8 Strict Mode - TypeError is thrown when deleting non-configurable 9 accessor property 10 flags: [onlyStrict] 11 ---*/ 12 13 var obj = {}; 14 Object.defineProperty(obj, 'prop', { 15 get: function() { 16 return 'abc'; 17 }, 18 configurable: false, 19 }); 20 assert.throws(TypeError, function() { 21 delete obj.prop; 22 }); 23 assert.sameValue(obj.prop, 'abc', 'obj.prop'); 24 25 reportCompare(0, 0);