Reviewers: Yang,

Message:
Yang, please take a look.

Description:
[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.

BUG=3920
LOG=Y
[email protected]

Please review this at https://codereview.chromium.org/1044173002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+4, -9 lines):
  M src/messages.js
  M test/cctest/test-api.cc


Index: src/messages.js
diff --git a/src/messages.js b/src/messages.js
index 672fd4b8100fa26b499d983ab0d06a379d435793..fffc91d096ec96d9ead9f54987e349449366ee90 100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -589,8 +589,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.
@@ -599,12 +599,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;
 }

Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 5edbda777cb49473185e3bcdedf28338be0be0eb..9896c06972072ee63ca8560a6eb8f587cc293490 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -15699,7 +15699,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();


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to