summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Object/seal/symbol-object-contains-symbol-properties-strict-strict.js
blob: 1c2715e31127a9dabdb926636749dafb2280c5b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'use strict';
// Copyright (C) 2013 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-object.seal
description: >
    Object.seal(obj) where obj contains symbol properties.
flags: [onlyStrict]
features: [Symbol]
---*/
var symA = Symbol("A");
var symB = Symbol("B");
var obj = {};
obj[symA] = 1;
Object.seal(obj);
obj[symA] = 2;

assert.sameValue(obj[symA], 2, "The value of `obj[symA]` is `2`");

assert.throws(TypeError, function() {
  delete obj[symA];
});

assert.throws(TypeError, function() {
  obj[symB] = 1;
});

reportCompare(0, 0);