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

Side by Side Diff: test/mjsunit/es6/regress/regress-cr493566.js

Issue 1417063011: [runtime] support new Proxy() instead of Proxy.create and install getPrototypeOf trap (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: removing unreachable code Created 5 years, 1 month 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/iteration-semantics.js ('k') | test/mjsunit/for-in-opt.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 // Flags: --harmony-proxies 5 // Flags: --harmony-proxies
6 6
7 "use strict"; 7 "use strict";
8 8
9 9
10 var global = this; 10 var global = this;
(...skipping 12 matching lines...) Expand all
23 23
24 (function TestProxyProto() { 24 (function TestProxyProto() {
25 var calls = 0; 25 var calls = 0;
26 var handler = { 26 var handler = {
27 getPropertyDescriptor: function(name) { 27 getPropertyDescriptor: function(name) {
28 calls++; 28 calls++;
29 return undefined; 29 return undefined;
30 } 30 }
31 }; 31 };
32 32
33 var proto = {}; 33 var target = {};
34 var proxy = Proxy.create(handler, proto); 34 var proxy = new Proxy(target, handler);
35 var object = { 35 var object = {
36 __proto__: proxy, 36 __proto__: proxy,
37 setX(v) { 37 setX(v) {
38 super.x = v; 38 super.x = v;
39 }, 39 },
40 setSymbol(sym, v) { 40 setSymbol(sym, v) {
41 super[sym] = v; 41 super[sym] = v;
42 } 42 }
43 }; 43 };
44 44
(...skipping 22 matching lines...) Expand all
67 assertUnreachable(); 67 assertUnreachable();
68 }, 68 },
69 set(receiver, name, value) { 69 set(receiver, name, value) {
70 calls++; 70 calls++;
71 assertEquals(proxy, receiver); 71 assertEquals(proxy, receiver);
72 assertEquals('y', name); 72 assertEquals('y', name);
73 assertEquals(3, value); 73 assertEquals(3, value);
74 } 74 }
75 }; 75 };
76 76
77 var proxy = Proxy.create(handler); 77 var proxy = new Proxy({}, handler);
78 object.setY.call(proxy, 3); 78 object.setY.call(proxy, 3);
79 assertEquals(1, calls); 79 assertEquals(1, calls);
80 })(); 80 })();
OLDNEW
« no previous file with comments | « test/mjsunit/es6/iteration-semantics.js ('k') | test/mjsunit/for-in-opt.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698