Skip to content

v3.9.5版本类型为:

ts
new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;

typescriptv4.9.5版本中Promise类型为:

ts
new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;

会导致resolve()在有些机器上编译报错,有些不报错。

参考: