mirror of https://github.com/tc39/test262.git
fixup! Add tests for MethodDefinition forms new to ES6
Update test according to latest change to ES6 spec: https://twitter.com/awbjs/status/603251578070552576
This commit is contained in:
parent
30a4a5da7d
commit
b2a62444fc
|
@ -3,26 +3,16 @@
|
|||
|
||||
/*---
|
||||
description: >
|
||||
When the `yield` keyword occurs within the Initializer of a
|
||||
SingleNameBinding witihn the FormalParameters of a GeneratorMethod, it
|
||||
behaves as a YieldExpression.
|
||||
The Initializer of a SingleNameBinding witihn the FormalParameters of a
|
||||
GeneratorMethod may not contain the `yield` keyword.
|
||||
es6id: 14.4
|
||||
features: [generators]
|
||||
flags: [noStrict]
|
||||
negative: SyntaxError
|
||||
---*/
|
||||
|
||||
var yield = 'defaultViaIdentifier';
|
||||
var obj;
|
||||
var iter = (function*() {
|
||||
obj = {
|
||||
*method(x = yield) {
|
||||
return x;
|
||||
}
|
||||
};
|
||||
}());
|
||||
|
||||
iter.next();
|
||||
|
||||
iter.next('defaultViaExpression');
|
||||
|
||||
assert.sameValue(obj.method().next(), 'defaultViaExpression');
|
||||
(function*() {
|
||||
({
|
||||
*method(x = yield) {}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue