functioncheckStrictModeEvalOrArguments(contextNode:Node, name:Node) {if (name &&name.kind ===SyntaxKind.Identifier) {let identifier = <Identifier>name;if (isEvalOrArgumentsIdentifier(identifier)) {// We check first if the name is inside class declaration or class expression; if so give explicit message// otherwise report generic error message.let span =getErrorSpanForNode(file, name);file.bindDiagnostics.push(createFileDiagnostic(file,span.start,span.length,getStrictModeEvalOrArgumentsMessage(contextNode),identifier.text)); } }}functionisEvalOrArgumentsIdentifier(node:Node):boolean {returnnode.kind ===SyntaxKind.Identifier && ((<Identifier>node).text ==="eval"|| (<Identifier>node).text ==="arguments");}functiongetStrictModeEvalOrArgumentsMessage(node:Node) {// Provide specialized messages to help the user understand why we think they're in// strict mode.if (getContainingClass(node)) {returnDiagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode; }if (file.externalModuleIndicator) {returnDiagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode; }returnDiagnostics.Invalid_use_of_0_in_strict_mode;}