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

Side by Side Diff: test/mjsunit/object-keys.js

Issue 2853393002: [builtins] Migrate Object.keys to CodeStubAssembler builtin. (Closed)
Patch Set: Really fix the test, meh. Created 3 years, 7 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/runtime/runtime-object.cc ('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 2017 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 // Flags: --allow-natives-syntax
6
7 // Ensure that mutation of the Object.keys result doesn't affect the
8 // enumeration cache for fast-mode objects.
9 (function() {
10 const a = {x:1, y:2};
11 let k = Object.keys(a);
12 %HeapObjectVerify(k);
13 assertEquals(2, k.length);
14 assertEquals("x", k[0]);
15 assertEquals("y", k[1]);
16 k[0] = "y";
17 k[1] = "x";
18 k = Object.keys(a);
19 assertEquals(2, k.length);
20 assertEquals("x", k[0]);
21 assertEquals("y", k[1]);
22 })();
23
24 // Ensure that the copy-on-write keys are handled properly, even in
25 // the presence of Symbols.
26 (function() {
27 const s = Symbol();
28 const a = {[s]: 1};
29 let k = Object.keys(a);
30 %HeapObjectVerify(k);
31 assertEquals(0, k.length);
32 k.shift();
33 assertEquals(0, k.length);
34 })();
OLDNEW
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698