Permalink
Browse files

Revert "Add type annotations for public ajax methods."

This reverts commit 3f89c59.
  • Loading branch information...
1 parent f2dcd20 commit 141c383df2aaed99049992075fb37171d7370049 @ChadKillingsworth ChadKillingsworth committed Apr 5, 2012
Showing with 12 additions and 40 deletions.
  1. +2 −2 Makefile
  2. +9 −31 src/ajax.js
  3. +0 −6 src/closure-compiler.js
  4. +1 −1 src/traversing.js
View
@@ -5,7 +5,7 @@ BUILD_DIR = build
PREFIX = .
DIST_DIR = ${PREFIX}/dist
-JS_ENGINE = '/cygdrive/c/Program Files (x86)/nodejs/node'
+JS_ENGINE ?= `which node nodejs 2>/dev/null`
COMPILER = ${JS_ENGINE} ${BUILD_DIR}/uglify.js --unsafe
POST_COMPILER = ${JS_ENGINE} ${BUILD_DIR}/post-compile.js
@@ -121,7 +121,7 @@ freq: jquery min
min: jquery ${JQ_MIN}
${JQ_MIN}: ${JQ}
- @@if test ! -z "${JS_ENGINE}"; then \
+ @@if test ! -z ${JS_ENGINE}; then \
echo "Minifying jQuery" ${JQ_MIN}; \
${COMPILER} ${JQ} > ${JQ_MIN}.tmp; \
${POST_COMPILER} ${JQ_MIN}.tmp; \
View
@@ -176,13 +176,6 @@ function ajaxExtend( target, src ) {
}
jQuery.fn.extend({
- /**
- * Annotations must reflect BOTH definitions of jQuery.fn.load
- * @param {string|function(!jQuery.Event=)|Object.<string,*>} url
- * @param {string|function(!jQuery.Event=)|Object.<string,*>} params
- * @param {function(string,string,XMLHttpRequest)=} callback
- * @return {!jQuery}
- */
load: function( url, params, callback ) {
if ( typeof url !== "string" && _load ) {
return _load.apply( this, arguments );
@@ -206,7 +199,7 @@ jQuery.fn.extend({
// If it's a function
if ( jQuery.isFunction( params ) ) {
// We assume that it's the callback
- callback = /** @type {function(string,string,XMLHttpRequest)} */ params;
+ callback = params;
params = undefined;
// Otherwise, build a param string
@@ -259,12 +252,10 @@ jQuery.fn.extend({
return this;
},
- /** @return {string} */
serialize: function() {
return jQuery.param( this.serializeArray() );
},
- /** @return {Array.<Object.<string,*>>} */
serializeArray: function() {
return this.map(function(){
return this.elements ? jQuery.makeArray( this.elements ) : this;
@@ -297,18 +288,12 @@ jQuery.expandedEach( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajax
});
jQuery.expandedEach( [ "get", "post" ], function( i, method ) {
- /**
- * @param {string} url
- * @param {(string|Object.<string,*>|function((string|Node),string,jQuery.jqXHR))=} data
- * @param {(function((string|Node),string,jQuery.jqXHR)|string)=} callback
- * @param {?string=} type
- * @return {!jQuery.jqXHR}
- */
+ /** @return {jQuery} */
jQuery[ method ] = function( url, data, callback, type ) {
// shift arguments if data argument was omitted
if ( jQuery.isFunction( data ) ) {
- type = type || /** @type{?string} */ callback;
- callback = /** @type {function((string|Node),string,jQuery.jqXHR)} */ data;
+ type = type || callback;
+ callback = data;
data = undefined;
}
@@ -323,21 +308,11 @@ jQuery.expandedEach( [ "get", "post" ], function( i, method ) {
});
jQuery.extend({
- /**
- * @param {string} url
- * @param {function((Node|string),string,jQuery.jqXHR)=} callback
- * @return {!jQuery.jqXHR}
- */
+
getScript: function( url, callback ) {
return jQuery.get( url, undefined, callback, "script" );
},
- /**
- * @param {string} url
- * @param {(Object.<string,*>|function(Node,string,jQuery.jqXHR))=} data
- * @param {function((Node|string),string,jQuery.jqXHR)=} callback
- * @return {!jQuery.jqXHR}
- */
getJSON: function( url, data, callback ) {
return jQuery.get( url, data, callback, "json" );
},
@@ -436,7 +411,6 @@ jQuery.extend({
* Main method
* @param {string|jQuery.AjaxSettings} url
* @param {jQuery.AjaxSettings=} options
- * @return {!jQuery.jqXHR}
*/
ajax: function( url, options ) {
@@ -529,6 +503,10 @@ jQuery.extend({
return this;
},
+ /**
+ * Cancel the request
+ * @param {string=} statusText
+ */
abort: function( statusText ) {
statusText = statusText || strAbort;
if ( transport ) {
View
@@ -217,12 +217,6 @@ jQuery.jqXHR = function () {};
jQuery.jqXHR.prototype.always = function( alwaysCallbacks, alwaysCallbacks2 ) {};
/**
- * @param {string=} statusText
- * @return {!jQuery.jqXHR}
- */
-jQuery.jqXHR.prototype.abort = function ( statusText ) {};
-
-/**
* @override
* @param {?function()} doneCallbacks
* @param {?function()=} failCallbacks
View
@@ -156,7 +156,7 @@ jQuery.fn.extend({
var set = typeof selector === "string" ?
jQuery( selector, context ) :
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
- all = /** @type {Array.<Element>} */ ( jQuery.merge( this.get(), set ) );
+ all = jQuery.merge( this.get(), set );
return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
all :

0 comments on commit 141c383

Please sign in to comment.