From 9b4ff3e8f617d4b84f9bad20d3b27448f04f0d7e Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Sun, 15 Mar 2026 13:44:21 +0000 Subject: [PATCH] Use array flattening instead of spread operator in a few places --- asm.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/asm.js b/asm.js index 3cbe273..bb03c0c 100644 --- a/asm.js +++ b/asm.js @@ -1306,7 +1306,7 @@ export class Assembler { ...data, ] }); - return [ contents.length ].concat(...contents); + return [ contents.length, contents ].flat(Infinity); } wasm() { @@ -1326,10 +1326,10 @@ export class Assembler { ]; const sections = template.map(([ code, generator ]) => { const body = generator(); - return body == null ? [] : [ code, body.length, ...body ]; + return body == null ? [] : [ code, body.length, body ]; }); - return new Uint8Array(HEADER.concat(...sections)); + return new Uint8Array([ HEADER, sections ].flat(Infinity)); } mem_wasm({ flags, init, max }) {