Skip to content

Commit 0f6729d

Browse files
committed
rename Array.prototype.slice.call() to Array.from()
1 parent 15247dc commit 0f6729d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/rrweb/src/replay/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,8 +1520,9 @@ export class Replayer {
15201520
parentSn.tagName === 'textarea' &&
15211521
mutation.node.type === NodeType.Text
15221522
) {
1523-
// ES6-TODO: rename this to Array.from(parent.childNodes)
1524-
const childNodeArray = Array.prototype.slice.call(parent.childNodes);
1523+
const childNodeArray = Array.from(
1524+
parent.childNodes as Iterable<Node & RRNode>,
1525+
);
15251526

15261527
// https://github.com/rrweb-io/rrweb/issues/745
15271528
// parent is textarea, will only keep one child node as the value

0 commit comments

Comments
 (0)