Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 447cd261ce9daba049a74c8cb4797641f2a246fb..3c12f651c7aa2ca254764f74327ec3b2bff4394c 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -17520,6 +17520,29 @@ TEST(DynamicWithSourceURLInStackTrace) { |
} |
+TEST(DynamicWithSourceURLInStackTraceString) { |
+ LocalContext context; |
+ v8::HandleScope scope(context->GetIsolate()); |
+ |
+ const char *source = |
+ "function outer() {\n" |
+ " function foo() {\n" |
+ " FAIL.FAIL;\n" |
+ " }\n" |
+ " foo();\n" |
+ "}\n" |
+ "outer()\n%s"; |
+ |
+ i::ScopedVector<char> code(1024); |
+ i::OS::SNPrintF(code, source, "//# sourceURL=source_url"); |
+ v8::TryCatch try_catch; |
+ CompileRunWithOrigin(code.start(), "", 0, 0); |
+ CHECK(try_catch.HasCaught()); |
+ v8::String::Utf8Value stack(try_catch.StackTrace()); |
+ CHECK(strstr(*stack, "at foo (source_url:3:5)") != NULL); |
+} |
+ |
+ |
static void CreateGarbageInOldSpace() { |
i::Factory* factory = CcTest::i_isolate()->factory(); |
v8::HandleScope scope(CcTest::isolate()); |