fix(57386): Invalid use of 'eval' when defining a namespaced eval function (#57391)

This commit is contained in:
Oleksandr T
2024-03-01 15:14:27 -08:00
committed by GitHub
parent 5d17aa7eb9
commit 8ada4ef44f
4 changed files with 63 additions and 1 deletions
+1 -1
View File
@@ -2563,7 +2563,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
}
function checkStrictModeFunctionName(node: FunctionLikeDeclaration) {
if (inStrictMode) {
if (inStrictMode && !(node.flags & NodeFlags.Ambient)) {
// It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a strict mode FunctionDeclaration or FunctionExpression (13.1))
checkStrictModeEvalOrArguments(node, node.name);
}