Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Unified Diff: test/cctest/test-api.cc

Issue 1157563005: Do not eagerly convert exception to string when creating a message object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: small change Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/messages.cc ('k') | test/mjsunit/regress/regress-crbug-490680.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 4890b80d259cbbf9293e8507f2081a8b22c3e792..20e8fffdbb67cb2183f8d1090fe5f0c14901289c 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -4932,6 +4932,26 @@ TEST(CustomErrorMessage) {
}
+static void check_custom_rethrowing_message(v8::Handle<v8::Message> message,
+ v8::Handle<v8::Value> data) {
+ const char* uncaught_error = "Uncaught exception";
+ CHECK(message->Get()->Equals(v8_str(uncaught_error)));
+}
+
+
+TEST(CustomErrorRethrowsOnToString) {
+ LocalContext context;
+ v8::HandleScope scope(context->GetIsolate());
+ v8::V8::AddMessageListener(check_custom_rethrowing_message);
+
+ CompileRun(
+ "var e = { toString: function() { throw e; } };"
+ "try { throw e; } finally {}");
+
+ v8::V8::RemoveMessageListeners(check_custom_rethrowing_message);
+}
+
+
static void receive_message(v8::Handle<v8::Message> message,
v8::Handle<v8::Value> data) {
message->Get();
« no previous file with comments | « src/messages.cc ('k') | test/mjsunit/regress/regress-crbug-490680.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698