mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-20 06:50:47 -07:00
1.7.5
This commit is contained in:
Vendored
+8
@@ -888,6 +888,7 @@ module.exports = factory;
|
||||
var _ = require('./util/underscore.js');
|
||||
var lexical = require('./lexical.js');
|
||||
var assert = require('./util/assert.js');
|
||||
var toStr = Object.prototype.toString;
|
||||
|
||||
var Scope = {
|
||||
getAll: function getAll() {
|
||||
@@ -962,9 +963,16 @@ var Scope = {
|
||||
throw new TypeError('undefined variable');
|
||||
}
|
||||
var variable = obj[varName];
|
||||
var lastName = paths.pop();
|
||||
paths.forEach(function (p) {
|
||||
return variable = variable[p];
|
||||
});
|
||||
if (undefined !== lastName) {
|
||||
if (lastName === 'size' && (toStr.call(variable) === '[object Array]' || toStr.call(variable) === '[object String]')) {
|
||||
return variable.length;
|
||||
}
|
||||
variable = variable[lastName];
|
||||
}
|
||||
return variable;
|
||||
},
|
||||
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user