지정된 함수에 대해 true를 반환하는 모든 항목이 포함된 새 배열을 반환.
@param	{Array}			target		대상 배열
@param	{Function}		callback	function callback(item:*, index:int, array:Array):Boolean;
@return	{Array}
176807
function ( target, callback ) {
            if ( typeof Array.prototype.filter === 'function' ) {
                this.filter = function ( target, callback ) {
                    if ( this.is(target) ) {
                        return target.filter( callback );
                    } else {
                        throw new Error('[ixBand] "filter()" ' + MSG_NOT_ARRAY);
                    }
                };
            } else {
                this.filter = function ( target, callback ) {
                    if ( this.is(target) ) {
                        var tArray = target,
                            aryNum = tArray.length,
                            result = [], i;
    
                        for ( i = 0; i < aryNum; ++i ) {
                            var ary = tArray[i],
                                state = callback.call( this , ary, i, tArray );
                            if ( state == true ) result.push( ary );
                        }
                        return result;
                    } else {
                        throw new Error('[ixBand] "filter()" ' + MSG_NOT_ARRAY);
                    }
                };
            }
    
            return this.filter( target, callback );
        }
851105
public function callback($callback, $func, $args=array())
	{
		// Make sure the callback is set (this is protecting us when running in non-interactive mode and callbacks aren't set)
		if (!isset($this->callbacks[$callback]))
		{
			return false;
		}

		// Call function
		return call_user_func_array(array($this->callbacks[$callback], $func), $args);
	}
166339
function( elems, callback, arg ) {
		var value, key, ret = [],
			i = 0,
			length = elems.length,
			// jquery objects are treated as arrays
			isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;

		// Go through the array, translating each of the items to their
		if ( isArray ) {
			for ( ; i < length; i++ ) {
				value = callback( elems[ i ], i, arg );

				if ( value != null ) {
					ret[ ret.length ] = value;
				}
			}

		// Go through every key on the object,
		} else {
			for ( key in elems ) {
				value = callback( elems[ key ], key, arg );

				if ( value != null ) {
					ret[ ret.length ] = value;
				}
			}
		}

		// Flatten any nested arrays
		return ret.concat.apply( [], ret );
	}
843747
public function on($target, $event, $callback = null)
    {
        $echostr        = isset($_GET['echostr']) ? $_GET['echostr'] : null;
        $checkSignature = $this->checkSignature();

        if (!$checkSignature) {
            exit("签名验证失败");
        }

        if (!empty($echostr)) {
            echo $echostr;
            exit;
        }

        if (is_null($callback)) {
            $callback = $event;
            $event    = '*';
        }

        if (!is_callable($callback)) {
            exit("$callback 不是一个可调用的函数或方法");
        }

        $rest = $this->$target($event);

        $datas         = [];
        $datas['data'] = $rest;

        if (!empty($rest)) {
            $rest_user                 = [];
            $rest_user['ToUserName']   = $rest['FromUserName'];
            $rest_user['FromUserName'] = $rest['ToUserName'];
            $rest_msg                  = call_user_func_array($callback, $datas);

            if ($rest_msg == 'success') {
                exit('success');
            }

            $rest_array = array_merge($rest_user, $rest_msg);

            $rest_xml = $this->arrayToXml($rest_array);

            $msg_signature = isset($_GET['msg_signature']) ? $_GET['msg_signature'] : null;
            if (!empty($msg_signature) && $msg_signature != '') {
                $rest_xml = $this->encryptMsg($rest_xml);
            }

            exit($rest_xml);
        } else {
            return false;
        }
    }
175692
function (object, callback) {
                var list;
                if (object instanceof List) {
                    list = object;
                } else if (object instanceof Array) {
                    list = new List(object);
                } else {
                    list = new List([object]);
                }

                if (list.size()) {
                    var element = list.at(0);
                    var objectType = this.getObjectTypeIdForElement(element);
                    if (!objectType) {
                        callback("Couldn't find label object type for " + element.prototype.constructor.name);
                        return;
                    }
                    var query = new Query().in("objectIds", list.toArray(function (object) {
                        return object && object.identifier();
                    })).in('objectTypeId', [objectType]);


                    var labels = this.$.dataSource.createCollection(Collection.of(Label)).query(query);

                    labels.fetch({fullData: true}, callback);
                } else {
                    callback && callback();
                }
            }
585344
function (target, f) {
      var r = [];

      var recurse = function (e) {
        r.push(e);
        return f(e);
      };

      var cur = f(target);
      do {
        cur = cur.bind(recurse);
      } while (cur.isSome());

      return r;
    }
201413
function(callback)
    {
        if (this._limit != null && this.offset >= this._limit)
        {
            return callback(null, null);
        }

        var self = this;
        var _next = function(err)
        {       
            if (err)
            {
                return callback(err);
            }
        
            if (self.pos < self.data.length)
            {
                var itemData = self.data[self.pos];
                self.pos++;
                self.offset++;
                var cls = self.itemCls;
                callback(null, new cls(self.api, itemData, true));
            }
            else
            {
                callback(null, null);
            }
        };
        
        if (this.data == null || this.pos >= this.data.length && this.truncated)
        {
            this.loadNextPage(_next);
        }
        else
        {
            process.nextTick(_next);
        }
    }
791565
function async(callback)
{
  var isAsync = false;

  // check if async happened
  defer(function() { isAsync = true; });

  return function async_callback(err, result)
  {
    if (isAsync)
    {
      callback(err, result);
    }
    else
    {
      defer(function nextTick_callback()
      {
        callback(err, result);
      });
    }
  };
}
1334873
function(callback, scope, args) {
        var mArgs = [null];
        if (!scope) {
          scope = this;
        }
        if (args) {
            if (!_isArr(args)) {
              args = [args];
            }
            mArgs = mArgs.concat(args);
        }
        var ord;
        while (ord !== -1 && this.hasMoreCells()){
            ord = this.nextCell();
            mArgs[0] = this.readCell();
            if (callback.apply(scope, mArgs)===false) {
              return false;
            }
        }
        this._idx = 0;
        return true;
    }
1254982
function(obj, callback) {
		var length, key, i, undef;

		if (obj) {
			try {
				length = obj.length;
			} catch(ex) {
				length = undef;
			}

			if (length === undef) {
				// Loop object items
				for (key in obj) {
					if (obj.hasOwnProperty(key)) {
						if (callback(obj[key], key) === false) {
							return;
						}
					}
				}
			} else {
				// Loop array items
				for (i = 0; i < length; i++) {
					if (callback(obj[i], i) === false) {
						return;
					}
				}
			}
		}
	}
143074
function callbackWith() {
  this._callbackWith = [];
  var length = arguments.length;
  for (var i = 0; i < length; i++) {
    var arg = arguments[i];
    this._callbackWith.push(arg);
  }
  return this;
}
110825
function(callback, thisArg) {
      return this.array.forEach(function(v, k) {
        callback.call(thisArg, v, k, this);
      }, this);
    }
351819
function(key, type, callback) {
		return function(value) {
			try {
				if ( value != null || type === 'string' ) {
					if (value) {
						localStorage.setItem(key, type === 'boolean' ? 'X' : value);
					} else {
						localStorage.removeItem(key);
					}
					callback(value);
				}
				value = localStorage.getItem(key);
				return type === 'boolean' ? value === 'X' : value;
			} catch (e) {
				Log.warning("Could not access localStorage while accessing '" + key + "' (value: '" + value + "', are cookies disabled?): " + e.message);
			}
		};
	}
868241
async function asyncForEach(array, callback) {
  for (let index = 0; index < array.length; index++) {
    // eslint-disable-next-line no-await-in-loop
    await callback(array[index], index, array);
  }
}
1190768
function(callback) {
    if (callback) {
      return this.on('destroy', callback);
    }

    // 先销毁遮罩层
    this.mask && this.mask.destroy();

    handleDialogInTop(this, true);

    Dialog.superclass.destroy.apply(this);
  }
533990
function CallbackArray(){
    this.callbacks = new SortedArray(
        function(a,b){
            if (a.uid < b.uid) {return -1;};
            if (a.uid > b.uid) {return  1;};
            if (a.counter < b.counter){ return -1;};
            if (a.counter > b.counter){ return  1;};
            return 0;
        });
}
92240
function (callback) {
            var i;

            for (i = 0; i < this.data.length; i += 1) {
                callback.call(this, this.data[i], i);
            }
            return this;
        }