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

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: 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);
rossberg 2015/10/15 12:12:55 Check Object.isSealed(sloppy) here (analogous belo
adamk 2015/10/15 12:29:32 Done and done (though the return value of that in
10 var desc = Object.getOwnPropertyDescriptor(sloppy, sym);
11 assertEquals(123, desc.value);
12 assertFalse(desc.configurable);
13 assertTrue(desc.writable);
14 })();
15
16
17 (function testFreeze() {
18 var sloppy = arguments;
19 var sym = Symbol();
20 sloppy[sym] = 123;
21 Object.freeze(sloppy);
22 var desc = Object.getOwnPropertyDescriptor(sloppy, sym);
23 assertEquals(123, desc.value);
24 assertFalse(desc.configurable);
25 assertFalse(desc.writable);
26 })();
27
28
29 (function testIsFrozenAndIsSealed() {
30 var sym = Symbol();
31 var obj = { [sym]: 123 };
32 Object.preventExtensions(obj);
33 assertFalse(Object.isFrozen(obj));
34 assertFalse(Object.isSealed(obj));
35 })();
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