src/helper/jsonify/references.js
function(ast){

      var local = this.getLocal(ast);
      var real = local.real || ast;
      var ret = { ignore: false, type: 'string', real: real, foreach: false };

      if (local.real === undefined && local.isGlobal !== true) {
        ret.ignore = true;
      }

      var m = this.hasMethod(real);
      var eachTo;

      if (local.type == 'foreach') {

        if (ast.id == local.ast.to) {

          // 排除get key value size等通用方法
          if (ast.path && !(~['get', 'key', 'value', 'size'].indexOf(ast.path[0].id))) {
            local.objectKeys.push(ast.path[0].id);
            ret.ignore = true;
          } else {
            ret.real = local.ast;
            ret.foreach = true;
          }
        }

        eachTo = ast.id;
      }

      if (m === 'ignore') {
        ret.ignore = true;
      } else if (m) {
        ret.foreach = ret.foreach || this.hasParamInForeach(real);
        ret.type = 'method';
      }

      return ret;

    }
function(ast){

      var local = this.getLocal(ast);
      var real = local.real || ast;
      var ret = { ignore: false, type: 'string', real: real, foreach: false };

      if (local.real === undefined && local.isGlobal !== true) {
        ret.ignore = true;
      }

      var m = this.hasMethod(real);
      var eachTo;

      if (local.type == 'foreach') {

        if (ast.id == local.ast.to) {

          // 排除get key value size等通用方法
          if (ast.path && !(~['get', 'key', 'value', 'size'].indexOf(ast.path[0].id))) {
            local.objectKeys.push(ast.path[0].id);
            ret.ignore = true;
          } else {
            ret.real = local.ast;
            ret.foreach = true;
          }
        }

        eachTo = ast.id;
      }

      if (m === 'ignore') {
        ret.ignore = true;
      } else if (m) {
        ret.foreach = ret.foreach || this.hasParamInForeach(real);
        ret.type = 'method';
      }

      return ret;

    }
获取变量类型 TODO: foreach嵌套处理