diff --git a/es2panda/compiler/core/function.cpp b/es2panda/compiler/core/function.cpp index b9a4bce84f25fb5ddf8ee00fc4d97bebd9ee837a..5fb0ba8c80c2b443d71c729f8344cf7893bcf070 100644 --- a/es2panda/compiler/core/function.cpp +++ b/es2panda/compiler/core/function.cpp @@ -156,7 +156,9 @@ static void CompileFunction(PandaGen *pg) pg->StoreAccToLexEnv(pg->RootNode(), funcParamScope->Find(funcParamScope->NameVar()->Name()), true); } + pg->SetSourceLocationFlag(lexer::SourceLocationFlag::INVALID_SOURCE_LOCATION); pg->FunctionEnter(); + pg->SetSourceLocationFlag(lexer::SourceLocationFlag::VALID_SOURCE_LOCATION); CompileFunctionParameterDeclaration(pg, decl); const ir::AstNode *body = decl->Body();