tests/auto/qml/ecmascripttests/test262/test/language/expressions/object/method-definition/generator-super-prop-param.js
raw| 1 | // Copyright 2015 Cubane Canada, Inc. All rights reserved. |
| 2 | // See LICENSE for details. |
| 3 | |
| 4 | /*--- |
| 5 | info: | |
| 6 | GeneratorMethod can reference SuperProperty in arg |
| 7 | es6id: 14.4.1 |
| 8 | author: Sam Mikes |
| 9 | description: GeneratorMethod uses SuperProperty (allowed) |
| 10 | features: [ default-arg, generators, super ] |
| 11 | ---*/ |
| 12 | |
| 13 | var obj = { |
| 14 | *foo(a = super.toString) { |
| 15 | return a; |
| 16 | } |
| 17 | }; |
| 18 | |
| 19 | obj.toString = null; |
| 20 | |
| 21 | assert.sameValue(obj.foo().next().value, Object.prototype.toString); |