fix(ivy): assertDomNode will now work properly in a worker (#28382)

PR Close #28382
This commit is contained in:
Ben Lesh 2019-02-13 13:11:39 -08:00
parent 929fe029c2
commit 7bae49b419
1 changed files with 2 additions and 1 deletions

View File

@ -65,8 +65,9 @@ export function throwError(msg: string): never {
}
export function assertDomNode(node: any) {
// If we're in a worker, `Node` will not be defined.
assertEqual(
node instanceof Node ||
(typeof Node !== 'undefined' && node instanceof Node) ||
(typeof node === 'object' && node.constructor.name === 'WebWorkerRenderNode'),
true, 'The provided value must be an instance of a DOM Node');
}