Skip to content

Commit

Permalink
IE7 gets mad if you name a local variable toString
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav authored and paulirish committed May 16, 2010
1 parent c32cecb commit a09c74b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modernizr.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ window.Modernizr = (function(window,doc,undefined){
smile = ':)',
touch = 'touch',

toString = Object.prototype.toString,
// IE7 gets mad if you name a local variable `toString`
tostring = Object.prototype.toString,

// list of property values to set for css tests. see ticket #21
setProperties = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '),
Expand Down Expand Up @@ -648,12 +649,12 @@ window.Modernizr = (function(window,doc,undefined){
// thanks to F1lt3r and lucideer
// http://github.com/Modernizr/Modernizr/issues#issue/35
tests[smil] = function(){
return doc.createElementNS && /SVG/.test(toString.call(doc.createElementNS('http://www.w3.org/2000/svg','animate')));
return doc.createElementNS && /SVG/.test(tostring.call(doc.createElementNS('http://www.w3.org/2000/svg','animate')));
};

tests[svgclippaths] = function(){
// returns a false positive in saf 3.2?
return doc.createElementNS && /SVG/.test(toString.call(doc.createElementNS('http://www.w3.org/2000/svg','clipPath')));
return doc.createElementNS && /SVG/.test(tostring.call(doc.createElementNS('http://www.w3.org/2000/svg','clipPath')));
};


Expand Down

0 comments on commit a09c74b

Please sign in to comment.