Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 49ee96988d4f55d7477e55878d0e8cbc046baac8..357b8b2448ab77748b4b2af3ecc58e4598cae174 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -7553,6 +7553,22 @@ THREADED_TEST(ExceptionCreateMessage) { |
} |
+THREADED_TEST(ExceptionCreateMessageLength) { |
+ LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
+ |
+ // Test that the message is not truncated. |
+ TryCatch try_catch(context->GetIsolate()); |
+ CompileRun( |
+ "var message = 'm';" |
+ "while (message.length < 1000) message += message;" |
+ "throw message;"); |
+ CHECK(try_catch.HasCaught()); |
+ |
+ CHECK_LT(1000, try_catch.Message()->Get()->Length()); |
+} |
+ |
+ |
static void YGetter(Local<String> name, |
const v8::PropertyCallbackInfo<v8::Value>& info) { |
ApiTestFuzzer::Fuzz(); |