File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -888,6 +888,7 @@ module.exports = factory;
888888var _ = require ( './util/underscore.js' ) ;
889889var lexical = require ( './lexical.js' ) ;
890890var assert = require ( './util/assert.js' ) ;
891+ var toStr = Object . prototype . toString ;
891892
892893var Scope = {
893894 getAll : function getAll ( ) {
@@ -962,9 +963,16 @@ var Scope = {
962963 throw new TypeError ( 'undefined variable' ) ;
963964 }
964965 var variable = obj [ varName ] ;
966+ var lastName = paths . pop ( ) ;
965967 paths . forEach ( function ( p ) {
966968 return variable = variable [ p ] ;
967969 } ) ;
970+ if ( undefined !== lastName ) {
971+ if ( lastName === 'size' && ( toStr . call ( variable ) === '[object Array]' || toStr . call ( variable ) === '[object String]' ) ) {
972+ return variable . length ;
973+ }
974+ variable = variable [ lastName ] ;
975+ }
968976 return variable ;
969977 } ,
970978
You can’t perform that action at this time.
0 commit comments