Skip to content
This repository has been archived by the owner on Jun 17, 2023. It is now read-only.

Commit

Permalink
d3-queue 3.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed May 9, 2017
1 parent 674f079 commit 86b6f75
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions d3-queue.v3.js
@@ -1,4 +1,4 @@
// https://d3js.org/d3-queue/ Version 3.0.5. Copyright 2017 Mike Bostock.
// https://d3js.org/d3-queue/ Version 3.0.6. Copyright 2017 Mike Bostock.
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
Expand All @@ -10,7 +10,7 @@ var slice = [].slice;
var noabort = {};

function Queue(size) {
if (!(size >= 1)) throw new Error;
if (!((size = +size) >= 1)) throw new Error("invalid size");
this._size = size;
this._call =
this._error = null;
Expand All @@ -25,7 +25,8 @@ function Queue(size) {
Queue.prototype = queue.prototype = {
constructor: Queue,
defer: function(callback) {
if (typeof callback !== "function" || this._call) throw new Error;
if (typeof callback !== "function") throw new Error("invalid callback");
if (this._call) throw new Error("defer after await");
if (this._error != null) return this;
var t = slice.call(arguments, 1);
t.push(callback);
Expand All @@ -38,13 +39,15 @@ Queue.prototype = queue.prototype = {
return this;
},
await: function(callback) {
if (typeof callback !== "function" || this._call) throw new Error;
if (typeof callback !== "function") throw new Error("invalid callback");
if (this._call) throw new Error("multiple await");
this._call = function(error, results) { callback.apply(null, [error].concat(results)); };
maybeNotify(this);
return this;
},
awaitAll: function(callback) {
if (typeof callback !== "function" || this._call) throw new Error;
if (typeof callback !== "function") throw new Error("invalid callback");
if (this._call) throw new Error("multiple await");
this._call = callback;
maybeNotify(this);
return this;
Expand Down
4 changes: 2 additions & 2 deletions d3-queue.v3.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 86b6f75

Please sign in to comment.