Merge pull request #5111 from spicyj/vdn-current

validateDOMNesting: parentTag -> current
This commit is contained in:
Ben Alpert
2015-10-09 11:43:31 -07:00
2 changed files with 6 additions and 5 deletions
@@ -55,7 +55,8 @@ describe('ReactContextValidator', function() {
it('allows any tag with no context', function() {
// With renderToString (for example), we don't know where we're mounting the
// tag so we must err on the side of leniency.
specialTags.concat(formattingTags, ['mysterytag']).forEach(function(tag) {
var allTags = [].concat(specialTags, formattingTags, ['mysterytag']);
allTags.forEach(function(tag) {
expect(validateDOMNesting.isTagValidInContext(tag, null)).toBe(true);
});
});
@@ -63,7 +63,7 @@ if (__DEV__) {
['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
var emptyAncestorInfo = {
parentTag: null,
current: null,
formTag: null,
aTagInScope: null,
@@ -98,7 +98,7 @@ if (__DEV__) {
ancestorInfo.dlItemTagAutoclosing = null;
}
ancestorInfo.parentTag = info;
ancestorInfo.current = info;
if (tag === 'form') {
ancestorInfo.formTag = info;
@@ -323,7 +323,7 @@ if (__DEV__) {
validateDOMNesting = function(childTag, childInstance, ancestorInfo) {
ancestorInfo = ancestorInfo || emptyAncestorInfo;
var parentInfo = ancestorInfo.parentTag;
var parentInfo = ancestorInfo.current;
var parentTag = parentInfo && parentInfo.tag;
var invalidParent =
@@ -420,7 +420,7 @@ if (__DEV__) {
// For testing
validateDOMNesting.isTagValidInContext = function(tag, ancestorInfo) {
ancestorInfo = ancestorInfo || emptyAncestorInfo;
var parentInfo = ancestorInfo.parentTag;
var parentInfo = ancestorInfo.current;
var parentTag = parentInfo && parentInfo.tag;
return (
isTagValidWithParent(tag, parentTag) &&