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

Unified Diff: test/mjsunit/harmony/super.js

Issue 1238743002: [turbofan] Implement super call support in TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_turbofan-super-2
Patch Set: Revert "Addressed comments." Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/super.js
diff --git a/test/mjsunit/harmony/super.js b/test/mjsunit/harmony/super.js
index 21b31d96c9b9bcac827f5c9a11e8f80f7050a164..270c159e80b22a1c9b1389e76d8d1262068205c2 100644
--- a/test/mjsunit/harmony/super.js
+++ b/test/mjsunit/harmony/super.js
@@ -2181,6 +2181,47 @@ TestKeyedSetterCreatingOwnPropertiesNonConfigurable(42, 43, 44);
})();
+(function TestSuperCallInLoop() {
+ 'use strict';
+ class Base {
+ constructor(x) {
+ this.x = x;
+ }
+ }
+ class Derived extends Base {
+ constructor(x, n) {
+ for (var i = 0; i < n; ++i) {
+ super(x);
+ }
+ }
+ }
+
+ let o = new Derived(23, 1);
+ assertEquals(23, o.x);
+ assertInstanceof(o, Derived);
+
+ assertThrows("new Derived(42, 0)", ReferenceError);
+ assertThrows("new Derived(65, 2)", ReferenceError);
+})();
+
+
+(function TestSuperCallReentrant() {
+ 'use strict';
+ class Base {
+ constructor(fun) {
+ this.x = fun();
+ }
+ }
+ class Derived extends Base {
+ constructor(x) {
+ let f = () => super(() => x)
+ super(f);
+ }
+ }
+ assertThrows("new Derived(23)", ReferenceError);
+})();
+
+
(function TestSuperCallSpreadInEval() {
'use strict';
class Base {
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698