Skip to content

Commit 9d70a7b

Browse files
committed
[changed] doesn't throw when context is missing.
1 parent 594fa53 commit 9d70a7b

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/util/reference.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,13 @@ export default class Ref {
1818
this.prefix = prefix;
1919
this.isContext = key.indexOf(prefix) === 0
2020
this.path = this.isContext ? this.key.slice(this.prefix.length) : this.key
21-
this._get = getter(this.path)
21+
this._get = getter(this.path, true)
2222
this.map = mapFn || (value => value);
2323
}
2424

2525
getValue(parent, context) {
2626
let isContext = this.isContext
27-
28-
if ((isContext && !context) || (!isContext && !context && !parent))
29-
throw new Error('missing the context necessary to cast this value')
30-
31-
let value = this._get(isContext ? context : (parent || context))
32-
27+
let value = this._get(isContext ? context : (parent || context) || {})
3328
return this.map(value)
3429
}
3530
}

0 commit comments

Comments
 (0)