From c8fe2b9972789c799e26c6ac95acb9ae7c00421b Mon Sep 17 00:00:00 2001 From: mmikeyy Date: Thu, 28 Aug 2014 14:54:13 -0400 Subject: [PATCH] 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. --- backbone.geppetto.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/backbone.geppetto.js b/backbone.geppetto.js index 32ebe1e..35e1ad1 100755 --- a/backbone.geppetto.js +++ b/backbone.geppetto.js @@ -80,11 +80,6 @@ }); }, - createChildResolver: function() { - var child = new Resolver(this._context); - child.parent = this; - return child; - }, getObject: function(key) { return this._retrieveFromCacheOrCreate(key, false); @@ -182,11 +177,13 @@ if (this.options.resolver) { this.resolver = this.options.resolver; - } else if (this.parentContext) { - this.resolver = this.parentContext.resolver.createChildResolver(); } else if (!this.resolver) { this.resolver = new Resolver(this); } + + if (this.parentContext){ + this.resolver.parent = this.parentContext.resolver + } this.vent = {}; _.extend(this.vent, Backbone.Events);