Index: src/messages.js |
diff --git a/src/messages.js b/src/messages.js |
index b819724a1034957e0422da4deb6fd8176db5140f..ad23d8923d9f5f5ae53323658cb1af96ea95b21b 100644 |
--- a/src/messages.js |
+++ b/src/messages.js |
@@ -532,8 +532,8 @@ function ScriptLineCount() { |
/** |
- * Returns the name of script if available, contents of sourceURL comment |
- * otherwise. See |
+ * If sourceURL comment is available and script starts at zero returns sourceURL |
+ * comment contents. Otherwise, script name is returned. See |
* http://fbug.googlecode.com/svn/branches/firebug1.1/docs/ReleaseNotes_1.1.txt |
* for details on using //@ sourceURL comment to identify scritps that don't |
* have name. |
@@ -542,14 +542,15 @@ function ScriptLineCount() { |
* otherwise. |
*/ |
function ScriptNameOrSourceURL() { |
- if (this.name) { |
+ if (this.line_offset > 0 || this.column_offset > 0) { |
return this.name; |
} |
// The result is cached as on long scripts it takes noticable time to search |
// for the sourceURL. |
- if (this.hasCachedNameOrSourceURL) |
- return this.cachedNameOrSourceURL; |
+ if (this.hasCachedNameOrSourceURL) { |
+ return this.cachedNameOrSourceURL; |
+ } |
this.hasCachedNameOrSourceURL = true; |
// TODO(608): the spaces in a regexp below had to be escaped as \040 |