mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-12-04 09:13:37 +00:00
!2153 FunctionPrototypeToString_bugfix
Merge pull request !2153 from 杨阳/FunctionPrototypeToString_bugfix
This commit is contained in:
commit
ce0b2b9e2d
@ -276,7 +276,11 @@ JSTaggedValue BuiltinsFunction::FunctionPrototypeToString(EcmaRuntimeCallInfo *a
|
||||
tooling::JSPtExtractor *debugExtractor =
|
||||
JSPandaFileManager::GetInstance()->GetJSPtExtractor(method->GetJSPandaFile());
|
||||
const std::string &sourceCode = debugExtractor->GetSourceCode(method->GetMethodId());
|
||||
return GetTaggedString(thread, sourceCode.c_str());
|
||||
if (!sourceCode.empty()) {
|
||||
return GetTaggedString(thread, sourceCode.c_str());
|
||||
} else {
|
||||
return GetTaggedString(thread, "Cannot get source code of funtion");
|
||||
}
|
||||
}
|
||||
|
||||
THROW_TYPE_ERROR_AND_RETURN(thread,
|
||||
|
@ -196,9 +196,15 @@ void DebugInfoExtractor::Extract(const panda_file::File *pf)
|
||||
LineNumberProgramProcessor<LineNumberProgramHandler> programProcessor(program, &handler);
|
||||
programProcessor.Process();
|
||||
|
||||
const char *sourceFile = "";
|
||||
if (state.HasFile()) {
|
||||
sourceFile = reinterpret_cast<const char *>(handler.GetFile());
|
||||
}
|
||||
const char *sourceCode = "";
|
||||
if (state.HasSourceCode()) {
|
||||
sourceCode = reinterpret_cast<const char *>(handler.GetSourceCode());
|
||||
}
|
||||
panda_file::File::EntityId methodId = mda.GetMethodId();
|
||||
const char *sourceFile = reinterpret_cast<const char *>(handler.GetFile());
|
||||
const char *sourceCode = reinterpret_cast<const char *>(handler.GetSourceCode());
|
||||
methods_.insert(std::make_pair(methodId.GetOffset(), MethodDebugInfo {sourceFile, sourceCode,
|
||||
handler.GetLineNumberTable(),
|
||||
handler.GetColumnNumberTable(),
|
||||
|
Loading…
Reference in New Issue
Block a user