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

Side by Side Diff: test/mjsunit/regress/regress-4525.js

Issue 1407373007: Remove CallFunctionStub, always call through the Call builtin (also from CallIC) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « test/mjsunit/call-cross-realm.js ('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
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: --allow-natives-syntax 5 // Flags: --allow-natives-syntax
6 6
7 function receiver() { 7 function receiver() {
8 return this; 8 return this;
9 } 9 }
10 10
11 function construct(f) { 11 function construct(f) {
12 "use strict"; 12 "use strict";
13 class B {} 13 class B {}
14 class C extends B { 14 class C extends B {
15 bar() { return super.foo() } 15 bar() { return super.foo() }
16 } 16 }
17 B.prototype.foo = f; 17 B.prototype.foo = f;
18 return new C(); 18 return new C();
19 } 19 }
20 20
21 function check(x, value, type) { 21 function check(x, value, type) {
22 assertEquals("object", typeof x); 22 assertEquals("object", typeof x);
23 assertInstanceof(x, type); 23 assertInstanceof(x, type);
24 assertEquals(value, x); 24 assertEquals(value, x);
25 } 25 }
26 26
27 var o = construct(receiver); 27 var o = construct(receiver);
28 check(o.bar.call(123), Object(123), Number); 28 check(o.bar.call(123), Object(123), Number);
29 check(o.bar.call("a"), Object("a"), String); 29 check(o.bar.call("a"), Object("a"), String);
30 // TODO(4526): Should convert to global receiver instead of throwing TypeError. 30 check(o.bar.call(undefined), this, Object);
31 // check(o.bar.call(undefined), this, Object); 31 check(o.bar.call(null), this, Object);
32 // check(o.bar.call(null), this, Object);
33 32
34 %OptimizeFunctionOnNextCall(o.bar); 33 %OptimizeFunctionOnNextCall(o.bar);
35 check(o.bar.call(456), Object(456), Number); 34 check(o.bar.call(456), Object(456), Number);
36 check(o.bar.call("b"), Object("b"), String); 35 check(o.bar.call("b"), Object("b"), String);
37 // TODO(4526): Should convert to global receiver instead of throwing TypeError. 36 check(o.bar.call(undefined), this, Object);
38 // check(o.bar.call(undefined), this, Object); 37 check(o.bar.call(null), this, Object);
39 // check(o.bar.call(null), this, Object);
OLDNEW
« no previous file with comments | « test/mjsunit/call-cross-realm.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698