Răsfoiți Sursa

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

huqi 5 ani în urmă
părinte
comite
533e1477bd
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      o2web/source/o2_core/o2.js

+ 1 - 1
o2web/source/o2_core/o2.js

@@ -1862,7 +1862,7 @@ if (!window.Promise){
 
     var _promiseAll = function(p){
         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);
             }else{
                 return { "then": function(s){ s(p); return this;} };