| 1 |
// Copyright (C) 2014 the V8 project authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
/*--- |
| 4 |
es6id: 12.2.5 |
| 5 |
description: > |
| 6 |
computed property names can be used as the name of a generator method in a class |
| 7 |
includes: [compareArray.js] |
| 8 |
---*/ |
| 9 |
class C { |
| 10 |
*['a']() { |
| 11 |
yield 1; |
| 12 |
yield 2; |
| 13 |
} |
| 14 |
} |
| 15 |
assert.sameValue( |
| 16 |
Object.keys(C.prototype).length, |
| 17 |
0, |
| 18 |
"The value of `Object.keys(C.prototype).length` is `0`" |
| 19 |
); |
| 20 |
assert( |
| 21 |
compareArray(Object.getOwnPropertyNames(C.prototype), ['constructor', 'a']), |
| 22 |
"`compareArray(Object.getOwnPropertyNames(C.prototype), ['constructor', 'a'])` returns `true`" |
| 23 |
); |