git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Renames Deferred's fire and fireReject methods as resolveWith and rejectWith respecti...
[jquery.git]
/
src
/
core.js
diff --git
a/src/core.js
b/src/core.js
index
fbf6491
..
69f4f5a
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-19,12
+19,8
@@
var jQuery = function( selector, context ) {
// (both of which we optimize for)
quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
// (both of which we optimize for)
quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
- // Is it a simple selector
- isSimple = /^.[^:#\[\.,]*$/,
-
// Check if a string has a non-whitespace character in it
rnotwhite = /\S/,
// Check if a string has a non-whitespace character in it
rnotwhite = /\S/,
- rwhite = /\s/,
// Used for trimming whitespace
trimLeft = /^\s+/,
// Used for trimming whitespace
trimLeft = /^\s+/,
@@
-410,7
+406,7
@@
jQuery.extend({
}
// If there are functions bound, to execute
}
// If there are functions bound, to execute
- readyList.fire( document , [ jQuery ] );
+ readyList.resolveWith( document , [ jQuery ] );
// Trigger any bound ready events
if ( jQuery.fn.trigger ) {
// Trigger any bound ready events
if ( jQuery.fn.trigger ) {
@@
-583,7
+579,7
@@
jQuery.extend({
script.type = "text/javascript";
script.type = "text/javascript";
- if ( jQuery.support.scriptEval ) {
+ if ( jQuery.support.scriptEval() ) {
script.appendChild( document.createTextNode( data ) );
} else {
script.text = data;
script.appendChild( document.createTextNode( data ) );
} else {
script.text = data;
@@
-848,7
+844,7
@@
jQuery.extend({
}
if ( _fired ) {
}
if ( _fired ) {
- deferred.fire( _fired[ 0 ] , _fired[ 1 ] );
+ deferred.resolveWith( _fired[ 0 ] , _fired[ 1 ] );
}
}
}
}
@@
-856,7
+852,7
@@
jQuery.extend({
},
// resolve with given context and args
},
// resolve with given context and args
- fire: function( context , args ) {
+ resolveWith: function( context , args ) {
if ( ! cancelled && ! fired && ! firing ) {
firing = 1;
if ( ! cancelled && ! fired && ! firing ) {
firing = 1;
@@
-876,7
+872,7
@@
jQuery.extend({
// resolve with this as context and given arguments
resolve: function() {
// resolve with this as context and given arguments
resolve: function() {
- deferred.fire( jQuery.isFunction( this.promise ) ? this.promise() : this , arguments );
+ deferred.resolveWith( jQuery.isFunction( this.promise ) ? this.promise() : this , arguments );
return this;
},
return this;
},
@@
-912,7
+908,7
@@
jQuery.extend({
return this;
},
fail: failDeferred.done,
return this;
},
fail: failDeferred.done,
- fireReject: failDeferred.fire,
+ rejectWith: failDeferred.resolveWith,
reject: failDeferred.resolve,
isRejected: failDeferred.isResolved,
// Get a promise for this deferred
reject: failDeferred.resolve,
isRejected: failDeferred.isResolved,
// Get a promise for this deferred
@@
-965,10
+961,10
@@
jQuery.extend({
args = arguments;
resolveArray[ index ] = args.length > 1 ? slice.call( args , 0 ) : value;
if( ! --length ) {
args = arguments;
resolveArray[ index ] = args.length > 1 ? slice.call( args , 0 ) : value;
if( ! --length ) {
- deferred.fire( promise, resolveArray );
+ deferred.resolveWith( promise, resolveArray );
}
}).fail( function() {
}
}).fail( function() {
- deferred.fireReject( promise, arguments );
+ deferred.rejectWith( promise, arguments );
});
return !deferred.isRejected();
});
});
return !deferred.isRejected();
});
@@
-1039,9
+1035,8
@@
if ( indexOf ) {
};
}
};
}
-// Verify that \s matches non-breaking spaces
-// (IE fails on this test)
-if ( !rwhite.test( "\xA0" ) ) {
+// IE doesn't match non-breaking spaces with \s
+if ( rnotwhite.test( "\xA0" ) ) {
trimLeft = /^[\s\xA0]+/;
trimRight = /[\s\xA0]+$/;
}
trimLeft = /^[\s\xA0]+/;
trimRight = /[\s\xA0]+$/;
}