@samitouri / QOS-React-2 / commits / 4b71cf2efe

Combine valid value checks

Matthew Dapena-Tretter committed Apr 3, 2014 at 22:12 UTC 4b71cf2efe1d476f6d2217c7d7c9a17648eefda7
1 file changed +5 -9
src/browser/ui/dom/DOMProperty.js
+5 -9
@@ -132,15 +132,11 @@ var DOMPropertyInjection = {
132 propName
133 );
134 invariant(
135 - !DOMProperty.hasBooleanValue[propName] ||
136 - !DOMProperty.hasNumericValue[propName],
137 - 'DOMProperty: Cannot have both boolean and numeric value: %s',
138 - propName
139 - );
140 - invariant(
141 - !DOMProperty.hasBooleanValue[propName] ||
142 - !DOMProperty.hasBooleanishValue[propName],
143 - 'DOMProperty: Cannot have boolean and booleanish value: %s',
135 + !!DOMProperty.hasBooleanValue[propName] +
136 + !!DOMProperty.hasNumericValue[propName] +
137 + !!DOMProperty.hasBooleanishValue[propName] <= 1,
138 + 'DOMProperty: Value can be one of boolean, booleanish, or numeric ' +
139 + 'value, but not a combination: %s',
140 propName
141 );
142 }