Debian Codegraph @

js/src/tests/test262/built-ins/Proxy/deleteProperty/targetdesc-is-not-configurable.js

raw
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 es6id: 9.5.10
5 description: >
6 [[Delete]] (P)
7
8 A property cannot be reported as deleted, if it exists as a non-configurable
9 own property of the target object.
10 info: |
11 14. If targetDesc.[[Configurable]] is false, throw a TypeError exception.
12 features: [Proxy]
13 ---*/
14
15 var target = {};
16 var p = new Proxy(target, {
17 deleteProperty: function() {
18 return true;
19 }
20 });
21
22 Object.defineProperty(target, "attr", {
23 configurable: false,
24 value: 1
25 });
26
27 assert.throws(TypeError, function() {
28 delete p.attr;
29 });
30
31 reportCompare(0, 0);