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

Side by Side Diff: test/mjsunit/es6/global-proto-proxy.js

Issue 2671553006: Allow global prototype to be a Proxy (Closed)
Patch Set: Allow global prototype to be a Proxy Created 3 years, 10 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
« src/objects.cc ('K') | « src/objects.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 var global = this;
6 ;(function () {
7 var calledDelete = false;
8 var calledGet = false;
9 var calledHas = false;
10 var calledSet = false;
11 var target = {};
12 var assertEquals = global.assertEquals;
13 var proxy = new Proxy(target, {
14 has(target, property) {
15 calledHas = true;
16 return Reflect.has(target, property);
17 },
18 get(target, property, receiver) {
19 calledGet = true;
20 return Reflect.get(target, property, receiver);
21 },
22 set(targer, property, value, receiver) {
23 calledSet = true;
24 return Reflect.set(target, property, value, receiver);
25 },
26 delete(target, property, receiver) {
27 calledDelete = true;
28 return Reflect.delete(target, property, receiver);
29 }
30 });
31 Object.setPrototypeOf(global, proxy);
32 getGlobal;
33 assertTrue(calledGet);
34 makeGlobal = 2;
35 assertTrue(calledSet);
36 "findGlobal" in global;
37 assertTrue(calledHas);
38 var deletedOwn = delete makeGlobal;
39 assertTrue(deletedOwn);
40 assertEquals(void 0, makeGlobal);
41 })();
OLDNEW
« src/objects.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698