Changeset 268634 in webkit


Ignore:
Timestamp:
Oct 16, 2020 9:34:26 PM (3 years ago)
Author:
Devin Rousso
Message:

Web Inspector: REGRESSION(r266669): DOMBreakpoint.js:106:23: CONSOLE ASSERT ERROR domNode should not change once set
https://bugs.webkit.org/show_bug.cgi?id=217865

Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

  • UserInterface/Models/DOMBreakpoint.js:

(WI.DOMBreakpoint.prototype.set domNode):
Adjust the assertion such that null is allowed if _domNode is already null.

  • UserInterface/Base/Utilities.js:

(xor): Added.
Global utility function for doing a non-bitwise or that returns false if both values are
truthy/falsy and the truthy value if only one is truthy.

LayoutTests:

  • inspector/unit-tests/utilities.html: Added.
  • inspector/unit-tests/utilities-expected.txt: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r268631 r268634  
     12020-10-16  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: REGRESSION(r266669): DOMBreakpoint.js:106:23: CONSOLE ASSERT ERROR domNode should not change once set
     4        https://bugs.webkit.org/show_bug.cgi?id=217865
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * inspector/unit-tests/utilities.html: Added.
     9        * inspector/unit-tests/utilities-expected.txt: Added.
     10
    1112020-10-16  Devin Rousso  <drousso@apple.com>
    212
  • trunk/Source/WebInspectorUI/ChangeLog

    r268631 r268634  
     12020-10-16  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: REGRESSION(r266669): DOMBreakpoint.js:106:23: CONSOLE ASSERT ERROR domNode should not change once set
     4        https://bugs.webkit.org/show_bug.cgi?id=217865
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UserInterface/Models/DOMBreakpoint.js:
     9        (WI.DOMBreakpoint.prototype.set domNode):
     10        Adjust the assertion such that `null` is allowed if `_domNode` is already `null`.
     11
     12        * UserInterface/Base/Utilities.js:
     13        (xor): Added.
     14        Global utility function for doing a non-bitwise or that returns `false` if both values are
     15        truthy/falsy and the truthy value if only one is truthy.
     16
    1172020-10-16  Devin Rousso  <drousso@apple.com>
    218
  • trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js

    r266735 r268634  
    3131var multiplicationSign = "\u00d7";
    3232
     33function xor(a, b)
     34{
     35    if (a)
     36        return b ? false : a;
     37    return b || false;
     38}
     39
    3340Object.defineProperty(Object, "shallowCopy",
    3441{
  • trunk/Source/WebInspectorUI/UserInterface/Models/DOMBreakpoint.js

    r266669 r268634  
    103103    set domNode(domNode)
    104104    {
    105         console.assert(domNode instanceof WI.DOMNode, domNode);
    106         console.assert(!this._domNode !== !domNode, "domNode should not change once set");
    107         if (!this._domNode === !domNode)
     105        console.assert(!domNode || domNode instanceof WI.DOMNode, domNode);
     106        console.assert(!domNode || xor(domNode, this._domNode), "domNode should not change once set", domNode, this._domNode);
     107        if (!xor(domNode, this._domNode))
    108108            return;
    109109
Note: See TracChangeset for help on using the changeset viewer.