Skip to content

Commit

Permalink
chore: add back dev assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
pmdartus committed Jan 19, 2022
1 parent 05302b6 commit f19433c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/@lwc/engine-core/src/framework/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ function h(sel: string, data: VElementData, children: VNodes): VElement {
vmBeingRendered
);
}
forEach.call(children, (childVnode: VNode | null | undefined) => {
if (childVnode != null) {
assert.isTrue(
'type' in childVnode &&
'sel' in childVnode &&
'elm' in childVnode &&
'key' in childVnode,
`${childVnode} is not a vnode.`
);
}
});
}

let elm;
Expand Down Expand Up @@ -182,6 +193,19 @@ function c(
vmBeingRendered
);
}
if (arguments.length === 4) {
forEach.call(children, (childVnode: VNode | null | undefined) => {
if (childVnode != null) {
assert.isTrue(
'type' in childVnode &&
'sel' in childVnode &&
'elm' in childVnode &&
'key' in childVnode,
`${childVnode} is not a vnode.`
);
}
});
}
}
const { key } = data;
let elm;
Expand Down

0 comments on commit f19433c

Please sign in to comment.