Parse parameters inside function's env (#652)
* Parse parameters inside function context * Add test for new.target inside parameters
This commit is contained in:
committed by
Daniel Tschinder
parent
fee7de2c1d
commit
cd050e1405
@@ -779,7 +779,9 @@ export default class StatementParser extends ExpressionParser {
|
||||
isAsync?: boolean,
|
||||
optionalId?: boolean,
|
||||
): T {
|
||||
const oldInFunc = this.state.inFunction;
|
||||
const oldInMethod = this.state.inMethod;
|
||||
this.state.inFunction = true;
|
||||
this.state.inMethod = false;
|
||||
|
||||
this.initFunction(node, isAsync);
|
||||
@@ -811,6 +813,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
isStatement ? "FunctionDeclaration" : "FunctionExpression",
|
||||
allowExpressionBody,
|
||||
);
|
||||
this.state.inFunction = oldInFunc;
|
||||
this.state.inMethod = oldInMethod;
|
||||
return node;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user