mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
fix #75
This commit is contained in:
+11
-9
@@ -56,15 +56,17 @@ var Scope = {
|
||||
}
|
||||
var key = paths.shift()
|
||||
var value = getValueFromScopes(key, scopes)
|
||||
return paths.reduce(
|
||||
(value, key) => {
|
||||
if (_.isNil(value)) {
|
||||
throw new TypeError('undefined variable: ' + key)
|
||||
}
|
||||
return getValueFromParent(key, value)
|
||||
},
|
||||
value
|
||||
)
|
||||
if (_.isNil(value)) {
|
||||
throw new TypeError('undefined variable: ' + key)
|
||||
}
|
||||
while (paths.length) {
|
||||
key = paths.shift()
|
||||
value = getValueFromParent(key, value)
|
||||
if (_.isNil(value)) {
|
||||
throw new TypeError('undefined variable: ' + key)
|
||||
}
|
||||
}
|
||||
return value
|
||||
},
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user