From 7d9e6a6f4aa7a5d27745b86cd2c9cfef97f44249 Mon Sep 17 00:00:00 2001 From: gavin1012_hw Date: Tue, 28 Mar 2023 17:46:53 +0800 Subject: [PATCH] Fix hotreload error message Issue:I6R22Q Signed-off-by: gavin1012_hw Change-Id: I82a594a392e061a1205aec454cf9336116760811 --- es2panda/test/hotreload/modify-class-1/expected.txt | 2 +- es2panda/util/hotfix.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/es2panda/test/hotreload/modify-class-1/expected.txt b/es2panda/test/hotreload/modify-class-1/expected.txt index c2769ab6dc..2bb5987190 100644 --- a/es2panda/test/hotreload/modify-class-1/expected.txt +++ b/es2panda/test/hotreload/modify-class-1/expected.txt @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -[Patch] Found class .Model changed, not supported! +[Patch] Found class .Model changed, not supported! If .Model is not changed and you are changing UI Component, please only change one Component at a time and make sure the Component is placed at the bottom of the file. [Patch] Found unsupported change in file, will not generate patch! Error: [base_mod.js:0:0] the size of programs is expected to be 1, but is 0 diff --git a/es2panda/util/hotfix.cpp b/es2panda/util/hotfix.cpp index c2a715d8eb..306572389c 100644 --- a/es2panda/util/hotfix.cpp +++ b/es2panda/util/hotfix.cpp @@ -474,7 +474,14 @@ bool Hotfix::CompareClassHash(std::vector> &hashL auto classIter = classInfo.find(className); if (classIter != classInfo.end()) { if (classIter->second != std::to_string(hashList[i].second)) { - std::cerr << "[Patch] Found class " << hashList[i].first << " changed, not supported!" << std::endl; + if (hotReload_) { + std::cerr << "[Patch] Found class " << hashList[i].first << " changed, not supported! If " << + hashList[i].first << " is not changed and you are changing UI Component, please only " << + "change one Component at a time and make sure the Component is placed at the bottom " << + "of the file." << std::endl; + } else { + std::cerr << "[Patch] Found class " << hashList[i].first << " changed, not supported!" << std::endl; + } patchError_ = true; return false; } -- Gitee