Rename "booleanish" to "overloaded boolean"
Matthew Dapena-Tretter committed
Apr 14, 2014 at 23:00 UTC
32a7a1cedbe695a0d22cfd6f17ee58ec4aeee3a6
3 files changed
+12
-11
src/browser/ui/dom/DOMProperty.js
+7
-7
@@ -34,7 +34,7 @@ var DOMPropertyInjection = {
34
HAS_BOOLEAN_VALUE: 0x8,
35
HAS_NUMERIC_VALUE: 0x10,
36
HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10,
37
- HAS_BOOLEANISH_VALUE: 0x40,
37
+ HAS_OVERLOADED_BOOLEAN_VALUE: 0x40,
38
39
/**
40
* Inject some specialized knowledge about the DOM. This takes a config object
@@ -116,8 +116,8 @@ var DOMPropertyInjection = {
116
propConfig & DOMPropertyInjection.HAS_NUMERIC_VALUE;
117
DOMProperty.hasPositiveNumericValue[propName] =
118
propConfig & DOMPropertyInjection.HAS_POSITIVE_NUMERIC_VALUE;
119
- DOMProperty.hasBooleanishValue[propName] =
120
- propConfig & DOMPropertyInjection.HAS_BOOLEANISH_VALUE;
119
+ DOMProperty.hasOverloadedBooleanValue[propName] =
120
+ propConfig & DOMPropertyInjection.HAS_OVERLOADED_BOOLEAN_VALUE;
121
122
invariant(
123
!DOMProperty.mustUseAttribute[propName] ||
@@ -134,9 +134,9 @@ var DOMPropertyInjection = {
134
invariant(
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',
137
+ !!DOMProperty.hasOverloadedBooleanValue[propName] <= 1,
138
+ 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' +
139
+ 'numeric value, but not a combination: %s',
140
propName
141
);
142
}
@@ -242,7 +242,7 @@ var DOMProperty = {
242
* to true; present with a value otherwise.
243
* @type {Object}
244
*/
245
- hasBooleanishValue: {},
245
+ hasOverloadedBooleanValue: {},
246
247
/**
248
* All of the isCustomAttribute() functions that have been injected.
src/browser/ui/dom/DOMPropertyOperations.js
+2
-2
@@ -30,7 +30,7 @@ function shouldIgnoreValue(name, value) {
30
(DOMProperty.hasBooleanValue[name] && !value) ||
31
(DOMProperty.hasNumericValue[name] && isNaN(value)) ||
32
(DOMProperty.hasPositiveNumericValue[name] && (value < 1)) ||
33
- (DOMProperty.hasBooleanishValue[name] && value === false);
33
+ (DOMProperty.hasOverloadedBooleanValue[name] && value === false);
34
}
35
36
var processAttributeNameAndPrefix = memoizeStringOnly(function(name) {
@@ -98,7 +98,7 @@ var DOMPropertyOperations = {
98
}
99
var attributeName = DOMProperty.getAttributeName[name];
100
if (DOMProperty.hasBooleanValue[name] ||
101
- (DOMProperty.hasBooleanishValue[name] && value === true)) {
101
+ (DOMProperty.hasOverloadedBooleanValue[name] && value === true)) {
102
return escapeTextForBrowser(attributeName);
103
}
104
return processAttributeNameAndPrefix(attributeName) +
src/browser/ui/dom/DefaultDOMPropertyConfig.js
+3
-2
@@ -29,7 +29,8 @@ var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS;
29
var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
30
var HAS_POSITIVE_NUMERIC_VALUE =
31
DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
32
-var HAS_BOOLEANISH_VALUE = DOMProperty.injection.HAS_BOOLEANISH_VALUE;
32
+var HAS_OVERLOADED_BOOLEAN_VALUE =
33
+ DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
34
35
var DefaultDOMPropertyConfig = {
36
isCustomAttribute: RegExp.prototype.test.bind(
@@ -67,7 +68,7 @@ var DefaultDOMPropertyConfig = {
68
defer: HAS_BOOLEAN_VALUE,
69
dir: null,
70
disabled: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
70
- download: HAS_BOOLEANISH_VALUE,
71
+ download: HAS_OVERLOADED_BOOLEAN_VALUE,
72
draggable: null,
73
encType: null,
74
form: MUST_USE_ATTRIBUTE,