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:
Mike Pennisi 2015-05-26 14:52:21 -04:00
parent 30a4a5da7d
commit b2a62444fc
1 changed files with 8 additions and 18 deletions

View File

@ -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) {}
});
});