[V8] Don't ignore sourceURL comment in inline scripts in .stack
In DevTools we've already used sourceURL in inline scripts. This CL makes the behavior of the V8 in the same for Error.stack property and v8::StackTrace. BUG=v8:3920 LOG=Y R=yangguo@chromium.org Review URL: https://codereview.chromium.org/1044173002 Cr-Commit-Position: refs/heads/master@{#27554}
This commit is contained in:
parent
5b76043481
commit
9f6b1333a1
@ -588,8 +588,8 @@ function ScriptLineCount() {
|
||||
|
||||
|
||||
/**
|
||||
* If sourceURL comment is available and script starts at zero returns sourceURL
|
||||
* comment contents. Otherwise, script name is returned. See
|
||||
* 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.
|
||||
@ -598,12 +598,7 @@ function ScriptLineCount() {
|
||||
* deprecated //@ sourceURL comment otherwise.
|
||||
*/
|
||||
function ScriptNameOrSourceURL() {
|
||||
if (this.line_offset > 0 || this.column_offset > 0) {
|
||||
return this.name;
|
||||
}
|
||||
if (this.source_url) {
|
||||
return this.source_url;
|
||||
}
|
||||
if (this.source_url) return this.source_url;
|
||||
return this.name;
|
||||
}
|
||||
|
||||
|
@ -15818,7 +15818,7 @@ void AnalyzeStackOfInlineScriptWithSourceURL(
|
||||
v8::Handle<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(
|
||||
args.GetIsolate(), 10, v8::StackTrace::kDetailed);
|
||||
CHECK_EQ(4, stackTrace->GetFrameCount());
|
||||
v8::Handle<v8::String> url = v8_str("url");
|
||||
v8::Handle<v8::String> url = v8_str("source_url");
|
||||
for (int i = 0; i < 3; i++) {
|
||||
v8::Handle<v8::String> name =
|
||||
stackTrace->GetFrame(i)->GetScriptNameOrSourceURL();
|
||||
|
Loading…
Reference in New Issue
Block a user