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

Side by Side Diff: test/mjsunit/es6/arrow-functions-this.js

Issue 1373633002: Remove --harmony-arrow-functions flag (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 5 years, 2 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
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-arrow-functions
6
7 var object = {}; 5 var object = {};
8 var global = this; 6 var global = this;
9 var call = Function.call.bind(Function.call); 7 var call = Function.call.bind(Function.call);
10 8
11 var globalSloppyArrow = () => this; 9 var globalSloppyArrow = () => this;
12 var globalStrictArrow = () => { "use strict"; return this; }; 10 var globalStrictArrow = () => { "use strict"; return this; };
13 var globalSloppyArrowEval = (s) => eval(s); 11 var globalSloppyArrowEval = (s) => eval(s);
14 var globalStrictArrowEval = (s) => { "use strict"; return eval(s); }; 12 var globalStrictArrowEval = (s) => { "use strict"; return eval(s); };
15 13
16 var sloppyFunctionArrow = function() { 14 var sloppyFunctionArrow = function() {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 call(strictFunctionArrowEval, object, "(() => this)()")); 70 call(strictFunctionArrowEval, object, "(() => this)()"));
73 assertEquals(undefined, 71 assertEquals(undefined,
74 call(strictFunctionArrowEval, undefined, "(() => this)()")); 72 call(strictFunctionArrowEval, undefined, "(() => this)()"));
75 73
76 assertEquals(global, call(arrowInsideWith, undefined)); 74 assertEquals(global, call(arrowInsideWith, undefined));
77 assertEquals(global, call(arrowInsideWith, object)); 75 assertEquals(global, call(arrowInsideWith, object));
78 assertEquals(global, call(arrowInsideWithEval, undefined, "this")); 76 assertEquals(global, call(arrowInsideWithEval, undefined, "this"));
79 assertEquals(global, call(arrowInsideWithEval, object, "this")); 77 assertEquals(global, call(arrowInsideWithEval, object, "this"));
80 assertEquals(global, call(arrowInsideWithEval, undefined, "(() => this)()")); 78 assertEquals(global, call(arrowInsideWithEval, undefined, "(() => this)()"));
81 assertEquals(global, call(arrowInsideWithEval, object, "(() => this)()")); 79 assertEquals(global, call(arrowInsideWithEval, object, "(() => this)()"));
OLDNEW
« no previous file with comments | « test/mjsunit/es6/arrow-functions-lexical-arguments.js ('k') | test/mjsunit/es6/object-literals-super.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698