From 9d70a7b6329c98d89d3c4b9fdf7fb134680a78ec Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Tue, 5 Apr 2016 16:56:14 -0400 Subject: [PATCH] [changed] doesn't throw when context is missing. --- src/util/reference.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/util/reference.js b/src/util/reference.js index 47ebd7f5f..39b383e35 100644 --- a/src/util/reference.js +++ b/src/util/reference.js @@ -18,18 +18,13 @@ export default class Ref { this.prefix = prefix; this.isContext = key.indexOf(prefix) === 0 this.path = this.isContext ? this.key.slice(this.prefix.length) : this.key - this._get = getter(this.path) + this._get = getter(this.path, true) this.map = mapFn || (value => value); } getValue(parent, context) { let isContext = this.isContext - - if ((isContext && !context) || (!isContext && !context && !parent)) - throw new Error('missing the context necessary to cast this value') - - let value = this._get(isContext ? context : (parent || context)) - + let value = this._get(isContext ? context : (parent || context) || {}) return this.map(value) } }