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

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

Issue 316173002: Handle "//# sourceURL" comments in the Parser instead of the JS. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 6 years, 6 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
« src/scanner.cc ('K') | « src/vector.h ('k') | no next file » | 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 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());
}
« src/scanner.cc ('K') | « src/vector.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698