小程序iOS Promise不支持finally语法 TypeError: undefined is not a function .finally is not a function

Posted wen_rc

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了小程序iOS Promise不支持finally语法 TypeError: undefined is not a function .finally is not a function相关的知识,希望对你有一定的参考价值。

小程序ios Promise不支持finally语法

一开始知道finally语法是在Java,以为是很基本的语法,所以在javascript应该也支持,不需要考虑兼容性,后来查MDN才发现并不是。

Promise的finally和try…catch…finally不是同一个东西,只是都叫finally而已。

在小程序的iOS中,更是直接不支持Promise的finaly语法,会报TypeError: undefined is not a function.finally is not a function的错误,还好,把finaly换成then能解决问题

以上是关于小程序iOS Promise不支持finally语法 TypeError: undefined is not a function .finally is not a function的主要内容,如果未能解决你的问题,请参考以下文章