Better names.

This commit is contained in:
André Cruz
2013-04-10 20:45:47 +01:00
parent 1c7e272ac3
commit 3116fde51c
3 changed files with 27 additions and 27 deletions

View File

@@ -20,7 +20,7 @@ var UnitOfWork = function (options) {
this._beingResolved = [];
this._beingResolvedEndpoints = {};
this._resolved = {};
this._unresolved = {};
this._failed = {};
this._completed = {};
};
@@ -80,8 +80,8 @@ UnitOfWork.prototype.getResolved = function (name) {
return name ? this._resolved[name] || [] : this._resolved;
};
UnitOfWork.prototype.getUnresolved = function (name) {
return name ? this._unresolved[name] || [] : this._unresolved;
UnitOfWork.prototype.getFailed = function (name) {
return name ? this._failed[name] || [] : this._failed;
};
// -----------------
@@ -181,11 +181,11 @@ UnitOfWork.prototype._onPackageDone = function (pkg, err) {
arr = this._resolved[pkgName] = this._resolved[pkgName] || [];
arr.push(pkg);
this.emit('resolve', pkg);
// Otherwise, it failed to resolve so we mark it as unresolved
// Otherwise, it failed to resolve so we mark it as failed
} else {
arr = this._unresolved[pkgName] = this._unresolved[pkgName] || [];
arr = this._failed[pkgName] = this._failed[pkgName] || [];
arr.push(pkg);
this.emit('unresolve', pkg);
this.emit('failed', pkg);
// If fail fast is enabled, make every other package in the queue to fail
this._failAll = this._options.failFast;