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 | 5 // Flags: --harmony |
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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 assertEquals('class E { x() { 42; } }', E.toString()); | 165 assertEquals('class E { x() { 42; } }', E.toString()); |
166 })(); | 166 })(); |
167 | 167 |
168 | 168 |
169 function assertMethodDescriptor(object, name) { | 169 function assertMethodDescriptor(object, name) { |
170 var descr = Object.getOwnPropertyDescriptor(object, name); | 170 var descr = Object.getOwnPropertyDescriptor(object, name); |
171 assertTrue(descr.configurable); | 171 assertTrue(descr.configurable); |
172 assertTrue(descr.enumerable); | 172 assertTrue(descr.enumerable); |
173 assertTrue(descr.writable); | 173 assertTrue(descr.writable); |
174 assertEquals('function', typeof descr.value); | 174 assertEquals('function', typeof descr.value); |
| 175 assertFalse('prototype' in descr.value); |
175 } | 176 } |
176 | 177 |
177 function assertGetterDescriptor(object, name) { | 178 function assertGetterDescriptor(object, name) { |
178 var descr = Object.getOwnPropertyDescriptor(object, name); | 179 var descr = Object.getOwnPropertyDescriptor(object, name); |
179 assertTrue(descr.configurable); | 180 assertTrue(descr.configurable); |
180 assertTrue(descr.enumerable); | 181 assertTrue(descr.enumerable); |
181 assertEquals('function', typeof descr.get); | 182 assertEquals('function', typeof descr.get); |
182 assertEquals(undefined, descr.set); | 183 assertEquals(undefined, descr.set); |
183 } | 184 } |
184 | 185 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 class C { | 393 class C { |
393 constructor() { | 394 constructor() { |
394 assertThrows(function() { | 395 assertThrows(function() { |
395 C = 42; | 396 C = 42; |
396 }, ReferenceError); | 397 }, ReferenceError); |
397 } | 398 } |
398 } | 399 } |
399 new C(); | 400 new C(); |
400 })(); | 401 })(); |
401 */ | 402 */ |
OLD | NEW |