From 96eac06e2d18f9d1b18fa892118cdf1008430e45 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 25 Nov 2017 14:23:57 -0500 Subject: [PATCH] fix ES5 scoping bug --- store.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/store.js b/store.js index 025d96a5ce..d3f3a3a5d9 100644 --- a/store.js +++ b/store.js @@ -154,7 +154,7 @@ function combineStores(children, store) { if (!store) store = new Store(); var updates = {}; - for (var key in children) { + function addChild(key) { var child = children[key]; updates[key] = child.get(); @@ -165,6 +165,8 @@ function combineStores(children, store) { }); } + for (var key in children) addChild(key); + store.set(updates); return store; }