1
0
mirror of https://github.com/fuse-friends/fuse-native synced 2024-10-27 18:34:01 +00:00

fix defaults

This commit is contained in:
Mathias Buus 2020-01-23 15:10:57 +01:00
parent baee91d5da
commit b98133a18f

View File

@ -216,7 +216,10 @@ class Fuse extends Nanoresource {
function signal (nativeHandler, err, ...args) {
var arr = [nativeHandler, err, ...args]
if (defaults && (!args.length)) arr = arr.concat(defaults)
if (defaults) {
while (arr.length > 2 && arr[arr.length - 1] === undefined) arr.pop()
if (arr.length === 2) arr = arr.concat(defaults)
}
return process.nextTick(nativeSignal, ...arr)
}
}