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

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

Issue 2129193003: [keys] propagate PropertyFilter to proxy targets in KeyAccumulator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: just hardcode kConvertToStrings for proxy targets Created 4 years, 5 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/objects.cc ('k') | test/mjsunit/regress/regress-5174.js » ('j') | 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 30 matching lines...) Expand all
41 var proxy2 = new Proxy(proxy, {}); 41 var proxy2 = new Proxy(proxy, {});
42 assertEquals(["target"], Object.keys(proxy2)); 42 assertEquals(["target"], Object.keys(proxy2));
43 43
44 44
45 (function testForSymbols() { 45 (function testForSymbols() {
46 var symbol = Symbol(); 46 var symbol = Symbol();
47 var p = new Proxy({}, {ownKeys() { return ["1", symbol, "2"] }}); 47 var p = new Proxy({}, {ownKeys() { return ["1", symbol, "2"] }});
48 assertEquals(["1","2"], Object.getOwnPropertyNames(p)); 48 assertEquals(["1","2"], Object.getOwnPropertyNames(p));
49 assertEquals([symbol], Object.getOwnPropertySymbols(p)); 49 assertEquals([symbol], Object.getOwnPropertySymbols(p));
50 })(); 50 })();
51
52 (function testNoProxyTraps() {
53 var test_sym = Symbol("sym1");
54 var test_sym2 = Symbol("sym2");
55 var target = {
56 one: 1,
57 two: 2,
58 [test_sym]: 4,
59 0: 0,
60 };
61 Object.defineProperty(
62 target, "non-enum",
63 { enumerable: false, value: "nope", configurable: true, writable: true });
64 target.__proto__ = {
65 target_proto: 3,
66 1: 1,
67 [test_sym2]: 5
68 };
69 Object.defineProperty(
70 target.__proto__, "non-enum2",
71 { enumerable: false, value: "nope", configurable: true, writable: true });
72 var proxy = new Proxy(target, {});
73
74 assertEquals(["0", "one", "two"], Object.keys(proxy));
75 assertEquals(["0", "one", "two", "non-enum"],
76 Object.getOwnPropertyNames(proxy));
77 assertEquals([test_sym], Object.getOwnPropertySymbols(proxy));
78 })();
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/regress/regress-5174.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698