/*
查看数据是否指定类型
@param  {Variable} 数据
@param  {String}   类型
@return {Boolean}  是否指定类型
492896
function(_data,_type){
        try{
            _type = _type.toLowerCase();
            if (_data===null) return _type=='null';
            if (_data===undefined) return _type=='undefined';
            return _o.toString.call(_data).toLowerCase()=='[object '+_type+']';
        }catch(e){
            return !1;
        }
    }
1370080
function findVariables(string) {
  // Do not parse empty files. Otherwise gonzales.parse will fail
  if (!string) {
    return [];
  }

  var out = [],
      ast = gonzales.parse(string, {
        syntax: syntax
      }),
      visitor = {
        // Visitor for SASS, SCSS and plain CSS syntaxes
        test: function(name, nodes) {
          return (name === 'declaration' && nodes.content[0].content[0].type === 'variable') || (name === 'variable' && nodes.content[0].type === 'ident');
        },
        process: function(nodes) {
          if (nodes.type !== 'declaration') {
            out.push(nodes.content[0].content);
          }
        }
      };

  traverser.traverse(ast, visitor);
  return out;
}
522416
function isEmpty(variable) {
        var emptyVariables = {
            'undefined': true,
            'null': true,
            'number': false,
            'boolean': false,
            'function': false,
            'regexp': false,
            'date': false,
            'error': false
        };

        var strType = globalHelpers.getType(variable);
        var boolReturn = void 0;

        if (emptyVariables.hasOwnProperty(strType)) {
            boolReturn = emptyVariables[strType];
        } else {
            switch (strType) {
                case 'object':
                    boolReturn = this.isObjectEmpty(variable);
                    break;

                case 'string':
                    boolReturn = variable ? false : true;
                    break;

                case 'array':
                    boolReturn = variable.length ? false : true;
                    break;
            }
        }

        return boolReturn;
    }
609516
public static boolean isVariableSet(QuerySolution resultRow, String variableName) {

        if (resultRow != null) {
            return resultRow.contains(variableName);
        }

        return false;
    }
822629
function dataselectfn(sel){
    if(typeof(sel) === 'function'){
      return sel;
    }
    //check for a valid js variable name with hyphen(for properties only), $, _ and :
    var m = sel.match(/^[a-zA-Z\$_\@][\w\$:-]*(\.[\w\$:-]*[^\.])*$/);
    if(m === null){
      var found = false, s = sel, parts = [], pfns = [], i = 0, retStr;
      // check if literal
      if(/\'|\"/.test( s.charAt(0) )){
        if(/\'|\"/.test( s.charAt(s.length-1) )){
          retStr = s.substring(1, s.length-1);
          return function(){ return retStr; };
        }
      }else{
        // check if literal + #{var}
        while((m = s.match(/#\{([^{}]+)\}/)) !== null){
          found = true;
          parts[i++] = s.slice(0, m.index);
          pfns[i] = dataselectfn(m[1]);
          s = s.slice(m.index + m[0].length, s.length);
        }
      }
      if(!found){
        error('bad data selector syntax: ' + sel);
      }
      parts[i] = s;
      return concatenator(parts, pfns);
    }
    m = sel.split('.');
    return function(ctxt){
      var data = ctxt.context;
      if(!data){
        return '';
      }
      var  v = ctxt[m[0]],
        i = 0;
      if(v && v.item){
        data = v.item;
        i += 1;
      }
      var n = m.length;
      for(; i < n; i++){
        if(!data){break;}
        data = data[m[i]];
      }
      return (!data && data !== 0) ? '':data;
    };
  }
288870
function checkVariable(i) {
  const start = i;
  let l;

  if (i >= tokensLength) return 0;

  // Skip `$`.
  if (tokens[i].type === TokenType.DollarSign) i++;
  else return 0;

  if (l = checkIdent(i)) i += l;
  else return 0;

  return i - start;
}
47297
function (variable) {
            return typeof variable === "object" &&
                /^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(variable)) &&
                variable.length !== undefined &&
                (variable.length === 0 || (typeof variable[0] === "object" && variable[0].nodeType > 0));
        }
700448
public synchronized boolean variablesChanged() {
        for (Map.Entry<String, Object> entry : variableCache.entrySet()) {
            String variableName = entry.getKey();
            Object oldVariableValue = entry.getValue();
            Object newVariableValue = lookupVariable(variableName);
            if (newVariableValue == null) {
                newVariableValue = defaultVariableCache.get(variableName);
            }
            if (!isEqual(oldVariableValue, newVariableValue)) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Variable " + variableName + " has changed. Old value: " + oldVariableValue + " New value: " + newVariableValue);
                }
                return true;
            }
        }
        return false;
    }
1165708
public boolean containsKey(Object key) {
    if(wrappedBindings.containsKey(key)) {
      return true;
    }
    if (key instanceof String) {
      return variableContext.containsVariable((String) key);
    }
    else {
      return false;
    }
  }
820733
function checkFunction(node) {
            const scope = context.getScope();
            const regExpVar = astUtils.getVariableByName(scope, "RegExp");
            const shadowed = regExpVar && regExpVar.defs.length > 0;

            if (node.callee.type === "Identifier" && node.callee.name === "RegExp" && isString(node.arguments[0]) && !shadowed) {
                checkRegex(node, node.arguments[0].value, node.arguments[0].range[0] + 1);
            }
        }
169327
public Object getVariable(Object key) {
		Object object = null;

		for (int i = working.size() - 1; i >= 0; --i) {
			Map<Object, Object> map = working.get(i);
			object = map.get(key);
			if (object != null)
				break;
		}
		if (object == null)
			object = global.get(key);

		return object;
	}
168499
function isExpression(exp) {
  if (exp && typeof exp === 'object' && !_.isArray(exp)) {
    // 对象
    var keys = _.keys(exp);
    if (
      keys.length &&
      _.every(keys, function (key) {
        return key && key[0] === '$';
      })
    ) {
      // 表达式对象
      return true;
    }
  }
  return false;
}
359775
function compileVariable(source, engine, forText) {
        var code = [];
        var options = engine.options;

        var toStringHead = '';
        var toStringFoot = '';
        var wrapHead = '';
        var wrapFoot = '';

        // 默认的filter，当forText模式时有效
        var defaultFilter;

        if (forText) {
            toStringHead = 'ts(';
            toStringFoot = ')';
            wrapHead = RENDER_STRING_ADD_START;
            wrapFoot = RENDER_STRING_ADD_END;
            defaultFilter = options.defaultFilter;
        }

        parseTextBlock(
            source, options.variableOpen, options.variableClose, 1,

            function (text) {
                // 加入默认filter
                // 只有当处理forText时，需要加入默认filter
                // 处理if/var/use等command时，不需要加入默认filter
                if (forText && text.indexOf('|') < 0 && defaultFilter) {
                    text += '|' + defaultFilter;
                }

                // variableCode是一个gv调用，然后通过循环，在外面包filter的调用
                // 形成filter["b"](filter["a"](gv(...)))
                //
                // 当forText模式，处理的是文本中的变量替换时
                // 传递给filter的需要是字符串形式，所以gv外需要包一层ts调用
                // 形成filter["b"](filter["a"](ts(gv(...))))
                //
                // 当variableName以*起始时，忽略ts调用，直接传递原值给filter
                var filterCharIndex = text.indexOf('|');
                var variableName = (
                        filterCharIndex > 0
                        ? text.slice(0, filterCharIndex)
                        : text
                    ).replace(/^\s+/, '').replace(/\s+$/, '');
                var filterSource = filterCharIndex > 0
                    ? text.slice(filterCharIndex + 1)
                    : '';

                var variableRawValue = variableName.indexOf('*') === 0;
                var variableCode = [
                    variableRawValue ? '' : toStringHead,
                    toGetVariableLiteral(variableName),
                    variableRawValue ? '' : toStringFoot
                ];

                if (filterSource) {
                    filterSource = compileVariable(filterSource, engine);
                    var filterSegs = filterSource.split('|');
                    for (var i = 0, len = filterSegs.length; i < len; i++) {
                        var seg = filterSegs[i];
                        var segMatch = seg.match(/^\s*([a-z0-9_-]+)(\((.*)\))?\s*$/i);
                        if (segMatch) {
                            variableCode.unshift('fs["' + segMatch[1] + '"](');

                            if (segMatch[3]) {
                                variableCode.push(',', segMatch[3]);
                            }

                            variableCode.push(')');
                        }
                    }
                }

                code.push(
                    wrapHead,
                    variableCode.join(''),
                    wrapFoot
                );
            },

            function (text) {
                code.push(
                    wrapHead,
                    forText ? stringLiteralize(text) : text,
                    wrapFoot
                );
            }
        );

        return code.join('');
    }
301968
public VarValueDef getBinding( VarDef var)
    {
    VarBindingDef binding = bindings_.get( var);
    return
      binding == null
      ? null
      : binding.getValueDef();
    }
432396
function checkVariable(variable) {
            astUtils.getModifyingReferences(variable.references).forEach(reference => {
                context.report({ node: reference.identifier, messageId: "unexpected" });
            });
        }
48379
function checkProperty(i) {
  const start = i;
  let l;

  if (i >= tokensLength) return 0;

  if (l = checkVariable(i) || checkIdent(i)) i += l;
  else return 0;

  return i - start;
}
820365
function (vars, name, showTrace) {

            var console = window.parent && window.parent.console && window.parent.console;

            if (!JBZoo.DEBUG) {
                return false;
            }

            // Get type
            var type    = "",
                varType = $this.type(vars);

            if (varType === "string" || varType === "array") {
                type = " (" + varType + ", " + $this.count(vars) + ")";
            } else {
                type = " (" + varType + ")";
            }

            // Wrap in vars quote if string
            if (varType === "string") {
                vars = "\"" + vars + "\"";
            }

            // Get var name
            if (!name) {
                name = "..." + type + " = ";
            } else {
                name += type + " = ";
            }

            // Dump var
            if (console.log) {
                console.log(name, vars);
            }

            // Show backtrace
            if (showTrace && console.trace !== "undefined") {
                console.trace();
                return false;
            }

            return false;
        }