diff --git a/tooling/test/testcases/js/exception.js b/tooling/test/testcases/js/exception.js index 7ce3ec2019cd784c377c33fae756de3ecda98098..9370b249b8846ef89f49b49f8f940856cb68683e 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 4437995ae7a638e8276ca1e87811ef3df24c2fd9..51b82854ebd58b3eeb4591aefe8cb1fa0cc869ac 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 6665191b4428820dc27115fbd5400c56c48a0bc4..899ab23097303126bb9188d4efff35f612aa16f7 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 88a9aa69c8914675fe787e44cc77cf0731ebbb2c..6d2b9f0d157f3ddf7270162392253a884aaf39a4 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 c7d8f4989b8c8b7357638bffe673e2fc9a8f1428..9c4a4b4b6ee1b8f5e7514f11e88ab6e648c08054 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 87dab1353d9730f90f12e72264dbba5f17db207f..2207b25d2a3fc1a73941c555340ea55e3ae8861b 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 b0b35a052bf3a61e61c39bb346414af3a83b2427..2f2038d0bc9f12d417b0942fc2290a309118550c 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 2ab925d11d05e50ed86e808a296dc077b21930b8..d311c1cec196cc297ab975040d9d8960b427ed13 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"<