Chromium Code Reviews| Index: src/messages.js |
| diff --git a/src/messages.js b/src/messages.js |
| index b819724a1034957e0422da4deb6fd8176db5140f..8c1457a09107ea90b5a1f0ae71d0fa34d290b0c4 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 |
| + * Returns contents of sourceURL comment if available and script starts at zero, |
|
yurys
2012/09/20 15:22:29
I'd rephrase it a bit: "If sourceURL comment is av
|
| + * script name otherwise. 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 |