javascript - Promises polyfill 是否在 Google Closure Compiler 20161024 中包含 all()?

标签 javascript ecmascript-6 google-closure-compiler es6-promise

20161024 版本中的发行说明显示了 Promises 的 ES3 polyfill,但是当我使用此版本编译并在 IE11 中进行测试时,我在控制台中收到一条错误消息,表明不支持 Promise.all():

TypeError: Object doesn't support property or method 'all'

(我在 gulp 任务定义中使用了 rewrite_polyfills: 'true'。)

如果我添加这些控制台输出:

console.log( 'Promise: ' + Promise );
console.log( 'Promise.all: ' + Promise.all );

我在 IE11 中得到这个:

Promise: function c(b){this.b=0;this.o=void 0;this.a=[];var c=this.i();try{b(c.resolve,c.reject)}catch(p){c.reject(p)}}
Promise.all: undefined

这在 Chrome 中(按预期工作):

Promise: function Promise() { [native code] }
Promise.all: function all() { [native code] }

all() 方法不是 polyfill 的一部分吗?

最佳答案

关于javascript - Promises polyfill 是否在 Google Closure Compiler 20161024 中包含 all()?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40391887/

相关文章:

JavaScript 实例 : can't define what instance of function's argument is

javascript - 美元符号后跟模板字符串中的方括号

javascript - 如何使用 JSDoc 记录 CoffeeScript 源代码?

javascript - 关闭编译器: ERROR - cannot read

javascript - 使用 Google 的 Closure Compiler 缩小字符串的正确方法是什么?

javascript - 使用 javascript/Jquery 在 MouseOver 之后删除元素的颜色

javascript - 带有复选框和 anchor 标记的 jquery

javascript - 如何避免滚动到焦点元素

javascript - 带有异步返回 Promise 的 Map

javascript - 使用箭头函数重构嵌套函数