summaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/compiler/test-run-jsexceptions.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/cctest/compiler/test-run-jsexceptions.cc')
-rw-r--r--deps/v8/test/cctest/compiler/test-run-jsexceptions.cc43
1 files changed, 12 insertions, 31 deletions
diff --git a/deps/v8/test/cctest/compiler/test-run-jsexceptions.cc b/deps/v8/test/cctest/compiler/test-run-jsexceptions.cc
index 2e2e10e9de..0e1977b720 100644
--- a/deps/v8/test/cctest/compiler/test-run-jsexceptions.cc
+++ b/deps/v8/test/cctest/compiler/test-run-jsexceptions.cc
@@ -10,19 +10,14 @@ using namespace v8::internal;
using namespace v8::internal::compiler;
TEST(Throw) {
- i::FLAG_turbo_exceptions = true;
FunctionTester T("(function(a,b) { if (a) { throw b; } else { return b; }})");
-// TODO(mstarzinger)
-#if 0
T.CheckThrows(T.true_value(), T.NewObject("new Error"));
-#endif
T.CheckCall(T.Val(23), T.false_value(), T.Val(23));
}
TEST(ThrowMessagePosition) {
- i::FLAG_turbo_exceptions = true;
static const char* src =
"(function(a, b) { \n"
" if (a == 1) throw 1; \n"
@@ -48,7 +43,6 @@ TEST(ThrowMessagePosition) {
TEST(ThrowMessageDirectly) {
- i::FLAG_turbo_exceptions = true;
static const char* src =
"(function(a, b) {"
" if (a) { throw b; } else { throw new Error(b); }"
@@ -56,19 +50,17 @@ TEST(ThrowMessageDirectly) {
FunctionTester T(src);
v8::Handle<v8::Message> message;
-// TODO(mstarzinger)
-#if 0
message = T.CheckThrowsReturnMessage(T.false_value(), T.Val("Wat?"));
CHECK(message->Get()->Equals(v8_str("Uncaught Error: Wat?")));
message = T.CheckThrowsReturnMessage(T.true_value(), T.Val("Kaboom!"));
CHECK(message->Get()->Equals(v8_str("Uncaught Kaboom!")));
-#endif
}
TEST(ThrowMessageIndirectly) {
- i::FLAG_turbo_exceptions = true;
+ i::FLAG_turbo_try_catch = true;
+ i::FLAG_turbo_try_finally = true;
static const char* src =
"(function(a, b) {"
" try {"
@@ -80,23 +72,16 @@ TEST(ThrowMessageIndirectly) {
FunctionTester T(src);
v8::Handle<v8::Message> message;
-// TODO(mstarzinger)
-#if 0
message = T.CheckThrowsReturnMessage(T.false_value(), T.Val("Wat?"));
CHECK(message->Get()->Equals(v8_str("Uncaught Error: Wat?")));
message = T.CheckThrowsReturnMessage(T.true_value(), T.Val("Kaboom!"));
CHECK(message->Get()->Equals(v8_str("Uncaught Kaboom!")));
-#endif
}
-// TODO(mstarzinger): Increase test coverage by having similar tests within the
-// mjsunit suite to also test integration with other components (e.g. OSR).
-
-
TEST(Catch) {
- i::FLAG_turbo_exceptions = true;
+ i::FLAG_turbo_try_catch = true;
const char* src =
"(function(a,b) {"
" var r = '-';"
@@ -115,7 +100,7 @@ TEST(Catch) {
TEST(CatchNested) {
- i::FLAG_turbo_exceptions = true;
+ i::FLAG_turbo_try_catch = true;
const char* src =
"(function(a,b) {"
" var r = '-';"
@@ -139,7 +124,7 @@ TEST(CatchNested) {
TEST(CatchBreak) {
- i::FLAG_turbo_exceptions = true;
+ i::FLAG_turbo_try_catch = true;
const char* src =
"(function(a,b) {"
" var r = '-';"
@@ -164,7 +149,7 @@ TEST(CatchBreak) {
TEST(CatchCall) {
- i::FLAG_turbo_exceptions = true;
+ i::FLAG_turbo_try_catch = true;
const char* src =
"(function(fun) {"
" var r = '-';"
@@ -186,7 +171,7 @@ TEST(CatchCall) {
TEST(Finally) {
- i::FLAG_turbo_exceptions = true;
+ i::FLAG_turbo_try_finally = true;
const char* src =
"(function(a,b) {"
" var r = '-';"
@@ -204,7 +189,7 @@ TEST(Finally) {
TEST(FinallyBreak) {
- i::FLAG_turbo_exceptions = true;
+ i::FLAG_turbo_try_finally = true;
const char* src =
"(function(a,b) {"
" var r = '-';"
@@ -228,8 +213,7 @@ TEST(FinallyBreak) {
TEST(DeoptTry) {
- i::FLAG_turbo_exceptions = true;
- i::FLAG_turbo_deoptimization = true;
+ i::FLAG_turbo_try_catch = true;
const char* src =
"(function f(a) {"
" try {"
@@ -246,8 +230,7 @@ TEST(DeoptTry) {
TEST(DeoptCatch) {
- i::FLAG_turbo_exceptions = true;
- i::FLAG_turbo_deoptimization = true;
+ i::FLAG_turbo_try_catch = true;
const char* src =
"(function f(a) {"
" try {"
@@ -264,8 +247,7 @@ TEST(DeoptCatch) {
TEST(DeoptFinallyReturn) {
- i::FLAG_turbo_exceptions = true;
- i::FLAG_turbo_deoptimization = true;
+ i::FLAG_turbo_try_finally = true;
const char* src =
"(function f(a) {"
" try {"
@@ -282,8 +264,7 @@ TEST(DeoptFinallyReturn) {
TEST(DeoptFinallyReThrow) {
- i::FLAG_turbo_exceptions = true;
- i::FLAG_turbo_deoptimization = true;
+ i::FLAG_turbo_try_finally = true;
const char* src =
"(function f(a) {"
" try {"