mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-22 22:55:36 -05:00
Move grammar checking: wihtStatement; there are still errors from incomplete grammar migration
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user