v3.9.5
版本类型为:
ts
new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
typescript
的v4.9.5
版本中Promise
类型为:
ts
new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
会导致resolve()
在有些机器上编译报错,有些不报错。
参考: