diff --git a/src/clone-element.js b/src/clone-element.js index d97384d613..241e9a706b 100644 --- a/src/clone-element.js +++ b/src/clone-element.js @@ -26,7 +26,7 @@ export function cloneElement(vnode, props, children) { for (i in props) { if (i == 'key') key = props[i]; else if (i == 'ref') ref = props[i]; - else if (props[i] === UNDEFINED && defaultProps !== UNDEFINED) { + else if (props[i] == UNDEFINED && defaultProps != UNDEFINED) { normalizedProps[i] = defaultProps[i]; } else { normalizedProps[i] = props[i]; diff --git a/src/component.js b/src/component.js index 967ebcac66..b233d8c7c0 100644 --- a/src/component.js +++ b/src/component.js @@ -28,7 +28,7 @@ export function BaseComponent(props, context) { BaseComponent.prototype.setState = function (update, callback) { // only clone state when copying to nextState the first time. let s; - if (this._nextState != NULL && this._nextState !== this.state) { + if (this._nextState != NULL && this._nextState != this.state) { s = this._nextState; } else { s = this._nextState = assign({}, this.state); @@ -204,7 +204,7 @@ export function enqueueRender(c) { (c._dirty = true) && rerenderQueue.push(c) && !process._rerenderCount++) || - prevDebounce !== options.debounceRendering + prevDebounce != options.debounceRendering ) { prevDebounce = options.debounceRendering; (prevDebounce || defer)(process); diff --git a/src/create-context.js b/src/create-context.js index 7961e56d7c..851b95acbc 100644 --- a/src/create-context.js +++ b/src/create-context.js @@ -19,7 +19,7 @@ export function createContext(defaultValue) { this.shouldComponentUpdate = function (_props) { // @ts-expect-error even - if (this.props.value !== _props.value) { + if (this.props.value != _props.value) { subs.forEach(c => { c._force = true; enqueueRender(c); diff --git a/src/create-element.js b/src/create-element.js index d4ea2dd935..39bebb70ba 100644 --- a/src/create-element.js +++ b/src/create-element.js @@ -33,7 +33,7 @@ export function createElement(type, props, children) { // Note: type may be undefined in development, must never error here. if (typeof type == 'function' && type.defaultProps != NULL) { for (i in type.defaultProps) { - if (normalizedProps[i] === UNDEFINED) { + if (normalizedProps[i] == UNDEFINED) { normalizedProps[i] = type.defaultProps[i]; } } diff --git a/src/diff/children.js b/src/diff/children.js index dc98a7ae01..25ebcd3660 100644 --- a/src/diff/children.js +++ b/src/diff/children.js @@ -84,7 +84,7 @@ export function diffChildren( // At this point, constructNewChildrenArray has assigned _index to be the // matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode). - if (childVNode._index === -1) { + if (childVNode._index == -1) { oldVNode = EMPTY_OBJ; } else { oldVNode = oldChildren[childVNode._index] || EMPTY_OBJ; @@ -207,7 +207,7 @@ function constructNewChildrenArray( NULL, NULL ); - } else if (childVNode.constructor === UNDEFINED && childVNode._depth > 0) { + } else if (childVNode.constructor == UNDEFINED && childVNode._depth > 0) { // VNode is already in use, clone it. This can happen in the following // scenario: // const reuse =
@@ -238,7 +238,7 @@ function constructNewChildrenArray( )); oldVNode = NULL; - if (matchingIndex !== -1) { + if (matchingIndex != -1) { oldVNode = oldChildren[matchingIndex]; remainingOldChildren--; if (oldVNode) { @@ -248,8 +248,8 @@ function constructNewChildrenArray( // Here, we define isMounting for the purposes of the skew diffing // algorithm. Nodes that are unsuspending are considered mounting and we detect - // this by checking if oldVNode._original === null - const isMounting = oldVNode == NULL || oldVNode._original === NULL; + // this by checking if oldVNode._original == null + const isMounting = oldVNode == NULL || oldVNode._original == NULL; if (isMounting) { if (matchingIndex == -1) { @@ -428,7 +428,7 @@ function findMatchingIndex( (oldVNode === NULL && childVNode.key == null) || (oldVNode && key == oldVNode.key && - type === oldVNode.type && + type == oldVNode.type && (oldVNode._flags & MATCHED) == 0) ) { return skewedIndex; @@ -442,7 +442,7 @@ function findMatchingIndex( oldVNode && (oldVNode._flags & MATCHED) == 0 && key == oldVNode.key && - type === oldVNode.type + type == oldVNode.type ) { return x; } @@ -455,7 +455,7 @@ function findMatchingIndex( oldVNode && (oldVNode._flags & MATCHED) == 0 && key == oldVNode.key && - type === oldVNode.type + type == oldVNode.type ) { return y; } diff --git a/src/diff/index.js b/src/diff/index.js index b5efb20666..1ae0ab1251 100644 --- a/src/diff/index.js +++ b/src/diff/index.js @@ -64,7 +64,7 @@ export function diff( // When passing through createElement it assigns the object // constructor as undefined. This to prevent JSON-injection. - if (newVNode.constructor !== UNDEFINED) return NULL; + if (newVNode.constructor != UNDEFINED) return NULL; // If the previous diff bailed out, resume creating/hydrating. if (oldVNode._flags & MODE_SUSPENDED) { @@ -369,7 +369,7 @@ export function commitRoot(commitQueue, root, refQueue) { } function cloneNode(node) { - if (typeof node !== 'object' || node == NULL) { + if (typeof node != 'object' || node == NULL) { return node; } @@ -467,9 +467,9 @@ function diffElementNodes( excessDomChildren = NULL; } - if (nodeType === NULL) { + if (nodeType == NULL) { // During hydration, we still have to split merged text from SSR'd HTML. - if (oldProps !== newProps && (!isHydrating || dom.data !== newProps)) { + if (oldProps !== newProps && (!isHydrating || dom.data != newProps)) { dom.data = newProps; } } else { @@ -531,8 +531,8 @@ function diffElementNodes( if ( !isHydrating && (!oldHtml || - (newHtml.__html !== oldHtml.__html && - newHtml.__html !== dom.innerHTML)) + (newHtml.__html != oldHtml.__html && + newHtml.__html != dom.innerHTML)) ) { dom.innerHTML = newHtml.__html; } @@ -543,7 +543,7 @@ function diffElementNodes( diffChildren( // @ts-expect-error - newVNode.type === 'template' ? dom.content : dom, + newVNode.type == 'template' ? dom.content : dom, isArray(newChildren) ? newChildren : [newChildren], newVNode, oldVNode, @@ -572,7 +572,7 @@ function diffElementNodes( if (nodeType == 'progress' && inputValue == NULL) { dom.removeAttribute('value'); } else if ( - inputValue !== UNDEFINED && + inputValue != UNDEFINED && // #2756 For the