diff --git a/src/document/doc-debug.js b/src/document/doc-debug.js index e6ad1df8c..bce1b34fa 100644 --- a/src/document/doc-debug.js +++ b/src/document/doc-debug.js @@ -7,7 +7,7 @@ function flattenDoc(doc) { for (let i = 0; i < doc.parts.length; ++i) { const doc2 = doc.parts[i]; if (typeof doc2 !== "string" && doc2.type === "concat") { - [].push.apply(res, flattenDoc(doc2).parts); + res.push(...flattenDoc(doc2).parts); } else { const flattened = flattenDoc(doc2); if (flattened !== "") { diff --git a/src/document/doc-printer.js b/src/document/doc-printer.js index e09678156..62fbe0b80 100644 --- a/src/document/doc-printer.js +++ b/src/document/doc-printer.js @@ -491,7 +491,7 @@ function printDocToString(doc, options) { case MODE_BREAK: if (lineSuffix.length) { cmds.push([ind, mode, doc]); - [].push.apply(cmds, lineSuffix.reverse()); + cmds.push(...lineSuffix.reverse()); lineSuffix = []; break; } diff --git a/src/language-html/utils.js b/src/language-html/utils.js index 2cf927d23..50088d19a 100644 --- a/src/language-html/utils.js +++ b/src/language-html/utils.js @@ -578,7 +578,7 @@ function normalizeParts(parts) { } if (part.type === "concat") { - Array.prototype.unshift.apply(restParts, part.parts); + restParts.unshift(...part.parts); continue; }