validateDOMNesting: parentTag -> current
Ben Alpert committed
Oct 9, 2015 at 11:40 UTC
9c836b09f2397f5a952115ae3974d2290b25f300
2 files changed
+6
-5
src/renderers/dom/client/__tests__/validateDOMNesting-test.js
+2
-1
@@ -55,7 +55,8 @@ describe('ReactContextValidator', function() {
55
it('allows any tag with no context', function() {
56
// With renderToString (for example), we don't know where we're mounting the
57
// tag so we must err on the side of leniency.
58
- specialTags.concat(formattingTags, ['mysterytag']).forEach(function(tag) {
58
+ var allTags = [].concat(specialTags, formattingTags, ['mysterytag']);
59
+ allTags.forEach(function(tag) {
60
expect(validateDOMNesting.isTagValidInContext(tag, null)).toBe(true);
61
});
62
});
src/renderers/dom/client/validateDOMNesting.js
+4
-4
@@ -63,7 +63,7 @@ if (__DEV__) {
63
['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
64
65
var emptyAncestorInfo = {
66
- parentTag: null,
66
+ current: null,
67
68
formTag: null,
69
aTagInScope: null,
@@ -98,7 +98,7 @@ if (__DEV__) {
98
ancestorInfo.dlItemTagAutoclosing = null;
99
}
100
101
- ancestorInfo.parentTag = info;
101
+ ancestorInfo.current = info;
102
103
if (tag === 'form') {
104
ancestorInfo.formTag = info;
@@ -323,7 +323,7 @@ if (__DEV__) {
323
324
validateDOMNesting = function(childTag, childInstance, ancestorInfo) {
325
ancestorInfo = ancestorInfo || emptyAncestorInfo;
326
- var parentInfo = ancestorInfo.parentTag;
326
+ var parentInfo = ancestorInfo.current;
327
var parentTag = parentInfo && parentInfo.tag;
328
329
var invalidParent =
@@ -420,7 +420,7 @@ if (__DEV__) {
420
// For testing
421
validateDOMNesting.isTagValidInContext = function(tag, ancestorInfo) {
422
ancestorInfo = ancestorInfo || emptyAncestorInfo;
423
- var parentInfo = ancestorInfo.parentTag;
423
+ var parentInfo = ancestorInfo.current;
424
var parentTag = parentInfo && parentInfo.tag;
425
return (
426
isTagValidWithParent(tag, parentTag) &&