Skip to content

Commit

Permalink
Don't polyfill Number.isNaN globally.
Browse files Browse the repository at this point in the history
  • Loading branch information
rickbeerendonk committed Jan 10, 2016
1 parent 7c5390f commit 0df4450
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/renderers/dom/shared/CSSPropertyOperations.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

'use strict';

require('Number.isNaN');

var CSSProperty = require('CSSProperty');
var ExecutionEnvironment = require('ExecutionEnvironment');
var ReactPerf = require('ReactPerf');
Expand All @@ -21,6 +19,7 @@ var camelizeStyleName = require('camelizeStyleName');
var dangerousStyleValue = require('dangerousStyleValue');
var hyphenateStyleName = require('hyphenateStyleName');
var memoizeStringOnly = require('memoizeStringOnly');
var numberIsNaN = require('Number.isNaN');
var warning = require('warning');

var processStyleName = memoizeStringOnly(function(styleName) {
Expand Down Expand Up @@ -120,7 +119,7 @@ if (__DEV__) {
warnBadVendoredStyleName(name);
} else if (badStyleValueWithSemicolonPattern.test(value)) {
warnStyleValueWithSemicolon(name, value);
} else if (Number.isNaN(value)) {
} else if (numberIsNaN(value)) {
warnStyleValueWithNaN(name, value);
}
};
Expand Down
6 changes: 3 additions & 3 deletions src/shared/stubs/Number.isNaN.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

'use strict';

/*eslint-disable no-self-compare */
Number.isNaN = Number.isNaN || function(value) {
function numberIsNaN(value) {
return value !== value;
};
/*eslint-enable no-self-compare */

module.exports = numberIsNaN;

0 comments on commit 0df4450

Please sign in to comment.