Skip to content

Commit 73fcf9f

Browse files
JeanMechealxhub
authored andcommitted
refactor(core): remove webworker related checks on assertDomNode (#50061)
Since the drop of the webworker platform the node can't be a `WebWorkerRenderNode`. PR Close #50061
1 parent f780d6f commit 73fcf9f

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

packages/core/src/util/assert.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,11 @@ export function throwError(msg: string, actual?: any, expected?: any, comparison
107107
}
108108

109109
export function assertDomNode(node: any): asserts node is Node {
110-
// If we're in a worker, `Node` will not be defined.
111-
if (!(typeof Node !== 'undefined' && node instanceof Node) &&
112-
!(typeof node === 'object' && node != null &&
113-
node.constructor.name === 'WebWorkerRenderNode')) {
110+
if (!(node instanceof Node)) {
114111
throwError(`The provided value must be an instance of a DOM Node but got ${stringify(node)}`);
115112
}
116113
}
117114

118-
119115
export function assertIndexInRange(arr: any[], index: number) {
120116
assertDefined(arr, 'Array must be defined.');
121117
const maxLen = arr.length;
@@ -124,7 +120,6 @@ export function assertIndexInRange(arr: any[], index: number) {
124120
}
125121
}
126122

127-
128123
export function assertOneOf(value: any, ...validValues: any[]) {
129124
if (validValues.indexOf(value) !== -1) return true;
130125
throwError(`Expected value to be one of ${JSON.stringify(validValues)} but was ${

0 commit comments

Comments
 (0)