git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3e165ae
)
Replaced the rest of the x.constructor != String comparions with typeof (Thanks Kelvin)
author
Jörn Zaefferer
<joern.zaefferer@gmail.com>
Fri, 15 Dec 2006 08:20:46 +0000
(08:20 +0000)
committer
Jörn Zaefferer
<joern.zaefferer@gmail.com>
Fri, 15 Dec 2006 08:20:46 +0000
(08:20 +0000)
src/jquery/jquery.js
patch
|
blob
|
history
diff --git
a/src/jquery/jquery.js
b/src/jquery/jquery.js
index
177d86b
..
554726e
100644
(file)
--- a/
src/jquery/jquery.js
+++ b/
src/jquery/jquery.js
@@
-390,7
+390,7
@@
jQuery.fn = jQuery.prototype = {
*/
\r
attr: function( key, value, type ) {
\r
// Check to see if we're setting style values
\r
*/
\r
attr: function( key, value, type ) {
\r
// Check to see if we're setting style values
\r
- return key.constructor != String || value != undefined ?
\r
+ return typeof key != "string" || value != undefined ?
\r
this.each(function(){
\r
// See if we're setting a hash of styles
\r
if ( value == undefined )
\r
this.each(function(){
\r
// See if we're setting a hash of styles
\r
if ( value == undefined )
\r
@@
-1456,7
+1456,7
@@
jQuery.extend({
// Set the correct context (if none is provided)
\r
context = context || document;
\r
\r
// Set the correct context (if none is provided)
\r
context = context || document;
\r
\r
- if ( t.constructor != String ) return [t];
\r
+ if ( typeof t != "string" ) return [t];
\r
\r
if ( !t.indexOf("//") ) {
\r
context = context.documentElement;
\r
\r
if ( !t.indexOf("//") ) {
\r
context = context.documentElement;
\r
@@
-1645,7
+1645,7
@@
jQuery.extend({
// Otherwise, find the expression to execute
\r
else {
\r
var f = jQuery.expr[m[1]];
\r
// Otherwise, find the expression to execute
\r
else {
\r
var f = jQuery.expr[m[1]];
\r
- if ( f.constructor != String )
\r
+ if ( typeof f != "string" )
\r
f = jQuery.expr[m[1]][m[2]];
\r
\r
// Build a custom macro to enclose it
\r
f = jQuery.expr[m[1]][m[2]];
\r
\r
// Build a custom macro to enclose it
\r