Просмотр исходного кода

Merge branch 'fix/promiseAll' into 'wrdp'

promiseAll在没有promise时同步

See merge request o2oa/o2oa!2517
胡起 5 лет назад
Родитель
Сommit
705adf00db
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      o2web/source/o2_core/o2.js

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

@@ -1883,15 +1883,15 @@ if (!window.Promise){
             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;} };
-                return new Promise(function(s){s(p); return this;});
+                return { "then": function(s){ s(p); return this;} };
+                //return new Promise(function(s){s(p); return this;});
             }
         }else{
             if (p && o2.typeOf(p.then)=="function"){
                 return Promise.resolve(p);
             }else{
-                //return { "then": function(s){ s(p); return this;} };
-                return new Promise(function(s){s(p); return this;});
+                return { "then": function(s){ s(p); return this;} };
+                //return new Promise(function(s){s(p); return this;});
             }
         }
         // var method = (o2.typeOf(p)=="array") ? "all" : "resolve";