Move grammar checking: wihtStatement; there are still errors from incomplete grammar migration
This commit is contained in:
parent
5d91394713
commit
896f172d72
2 changed files with 7 additions and 2 deletions
|
@ -8171,7 +8171,12 @@ module ts {
|
|||
}
|
||||
|
||||
function checkWithStatement(node: WithStatement) {
|
||||
// Grammar checking
|
||||
// Grammar checking for withStatement
|
||||
if (node.parserContextFlags & ParserContextFlags.StrictMode) {
|
||||
grammarErrorOnFirstToken(node, Diagnostics.with_statements_are_not_allowed_in_strict_mode);
|
||||
}
|
||||
|
||||
// Grammar checking for invalid use of return statement
|
||||
if (node.statement.kind === SyntaxKind.ReturnStatement) {
|
||||
// Grammar check for invalid use of return statement
|
||||
grammarErrorOnFirstToken(node.statement, Diagnostics.A_return_statement_can_only_be_used_within_a_function_body);
|
||||
|
|
|
@ -4675,7 +4675,7 @@ module ts {
|
|||
//case SyntaxKind.TypeReference: return checkTypeReference(<TypeReferenceNode>node);
|
||||
case SyntaxKind.VariableDeclaration: return checkVariableDeclaration(<VariableDeclaration>node);
|
||||
case SyntaxKind.VariableStatement: return checkVariableStatement(<VariableStatement>node);
|
||||
case SyntaxKind.WithStatement: return checkWithStatement(<WithStatement>node);
|
||||
//case SyntaxKind.WithStatement: return checkWithStatement(<WithStatement>node);
|
||||
case SyntaxKind.YieldExpression: return checkYieldExpression(<YieldExpression>node);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue