From e97990577d81b59a44f0fbec4dfef96b4b9be048 Mon Sep 17 00:00:00 2001 From: Andreas Eldh Date: Fri, 22 Aug 2014 14:04:00 +0200 Subject: [PATCH 1/3] Allow infinite ActiveState change listeners. Fixes a warning from event-emitter when using more than ten Links (or other components using the ActiveState mixin). --- modules/stores/ActiveStore.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/stores/ActiveStore.js b/modules/stores/ActiveStore.js index 654bd402ff..f56db8c296 100644 --- a/modules/stores/ActiveStore.js +++ b/modules/stores/ActiveStore.js @@ -3,6 +3,8 @@ var EventEmitter = require('events').EventEmitter; var CHANGE_EVENT = 'change'; var _events = new EventEmitter; +_events.setMaxListeners(0); + function notifyChange() { _events.emit(CHANGE_EVENT); } From fa4127f9116541f3c5b8d6dec56365116eb62349 Mon Sep 17 00:00:00 2001 From: Andreas Eldh Date: Fri, 22 Aug 2014 14:17:53 +0200 Subject: [PATCH 2/3] Fix error in updateMatchComponents Fix for an error being thrown in Routes.js - updateMatchComponents. --- modules/components/Routes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/components/Routes.js b/modules/components/Routes.js index 7d87437e78..3dd8194b58 100644 --- a/modules/components/Routes.js +++ b/modules/components/Routes.js @@ -230,7 +230,7 @@ function findMatches(path, routes, defaultRoute) { if (matches != null) { var rootParams = getRootMatch(matches).params; - + params = route.props.paramNames.reduce(function (params, paramName) { params[paramName] = rootParams[paramName]; return params; @@ -281,7 +281,7 @@ function getRootMatch(matches) { function updateMatchComponents(matches, refs) { var i = 0, component; - while (component = refs[REF_NAME]) { + while ((component = refs[REF_NAME]) && (matches[i+1] !== undefined)) { matches[i++].component = component; refs = component.refs; } From 1df30574da94a959211792e9b73a8b8960081d7c Mon Sep 17 00:00:00 2001 From: Andreas Eldh Date: Fri, 22 Aug 2014 17:35:05 +0200 Subject: [PATCH 3/3] Revert "Fix error in updateMatchComponents" This reverts commit fa4127f9116541f3c5b8d6dec56365116eb62349. --- modules/components/Routes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/components/Routes.js b/modules/components/Routes.js index 3dd8194b58..7d87437e78 100644 --- a/modules/components/Routes.js +++ b/modules/components/Routes.js @@ -230,7 +230,7 @@ function findMatches(path, routes, defaultRoute) { if (matches != null) { var rootParams = getRootMatch(matches).params; - + params = route.props.paramNames.reduce(function (params, paramName) { params[paramName] = rootParams[paramName]; return params; @@ -281,7 +281,7 @@ function getRootMatch(matches) { function updateMatchComponents(matches, refs) { var i = 0, component; - while ((component = refs[REF_NAME]) && (matches[i+1] !== undefined)) { + while (component = refs[REF_NAME]) { matches[i++].component = component; refs = component.refs; }