[Webkit-unassigned] [Bug 183115] New: Web Inspector: Object.shallowCopy(obj) should always equal shallowEqual

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Feb 25 20:17:48 PST 2018


https://bugs.webkit.org/show_bug.cgi?id=183115

            Bug ID: 183115
           Summary: Web Inspector: Object.shallowCopy(obj) should always
                    equal shallowEqual
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Inspector
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: nvasilyev at apple.com
                CC: inspector-bugzilla-changes at group.apple.com

let copy = Object.shallowCopy(obj);
    Object.shallowEqual(obj, copy); // true only if obj is a plain object, e.g. obj.constructor === Object

I find it's odd that a shallow copy of an object may NOT equal to the original object.

This can be fixed by:
A. Using Object.setPrototypeOf for Object.shallowCopy, which is very slow https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf
B. Reverting Bug 161852: Web Inspector: Object.shallowEqual() should return false if object prototype chains differ

I like option B.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180226/4b0c49f6/attachment-0001.html>


More information about the webkit-unassigned mailing list