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

Side by Side Diff: test/mjsunit/es6/regress/regress-new-target-context.js

Issue 1492793002: [fullcode] Switch passing of new.target to register. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ported. 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
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.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 // Test access of the new.target value in functions that also allocate local
6 // function contexts of varying sizes, making sure the value is not clobbered.
7
8 function makeFun(n) {
9 var source = "(function f" + n + "() { ";
10 for (var i = 0; i < n; ++i) source += "var v" + i + "; ";
11 source += "(function() { 0 ";
12 for (var i = 0; i < n; ++i) source += "+ v" + i + " ";
13 source += "})(); return { value: new.target }; })";
14 return eval(source);
15 }
16
17 // Exercise fast case.
18 var a = makeFun(4);
19 assertEquals(a, new a().value);
20 assertEquals(undefined, a().value);
21
22 // Exercise slow case.
23 var b = makeFun(128);
24 assertEquals(b, new b().value);
25 assertEquals(undefined, b().value);
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698