mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Fix catch parse error when the debugger is enabled
Signed-off-by: Robert Fancsik <frobert@inf.u-szeged.hu>
This commit is contained in:
parent
4dfaec7c4a
commit
7bb5428cff
5 changed files with 32 additions and 4 deletions
|
|
@ -466,19 +466,21 @@ ScriptParser::InitializeScriptResult ScriptParser::initializeScriptWithDebugger(
|
|||
result.script = script;
|
||||
return result;
|
||||
|
||||
} catch (esprima::Error& orgError) {
|
||||
} catch (esprima::Error* orgError) {
|
||||
// reset ASTAllocator
|
||||
m_context->astAllocator().reset();
|
||||
|
||||
if (m_context->debugger() != nullptr && m_context->debugger()->enabled()) {
|
||||
m_context->debugger()->sendType(Debugger::ESCARGOT_MESSAGE_PARSE_ERROR);
|
||||
StringView* errorView = new StringView(orgError->message, 0, orgError->message->length());
|
||||
m_context->debugger()->sendString(Debugger::ESCARGOT_MESSAGE_STRING_8BIT, errorView);
|
||||
}
|
||||
|
||||
GC_enable();
|
||||
|
||||
ScriptParser::InitializeScriptResult result;
|
||||
result.parseErrorCode = orgError.errorCode;
|
||||
result.parseErrorMessage = orgError.message;
|
||||
result.parseErrorCode = orgError->errorCode;
|
||||
result.parseErrorMessage = orgError->message;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue