Commit 3e0c95f7 authored by Stefan Penner's avatar Stefan Penner

Fixes IE array detection

toString.call([]) fails while the Object.prototype.toString.call([]) works
parent cf50c865
...@@ -3,9 +3,10 @@ ...@@ -3,9 +3,10 @@
import { Promise } from "./promise"; import { Promise } from "./promise";
function all(promises) { function all(promises) {
if(toString.call(promises) !== "[object Array]") { if (Object.prototype.toString.call(promises) !== "[object Array]") {
throw new TypeError('You must pass an array to all.'); throw new TypeError('You must pass an array to all.');
} }
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
var results = [], remaining = promises.length, var results = [], remaining = promises.length,
promise; promise;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment