diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e3d78092282..3252c2e72f2 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7101,6 +7101,16 @@ module ts { } function checkParameter(node: ParameterDeclaration) { + // Grammar checking + // It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs as the + // Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code + // or if its FunctionBody is strict code(11.1.5). + // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a + // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) + if (!checkGrammarModifiers(node) && (node.parserContextFlags & ParserContextFlags.StrictMode && isEvalOrArgumentsIdentifier(node.name))) { + reportGrammarErrorOfInvalidUseInStrictMode(node.name); + } + checkVariableLikeDeclaration(node); var func = getContainingFunction(node); if (node.flags & (NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected)) { diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 22028913157..3f4482b0f69 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -4659,7 +4659,7 @@ module ts { case SyntaxKind.ModuleDeclaration: return checkModuleDeclaration(node); //case SyntaxKind.ObjectLiteralExpression: return checkObjectLiteralExpression(node); //case SyntaxKind.NumericLiteral: return checkNumericLiteral(node); - case SyntaxKind.Parameter: return checkParameter(node); + //case SyntaxKind.Parameter: return checkParameter(node); case SyntaxKind.PostfixUnaryExpression: return checkPostfixUnaryExpression(node); case SyntaxKind.PrefixUnaryExpression: return checkPrefixUnaryExpression(node); case SyntaxKind.PropertyDeclaration: @@ -5337,7 +5337,7 @@ module ts { case SyntaxKind.FunctionDeclaration: case SyntaxKind.TypeAliasDeclaration: case SyntaxKind.ImportDeclaration: - case SyntaxKind.Parameter: + //case SyntaxKind.Parameter: break; default: return false;