Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 3ce54cf574cad7a83e3bffb9c8d3310a0d6c6720..3fd05db8f04cad9dcb667259eef7a797307f0fcc 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -17630,14 +17630,29 @@ TEST(DynamicWithSourceURLInStackTrace) { |
"\n" |
" bar();\n" |
"}\n" |
+ "%s\n" |
"foo();\n" |
"}\n" |
"outer()\n%s"; |
i::ScopedVector<char> code(1024); |
- i::OS::SNPrintF(code, source, "//# sourceURL=source_url"); |
+ i::OS::SNPrintF(code, source, "", "//# sourceURL=source_url"); |
CHECK(CompileRunWithOrigin(code.start(), "url", 0, 0)->IsUndefined()); |
- i::OS::SNPrintF(code, source, "//@ sourceURL=source_url"); |
+ i::OS::SNPrintF(code, source, "", "//@ sourceURL=source_url"); |
+ CHECK(CompileRunWithOrigin(code.start(), "url", 0, 0)->IsUndefined()); |
+ |
+ // More whitespace. |
+ i::OS::SNPrintF(code, source, "", |
+ "//# \t sourceURL \t = \t source_url\t\t "); |
+ CHECK(CompileRunWithOrigin(code.start(), "url", 0, 0)->IsUndefined()); |
+ |
+ // Two source URLs |
+ i::OS::SNPrintF(code, source, |
+ "//# sourceURL=ignore_this", "//# sourceURL=source_url"); |
+ CHECK(CompileRunWithOrigin(code.start(), "url", 0, 0)->IsUndefined()); |
+ |
+ // Source URL in the middle of the script. |
+ i::OS::SNPrintF(code, source, "//# sourceURL=source_url", ""); |
CHECK(CompileRunWithOrigin(code.start(), "url", 0, 0)->IsUndefined()); |
} |