Use array flattening instead of spread operator in a few places

This commit is contained in:
2026-03-15 13:44:21 +00:00
parent e9beacba3a
commit 9b4ff3e8f6

6
asm.js
View File

@@ -1306,7 +1306,7 @@ export class Assembler {
...data, ...data,
] ]
}); });
return [ contents.length ].concat(...contents); return [ contents.length, contents ].flat(Infinity);
} }
wasm() { wasm() {
@@ -1326,10 +1326,10 @@ export class Assembler {
]; ];
const sections = template.map(([ code, generator ]) => { const sections = template.map(([ code, generator ]) => {
const body = 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 }) { mem_wasm({ flags, init, max }) {