Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(611)

Side by Side Diff: test/mjsunit/regress/regress-539875.js

Issue 1393373005: Take Symbol-keyed properties into account in Object.freeze and friends (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Assert more things Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/js/v8natives.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 (function testSeal() {
6 var sloppy = arguments;
7 var sym = Symbol();
8 sloppy[sym] = 123;
9 Object.seal(sloppy);
10 assertTrue(Object.isSealed(sloppy));
11 var desc = Object.getOwnPropertyDescriptor(sloppy, sym);
12 assertEquals(123, desc.value);
13 assertFalse(desc.configurable);
14 assertTrue(desc.writable);
15 })();
16
17
18 (function testFreeze() {
19 var sloppy = arguments;
20 var sym = Symbol();
21 sloppy[sym] = 123;
22 Object.freeze(sloppy);
23 assertTrue(Object.isFrozen(sloppy));
24 var desc = Object.getOwnPropertyDescriptor(sloppy, sym);
25 assertEquals(123, desc.value);
26 assertFalse(desc.configurable);
27 assertFalse(desc.writable);
28 })();
29
30
31 (function testIsFrozenAndIsSealed() {
32 var sym = Symbol();
33 var obj = { [sym]: 123 };
34 Object.preventExtensions(obj);
35 assertFalse(Object.isFrozen(obj));
36 assertFalse(Object.isSealed(obj));
37 })();
OLDNEW
« no previous file with comments | « src/js/v8natives.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698