jQuery 1.4.2のスケルトン

本当は要点となる部分をサクっと把握できればいいのだろうけど、地道に作業してみた。約6000行を400行にした。

(function(window, undefined){
	var jQuery = function(){
			return new jQuery.fn.init();
		},
		_jQuery, _$, document, rootjQuery, quickExpr, isSimple, 
		rnotwhite, rtrim, rsingleTag, userAgent, browserMatch, readyBound,
		readyList, DOMContentLoaded, toString, hasOwnProperty, push, slice, indexOf;

	jQuery.fn = jQuery.prototype = {
		init      : function(){},
		selector  : "",
		jquery    : "",
		length    : "",
		size      : function(){},
		toArray   : function(){},
		get       : function(){},
		pushStack : function(){},
		each      : function(){},
		ready     : function(){},
		eq        : function(){},
		first     : function(){},
		last      : function(){},
		slice     : function(){},
		map       : function(){},
		end       : function(){},
		push      : push,
		sort      : [].sort,
		splice    : [].splice
	};

	jQuery.fn.init.prototype = jQuery.fn;

	jQuery.extend = jQuery.fn.extend = function(){};
	
	jQuery.extend({
		noConflict    : function(){},
		isReady       : function(){},
		ready         : function(){},
		bindReady     : function(){},
		isFunction    : function(){},
		isArray       : function(){},
		isPlainObject : function(){},
		isEmptyObject : function(){},
		error         : function(){},
		parseJSON     : function(){},
		noop          : function(){},
		globalEval    : function(){},
		nodeName      : function(){},
		each          : function(){},
		trim          : function(){},
		makeArray     : function(){},
		inArray       : function(){},
		merge         : function(){},
		grep          : function(){},
		map           : function(){},
		guid          : "",
		proxy         : function(){},
		uaMatch       : function(){},
		browser       : ""
	});
	
	browserMatch = jQuery.uaMatch();
	
	rootjQuery = jQuery(document);
	
	function doScrollCheck(){}
	function evalScript(){}
	function access(){}
	function now(){}
	(function(){
		jQuery.support = {
			leadingWhitespace : "",
			tbody             : "",
			style             : "",
			hrefNormalized    : "",
			opacity           : "",
			cssFloat          : "",
			checkOn           : "",
			optSelected       : "",
			parentNode        : "",
			deleteExpando     : "",
			checkClone        : "",
			scriptEval        : "",
			noCloneEvent      : "",
			boxModel          : ""
		};
		etc..
	})();
	
	jQuery.props = {};
	var expando = "";
	
	jQuery.extend({
		cache       : "",
		expando     : "",
		noData      : "",
		data        : function(){},
		removeData  : function(){}
	});
	jQuery.fn.extend({
		data        : function(){},
		removeData  : function(){}
	});
	
	
	jQuery.extend({
		queue       : function(){},
		dequeue     : function(){}
	});
	jQuery.fn.extend({
		queue       : function(){},
		dequeue     : function(){},
		delay       : function(){},
		clearQueue  : function(){}
	});
	
	var rclass, rspace, rreturn, rspecialurl,
	    rtype, rfocusable, rclickable, rradiochek;
	    
	jQuery.fn.extend({
		attr        : function(){},
		removeAttr  : function(){},
		addClass    : function(){},
		removeClass : function(){},
		toggleClass : function(){},
		hasClass    : function(){},
		val         : function(){}
	});
	
	jQuery.extend({
		attrFn      : "",
		attr        : function(){}
	});
	
	var rnamespace, fcleanup;
	
	jQuery.event = {
		add         : function(){},
		global      : "",
		remove      : function(){},
		trigger     : function(){},
		handle      : function(){},
		props       : "",
		fix         : function(){},
		guid        : "",
		proxy       : "",
		special     : ""
	};

	var removeEvent = function(){};
	
	jQuery.Event = function(){};
	
	function returnFalse(){};
	function returnTrue(){};
	
	jQuery.Event.prototype = {
		preventDefault     : function(){},
		stopPropagation    : function(){},
		stopImmediatePropagation : function(){},
		isDefaultPrevented       : "",
		isImmediatePropagationStopped : ""
	};
	
	var withinElement = function(){},
		delegate = function(){};

	jQuery.each({
		mouseenter : "",
		mouseleave : ""
	},  function(){}
	);
	
	if(!jQuery.support.submitBubbles){
		
	}
	if(!jQuery.support.changeBubbles){
		
	}
	
	function trigger(){};
	
	if(document.addEventListener){
		
	}
	
	jQuery.each(["bind", "one"], function(){});
	
	jQuery.fn.extend({
		unbind         : function(){},
		delegate       : function(){},
		undelegate     : function(){},
		trigger        : function(){},
		triggerHandler : function(){},
		toggle         : function(){},
		hover          : function(){}
	});
	
	var liveMap = "";
	jQuery.each(["live", "die"], function(){});
	
	function liveHandler(){}
	function liveConvert(){}
	
	jQuery.each(
		"blur focus focusin focusout load resize scroll unload click dblclick " +
		"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
		"change select submit keydown keypress keyup error").split(" "), function(){});
	
	if(window.attachEvent && !window.addEventListener){}
	
	//Sizzle CSS Selecter
	(function(){
		jQuery.find      = Sizzle;
		jQuery.expr      = Sizzle.selectors;
		jQuery.expr[":"] = jQuery.expr.filters;
		jQuery.unique    = Sizzle.uniqueSort;
		jQuery.text      = getText;
		jQuery.isXMLDoc  = isXML;
		jQuery.contains  = contains;
	})();
	
	var runtil, rparentsprev, rmultiselector, slice;
	var winnow = function(){};
	
	jQuery.fn.extend({
		find     : function(){},
		has      : function(){},
		not      : function(){},
		filter   : function(){},
		is       : function(){},
		closest  : function(){},
		index    : function(){},
		add      : function(){},
		andSelf  : function(){}
	});
	
	function isDisconnected(){}
	
	jQuery.each({
		parent        : function(){},
		parents       : function(){},
		parentsUntil  : function(){},
		next          : function(){},
		prev          : function(){},
		nextAll       : function(){},
		prevAll       : function(){},
		nextUntil     : function(){},
		prevUntil     : function(){},
		siblings      : function(){},
		children      : function(){},
		contents      : function(){}
	}, function(){
		
	});
	
	jQuery.extend({
		filter     : function(){},
		dir        : function(){},
		nth        : function(){},
		sibling    : function(){},
	});
	
	var rinlinejQuery, rleadingWhitespace, rxhtmlTag, rselfClosing, rtagName,
	    rtbody, rhtml, rnocache, rchecked, fcloseTag, wrapMap;

	if(!jQuery.support.htmlSerialize){}
	
	jQuery.fn.extend({
		text        : function(){},
		wrapAll     : function(){},
		wrapInner   : function(){},
		wrap        : function(){},
		unwrap      : function(){},
		append      : function(){},
		prepend     : function(){},
		before      : function(){},
		after       : function(){},
		remove      : function(){},
		empty       : function(){},
		clone       : function(){},
		html        : function(){},
		replaceWith : function(){},
		detach      : function(){},
		domMainp    : function(){},
	});
	
	function cloneCopyEvent(){}
	function buildFragment(){}
	
	jQuery.fragments = "";
	
	jQuery.each({
		appendTo     : "",
		prependTo    : "",
		insertBefore : "",
		insertAfter  : "",
		replaceAll   : ""
	}, function(){}
	);
	
	jQuery.extend({
		clean      : function(){},
		cleanData  : function(){}
	});
	
	var rexclude, ralpha, ropacity, rfloat, fdashAlpha, rupper, rnumpx, rnum, 
	    cssShow, cssWidth, cssHeight, getComputedStyle, fcamelCase;

	jQuery.fn.css = function(){};
	
	jQuery.extend({
		style      : function(){},
		css        : function(){},
		curCSS     : function(){},
		swap       : function(){}
	});
	
	if(jQuery.expr && jQuery.expr.filters){}
	
	var jsc, rscript, rselectTextarea, rinput, 
		jsre, rquery, rts, rurl, r20, _load;
		
	jQuery.fn.extend({
		load            : function(){},
		serialize       : function(){},
		serializeArray  : function(){}
	});
	
	jQuery.each(
		"ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
		function(){}
	);
	
	jQuery.extend({
		get              : function(){},
		getScript        : function(){},
		getJSON          : function(){},
		post             : function(){},
		ajaxSetup        : function(){},
		ajaxSettings     : function(){},
		lastModified     : "",
		etag             : "",
		ajax             : function(){},
		handleError      : function(){},
		active           : "",
		httpSuccess      : function(){},
		httpNotModified  : function(){},
		httpData         : function(){},
		param            : function(){}
	});
	
	var elemdisplay, rfxtypes, rfxnum, fxAttrs;

	jQuery.fn.extend({
		show         : function(){},
		hide         : function(){},
		_toggle      : function(){},
		toggle       : function(){},
		fadeTo       : function(){},
		animate      : function(){},
		stop         : function(){}
	});
	
	jQuery.each({
		slideDown    : genFx(),
		slideUp      : genFx(),
		slideToggle  : genFx(),
		fadeIn       : "",
		fadeOut      : ""
	}, function(){});
	
	jQuery.extend({
		speed        : function(){},
		easing       : function(){},
		timers       : "",
		fx           : function(){}
	});
	
	jQuery.fx.prototype = {
		update       : function(){},
		cur          : function(){},
		custom       : function(){},
		show         : function(){},
		hide         : function(){},
		step         : function(){}
	};
	
	jQuery.extend(jQuery.fx, {
		tick         : function(){},
		stop         : function(){},
		speeds       : function(){},
		step         : function(){}
	});
	
	if(jQuery.expr && jQuery.expr.filters){}
	
	function genFx(){}

	if("getBoundingClientRect" in document.documentElement){}
	
	jQuery.offset = {
		initialize      : function(){},
		bodyOffset      : function(){},
		setOffset       : function(){}
	};
	
	jQuery.fn.extend({
		position        : function(){},
		offsetParent    : function(){}
	});
	
	jQuery.each(["Left", "Top"], function(){});
	
	function getWindow(){}
	
	jQuery.each(["Height", "Width"], function(){});
	
	window.jQuery = window.$ = jQuery;
})(window);