Bug 182219

Summary: Web Inspector: Replace Object.shallowMerge with ES2018 spread operator
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Devin Rousso <hi>
Severity: Normal CC: bburg, commit-queue, hi, inspector-bugzilla-changes, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Description Flags
Patch none

Description Nikita Vasilyev 2018-01-27 19:53:46 PST
Object.shallowMerge defined in Utilities.js is no longer needed with ES2018 spread operator.

    Object.shallowMerge(a, b)

can be replaced with:

    {...a, ...b}
Comment 1 Devin Rousso 2018-01-27 22:13:38 PST
Created attachment 332488 [details]

My only hesitation to this is that we might get collisions between keys (such as if we chain an options variable between functions), but I think that will be very rare
Comment 2 BJ Burg 2018-01-30 09:30:52 PST
Comment on attachment 332488 [details]

Comment 3 Joseph Pecoraro 2018-01-30 10:34:26 PST
Comment on attachment 332488 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=332488&action=review

> Source/WebInspectorUI/UserInterface/Base/DOMUtilities.js:68
> -    return WI.linkifyNodeReferenceElement(node, link, Object.shallowMerge(options, {displayName}));
> +    return WI.linkifyNodeReferenceElement(node, link, {...options, displayName});

I find this a little harder to read / understand, but I suppose its fine.
Comment 4 WebKit Commit Bot 2018-01-30 16:39:24 PST
Comment on attachment 332488 [details]

Clearing flags on attachment: 332488

Committed r227864: <https://trac.webkit.org/changeset/227864>
Comment 5 WebKit Commit Bot 2018-01-30 16:39:25 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2018-01-30 16:40:18 PST