From 83046d5280483c7dca9a373381ca733fc537e747 Mon Sep 17 00:00:00 2001 From: openharmony_ci <120357966@qq.com> Date: Thu, 7 Mar 2024 03:37:49 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!564=20:?= =?UTF-8?q?=20ark=5Fjs=5Fvm=E8=84=9A=E6=9C=AC=E6=8A=9B=E5=87=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=97=B6=E8=BF=94=E5=9B=9E=E5=A4=B1=E8=B4=A5'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tooling/test/testcases/js/exception.js | 8 ++------ tooling/test/testcases/js/range_error.js | 10 +++------- tooling/test/testcases/js/syntax_exception.js | 11 +++-------- tooling/test/testcases/js/throw_exception.js | 12 +++++------- tooling/test/testcases/js_exception_test.h | 4 ++-- tooling/test/testcases/js_range_error_test.h | 8 ++++---- tooling/test/testcases/js_syntax_exception_test.h | 8 ++++---- tooling/test/testcases/js_throw_exception_test.h | 8 ++++---- 8 files changed, 27 insertions(+), 42 deletions(-) diff --git a/tooling/test/testcases/js/exception.js b/tooling/test/testcases/js/exception.js index 7ce3ec20..9370b249 100644 --- a/tooling/test/testcases/js/exception.js +++ b/tooling/test/testcases/js/exception.js @@ -20,9 +20,5 @@ function exception_func() { } print("exception test begin") -try { - exception_func() -} catch (e) { - print("exception test ok") -} -print("exception test end") \ No newline at end of file +exception_func() +print("exception test end") diff --git a/tooling/test/testcases/js/range_error.js b/tooling/test/testcases/js/range_error.js index 4437995a..51b82854 100644 --- a/tooling/test/testcases/js/range_error.js +++ b/tooling/test/testcases/js/range_error.js @@ -17,10 +17,6 @@ function rangeErrorException() { let a = new Array(-1); } -print("rangeError test begin") -try { - rangeErrorException() -} catch (e) { - print("rangeError test ok") -} -print("rangeError test end") \ No newline at end of file +print("begin"); +rangeErrorException(); +print("end"); \ No newline at end of file diff --git a/tooling/test/testcases/js/syntax_exception.js b/tooling/test/testcases/js/syntax_exception.js index 6665191b..899ab230 100644 --- a/tooling/test/testcases/js/syntax_exception.js +++ b/tooling/test/testcases/js/syntax_exception.js @@ -24,11 +24,6 @@ function countSyntaxException() { } return sum; } - -print("SyntaxException test begin") -try { - countSyntaxException() -} catch (e) { - print("SyntaxException test ok") -} -print("SyntaxException test end") \ No newline at end of file +print("begin"); +countSyntaxException(); +print("end"); \ No newline at end of file diff --git a/tooling/test/testcases/js/throw_exception.js b/tooling/test/testcases/js/throw_exception.js index 88a9aa69..6d2b9f0d 100644 --- a/tooling/test/testcases/js/throw_exception.js +++ b/tooling/test/testcases/js/throw_exception.js @@ -26,11 +26,9 @@ function countThrowException() { } return sum; } +print("begin"); +print(countThrowException()); +print("end"); + + -print("ThrowException test begin") -try { - countThrowException() -} catch (e) { - print("ThrowException test ok") -} -print("ThrowException test end") \ No newline at end of file diff --git a/tooling/test/testcases/js_exception_test.h b/tooling/test/testcases/js_exception_test.h index c7d8f498..9c4a4b4b 100644 --- a/tooling/test/testcases/js_exception_test.h +++ b/tooling/test/testcases/js_exception_test.h @@ -35,7 +35,7 @@ public: // break on start {SocketAction::RECV, "Debugger.paused", ActionRule::STRING_CONTAIN}, // set first breakpoint - {SocketAction::SEND, "b " DEBUGGER_JS_DIR "exception.js 24"}, + {SocketAction::SEND, "b " DEBUGGER_JS_DIR "exception.js 23"}, {SocketAction::RECV, "", ActionRule::CUSTOM_RULE, MatchRule::replySuccess}, // hit breakpoint after resume first time @@ -66,7 +66,7 @@ public: std::string breakpoint; breakpoint = hitBreakpoints->Get(0)->GetString(); if (ret != Result::SUCCESS || breakpoint.find(sourceFile_) == std::string::npos || - breakpoint.find("23") == std::string::npos) { + breakpoint.find("22") == std::string::npos) { return false; } diff --git a/tooling/test/testcases/js_range_error_test.h b/tooling/test/testcases/js_range_error_test.h index 87dab135..2207b25d 100644 --- a/tooling/test/testcases/js_range_error_test.h +++ b/tooling/test/testcases/js_range_error_test.h @@ -32,8 +32,8 @@ public: ASSERT_TRUE(callFrames.size() > 0); auto jsLocation = callFrames[0]->GetLocation(); ASSERT_TRUE(jsLocation != nullptr); - ASSERT_EQ(jsLocation->GetLine(), 21); // 21: breakpoint line - ASSERT_EQ(jsLocation->GetColumn(), 4); // 4: breakpoint column + ASSERT_EQ(jsLocation->GetLine(), 20); // 22: breakpoint line + ASSERT_EQ(jsLocation->GetColumn(), 0); // 0: breakpoint column TestUtil::SuspendUntilContinue(DebugEvent::BREAKPOINT, location); return true; }; @@ -56,8 +56,8 @@ public: loadModule = [this](std::string_view moduleName) { runtime_->Enable(); - // 21: breakpointer line, 4: breakpointer column - location_ = TestUtil::GetLocation(sourceFile_.c_str(), 21, 4, pandaFile_.c_str()); + // 20: breakpointer line + location_ = TestUtil::GetLocation(sourceFile_.c_str(), 20, 0, pandaFile_.c_str()); ASSERT_TRUE(location_.GetMethodId().IsValid()); TestUtil::SuspendUntilContinue(DebugEvent::LOAD_MODULE); ASSERT_EQ(moduleName, pandaFile_); diff --git a/tooling/test/testcases/js_syntax_exception_test.h b/tooling/test/testcases/js_syntax_exception_test.h index b0b35a05..2f2038d0 100644 --- a/tooling/test/testcases/js_syntax_exception_test.h +++ b/tooling/test/testcases/js_syntax_exception_test.h @@ -32,8 +32,8 @@ public: ASSERT_TRUE(callFrames.size() > 0); auto jsLocation = callFrames[0]->GetLocation(); ASSERT_TRUE(jsLocation != nullptr); - ASSERT_EQ(jsLocation->GetLine(), 29); // 29: breakpoint line - ASSERT_EQ(jsLocation->GetColumn(), 4); // 4: breakpoint column + ASSERT_EQ(jsLocation->GetLine(), 27); // 27: breakpoint line + ASSERT_EQ(jsLocation->GetColumn(), 0); // 0: breakpoint column TestUtil::SuspendUntilContinue(DebugEvent::BREAKPOINT, location); return true; }; @@ -56,8 +56,8 @@ public: loadModule = [this](std::string_view moduleName) { runtime_->Enable(); - // 29: breakpointer line, 4: breakpointer column - location_ = TestUtil::GetLocation(sourceFile_.c_str(), 29, 4, pandaFile_.c_str()); + // 27: breakpointer line + location_ = TestUtil::GetLocation(sourceFile_.c_str(), 27, 0, pandaFile_.c_str()); ASSERT_TRUE(location_.GetMethodId().IsValid()); TestUtil::SuspendUntilContinue(DebugEvent::LOAD_MODULE); ASSERT_EQ(moduleName, pandaFile_); diff --git a/tooling/test/testcases/js_throw_exception_test.h b/tooling/test/testcases/js_throw_exception_test.h index 2ab925d1..d311c1ce 100644 --- a/tooling/test/testcases/js_throw_exception_test.h +++ b/tooling/test/testcases/js_throw_exception_test.h @@ -32,8 +32,8 @@ public: ASSERT_TRUE(callFrames.size() > 0); auto jsLocation = callFrames[0]->GetLocation(); ASSERT_TRUE(jsLocation != nullptr); - ASSERT_EQ(jsLocation->GetLine(), 31); // 31: breakpoint line - ASSERT_EQ(jsLocation->GetColumn(), 4); // 4: breakpoint column + ASSERT_EQ(jsLocation->GetLine(), 28); // 28: breakpoint line + ASSERT_EQ(jsLocation->GetColumn(), 0); // 0: breakpoint column TestUtil::SuspendUntilContinue(DebugEvent::BREAKPOINT, location); return true; }; @@ -57,8 +57,8 @@ public: loadModule = [this](std::string_view moduleName) { runtime_->Enable(); - // 31: breakpointer line - location_ = TestUtil::GetLocation(sourceFile_.c_str(), 31, 0, pandaFile_.c_str()); + // 28: breakpointer line + location_ = TestUtil::GetLocation(sourceFile_.c_str(), 28, 0, pandaFile_.c_str()); std::cout<<"vmStart1"<