Commit 1db01d6d authored by yangguo's avatar yangguo Committed by Commit bot

Revert of Removed support deprecated (//@|/*@) source(URL|MappingURL)=...

Revert of Removed support deprecated (//@|/*@) source(URL|MappingURL)= (patchset #1 id:1 of https://codereview.chromium.org/1474543005/ )

Reason for revert:
Failing layout tests:

inspector/tracing/timeline-event-causes.html
virtual/syncpaint/inspector/tracing/timeline-event-causes.html
inspector/animation/animation-timeline-fill.html
virtual/threaded/inspector/tracing/timeline-event-causes.html
inspector/tracing/timeline-script-id.html
inspector/sources/debugger-ui/source-url-comment.html
inspector/console/console-log-linkify-stack-in-errors.html
virtual/syncpaint/inspector/tracing/timeline-script-id.html
virtual/threaded/inspector/tracing/timeline-script-id.html

Original issue's description:
> Removed support deprecated (//@|/*@) source(URL|MappingURL)=
>
> LOG=Y
> BUG=chromium:558998
> R=yangguo@chromium.org
>
> Committed: https://crrev.com/c1e5f005d79c436d90f474f8bc6448c4555a619f
> Cr-Commit-Position: refs/heads/master@{#32249}

TBR=machenbach@chromium.org,kozyatinskiy@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:558998

Review URL: https://codereview.chromium.org/1481513002

Cr-Commit-Position: refs/heads/master@{#32259}
parent 13b39259
......@@ -1604,7 +1604,8 @@ class V8_EXPORT StackFrame {
/**
* Returns the name of the resource that contains the script for the
* function for this StackFrame or sourceURL value if the script name
* is undefined and its source ends with //# sourceURL=... string.
* is undefined and its source ends with //# sourceURL=... string or
* deprecated //@ sourceURL=... string.
*/
Local<String> GetScriptNameOrSourceURL() const;
......
......@@ -448,10 +448,11 @@ function ScriptLineEnd(n) {
* If sourceURL comment is available returns sourceURL comment contents.
* Otherwise, script name is returned. See
* http://fbug.googlecode.com/svn/branches/firebug1.1/docs/ReleaseNotes_1.1.txt
* and Source Map Revision 3 proposal for details on using //# sourceURL
* comment to identify scripts that don't have name.
* and Source Map Revision 3 proposal for details on using //# sourceURL and
* deprecated //@ sourceURL comment to identify scripts that don't have name.
*
* @return {?string} script name if present, value for //# sourceURL comment.
* @return {?string} script name if present, value for //# sourceURL or
* deprecated //@ sourceURL comment otherwise.
*/
function ScriptNameOrSourceURL() {
if (this.source_url) return this.source_url;
......
......@@ -356,7 +356,7 @@ Token::Value Scanner::SkipSourceURLComment() {
void Scanner::TryToParseSourceURLComment() {
// Magic comments are of the form: //[#]\s<name>=\s*<value>\s*.* and this
// Magic comments are of the form: //[#@]\s<name>=\s*<value>\s*.* and this
// function will just return if it cannot parse a magic comment.
if (c0_ < 0 || !unicode_cache_->IsWhiteSpace(c0_)) return;
Advance();
......@@ -574,7 +574,7 @@ void Scanner::Scan() {
Advance();
if (c0_ == '/') {
Advance();
if (c0_ == '#') {
if (c0_ == '@' || c0_ == '#') {
Advance();
token = SkipSourceURLComment();
} else {
......
......@@ -15321,6 +15321,8 @@ TEST(SourceURLInStackTrace) {
i::ScopedVector<char> code(1024);
i::SNPrintF(code, source, "//# sourceURL=eval_url");
CHECK(CompileRun(code.start())->IsUndefined());
i::SNPrintF(code, source, "//@ sourceURL=eval_url");
CHECK(CompileRun(code.start())->IsUndefined());
}
......@@ -15402,6 +15404,8 @@ TEST(InlineScriptWithSourceURLInStackTrace) {
i::ScopedVector<char> code(1024);
i::SNPrintF(code, source, "//# sourceURL=source_url");
CHECK(CompileRunWithOrigin(code.start(), "url", 0, 1)->IsUndefined());
i::SNPrintF(code, source, "//@ sourceURL=source_url");
CHECK(CompileRunWithOrigin(code.start(), "url", 0, 1)->IsUndefined());
}
......@@ -15446,6 +15450,8 @@ TEST(DynamicWithSourceURLInStackTrace) {
i::ScopedVector<char> code(1024);
i::SNPrintF(code, source, "//# sourceURL=source_url");
CHECK(CompileRunWithOrigin(code.start(), "url", 0, 0)->IsUndefined());
i::SNPrintF(code, source, "//@ sourceURL=source_url");
CHECK(CompileRunWithOrigin(code.start(), "url", 0, 0)->IsUndefined());
}
......
......@@ -86,9 +86,9 @@ test(test1, 58);
test(test2, 65);
test(test3, 72);
eval(test1.toString() + "//# sourceUrl=foo");
eval(test2.toString() + "//# sourceUrl=foo");
eval(test3.toString() + "//# sourceUrl=foo");
eval(test1.toString() + "//@ sourceUrl=foo");
eval(test2.toString() + "//@ sourceUrl=foo");
eval(test3.toString() + "//@ sourceUrl=foo");
test(test1, 2);
test(test2, 3);
......
......@@ -15,20 +15,20 @@ function test(expectation, f) {
/*
(function() {
1 + reference_error //# sourceURL=evaltest
1 + reference_error //@ sourceURL=evaltest
})
*/
test("2:5", new Function(
'1 + reference_error //# sourceURL=evaltest'));
'1 + reference_error //@ sourceURL=evaltest'));
/*
(function(x
/\**\/) {
1 + reference_error //# sourceURL=evaltest
1 + reference_error //@ sourceURL=evaltest
})
*/
test("4:6", new Function(
'x', '\n 1 + reference_error //# sourceURL=evaltest'));
'x', '\n 1 + reference_error //@ sourceURL=evaltest'));
/*
(function(x
......@@ -36,24 +36,24 @@ test("4:6", new Function(
,y
/\**\/) {
1 + reference_error //# sourceURL=evaltest
1 + reference_error //@ sourceURL=evaltest
})
*/
test("7:6", new Function(
'x\n\n', "z//\n", "y", '\n 1 + reference_error //# sourceURL=evaltest'));
'x\n\n', "z//\n", "y", '\n 1 + reference_error //@ sourceURL=evaltest'));
/*
(function(x/\*,z//
,y*\/
/\**\/) {
1 + reference_error //# sourceURL=evaltest
1 + reference_error //@ sourceURL=evaltest
})
*/
test("4:5", new Function(
'x/*', "z//\n", "y*/", '1 + reference_error //# sourceURL=evaltest'));
'x/*', "z//\n", "y*/", '1 + reference_error //@ sourceURL=evaltest'));
/*
(function () {
1 + reference_error //# sourceURL=evaltest5
1 + reference_error //@ sourceURL=evaltest5
})
*/
test("2:6", eval(
'(function () {\n 1 + reference_error //# sourceURL=evaltest\n})'));
'(function () {\n 1 + reference_error //@ sourceURL=evaltest\n})'));
......@@ -29,7 +29,7 @@ function install() {
eval("this.dynamic = function dynamic() { \n" +
" print(\"> dynamic\"); // Break\n" +
"}\n" +
"//# sourceURL=dynamicScript");
"//@ sourceURL=dynamicScript");
}
install();
......@@ -53,4 +53,4 @@ Debug.setListener(null);
assertNull(exception);
assertEquals(2, break_count);
//# sourceURL=staticScript
//@ sourceURL=staticScript
......@@ -8,7 +8,7 @@ var source =
"var foo = function foo() {\n" +
" return 1;\n" +
"}\n" +
"//# sourceURL=test";
"//@ sourceURL=test";
Debug = debug.Debug;
Debug.setListener(listener);
......
......@@ -69,7 +69,7 @@ function testEvalWithSourceURL() {
function testNestedEvalWithSourceURL() {
var x = "FAIL";
var innerEval = 'function Inner() { eval(x); }\n//# sourceURL=res://inner-eval';
var innerEval = 'function Inner() { eval(x); }\n//@ sourceURL=res://inner-eval';
eval("function Outer() { eval(innerEval); Inner(); }; Outer();\n//# sourceURL=res://outer-eval");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment