This reverts CL 217417 (commit
753d56d3642eb83848aa39e65982a9fc77e722d7).
This change was unintentionally submitted to master during the
Go 1.14 code freeze; it should be sent again for Go 1.15.
Change-Id: Ie790342f227ae3adfc5f9a90ce3abdc2c9be619b
Reviewed-on: https://go-review.googlesource.com/c/go/+/217721
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
}
c := make(chan callResult, 1)
- f := js.FuncOf(func(this js.Value, args []js.Value) interface{} {
+ jsFS.Call(name, append(args, js.FuncOf(func(this js.Value, args []js.Value) interface{} {
var res callResult
if len(args) >= 1 { // on Node.js 8, fs.utimes calls the callback without any arguments
c <- res
return nil
- })
- defer f.Release()
- jsFS.Call(name, append(args, f)...)
+ }))...)
res := <-c
return res.val, res.err
}