Debian Codegraph @

js/src/tests/test262/built-ins/Object/seal/symbol-object-contains-symbol-properties-strict-strict.js

raw
1 'use strict';
2 // Copyright (C) 2013 the V8 project authors. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 esid: sec-object.seal
6 description: >
7 Object.seal(obj) where obj contains symbol properties.
8 flags: [onlyStrict]
9 features: [Symbol]
10 ---*/
11 var symA = Symbol("A");
12 var symB = Symbol("B");
13 var obj = {};
14 obj[symA] = 1;
15 Object.seal(obj);
16 obj[symA] = 2;
17
18 assert.sameValue(obj[symA], 2, "The value of `obj[symA]` is `2`");
19
20 assert.throws(TypeError, function() {
21 delete obj[symA];
22 });
23
24 assert.throws(TypeError, function() {
25 obj[symB] = 1;
26 });
27
28 reportCompare(0, 0);