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

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

Issue 766663003: harmony-classes: Implement 'super(...)' call syntactic restriction. (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
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 5 // Flags: --harmony-classes
6 6
7 7
8 (function TestSuperNamedLoads() { 8 (function TestSuperNamedLoads() {
9 function Base() { } 9 function Base() { }
10 function Derived() { 10 function Derived() {
(...skipping 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after
1854 // we throw TypeError. 1854 // we throw TypeError.
1855 // Filed https://bugs.ecmascript.org/show_bug.cgi?id=3282 1855 // Filed https://bugs.ecmascript.org/show_bug.cgi?id=3282
1856 assertThrows(function() { new T(); }, TypeError); 1856 assertThrows(function() { new T(); }, TypeError);
1857 1857
1858 function T1() { 1858 function T1() {
1859 var b = new super(); 1859 var b = new super();
1860 } 1860 }
1861 T1.__proto = null; 1861 T1.__proto = null;
1862 assertThrows(function() { new T1(); }, TypeError); 1862 assertThrows(function() { new T1(); }, TypeError);
1863 }()); 1863 }());
1864
1865
1866 (function TestSuperCallSyntacticRestriction() {
1867 assertThrows(function() {
1868 function C() {
1869 var y;
1870 super();
1871 }
1872 new C();
1873 }, TypeError);
1874 assertThrows(function() {
1875 function C() {
1876 super(this.x);
1877 }
1878 new C();
1879 }, TypeError);
1880 assertThrows(function() {
1881 function C() {
1882 super(this);
1883 }
1884 new C();
1885 }, TypeError);
1886 assertThrows(function() {
1887 function C() {
1888 super(1, 2, Object.getPrototypeOf(this));
1889 }
1890 new C();
1891 }, TypeError);
1892
1893 function C1() {
1894 'use strict';
1895 super();
1896 };
1897 new C1();
1898
1899 function C2() {
1900 ; 'use strict';;;;;
1901 super();
1902 };
1903 new C2();
1904
1905 function C3() {
1906 ; 'use strict';;;;;
1907 // This is a comment.
1908 super();
1909 }
1910 new C3();
1911 }());
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698