diff --git a/bower.json b/bower.json index 2f76341c..81a5058e 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-templating", - "version": "0.6.0", + "version": "0.6.1", "description": "An extensible HTML templating engine supporting databinding, custom elements, attached behaviors and more.", "keywords": [ "aurelia", diff --git a/dist/amd/behavior-instance.js b/dist/amd/behavior-instance.js index fbda6077..333c33e9 100644 --- a/dist/amd/behavior-instance.js +++ b/dist/amd/behavior-instance.js @@ -5,10 +5,10 @@ define(["exports"], function (exports) { this.behaviorType = behaviorType; this.executionContext = executionContext; - var lookup = observerLocator.getObserversLookup(executionContext), skipSelfSubscriber = behaviorType.handlesBind, attributes = instruction.attributes, boundProperties = this.boundProperties = [], properties = behaviorType.properties, i, ii, prop, selfSubscriber, observer, info, attribute; + var lookup = observerLocator.getObserversLookup(executionContext), skipSelfSubscriber = behaviorType.handlesBind, attributes = instruction.attributes, boundProperties = this.boundProperties = [], properties = behaviorType.properties; - for (i = 0, ii = properties.length; i < ii; ++i) { - prop = properties[i]; + properties.forEach(function (prop) { + var selfSubscriber, observer, info, attribute; if (prop.changeHandler) { selfSubscriber = function (newValue, oldValue) { @@ -45,7 +45,7 @@ define(["exports"], function (exports) { observer.publishing = true; observer.selfSubscriber = selfSubscriber; - } + }); }; BehaviorInstance.prototype.created = function (context) { diff --git a/dist/commonjs/behavior-instance.js b/dist/commonjs/behavior-instance.js index 731baed7..3c67d4c0 100644 --- a/dist/commonjs/behavior-instance.js +++ b/dist/commonjs/behavior-instance.js @@ -4,10 +4,10 @@ var BehaviorInstance = function BehaviorInstance(taskQueue, observerLocator, beh this.behaviorType = behaviorType; this.executionContext = executionContext; - var lookup = observerLocator.getObserversLookup(executionContext), skipSelfSubscriber = behaviorType.handlesBind, attributes = instruction.attributes, boundProperties = this.boundProperties = [], properties = behaviorType.properties, i, ii, prop, selfSubscriber, observer, info, attribute; + var lookup = observerLocator.getObserversLookup(executionContext), skipSelfSubscriber = behaviorType.handlesBind, attributes = instruction.attributes, boundProperties = this.boundProperties = [], properties = behaviorType.properties; - for (i = 0, ii = properties.length; i < ii; ++i) { - prop = properties[i]; + properties.forEach(function (prop) { + var selfSubscriber, observer, info, attribute; if (prop.changeHandler) { selfSubscriber = function (newValue, oldValue) { @@ -44,7 +44,7 @@ var BehaviorInstance = function BehaviorInstance(taskQueue, observerLocator, beh observer.publishing = true; observer.selfSubscriber = selfSubscriber; - } + }); }; BehaviorInstance.prototype.created = function (context) { diff --git a/dist/es6/behavior-instance.js b/dist/es6/behavior-instance.js index 96307ee2..fc043074 100644 --- a/dist/es6/behavior-instance.js +++ b/dist/es6/behavior-instance.js @@ -7,12 +7,11 @@ export class BehaviorInstance { skipSelfSubscriber = behaviorType.handlesBind, attributes = instruction.attributes, boundProperties = this.boundProperties = [], - properties = behaviorType.properties, - i, ii, prop, selfSubscriber, observer, info, attribute; - - for(i = 0, ii = properties.length; i < ii; ++i){ - prop = properties[i]; + properties = behaviorType.properties; + properties.forEach(prop => { + var selfSubscriber, observer, info, attribute; + if(prop.changeHandler){ selfSubscriber = (newValue, oldValue) => executionContext[prop.changeHandler](newValue, oldValue); } @@ -51,7 +50,7 @@ export class BehaviorInstance { observer.publishing = true; observer.selfSubscriber = selfSubscriber; - } + }); } created(context){ diff --git a/dist/system/behavior-instance.js b/dist/system/behavior-instance.js index e3fde20d..1fcfa92c 100644 --- a/dist/system/behavior-instance.js +++ b/dist/system/behavior-instance.js @@ -9,10 +9,10 @@ System.register([], function (_export) { this.behaviorType = behaviorType; this.executionContext = executionContext; - var lookup = observerLocator.getObserversLookup(executionContext), skipSelfSubscriber = behaviorType.handlesBind, attributes = instruction.attributes, boundProperties = this.boundProperties = [], properties = behaviorType.properties, i, ii, prop, selfSubscriber, observer, info, attribute; + var lookup = observerLocator.getObserversLookup(executionContext), skipSelfSubscriber = behaviorType.handlesBind, attributes = instruction.attributes, boundProperties = this.boundProperties = [], properties = behaviorType.properties; - for (i = 0, ii = properties.length; i < ii; ++i) { - prop = properties[i]; + properties.forEach(function (prop) { + var selfSubscriber, observer, info, attribute; if (prop.changeHandler) { selfSubscriber = function (newValue, oldValue) { @@ -49,7 +49,7 @@ System.register([], function (_export) { observer.publishing = true; observer.selfSubscriber = selfSubscriber; - } + }); }; BehaviorInstance.prototype.created = function (context) { diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index ea889442..c12e88c5 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,11 @@ +### 0.6.1 (2015-01-08) + + +#### Bug Fixes + +* **behavior-instance:** classic loop, function var bug ([359749a4](http://github.com/aurelia/templating/commit/359749a43b8cdfc669f4f7c7a9796db3a31d67cd)) + + ## 0.6.0 (2015-01-07) diff --git a/package.json b/package.json index 3979735f..11195766 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-templating", - "version": "0.6.0", + "version": "0.6.1", "description": "An extensible HTML templating engine supporting databinding, custom elements, attached behaviors and more.", "keywords": [ "aurelia",