function once(fn) {
			var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

			var func = fn.bind(context);
			called = 0, result = null;
			return rename(function () {
				result = called === 1 ? result : func.apply(undefined, arguments);
				called |= 1;
				return result;
			}, fn.name);
		}
/**
   * Restricts the execution of a function to one call. Note this does not change the original function.
   * @param {Function} fn The function to limit.
   * @param {Object} [context=null] The context to use.
   * @returns {Function} The restricted function.
   * @memberof XtraUtils.Function.
   * @example
   * function k(a) { return a };
   * k = Function.once(k);
   * k(3);		// 3
   * k(4);		// 4
   */
Restricts the execution of a function to one call. Note this does not change the original function.
@param {Function} fn The function to limit.
@param {Object} [context=null] The context to use.
@returns {Function} The restricted function.
Restricts the execution of a function to one call . Note this does not change the original function . @param { Function } fn The function to limit . @param { Object } [ context = null ] The context to use . @returns { Function } The restricted function .
function once(fn) {
			var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
			var func = fn.bind(context);
			called = 0, result = null;
			return rename(function () {
				result = called === 1 ? result : func.apply(undefined, arguments);
				called |= 1;
				return result;
			}, fn.name);
		}
function once ( fn ) { var context = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : null ; var func = fn . bind ( context ) ; called = 0 , result = null ; return rename ( function ( ) { result = called === 1 ? result : func . apply ( undefined , arguments ) ; called |= 1 ; return result ; } , fn . name ) ; }
Restricts the execution of a function to one call.
Restricts the execution of a function to one call .