Skip to content

Commit c373f23

Browse files
authored
10.26 strict equality (#4988)
1 parent d008a1a commit c373f23

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/create-element.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ export function Fragment(props) {
9494
* @returns {vnode is VNode}
9595
*/
9696
export const isValidElement = vnode =>
97-
vnode != NULL && vnode.constructor == UNDEFINED;
97+
vnode != NULL && vnode.constructor === UNDEFINED;

src/diff/children.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ function constructNewChildrenArray(
207207
NULL,
208208
NULL
209209
);
210-
} else if (childVNode.constructor == UNDEFINED && childVNode._depth > 0) {
210+
} else if (childVNode.constructor === UNDEFINED && childVNode._depth > 0) {
211211
// VNode is already in use, clone it. This can happen in the following
212212
// scenario:
213213
// const reuse = <div />

src/diff/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function diff(
6464

6565
// When passing through createElement it assigns the object
6666
// constructor as undefined. This to prevent JSON-injection.
67-
if (newVNode.constructor != UNDEFINED) return NULL;
67+
if (newVNode.constructor !== UNDEFINED) return NULL;
6868

6969
// If the previous diff bailed out, resume creating/hydrating.
7070
if (oldVNode._flags & MODE_SUSPENDED) {

0 commit comments

Comments
 (0)