@@ -8,9 +8,6 @@ let s:PENDING = 0
8
8
let s: FULFILLED = 1
9
9
let s: REJECTED = 2
10
10
11
- let s: DICT_T = type ({})
12
- let s: NULL_T = type (v: null )
13
-
14
11
" @vimlint(EVL103, 1, a:resolve)
15
12
" @vimlint(EVL103, 1, a:reject)
16
13
function ! s: noop (resolve , reject) abort
@@ -37,7 +34,7 @@ endfunction
37
34
38
35
" ... is added to use this function as a callback of timer_start()
39
36
function ! s: _invoke_callback (settled, promise, callback, result, ... ) abort
40
- let has_callback = type (a: callback ) != s: NULL_T
37
+ let has_callback = type (a: callback ) != v: t_none
41
38
let success = 1
42
39
let Err = v: null
43
40
if has_callback
@@ -79,7 +76,7 @@ function! s:_publish(promise, ...) abort
79
76
throw ' vital: Async.Promise: Cannot publish a pending promise'
80
77
endif
81
78
let child = a: promise ._children[i ]
82
- if type (child) != s: NULL_T
79
+ if type (child) != v: t_none
83
80
call s: _invoke_callback (settled, child, l: CB , a: promise ._result)
84
81
else
85
82
call l: CB (a: promise ._result)
@@ -223,7 +220,7 @@ function! s:is_available() abort
223
220
endfunction
224
221
225
222
function ! s: is_promise (maybe_promise) abort
226
- return type (a: maybe_promise ) == s: DICT_T && has_key (a: maybe_promise , ' _vital_promise' )
223
+ return type (a: maybe_promise ) == v: t_dict && has_key (a: maybe_promise , ' _vital_promise' )
227
224
endfunction
228
225
229
226
function ! s: _promise_then (... ) dict abort
0 commit comments