Hide debugger enabled from public use.

Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg 2021-11-19 07:23:24 +00:00 committed by Hyukwoo Park
commit d79eb6f9e1
12 changed files with 72 additions and 51 deletions

View file

@ -418,7 +418,7 @@ ScriptParser::InitializeScriptResult ScriptParser::initializeScript(String* sour
{
ASSERT(m_context->astAllocator().isInitialized());
#ifdef ESCARGOT_DEBUGGER
if (LIKELY(needByteCodeGeneration) && m_context->debugger() != nullptr && m_context->debugger()->enabled()) {
if (LIKELY(needByteCodeGeneration) && m_context->debugger() != nullptr) {
return initializeScriptWithDebugger(source, srcName, parentCodeBlock, isModule, isEvalMode, isEvalCodeInFunction, inWithOperation, strictFromOutside, allowSuperCall, allowSuperProperty, allowNewTarget);
}
#endif /* ESCARGOT_DEBUGGER */
@ -644,14 +644,14 @@ ScriptParser::InitializeScriptResult ScriptParser::initializeScriptWithDebugger(
// Generate ByteCode
topCodeBlock->m_byteCodeBlock = ByteCodeGenerator::generateByteCode(m_context, topCodeBlock, programNode, inWith);
if (m_context->debugger() != nullptr && m_context->debugger()->enabled()) {
if (m_context->debugger() != nullptr) {
m_context->debugger()->storeCodeBlockInfo(topCodeBlock);
}
// reset ASTAllocator
m_context->astAllocator().reset();
if (m_context->debugger() != nullptr && m_context->debugger()->enabled()) {
if (m_context->debugger() != nullptr) {
recursivelyGenerateChildrenByteCode(topCodeBlock);
m_context->debugger()->endParsing();