Skip to content

Commit c8fe2b9

Browse files
committed
Fix parent context
context.parentContext just needs to be a reference to the parent context. createChildResolver function not required. No need to go to the parent context to do anything as the parent has no need to be aware of the child's existence (it's the child that must reference the parent). Original createChildResolver function was calling "child" a resolver based on the parent context as this._context is the parent context when the function is called.
1 parent f6b39be commit c8fe2b9

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

backbone.geppetto.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@
8080
});
8181
},
8282

83-
createChildResolver: function() {
84-
var child = new Resolver(this._context);
85-
child.parent = this;
86-
return child;
87-
},
8883

8984
getObject: function(key) {
9085
return this._retrieveFromCacheOrCreate(key, false);
@@ -182,11 +177,13 @@
182177

183178
if (this.options.resolver) {
184179
this.resolver = this.options.resolver;
185-
} else if (this.parentContext) {
186-
this.resolver = this.parentContext.resolver.createChildResolver();
187180
} else if (!this.resolver) {
188181
this.resolver = new Resolver(this);
189182
}
183+
184+
if (this.parentContext){
185+
this.resolver.parent = this.parentContext.resolver
186+
}
190187

191188
this.vent = {};
192189
_.extend(this.vent, Backbone.Events);

0 commit comments

Comments
 (0)