Put arguments read once into inlined bodies directly
Why
Calls to other modules' functions are inlined in two places. When an argument is a parameter of the caller, inlining waits until the JavaScript is generated, and a pure argument the body reads once takes the parameter's place. Otherwise lam_pass_remove_alias inlines the call early and bound every argument to a variable first; it did the same when applying a function directly. Both now substitute like the late path.
modifiedJS literal and function arguments
let called = []Ok(3)->Result.forEach(i => called->Array.push(i))let merged = Array.concatAll([[1], arr])
js
Before
After
let called = [];let called = [];let f = i => { called.push(i);};f(3);called.push(3); function merge(arr) {function merge(arr) { let arrays = [ [1], arr ]; return [].concat(...arrays); return [].concat([1], arr); }}