Evaluate partial application arguments once
Why
f(a, ...) put its callee and arguments inside the function it creates, so they ran on every call, and an await in them ended up in a non-async arrow, a JavaScript syntax error.
They are now bound outside that function, as the optional-argument path already did. Variables, constants, closures, external values and module paths stay in place, so such a function can still be inlined. Fixes #8932.
modifiedJS partial application
let add = (a, b, c) => a + b + clet f = async p => { let h = add(await p, ...) h(1, 2) + h(3, 4)}
js
Review
- Is evaluating arguments once a behaviour change? Yes, for arguments with side effects (earger_curry_test shows one). They now run once, where the application is, like the arguments of any other call.