From 2c290709d867ffd54b0011373de292b8e86a3509 Mon Sep 17 00:00:00 2001 From: jeresig Date: Wed, 26 Jan 2011 16:36:33 -0500 Subject: [PATCH 1/3] Make sure that init is run before jquery is built (avoiding weird warnings when running 'make jquery' or 'make min'). Additionally only attempt to run JSLint or the minifier if NodeJS is installed (avoiding a weird warning when you first run 'make' or 'make all'). --- Makefile | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index c708db5a..4dcc9e35 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ VER = sed "s/@VERSION/${JQ_VER}/" DATE=$(shell git log -1 --pretty=format:%ad) -all: init jquery min lint +all: jquery min lint @@echo "jQuery build complete." ${DIST_DIR}: @@ -68,12 +68,16 @@ define clone_or_pull endef -init: +${QUNIT_DIR}: $(call clone_or_pull, ${QUNIT_DIR}, git://github.com/jquery/qunit.git) + +${SIZZLE_DIR}: $(call clone_or_pull, ${SIZZLE_DIR}, git://github.com/jeresig/sizzle.git) -jquery: ${JQ} -jq: ${JQ} +init: ${QUNIT_DIR} ${SIZZLE_DIR} + +jquery: init ${JQ} +jq: init ${JQ} ${JQ}: ${MODULES} | ${DIST_DIR} @@echo "Building" ${JQ} @@ -88,18 +92,27 @@ ${SRC_DIR}/selector.js: ${SIZZLE_DIR}/sizzle.js @@echo "Building selector code from Sizzle" @@sed '/EXPOSE/r src/sizzle-jquery.js' ${SIZZLE_DIR}/sizzle.js | grep -v window.Sizzle > ${SRC_DIR}/selector.js -lint: ${JQ} - @@echo "Checking jQuery against JSLint..." - @@${JS_ENGINE} build/jslint-check.js +lint: jquery + @@if test ! -z ${JS_ENGINE}; then \ + echo "Checking jQuery against JSLint..."; \ + ${JS_ENGINE} build/jslint-check.js; \ + else \ + echo "You must have NodeJS installed in order to test jQuery against JSLint."; \ + fi min: ${JQ_MIN} -${JQ_MIN}: ${JQ} - @@echo "Building" ${JQ_MIN} - @@${COMPILER} ${JQ} > ${JQ_MIN}.tmp - @@echo ";" >> ${JQ_MIN}.tmp - @@sed 's/\*\/(/*\/ʩ(/' ${JQ_MIN}.tmp | tr "ʩ" "\n" > ${JQ_MIN} - @@rm -rf ${JQ_MIN}.tmp +${JQ_MIN}: jquery + @@if test ! -z ${JS_ENGINE}; then \ + echo "Minifying jQuery" ${JQ_MIN}; \ + ${COMPILER} ${JQ} > ${JQ_MIN}.tmp; \ + echo ";" >> ${JQ_MIN}.tmp; \ + sed 's/\*\/(/*\/ʩ(/' ${JQ_MIN}.tmp | tr "ʩ" "\n" > ${JQ_MIN}; \ + rm -rf ${JQ_MIN}.tmp; \ + else \ + echo "You must have NodeJS installed in order to minify jQuery."; \ + fi + clean: @@echo "Removing Distribution directory:" ${DIST_DIR} From ba43d37394b6018779d9a668c548e11579cd424a Mon Sep 17 00:00:00 2001 From: Anton M Date: Wed, 26 Jan 2011 22:50:15 +0100 Subject: [PATCH 2/3] Fix Makefile to use plain sed agin. Remove unicode trickery. Thanks to danheberden and gnarf for figuring out why it previously faild on Mac OS X. --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4dcc9e35..48a885da 100644 --- a/Makefile +++ b/Makefile @@ -106,8 +106,7 @@ ${JQ_MIN}: jquery @@if test ! -z ${JS_ENGINE}; then \ echo "Minifying jQuery" ${JQ_MIN}; \ ${COMPILER} ${JQ} > ${JQ_MIN}.tmp; \ - echo ";" >> ${JQ_MIN}.tmp; \ - sed 's/\*\/(/*\/ʩ(/' ${JQ_MIN}.tmp | tr "ʩ" "\n" > ${JQ_MIN}; \ + sed '$ s#^\( \*/\)\(.\+\)#\1\n\2;#' ${JQ_MIN}.tmp > ${JQ_MIN}; \ rm -rf ${JQ_MIN}.tmp; \ else \ echo "You must have NodeJS installed in order to minify jQuery."; \ From ab1d9a8a2c296a2fa31b7d15146ce115c4057fad Mon Sep 17 00:00:00 2001 From: gnarf Date: Wed, 26 Jan 2011 16:12:23 -0600 Subject: [PATCH 3/3] Remove unneeded and confusing variable definition for better readability. --- src/core.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core.js b/src/core.js index 43d46e9e..422b6887 100644 --- a/src/core.js +++ b/src/core.js @@ -929,10 +929,9 @@ jQuery.extend({ if ( length > 1 ) { resolveArray = new Array( length ); - jQuery.each( args, function( index, element, args ) { + jQuery.each( args, function( index, element ) { jQuery.when( element ).then( function( value ) { - args = arguments; - resolveArray[ index ] = args.length > 1 ? slice.call( args, 0 ) : value; + resolveArray[ index ] = arguments.length > 1 ? slice.call( arguments, 0 ) : value; if( ! --length ) { deferred.resolveWith( promise, resolveArray ); }