Skip to content

Commit

Permalink
Inline the Number.isNaN polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
jontewks committed Jan 12, 2016
1 parent c82ce1d commit 59d5d01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
8 changes: 4 additions & 4 deletions src/renderers/dom/shared/CSSPropertyOperations.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ var dangerousStyleValue = require('dangerousStyleValue');
var hyphenateStyleName = require('hyphenateStyleName');
var memoizeStringOnly = require('memoizeStringOnly');
var warning = require('warning');
var numberIsNaN = require('../../../shared/stubs/Number.isNaN');

var processStyleName = memoizeStringOnly(function(styleName) {
return hyphenateStyleName(styleName);
Expand Down Expand Up @@ -51,6 +50,7 @@ if (__DEV__) {

var warnedStyleNames = {};
var warnedStyleValues = {};
var warnedForNaNValue = false;

var warnHyphenatedStyleName = function(name) {
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
Expand Down Expand Up @@ -96,11 +96,11 @@ if (__DEV__) {
};

var warnStyleValueIsNaN = function(name, value) {
if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
if (warnedForNaNValue) {
return;
}

warnedStyleValues[value] = true;
warnedForNaNValue = true;
warning(
false,
'`NaN` is an invalid value for the `%s` css style property',
Expand All @@ -121,7 +121,7 @@ if (__DEV__) {
warnStyleValueWithSemicolon(name, value);
}

if (numberIsNaN(value)) {
if (typeof value === 'number' && isNaN(value)) {
warnStyleValueIsNaN(name, value);
}
};
Expand Down
11 changes: 0 additions & 11 deletions src/shared/stubs/Number.isNaN.js

This file was deleted.

0 comments on commit 59d5d01

Please sign in to comment.