Debian Codegraph @

js/src/tests/test262/language/expressions/delete/11.4.1-5-a-27-s-strict.js

raw
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 after deleting a property,
9 calling preventExtensions, and attempting to reassign the property
10 flags: [onlyStrict]
11 ---*/
12
13 var a = {
14 x: 0,
15 get y() {
16 return 0;
17 },
18 };
19 delete a.x;
20 Object.preventExtensions(a);
21 assert.throws(TypeError, function() {
22 a.x = 1;
23 });
24
25 reportCompare(0, 0);