2011-03-30 Pavel Podivilov <podivilov@chromium.org>
authorpodivilov@chromium.org <podivilov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Apr 2011 10:51:20 +0000 (10:51 +0000)
committerpodivilov@chromium.org <podivilov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Apr 2011 10:51:20 +0000 (10:51 +0000)
        Reviewed by Pavel Feldman.

        Web Inspector: remove dead code from Script.js.
        https://bugs.webkit.org/show_bug.cgi?id=57454

        * inspector/front-end/DebuggerModel.js:
        (WebInspector.DebuggerModel.prototype._parsedScriptSource):
        (WebInspector.DebuggerModel.prototype._failedToParseScriptSource):
        * inspector/front-end/Script.js:
        (WebInspector.Script):
        (WebInspector.Script.prototype.requestSource.didGetScriptSource):
        (WebInspector.Script.prototype.requestSource):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@82670 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/DebuggerModel.js
Source/WebCore/inspector/front-end/Script.js

index bb0e782..6e713ec 100644 (file)
@@ -1,3 +1,18 @@
+2011-03-30  Pavel Podivilov  <podivilov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: remove dead code from Script.js.
+        https://bugs.webkit.org/show_bug.cgi?id=57454
+
+        * inspector/front-end/DebuggerModel.js:
+        (WebInspector.DebuggerModel.prototype._parsedScriptSource):
+        (WebInspector.DebuggerModel.prototype._failedToParseScriptSource):
+        * inspector/front-end/Script.js:
+        (WebInspector.Script):
+        (WebInspector.Script.prototype.requestSource.didGetScriptSource):
+        (WebInspector.Script.prototype.requestSource):
+
 2011-04-01  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r82667.
 2011-04-01  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r82667.
index a70ecb1..b3f71d4 100644 (file)
@@ -182,7 +182,7 @@ WebInspector.DebuggerModel.prototype = {
     _didEditScriptSource: function(sourceID, newSource, callback, error, callFrames)
     {
         if (!error) {
     _didEditScriptSource: function(sourceID, newSource, callback, error, callFrames)
     {
         if (!error) {
-            this._scripts[sourceID].source = newSource;
+            this._scripts[sourceID]._source = newSource;
             if (callFrames && callFrames.length)
                 this._debuggerPausedDetails.callFrames = callFrames;
         }
             if (callFrames && callFrames.length)
                 this._debuggerPausedDetails.callFrames = callFrames;
         }
@@ -213,14 +213,14 @@ WebInspector.DebuggerModel.prototype = {
 
     _parsedScriptSource: function(sourceID, sourceURL, lineOffset, columnOffset, length, scriptWorldType)
     {
 
     _parsedScriptSource: function(sourceID, sourceURL, lineOffset, columnOffset, length, scriptWorldType)
     {
-        var script = new WebInspector.Script(sourceID, sourceURL, "", lineOffset, columnOffset, length, undefined, undefined, scriptWorldType);
+        var script = new WebInspector.Script(sourceID, sourceURL, lineOffset, columnOffset, length, undefined, undefined, scriptWorldType);
         this._scripts[sourceID] = script;
         this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ParsedScriptSource, script);
     },
 
     _failedToParseScriptSource: function(sourceURL, source, startingLine, errorLine, errorMessage)
     {
         this._scripts[sourceID] = script;
         this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ParsedScriptSource, script);
     },
 
     _failedToParseScriptSource: function(sourceURL, source, startingLine, errorLine, errorMessage)
     {
-        var script = new WebInspector.Script(null, sourceURL, source, startingLine, errorLine, errorMessage, undefined);
+        var script = new WebInspector.Script(null, sourceURL, startingLine, errorLine, errorMessage, undefined);
         this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, script);
     }
 }
         this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, script);
     }
 }
index 805e191..7e88389 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.Script = function(sourceID, sourceURL, source, lineOffset, columnOffset, length, errorLine, errorMessage, worldType)
+WebInspector.Script = function(sourceID, sourceURL, lineOffset, columnOffset, length, errorLine, errorMessage, worldType)
 {
     this.sourceID = sourceID;
     this.sourceURL = sourceURL;
 {
     this.sourceID = sourceID;
     this.sourceURL = sourceURL;
-    this._source = source;
     this.lineOffset = lineOffset;
     this.columnOffset = columnOffset;
     this.length = length;
     this.errorLine = errorLine;
     this.errorMessage = errorMessage;
     this.worldType = worldType;
     this.lineOffset = lineOffset;
     this.columnOffset = columnOffset;
     this.length = length;
     this.errorLine = errorLine;
     this.errorMessage = errorMessage;
     this.worldType = worldType;
-
-    // if no URL, look for "//@ sourceURL=" decorator
-    // note that this sourceURL comment decorator is behavior that FireBug added
-    // in it's 1.1 release as noted in the release notes:
-    // http://fbug.googlecode.com/svn/branches/firebug1.1/docs/ReleaseNotes_1.1.txt
-    if (!sourceURL) {
-        // use of [ \t] rather than \s is to prevent \n from matching
-        var pattern = /^\s*\/\/[ \t]*@[ \t]*sourceURL[ \t]*=[ \t]*(\S+).*$/m;
-        var match = pattern.exec(source);
-
-        if (match)
-            this.sourceURL = match[1];
-    }
-}
-
-WebInspector.Script.WorldType = {
-    MAIN_WORLD: 0,
-    EXTENSIONS_WORLD: 1
 }
 
 WebInspector.Script.WorldType = {
 }
 
 WebInspector.Script.WorldType = {
@@ -60,54 +41,6 @@ WebInspector.Script.WorldType = {
 }
 
 WebInspector.Script.prototype = {
 }
 
 WebInspector.Script.prototype = {
-    get startingLine()
-    {
-        return this.lineOffset + 1;
-    },
-
-    get linesCount()
-    {
-        if (!this.source)
-            return 0;
-        if (!this._lineEndings)
-            this._lineEndings = this._source.findAll("\n");
-        return this._lineEndings.length + 1;
-    },
-
-    sourceLine: function(lineNumber, callback)
-    {
-        function extractSourceLine()
-        {
-            lineNumber -= this.lineOffset;
-            callback(this._source.substring(this._lineEndings[lineNumber - 1], this._lineEndings[lineNumber]));
-        }
-
-        if (this._lineEndings) {
-            extractSourceLine.call(this);
-            return;
-        }
-
-        function didRequestSource()
-        {
-            this._lineEndings = this._source.findAll("\n");
-            extractSourceLine.call(this);
-        }
-        this.requestSource(didRequestSource.bind(this));
-    },
-
-    get source()
-    {
-        if (!this._source && this.resource)
-            this._source = this.resource.content;
-        return this._source;
-    },
-
-    set source(source)
-    {
-        this._source = source;
-        delete this._lineEndings;
-    },
-
     requestSource: function(callback)
     {
         if (this._source) {
     requestSource: function(callback)
     {
         if (this._source) {
@@ -117,8 +50,6 @@ WebInspector.Script.prototype = {
 
         function didGetScriptSource(error, source)
         {
 
         function didGetScriptSource(error, source)
         {
-            if (error)
-                return;
             this._source = source;
             callback(this._source);
         }
             this._source = source;
             callback(this._source);
         }