Changeset 189965 in webkit


Ignore:
Timestamp:
Sep 17, 2015, 11:04:41 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Simplify some functional callbacks
https://bugs.webkit.org/show_bug.cgi?id=149333

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2015-09-17
Reviewed by Brian Burg.

  • UserInterface/Controllers/LogManager.js:

(WebInspector.LogManager.prototype.messageWasAdded):

  • UserInterface/Models/Color.js:

(WebInspector.Color):

  • UserInterface/Models/Geometry.js:

(WebInspector.CubicBezier.fromCoordinates):

  • UserInterface/Models/ObjectPreview.js:

(WebInspector.ObjectPreview.fromPayload):

  • UserInterface/Models/TypeDescription.js:

(WebInspector.TypeDescription.fromPayload):

  • UserInterface/Protocol/RemoteObject.js:

(WebInspector.RemoteObject.prototype.getCollectionEntries):
(WebInspector.RemoteObject.prototype.getCollectionEntries.): Deleted.

  • UserInterface/Views/TextEditor.js:

(WebInspector.TextEditor.prototype.get markers):
(WebInspector.TextEditor.prototype.markersAtPosition):

Location:
trunk/Source/WebInspectorUI
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r189964 r189965  
     12015-09-17  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Simplify some functional callbacks
     4        https://bugs.webkit.org/show_bug.cgi?id=149333
     5
     6        Reviewed by Brian Burg.
     7
     8        * UserInterface/Controllers/LogManager.js:
     9        (WebInspector.LogManager.prototype.messageWasAdded):
     10        * UserInterface/Models/Color.js:
     11        (WebInspector.Color):
     12        * UserInterface/Models/Geometry.js:
     13        (WebInspector.CubicBezier.fromCoordinates):
     14        * UserInterface/Models/ObjectPreview.js:
     15        (WebInspector.ObjectPreview.fromPayload):
     16        * UserInterface/Models/TypeDescription.js:
     17        (WebInspector.TypeDescription.fromPayload):
     18        * UserInterface/Protocol/RemoteObject.js:
     19        (WebInspector.RemoteObject.prototype.getCollectionEntries):
     20        (WebInspector.RemoteObject.prototype.getCollectionEntries.): Deleted.
     21        * UserInterface/Views/TextEditor.js:
     22        (WebInspector.TextEditor.prototype.get markers):
     23        (WebInspector.TextEditor.prototype.markersAtPosition):
     24
    1252015-09-17  Joseph Pecoraro  <pecoraro@apple.com>
    226
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/LogManager.js

    r186645 r189965  
    4848
    4949        if (parameters)
    50             parameters = parameters.map(function(x) { return WebInspector.RemoteObject.fromPayload(x); });
     50            parameters = parameters.map(WebInspector.RemoteObject.fromPayload);
    5151
    5252        var message = new WebInspector.ConsoleMessage(source, level, text, type, url, line, column, repeatCount, parameters, stackTrace, null);
  • trunk/Source/WebInspectorUI/UserInterface/Models/Color.js

    r182113 r189965  
    3939            this._rgba = components;
    4040
    41         this.valid = !components.some(function(component) {
    42             return isNaN(component);
    43         });
     41        this.valid = !components.some(isNaN);
    4442    }
    4543
  • trunk/Source/WebInspectorUI/UserInterface/Models/Geometry.js

    r188028 r189965  
    350350            return null;
    351351
    352         coordinates = coordinates.map((x) => Number(x));
     352        coordinates = coordinates.map(Number);
    353353        if (coordinates.includes(NaN))
    354354            return null;
  • trunk/Source/WebInspectorUI/UserInterface/Models/ObjectPreview.js

    r183025 r189965  
    5252    {
    5353        if (payload.properties)
    54             payload.properties = payload.properties.map(function(property) { return WebInspector.PropertyPreview.fromPayload(property); });
     54            payload.properties = payload.properties.map(WebInspector.PropertyPreview.fromPayload);
    5555        if (payload.entries)
    56             payload.entries = payload.entries.map(function(entry) { return WebInspector.CollectionEntryPreview.fromPayload(entry); });
     56            payload.entries = payload.entries.map(WebInspector.CollectionEntryPreview.fromPayload);
    5757
    5858        if (payload.subtype === "array") {
  • trunk/Source/WebInspectorUI/UserInterface/Models/TypeDescription.js

    r184736 r189965  
    5252        var structures = undefined;
    5353        if (payload.structures)
    54             structures = payload.structures.map(function(x) { return WebInspector.StructureDescription.fromPayload(x); });
     54            structures = payload.structures.map(WebInspector.StructureDescription.fromPayload);
    5555
    5656        return new WebInspector.TypeDescription(payload.leastCommonAncestor, typeSet, structures, payload.isValid, payload.isTruncated);
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js

    r189373 r189965  
    392392
    393393        RuntimeAgent.getCollectionEntries(this._objectId, objectGroup, start, numberToFetch, function(error, entries) {
    394             entries = entries.map(function(entry) { return WebInspector.CollectionEntry.fromPayload(entry); });
     394            entries = entries.map(WebInspector.CollectionEntry.fromPayload);
    395395            callback(entries);
    396396        });
  • trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js

    r189872 r189965  
    621621    get markers()
    622622    {
    623         return this._codeMirror.getAllMarks().map(function(codeMirrorTextMarker) {
    624             return WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker(codeMirrorTextMarker);
    625         });
     623        return this._codeMirror.getAllMarks().map(WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker);
    626624    }
    627625
    628626    markersAtPosition(position)
    629627    {
    630         return this._codeMirror.findMarksAt(position).map(function(codeMirrorTextMarker) {
    631             return WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker(codeMirrorTextMarker);
    632         });
     628        return this._codeMirror.findMarksAt(position).map(WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker);
    633629    }
    634630
Note: See TracChangeset for help on using the changeset viewer.