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:
parent
baee91d5da
commit
b98133a18f
5
index.js
5
index.js
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user