.
Created attachment 411649 [details] Patch
Committed r268634: <https://trac.webkit.org/changeset/268634> All reviewed patches have been landed. Closing bug and clearing flags on attachment 411649 [details].
<rdar://problem/70402343>
Comment on attachment 411649 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=411649&action=review > LayoutTests/inspector/unit-tests/utilities.html:16 > + InspectorTest.expectEqual(xor(42, "test"), false, "xor should explicitly return false when both values are truthy."); I would have expected a logical operator to return true or false, not false or anything. What is the use case for returning the value instead of converting it to boolean first?
Comment on attachment 411649 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=411649&action=review >> LayoutTests/inspector/unit-tests/utilities.html:16 >> + InspectorTest.expectEqual(xor(42, "test"), false, "xor should explicitly return false when both values are truthy."); > > I would have expected a logical operator to return true or false, not false or anything. What is the use case for returning the value instead of converting it to boolean first? This way it behaves like `||` and `&&` in JavaScript, where the actual value is used in the "positive" case instead of `true`.