Skip to content

Commit

Permalink
Removed support deprecated (//@|/*@) source(URL|MappingURL)=
Browse files Browse the repository at this point in the history
LOG=Y
BUG=chromium:558998
R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#32249}
  • Loading branch information
alexkozy authored and Commit bot committed Nov 25, 2015
1 parent 9564ffe commit c1e5f00
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 31 deletions.
3 changes: 1 addition & 2 deletions include/v8.h
Expand Up @@ -1604,8 +1604,7 @@ 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 or
* deprecated //@ sourceURL=... string.
* is undefined and its source ends with //# sourceURL=... string.
*/
Local<String> GetScriptNameOrSourceURL() const;

Expand Down
7 changes: 3 additions & 4 deletions src/js/messages.js
Expand Up @@ -448,11 +448,10 @@ 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 and
* deprecated //@ sourceURL comment to identify scripts that don't have name.
* and Source Map Revision 3 proposal for details on using //# sourceURL
* comment to identify scripts that don't have name.
*
* @return {?string} script name if present, value for //# sourceURL or
* deprecated //@ sourceURL comment otherwise.
* @return {?string} script name if present, value for //# sourceURL comment.
*/
function ScriptNameOrSourceURL() {
if (this.source_url) return this.source_url;
Expand Down
4 changes: 2 additions & 2 deletions src/scanner.cc
Expand Up @@ -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();
Expand Down Expand Up @@ -574,7 +574,7 @@ void Scanner::Scan() {
Advance();
if (c0_ == '/') {
Advance();
if (c0_ == '@' || c0_ == '#') {
if (c0_ == '#') {
Advance();
token = SkipSourceURLComment();
} else {
Expand Down
6 changes: 0 additions & 6 deletions test/cctest/test-api.cc
Expand Up @@ -15321,8 +15321,6 @@ 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());
}


Expand Down Expand Up @@ -15404,8 +15402,6 @@ 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());
}


Expand Down Expand Up @@ -15450,8 +15446,6 @@ 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());
}


Expand Down
6 changes: 3 additions & 3 deletions test/mjsunit/regress/regress-conditional-position.js
Expand Up @@ -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);
Expand Down
20 changes: 10 additions & 10 deletions test/mjsunit/regress/regress-crbug-109362.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions test/mjsunit/regress/regress-crbug-481896.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/mjsunit/regress/regress-crbug-517592.js
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/mjsunit/stack-traces.js
Expand Up @@ -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");
}

Expand Down

0 comments on commit c1e5f00

Please sign in to comment.