Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Unified Diff: src/mirror-debugger.js

Issue 1527007: Support setting brekpoint by script name set in //@ scriptURL= comment, (Closed)
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/messages.js ('k') | test/mjsunit/debug-setbreakpoint.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mirror-debugger.js
diff --git a/src/mirror-debugger.js b/src/mirror-debugger.js
index 6f8ebb4000ae71c584ef7da9cc266f4b94611bca..29d0069437967a7ec0f842fee3752f1db2891f0c 100644
--- a/src/mirror-debugger.js
+++ b/src/mirror-debugger.js
@@ -1728,8 +1728,7 @@ ScriptMirror.prototype.value = function() {
ScriptMirror.prototype.name = function() {
- // If we have name, we trust it more than sourceURL from comments
- return this.script_.name || this.sourceUrlFromComment_();
+ return this.script_.name || this.script_.nameOrSourceURL();
};
@@ -1825,29 +1824,6 @@ ScriptMirror.prototype.toText = function() {
/**
- * Returns a suggested script URL from comments in script code (if found),
- * undefined otherwise. Used primarily by debuggers for identifying eval()'ed
- * scripts. See
- * http://fbug.googlecode.com/svn/branches/firebug1.1/docs/ReleaseNotes_1.1.txt
- * for details.
- *
- * @return {?string} value for //@ sourceURL comment
- */
-ScriptMirror.prototype.sourceUrlFromComment_ = function() {
- if (!('sourceUrl_' in this) && this.source()) {
- // TODO(608): the spaces in a regexp below had to be escaped as \040
- // because this file is being processed by js2c whose handling of spaces
- // in regexps is broken.
- // We're not using \s here to prevent \n from matching.
- var sourceUrlPattern = /\/\/@[\040\t]sourceURL=[\040\t]*(\S+)[\040\t]*$/m;
- var match = sourceUrlPattern.exec(this.source());
- this.sourceUrl_ = match ? match[1] : undefined;
- }
- return this.sourceUrl_;
-};
-
-
-/**
* Mirror object for context.
* @param {Object} data The context data
* @constructor
« no previous file with comments | « src/messages.js ('k') | test/mjsunit/debug-setbreakpoint.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698