More sensible argument order on Gestalt.project

This commit is contained in:
Tony Garnock-Jones 2014-05-26 23:22:03 -04:00
parent 03773b6d6d
commit 336b4f36ac
2 changed files with 8 additions and 8 deletions

View File

@ -361,14 +361,14 @@ DemandMatcher.prototype.handleEvent = function (e) {
}; };
DemandMatcher.prototype.handleGestalt = function (gestalt) { DemandMatcher.prototype.handleGestalt = function (gestalt) {
var newDemandMatcher = gestalt.project(this.metaLevel, var newDemandMatcher = gestalt.project(this.projectionSpec,
this.demandLevel,
!this.demandSideIsSubscription, !this.demandSideIsSubscription,
this.projectionSpec); this.metaLevel,
var newSupplyMatcher = gestalt.project(this.metaLevel, this.demandLevel);
this.supplyLevel, var newSupplyMatcher = gestalt.project(this.projectionSpec,
this.demandSideIsSubscription, this.demandSideIsSubscription,
this.projectionSpec) this.metaLevel,
this.supplyLevel);
var newDemand = route.arrayToSet(route.matcherKeys(newDemandMatcher)); var newDemand = route.arrayToSet(route.matcherKeys(newDemandMatcher));
var newSupply = route.arrayToSet(route.matcherKeys(newSupplyMatcher)); var newSupply = route.arrayToSet(route.matcherKeys(newSupplyMatcher));
var demandDelta = route.setSubtract(newDemand, this.currentDemand); var demandDelta = route.setSubtract(newDemand, this.currentDemand);

View File

@ -1176,8 +1176,8 @@ function Routing(exports) {
return setToArray(pids); return setToArray(pids);
}; };
Gestalt.prototype.project = function (metaLevel, level, getAdvertisements, spec) { Gestalt.prototype.project = function (spec, getAdvertisements, metaLevel, level) {
var l = this.getLevel(metaLevel, level); var l = this.getLevel(metaLevel | 0, level | 0);
var matcher = (getAdvertisements ? l.advertisements : l.subscriptions); var matcher = (getAdvertisements ? l.advertisements : l.subscriptions);
return project(matcher, spec); return project(matcher, spec);
}; };