list/list.js
function(where, name) {
		var orig = [][name];
		DefineList.prototype[name] = function() {
			if (!this._length) {
				// For shift and pop, we just return undefined without
				// triggering events.
				return undefined;
			}

			var args = getArgs(arguments),
				len = where && this._length ? this._length - 1 : 0,
				oldLength = this._length ? this._length : 0,
				res;

			// Call the original method.
			runningNative = true;
			res = orig.apply(this, args);
			runningNative = false;

			// Create a change where the args are
			// `len` - Where these items were removed.
			// `remove` - Items removed.
			// `undefined` - The new values (there are none).
			// `res` - The old, removed values (should these be unbound).
			queues.batch.start();
			this._triggerChange("" + len, "remove", undefined, [ res ]);
			this.dispatch('length', [ this._length, oldLength ]);
			queues.batch.stop();

			return res;
		};
	}
function(where, name) {
		var orig = [][name];
		DefineList.prototype[name] = function() {
			if (!this._length) {
				// For shift and pop, we just return undefined without
				// triggering events.
				return undefined;
			}

			var args = getArgs(arguments),
				len = where && this._length ? this._length - 1 : 0,
				oldLength = this._length ? this._length : 0,
				res;

			// Call the original method.
			runningNative = true;
			res = orig.apply(this, args);
			runningNative = false;

			// Create a change where the args are
			// `len` - Where these items were removed.
			// `remove` - Items removed.
			// `undefined` - The new values (there are none).
			// `res` - The old, removed values (should these be unbound).
			queues.batch.start();
			this._triggerChange("" + len, "remove", undefined, [ res ]);
			this.dispatch('length', [ this._length, oldLength ]);
			queues.batch.stop();

			return res;
		};
	}
function ( where , name ) { var orig = [ ] [ name ] ; DefineList . prototype [ name ] = function ( ) { if ( ! this . _length ) { // For shift and pop, we just return undefined without // triggering events. return undefined ; } var args = getArgs ( arguments ) , len = where && this . _length ? this . _length - 1 : 0 , oldLength = this . _length ? this . _length : 0 , res ; // Call the original method. runningNative = true ; res = orig . apply ( this , args ) ; runningNative = false ; // Create a change where the args are // `len` - Where these items were removed. // `remove` - Items removed. // `undefined` - The new values (there are none). // `res` - The old, removed values (should these be unbound). queues . batch . start ( ) ; this . _triggerChange ( "" + len , "remove" , undefined , [ res ] ) ; this . dispatch ( 'length' , [ this . _length , oldLength ] ) ; queues . batch . stop ( ) ; return res ; } ; }
Creates a `remove` type method
Creates a remove type method