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

Side by Side Diff: test/mjsunit/harmony/classes.js

Issue 770843002: harmony-classes: Fix some issues with syntactic restriction on super(...). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 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/scopes.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
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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-classes --harmony-sloppy 5 // Flags: --harmony-classes --harmony-sloppy
6 6
7 (function TestBasics() { 7 (function TestBasics() {
8 var C = class C {} 8 var C = class C {}
9 assertEquals(typeof C, 'function'); 9 assertEquals(typeof C, 'function');
10 assertEquals(C.__proto__, Function.prototype); 10 assertEquals(C.__proto__, Function.prototype);
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 assertThrows(function() { 798 assertThrows(function() {
799 class C { 799 class C {
800 constructor() { 800 constructor() {
801 super(this); 801 super(this);
802 } 802 }
803 }; new C(); 803 }; new C();
804 }, TypeError); 804 }, TypeError);
805 assertThrows(function() { 805 assertThrows(function() {
806 class C { 806 class C {
807 constructor() { 807 constructor() {
808 super.method();
809 super(this);
810 }
811 }; new C();
812 }, TypeError);
813 assertThrows(function() {
814 class C {
815 constructor() {
816 super(super.method());
817 }
818 }; new C();
819 }, TypeError);
820 assertThrows(function() {
821 class C {
822 constructor() {
823 super(super());
824 }
825 }; new C();
826 }, TypeError);
827 assertThrows(function() {
828 class C {
829 constructor() {
808 super(1, 2, Object.getPrototypeOf(this)); 830 super(1, 2, Object.getPrototypeOf(this));
809 } 831 }
810 }; new C(); 832 }; new C();
811 }, TypeError); 833 }, TypeError);
812 assertThrows(function() { 834 assertThrows(function() {
813 class C { 835 class C {
814 constructor() { 836 constructor() {
815 { super(1, 2); } 837 { super(1, 2); }
816 } 838 }
817 }; new C(); 839 }; new C();
(...skipping 23 matching lines...) Expand all
841 new C2(); 863 new C2();
842 864
843 class C3 extends Object { 865 class C3 extends Object {
844 constructor() { 866 constructor() {
845 ; 'use strict';;;;; 867 ; 'use strict';;;;;
846 // This is a comment. 868 // This is a comment.
847 super(); 869 super();
848 } 870 }
849 }; 871 };
850 new C3(); 872 new C3();
873
874 class C4 extends Object {
875 constructor() {
876 super(new super());
877 }
878 }; new C4();
851 }()); 879 }());
OLDNEW
« no previous file with comments | « src/scopes.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698