From 23a9a068b4c1d72f26dd28aa90a8b53a8f487ef3 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Mon, 19 Oct 2015 14:43:27 -0700 Subject: [PATCH] More efficient iteration. --- src/standard/configure.html | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/standard/configure.html b/src/standard/configure.html index 62fd8cf1ff..cc0f9f9d1e 100644 --- a/src/standard/configure.html +++ b/src/standard/configure.html @@ -46,13 +46,15 @@ // storage for configuration _setupConfigure: function(initialConfig) { this._config = {}; - // don't accept undefined values in intialConfig - for (var i in initialConfig) { - if (initialConfig[i] !== undefined) { - this._config[i] = initialConfig[i]; + this._handlers = []; + if (initialConfig) { + // don't accept undefined values in intialConfig + for (var i in initialConfig) { + if (initialConfig[i] !== undefined) { + this._config[i] = initialConfig[i]; + } } } - this._handlers = []; }, // static attributes are deserialized into _config @@ -87,9 +89,9 @@ // get individual default values from property configs var config = {}; // mixed-in behaviors - this.behaviors.forEach(function(b) { - this._configureProperties(b.properties, config); - }, this); + for (var i=0; i < this.behaviors.length; i++) { + this._configureProperties(this.behaviors[i].properties, config); + } // prototypical behavior this._configureProperties(this.properties, config); // override local configuration with configuration from above