Changeset 173494 in webkit


Ignore:
Timestamp:
Sep 10, 2014 3:41:20 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Eliminate typeof "undefined" checks
https://bugs.webkit.org/show_bug.cgi?id=136691

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2014-09-10
Reviewed by Alexey Proskuryakov.

  • UserInterface/Base/Main.js:

(WebInspector.linkifyURLAsNode):
(WebInspector.linkifyStringAsFragment):

  • UserInterface/Protocol/InspectorBackend.js:

(InspectorBackend.Command.prototype._invokeWithArguments):

  • UserInterface/Views/DataGrid.js:

(WebInspector.DataGrid.prototype.get resizeMethod):

  • UserInterface/Views/NavigationBar.js:

(WebInspector.NavigationBar.prototype.get minimumWidth):

Location:
trunk/Source/WebInspectorUI
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r173492 r173494  
     12014-09-10  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Eliminate typeof "undefined" checks
     4        https://bugs.webkit.org/show_bug.cgi?id=136691
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        * UserInterface/Base/Main.js:
     9        (WebInspector.linkifyURLAsNode):
     10        (WebInspector.linkifyStringAsFragment):
     11        * UserInterface/Protocol/InspectorBackend.js:
     12        (InspectorBackend.Command.prototype._invokeWithArguments):
     13        * UserInterface/Views/DataGrid.js:
     14        (WebInspector.DataGrid.prototype.get resizeMethod):
     15        * UserInterface/Views/NavigationBar.js:
     16        (WebInspector.NavigationBar.prototype.get minimumWidth):
     17
    1182014-09-10  Joseph Pecoraro  <pecoraro@apple.com>
    219
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r173407 r173494  
    16271627    a.className = classes;
    16281628
    1629     if (typeof tooltipText === "undefined")
     1629    if (tooltipText === undefined)
    16301630        a.title = url;
    16311631    else if (typeof tooltipText !== "string" || tooltipText.length)
     
    16761676    {
    16771677        var urlNode = WebInspector.linkifyURLAsNode(url, title, undefined);
    1678         if (typeof(lineNumber) !== "undefined")
     1678        if (lineNumber !== undefined)
    16791679            urlNode.lineNumber = lineNumber;
    16801680
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js

    r172158 r173494  
    431431
    432432            var value = commandArguments.shift();
    433             if (optionalFlag && typeof value === "undefined")
     433            if (optionalFlag && value === undefined)
    434434                continue;
    435435
     
    443443
    444444        if (commandArguments.length === 1 && !callback) {
    445             if (typeof commandArguments[0] !== "undefined") {
     445            if (commandArguments[0] !== undefined) {
    446446                console.error("Protocol Error: Optional callback argument for method '" + instance.qualifiedName + "' call must be a function but its type is '" + typeof args[0] + "'.");
    447447                return;
  • trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js

    r173433 r173494  
    415415
    416416    insertColumn: function(columnIdentifier, columnData, insertionIndex) {
    417         if (typeof insertionIndex === "undefined")
     417        if (insertionIndex === undefined)
    418418            insertionIndex = this.orderedColumns.length;
    419419        insertionIndex = Number.constrain(insertionIndex, 0, this.orderedColumns.length);
     
    12181218    get resizeMethod()
    12191219    {
    1220         if (typeof this._resizeMethod === "undefined")
     1220        if (!this._resizeMethod)
    12211221            return WebInspector.DataGrid.ResizeMethod.Nearest;
    12221222        return this._resizeMethod;
  • trunk/Source/WebInspectorUI/UserInterface/Views/NavigationBar.js

    r173477 r173494  
    234234    get minimumWidth()
    235235    {
    236         if (typeof this._minimumWidth === "undefined" || this._minimumWidthNeedsRecalculation) {
     236        if (this._minimumWidth === undefined || this._minimumWidthNeedsRecalculation) {
    237237            this._minimumWidth = this._calculateMinimumWidth();
    238238            delete this._minimumWidthNeedsRecalculation;
Note: See TracChangeset for help on using the changeset viewer.