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 --harmony-sloppy | 5 // Flags: --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); |
11 assertEquals(Object.prototype, Object.getPrototypeOf(C.prototype)); | 11 assertEquals(Object.prototype, Object.getPrototypeOf(C.prototype)); |
12 assertEquals(Function.prototype, Object.getPrototypeOf(C)); | 12 assertEquals(Function.prototype, Object.getPrototypeOf(C)); |
13 assertEquals('C', C.name); | 13 assertEquals('C', C.name); |
14 | 14 |
15 class D {} | 15 class D {} |
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 testClassRestrictedProperties(ClassWithDefaultConstructor); | 939 testClassRestrictedProperties(ClassWithDefaultConstructor); |
940 testClassRestrictedProperties(Class); | 940 testClassRestrictedProperties(Class); |
941 testClassRestrictedProperties(DerivedClassWithDefaultConstructor); | 941 testClassRestrictedProperties(DerivedClassWithDefaultConstructor); |
942 testClassRestrictedProperties(DerivedClass); | 942 testClassRestrictedProperties(DerivedClass); |
943 testClassRestrictedProperties(class { method() {} }); | 943 testClassRestrictedProperties(class { method() {} }); |
944 testClassRestrictedProperties(class { constructor() {} method() {} }); | 944 testClassRestrictedProperties(class { constructor() {} method() {} }); |
945 testClassRestrictedProperties(class extends Class { }); | 945 testClassRestrictedProperties(class extends Class { }); |
946 testClassRestrictedProperties( | 946 testClassRestrictedProperties( |
947 class extends Class { constructor() { super(); } }); | 947 class extends Class { constructor() { super(); } }); |
948 })(); | 948 })(); |
OLD | NEW |