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

Side by Side Diff: test/mjsunit/harmony/proxy-get.js

Issue 1482283002: [runtime] [proxy] implementing [[Get]] trap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // Flags: --harmony-proxies
6
7 var target = {
8 "target_one": 1,
9 "property": "value"
10 };
11
12 var handler = { "handler": 1 };
13
14 var proxy = new Proxy(target, handler);
15 assertEquals("value", proxy.property);
16 assertEquals(undefined, proxy.nothing);
17 assertEquals(undefined, proxy.handler);
18
19 handler.get = function() { return "value 2" };
20 assertEquals("value 2", proxy.property);
21 assertEquals("value 2", proxy.nothing);
22 assertEquals("value 2", proxy.handler);
23
Jakob Kummerow 2015/11/30 12:56:11 How about test cases for the code paths that throw
Camillo Bruni 2015/11/30 14:57:35 right, let's add some more detailed tests.
24 var handler2 = new Proxy({"get": function() { return "value 3" }},{});
25 var proxy2 = new Proxy(target, handler2);
26 assertEquals("value 3", proxy2.property);
27 assertEquals("value 3", proxy2.nothing);
28 assertEquals("value 3", proxy2.handler);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698