From a380fd0bfb9b064ad576a32f011ed0f21220e888 Mon Sep 17 00:00:00 2001 From: yanzhiqi1 Date: Thu, 15 May 2025 20:53:34 +0800 Subject: [PATCH] toolchain adapt to multi-context Issue: #IC8593 Signed-off-by: yanzhiqi1 Change-Id: Idc4b0f538f53fa251402b7249ab9b49c5b8fa730 --- tooling/agent/debugger_impl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tooling/agent/debugger_impl.cpp b/tooling/agent/debugger_impl.cpp index 3d3ff4c1..97ccc942 100755 --- a/tooling/agent/debugger_impl.cpp +++ b/tooling/agent/debugger_impl.cpp @@ -2057,15 +2057,15 @@ std::vector> DebuggerImpl::GetClosureScopeChains(const Fr thread, DebuggerApi::GetEnv(frameHandler)); JSMutableHandle valueHandle = JSMutableHandle(thread, JSTaggedValue::Hole()); JSTaggedValue currentEnv = envHandle.GetTaggedValue(); - if (!currentEnv.IsTaggedArray()) { + if (!currentEnv.IsLexicalEnv()) { LOG_DEBUGGER(DEBUG) << "GetClosureScopeChains: currentEnv is invalid"; return closureScopes; } // check if GetLocalScopeChain has already found and set 'this' value bool thisFound = (*thisObj)->HasValue(); bool closureVarFound = false; - // currentEnv = currentEnv->parent until currentEnv becomes undefined - for (; currentEnv.IsTaggedArray(); currentEnv = LexicalEnv::Cast(currentEnv.GetTaggedObject())->GetParentEnv()) { + // currentEnv = currentEnv->parent until currentEnv is not lexicalEnv + for (; currentEnv.IsLexicalEnv(); currentEnv = LexicalEnv::Cast(currentEnv.GetTaggedObject())->GetParentEnv()) { LexicalEnv *lexicalEnv = LexicalEnv::Cast(currentEnv.GetTaggedObject()); envHandle.Update(currentEnv); if (lexicalEnv->GetScopeInfo().IsHole()) { -- Gitee