mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Rename "booleanish" to "overloaded boolean"
This commit is contained in:
@@ -34,7 +34,7 @@ var DOMPropertyInjection = {
|
||||
HAS_BOOLEAN_VALUE: 0x8,
|
||||
HAS_NUMERIC_VALUE: 0x10,
|
||||
HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10,
|
||||
HAS_BOOLEANISH_VALUE: 0x40,
|
||||
HAS_OVERLOADED_BOOLEAN_VALUE: 0x40,
|
||||
|
||||
/**
|
||||
* Inject some specialized knowledge about the DOM. This takes a config object
|
||||
@@ -116,8 +116,8 @@ var DOMPropertyInjection = {
|
||||
propConfig & DOMPropertyInjection.HAS_NUMERIC_VALUE;
|
||||
DOMProperty.hasPositiveNumericValue[propName] =
|
||||
propConfig & DOMPropertyInjection.HAS_POSITIVE_NUMERIC_VALUE;
|
||||
DOMProperty.hasBooleanishValue[propName] =
|
||||
propConfig & DOMPropertyInjection.HAS_BOOLEANISH_VALUE;
|
||||
DOMProperty.hasOverloadedBooleanValue[propName] =
|
||||
propConfig & DOMPropertyInjection.HAS_OVERLOADED_BOOLEAN_VALUE;
|
||||
|
||||
invariant(
|
||||
!DOMProperty.mustUseAttribute[propName] ||
|
||||
@@ -134,9 +134,9 @@ var DOMPropertyInjection = {
|
||||
invariant(
|
||||
!!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',
|
||||
!!DOMProperty.hasOverloadedBooleanValue[propName] <= 1,
|
||||
'DOMProperty: Value can be one of boolean, overloaded boolean, or ' +
|
||||
'numeric value, but not a combination: %s',
|
||||
propName
|
||||
);
|
||||
}
|
||||
@@ -242,7 +242,7 @@ var DOMProperty = {
|
||||
* to true; present with a value otherwise.
|
||||
* @type {Object}
|
||||
*/
|
||||
hasBooleanishValue: {},
|
||||
hasOverloadedBooleanValue: {},
|
||||
|
||||
/**
|
||||
* All of the isCustomAttribute() functions that have been injected.
|
||||
|
||||
@@ -30,7 +30,7 @@ function shouldIgnoreValue(name, value) {
|
||||
(DOMProperty.hasBooleanValue[name] && !value) ||
|
||||
(DOMProperty.hasNumericValue[name] && isNaN(value)) ||
|
||||
(DOMProperty.hasPositiveNumericValue[name] && (value < 1)) ||
|
||||
(DOMProperty.hasBooleanishValue[name] && value === false);
|
||||
(DOMProperty.hasOverloadedBooleanValue[name] && value === false);
|
||||
}
|
||||
|
||||
var processAttributeNameAndPrefix = memoizeStringOnly(function(name) {
|
||||
@@ -98,7 +98,7 @@ var DOMPropertyOperations = {
|
||||
}
|
||||
var attributeName = DOMProperty.getAttributeName[name];
|
||||
if (DOMProperty.hasBooleanValue[name] ||
|
||||
(DOMProperty.hasBooleanishValue[name] && value === true)) {
|
||||
(DOMProperty.hasOverloadedBooleanValue[name] && value === true)) {
|
||||
return escapeTextForBrowser(attributeName);
|
||||
}
|
||||
return processAttributeNameAndPrefix(attributeName) +
|
||||
|
||||
@@ -29,7 +29,8 @@ var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS;
|
||||
var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
|
||||
var HAS_POSITIVE_NUMERIC_VALUE =
|
||||
DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
|
||||
var HAS_BOOLEANISH_VALUE = DOMProperty.injection.HAS_BOOLEANISH_VALUE;
|
||||
var HAS_OVERLOADED_BOOLEAN_VALUE =
|
||||
DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
|
||||
|
||||
var DefaultDOMPropertyConfig = {
|
||||
isCustomAttribute: RegExp.prototype.test.bind(
|
||||
@@ -67,7 +68,7 @@ var DefaultDOMPropertyConfig = {
|
||||
defer: HAS_BOOLEAN_VALUE,
|
||||
dir: null,
|
||||
disabled: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
|
||||
download: HAS_BOOLEANISH_VALUE,
|
||||
download: HAS_OVERLOADED_BOOLEAN_VALUE,
|
||||
draggable: null,
|
||||
encType: null,
|
||||
form: MUST_USE_ATTRIBUTE,
|
||||
|
||||
Reference in New Issue
Block a user