Closed
Description
Update: will be fixed in v10.1.3
, see also #5980
// rescript
let add = x=>async(y)=> x+y
let g = add(0)
let h = x=>async(y)=>3+await x->add(y)
The minimal example above compiled into the following code in rescript v10.1.2
:
// javascript
function add(x, y) {
return x + y | 0;
}
function g(param) {
return 0 + param | 0;
}
function h(x, y) {
return 3 + await (x + y | 0) | 0;
}
/*
return 3 + await (x + y | 0) | 0;
^^^^^
SyntaxError: Unexpected reserved word
at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:119:18)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:468:14)
at async link (node:internal/modules/esm/module_job:67:21)
Node.js v18.12.1
*/
Metadata
Metadata
Assignees
Labels
No labels