Index: test/cctest/compiler/test-run-jsexceptions.cc |
diff --git a/test/cctest/compiler/test-run-jsexceptions.cc b/test/cctest/compiler/test-run-jsexceptions.cc |
index 2ba8fdfcc8fc16a5cfd0a9d5f6d5c48519fb0f33..852cf2fa1b0a376d6c8fb5bfa7257c0fd92d3004 100644 |
--- a/test/cctest/compiler/test-run-jsexceptions.cc |
+++ b/test/cctest/compiler/test-run-jsexceptions.cc |
@@ -2,6 +2,9 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+// TODO(jochen): Remove this after the setting is turned on globally. |
+#define V8_IMMINENT_DEPRECATION_WARNINGS |
+ |
#include "src/v8.h" |
#include "test/cctest/compiler/function-tester.h" |
@@ -26,18 +29,19 @@ TEST(ThrowMessagePosition) { |
" throw 4; \n" |
"}) "; |
FunctionTester T(src); |
- v8::Handle<v8::Message> message; |
+ v8::Local<v8::Message> message; |
+ v8::Local<v8::Context> context = CcTest::isolate()->GetCurrentContext(); |
message = T.CheckThrowsReturnMessage(T.Val(1), T.undefined()); |
- CHECK_EQ(2, message->GetLineNumber()); |
+ CHECK_EQ(2, message->GetLineNumber(context).FromMaybe(-1)); |
CHECK_EQ(40, message->GetStartPosition()); |
message = T.CheckThrowsReturnMessage(T.Val(2), T.undefined()); |
- CHECK_EQ(3, message->GetLineNumber()); |
+ CHECK_EQ(3, message->GetLineNumber(context).FromMaybe(-1)); |
CHECK_EQ(67, message->GetStartPosition()); |
message = T.CheckThrowsReturnMessage(T.Val(3), T.undefined()); |
- CHECK_EQ(4, message->GetLineNumber()); |
+ CHECK_EQ(4, message->GetLineNumber(context).FromMaybe(-1)); |
CHECK_EQ(95, message->GetStartPosition()); |
} |
@@ -48,13 +52,15 @@ TEST(ThrowMessageDirectly) { |
" if (a) { throw b; } else { throw new Error(b); }" |
"})"; |
FunctionTester T(src); |
- v8::Handle<v8::Message> message; |
+ v8::Local<v8::Message> message; |
+ v8::Local<v8::Context> context = CcTest::isolate()->GetCurrentContext(); |
+ v8::Maybe<bool> t = v8::Just(true); |
message = T.CheckThrowsReturnMessage(T.false_value(), T.Val("Wat?")); |
- CHECK(message->Get()->Equals(v8_str("Uncaught Error: Wat?"))); |
+ CHECK(t == message->Get()->Equals(context, v8_str("Uncaught Error: Wat?"))); |
message = T.CheckThrowsReturnMessage(T.true_value(), T.Val("Kaboom!")); |
- CHECK(message->Get()->Equals(v8_str("Uncaught Kaboom!"))); |
+ CHECK(t == message->Get()->Equals(context, v8_str("Uncaught Kaboom!"))); |
} |
@@ -69,13 +75,15 @@ TEST(ThrowMessageIndirectly) { |
" }" |
"})"; |
FunctionTester T(src); |
- v8::Handle<v8::Message> message; |
+ v8::Local<v8::Message> message; |
+ v8::Local<v8::Context> context = CcTest::isolate()->GetCurrentContext(); |
+ v8::Maybe<bool> t = v8::Just(true); |
message = T.CheckThrowsReturnMessage(T.false_value(), T.Val("Wat?")); |
- CHECK(message->Get()->Equals(v8_str("Uncaught Error: Wat?"))); |
+ CHECK(t == message->Get()->Equals(context, v8_str("Uncaught Error: Wat?"))); |
message = T.CheckThrowsReturnMessage(T.true_value(), T.Val("Kaboom!")); |
- CHECK(message->Get()->Equals(v8_str("Uncaught Kaboom!"))); |
+ CHECK(t == message->Get()->Equals(context, v8_str("Uncaught Kaboom!"))); |
} |