@@ -1371,6 +1371,7 @@ module TypeScript.Parser {
1371
1371
}
1372
1372
1373
1373
function parseFunctionDeclarationWorker ( modifiers : ISyntaxToken [ ] , functionKeyword : ISyntaxToken , asteriskToken : ISyntaxToken ) : FunctionDeclarationSyntax {
1374
+ // FunctionDeclaration[Yield, Default] : // function BindingIdentifier[?Yield] ( FormalParameters ) { FunctionBody }
1374
1375
// GeneratorDeclaration[Yield, Default] :
1375
1376
// function * BindingIdentifier[?Yield](FormalParameters[Yield, GeneratorParameter]) { GeneratorBody[Yield] }
1376
1377
@@ -3136,17 +3137,14 @@ module TypeScript.Parser {
3136
3137
var _currentToken = currentToken ( ) ;
3137
3138
// Debug.assert(currentToken.kind === SyntaxKind.OpenParenToken || currentToken.kind === SyntaxKind.LessThanToken);
3138
3139
3139
- // Note: ES6 specifies the formal parametes of an arrow function like this:
3140
- //
3141
- // ArrowFormalParameters[Yield, GeneratorParameter] :
3142
- // (StrictFormalParameters[?Yield, ?GeneratorParameter])
3143
- //
3144
- // However, the 'GeneratorParameter' portion appears to be a spec bug. There does not
3145
- // appear to be any way for that value to be passed in through any grammar constructs.
3146
- //
3147
- // [Yield], on the other hand, is available, and is passed through.
3148
-
3149
- var callSignature = parseCallSignature ( /*requireCompleteTypeParameterList:*/ true , /*yield:*/ inYieldContext ( ) , /*generatorParameter:*/ false ) ;
3140
+ // From the static semantic section:
3141
+ // 1.If the [Yield] grammar parameter is present for CoverParenthesizedExpressionAndArrowParameterList[Yield]
3142
+ // return the result of parsing the lexical token stream matched by CoverParenthesizedExpressionAndArrowParameterList[Yield]
3143
+ // using ArrowFormalParameters[Yield, GeneratorParameter] as the goal symbol.
3144
+ // 2.If the [Yield] grammar parameter is not present for CoverParenthesizedExpressionAndArrowParameterList[Yield]
3145
+ // return the result of parsing the lexical token stream matched by CoverParenthesizedExpressionAndArrowParameterList
3146
+ // using ArrowFormalParameters as the goal symbol.
3147
+ var callSignature = parseCallSignature ( /*requireCompleteTypeParameterList:*/ true , /*yield:*/ inYieldContext ( ) , /*generatorParameter:*/ inYieldContext ( ) ) ;
3150
3148
3151
3149
if ( requireArrow && currentToken ( ) . kind !== SyntaxKind . EqualsGreaterThanToken ) {
3152
3150
return undefined ;
0 commit comments