| OLD | NEW |
| 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 Loading... |
| 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 }()); |
| OLD | NEW |