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

Side by Side Diff: test/mjsunit/es6/proxies-keys.js

Issue 1963633002: [keys] fixing nested JSProxy for-in enumeration (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | « test/mjsunit/es6/proxies-for.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
1 // Copyright 2015 the V8 project authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var target = { 5 var target = {
6 target: 1 6 target: 1
7 }; 7 };
8 target.__proto__ = { 8 target.__proto__ = {
9 target_proto: 2 9 target_proto: 2
10 }; 10 };
(...skipping 19 matching lines...) Expand all
30 assertEquals([], Object.keys(proxy)); 30 assertEquals([], Object.keys(proxy));
31 31
32 // Throwing shouldn't crash. 32 // Throwing shouldn't crash.
33 handler.getOwnPropertyDescriptor = function() { throw new Number(1); }; 33 handler.getOwnPropertyDescriptor = function() { throw new Number(1); };
34 assertThrows("Object.keys(proxy)", Number); 34 assertThrows("Object.keys(proxy)", Number);
35 35
36 // Fall through to target if there is no trap. 36 // Fall through to target if there is no trap.
37 handler.ownKeys = undefined; 37 handler.ownKeys = undefined;
38 assertEquals(["target"], Object.keys(proxy)); 38 assertEquals(["target"], Object.keys(proxy));
39 assertEquals(["target"], Object.keys(target)); 39 assertEquals(["target"], Object.keys(target));
40
41 var proxy2 = new Proxy(proxy, {});
42 assertEquals(["target"], Object.keys(proxy2));
43
44
45 (function testForSymbols() {
46 var symbol = Symbol();
47 var p = new Proxy({}, {ownKeys() { return ["1", symbol, "2"] }});
48 assertEquals(["1","2"], Object.getOwnPropertyNames(p));
49 assertEquals([symbol], Object.getOwnPropertySymbols(p));
50 })();
OLDNEW
« no previous file with comments | « test/mjsunit/es6/proxies-for.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698