Skip to content

Commit fbed16a

Browse files
committed
Async.Promise: Prefer is v:null to == type(v:null)
1 parent b8770b7 commit fbed16a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

autoload/vital/__vital__/Async/Promise.vim

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ let s:FULFILLED = 1
99
let s:REJECTED = 2
1010

1111
let s:DICT_T = type({})
12-
let s:NULL_T = type(v:null)
1312

1413
" @vimlint(EVL103, 1, a:resolve)
1514
" @vimlint(EVL103, 1, a:reject)
@@ -37,7 +36,7 @@ endfunction
3736

3837
" ... is added to use this function as a callback of timer_start()
3938
function! s:_invoke_callback(settled, promise, callback, result, ...) abort
40-
let has_callback = type(a:callback) != s:NULL_T
39+
let has_callback = a:callback isnot v:null
4140
let success = 1
4241
let err = v:null
4342
if has_callback
@@ -86,7 +85,7 @@ function! s:_publish(promise, ...) abort
8685
let l:CB = a:promise._rejections[i]
8786
endif
8887
let child = a:promise._children[i]
89-
if type(child) != s:NULL_T
88+
if child isnot v:null
9089
call s:_invoke_callback(settled, child, l:CB, a:promise._result)
9190
else
9291
call l:CB(a:promise._result)

0 commit comments

Comments
 (0)