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

Side by Side Diff: test/mjsunit/harmony/arrow-functions-scoping.js

Issue 791603003: WIP context-allocation for “this” in arrow functions Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: WIP v3 Created 5 years, 11 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/x64/full-codegen-x64.cc ('K') | « test/cctest/test-parsing.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 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-arrow-functions
6
7 // The following are tests from:
8 // http://wiki.ecmascript.org/doku.php?id=harmony:arrow_function_syntax
9
10 // ''=>'' has only lexical ''this'', no dynamic ''this''
11 var obj = {
12 method: function () {
13 return () => this;
14 }
15 };
16 assertSame(obj, obj.method()());
17
18 var fake = {steal: obj.method()};
19 assertSame(obj, fake.steal());
20
21 // But ''function'' still has dynamic ''this'' of course
22 var real = {borrow: obj.method};
23 assertSame(real, real.borrow()());
OLDNEW
« src/x64/full-codegen-x64.cc ('K') | « test/cctest/test-parsing.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698