diff --git a/src/array.js b/src/array.js deleted file mode 100644 index 62d8393..0000000 --- a/src/array.js +++ /dev/null @@ -1 +0,0 @@ -export var slice = [].slice; diff --git a/src/queue.js b/src/queue.js index 4abd36c..8fee19d 100644 --- a/src/queue.js +++ b/src/queue.js @@ -1,5 +1,3 @@ -import {slice} from "./array"; - var noabort = {}; function Queue(size) { @@ -20,8 +18,17 @@ Queue.prototype = queue.prototype = { defer: function(callback) { if (typeof callback !== "function" || this._call) throw new Error; if (this._error != null) return this; - var t = slice.call(arguments, 1); + + var l = arguments.length; + var t = []; + if (l > 0) { + t = new Array(l - 1); + for (var i = 1; i < l; ++i) { + t[i - 1] = arguments[i]; + } + } t.push(callback); + ++this._waiting, this._tasks.push(t); poke(this); return this;