提交 ab3ef23b 编写于 作者: NoSubject's avatar NoSubject

Merge branch 'fix/promiseAll' into 'wrdp'

修复promiseAll方法为空数组时的问题

See merge request o2oa/o2oa!2434
...@@ -1862,7 +1862,7 @@ if (!window.Promise){ ...@@ -1862,7 +1862,7 @@ if (!window.Promise){
var _promiseAll = function(p){ var _promiseAll = function(p){
if (o2.typeOf(p)=="array"){ if (o2.typeOf(p)=="array"){
if (p.some(function(e){ return (o2.typeOf(e.then)=="function") })){ if (p.some(function(e){ return (e && o2.typeOf(e.then)=="function") })){
return Promise.all(p); return Promise.all(p);
}else{ }else{
return { "then": function(s){ s(p); return this;} }; return { "then": function(s){ s(p); return this;} };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册