Combine valid value checks

This commit is contained in:
Matthew Dapena-Tretter
2014-04-10 09:21:56 -04:00
parent 77ae237be9
commit 4b71cf2efe
+5 -9
View File
@@ -132,15 +132,11 @@ var DOMPropertyInjection = {
propName
);
invariant(
!DOMProperty.hasBooleanValue[propName] ||
!DOMProperty.hasNumericValue[propName],
'DOMProperty: Cannot have both boolean and numeric value: %s',
propName
);
invariant(
!DOMProperty.hasBooleanValue[propName] ||
!DOMProperty.hasBooleanishValue[propName],
'DOMProperty: Cannot have boolean and booleanish value: %s',
!!DOMProperty.hasBooleanValue[propName] +
!!DOMProperty.hasNumericValue[propName] +
!!DOMProperty.hasBooleanishValue[propName] <= 1,
'DOMProperty: Value can be one of boolean, booleanish, or numeric ' +
'value, but not a combination: %s',
propName
);
}