From c02a63e26e23f71b3da0c6e7636954f789381c78 Mon Sep 17 00:00:00 2001 From: gavin1012_hw Date: Thu, 27 Oct 2022 15:21:49 +0800 Subject: [PATCH] fixed 5afba17 from https://gitee.com/gavin1012_hw/ark_ts2abc/pulls/631 Fix watching 'this' variable failure && showing local variables in IDE for es2panda Issue: I5Y1G7 Signed-off-by: gavin1012_hw Change-Id: Ibcbad9cf911b4bbc902f0d15a96d7858dc093851 --- es2panda/binder/binder.h | 12 ++++++------ es2panda/ir/expressions/thisExpression.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/es2panda/binder/binder.h b/es2panda/binder/binder.h index 7f07e686e2..45ae663186 100644 --- a/es2panda/binder/binder.h +++ b/es2panda/binder/binder.h @@ -111,9 +111,9 @@ public: } static constexpr std::string_view FUNCTION_ARGUMENTS = "arguments"; - static constexpr std::string_view MANDATORY_PARAM_FUNC = "=f"; - static constexpr std::string_view MANDATORY_PARAM_NEW_TARGET = "=nt"; - static constexpr std::string_view MANDATORY_PARAM_THIS = "=t"; + static constexpr std::string_view MANDATORY_PARAM_FUNC = "4funcObj"; + static constexpr std::string_view MANDATORY_PARAM_NEW_TARGET = "4newTarget"; + static constexpr std::string_view MANDATORY_PARAM_THIS = "this"; static constexpr std::string_view CJS_MANDATORY_PARAM_EXPORTS = "exports"; static constexpr std::string_view CJS_MANDATORY_PARAM_REQUIRE = "require"; @@ -125,9 +125,9 @@ public: static constexpr uint32_t MANDATORY_PARAMS_NUMBER = 3; static constexpr uint32_t CJS_MANDATORY_PARAMS_NUMBER = 8; - static constexpr std::string_view LEXICAL_MANDATORY_PARAM_FUNC = "!f"; - static constexpr std::string_view LEXICAL_MANDATORY_PARAM_NEW_TARGET = "!nt"; - static constexpr std::string_view LEXICAL_MANDATORY_PARAM_THIS = "!t"; + static constexpr std::string_view LEXICAL_MANDATORY_PARAM_FUNC = "0funcObj"; + static constexpr std::string_view LEXICAL_MANDATORY_PARAM_NEW_TARGET = "0newTarget"; + static constexpr std::string_view LEXICAL_MANDATORY_PARAM_THIS = "0this"; static constexpr std::string_view MAIN_FUNC_NAME = "func_main_0"; static constexpr std::string_view ANONYMOUS_FUNC_NAME = ""; diff --git a/es2panda/ir/expressions/thisExpression.cpp b/es2panda/ir/expressions/thisExpression.cpp index 397b0bab53..95b94aa69b 100644 --- a/es2panda/ir/expressions/thisExpression.cpp +++ b/es2panda/ir/expressions/thisExpression.cpp @@ -36,7 +36,7 @@ void ThisExpression::Compile(compiler::PandaGen *pg) const ASSERT(res.variable && res.variable->IsLocalVariable()); if (pg->isDebuggerEvaluateExpressionMode()) { - pg->LoadObjByNameViaDebugger(this, "this", true); + pg->LoadObjByNameViaDebugger(this, binder::Binder::MANDATORY_PARAM_THIS, true); } else { pg->LoadAccFromLexEnv(this, res); } -- Gitee