diff --git a/es2panda/compiler/core/function.cpp b/es2panda/compiler/core/function.cpp index 939d1740acf9659a229b3be83d95518f4fda64e2..c7258235b59506638125ec22eeac23b0fbcc778c 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();