diff --git a/src/dom/DOMProperty.js b/src/dom/DOMProperty.js index fa031bb87a..67d0596afe 100644 --- a/src/dom/DOMProperty.js +++ b/src/dom/DOMProperty.js @@ -85,8 +85,12 @@ var DOMPropertyInjection = { var lowerCased = propName.toLowerCase(); DOMProperty.getPossibleStandardName[lowerCased] = propName; - DOMProperty.getAttributeName[propName] = - DOMAttributeNames[propName] || lowerCased; + var attributeName = DOMAttributeNames[propName]; + if (attributeName) { + DOMProperty.getPossibleStandardName[attributeName] = propName; + } + + DOMProperty.getAttributeName[propName] = attributeName || lowerCased; DOMProperty.getPropertyName[propName] = DOMPropertyNames[propName] || propName; diff --git a/src/dom/__tests__/DOMPropertyOperations-test.js b/src/dom/__tests__/DOMPropertyOperations-test.js index 6382a69c5b..5f558d1300 100644 --- a/src/dom/__tests__/DOMPropertyOperations-test.js +++ b/src/dom/__tests__/DOMPropertyOperations-test.js @@ -68,6 +68,16 @@ describe('DOMPropertyOperations', function() { expect(console.warn.argsForCall[0][0]).toContain('tabIndex'); }); + it('should warn about class', function() { + spyOn(console, 'warn'); + expect(DOMPropertyOperations.createMarkupForProperty( + 'class', + 'muffins' + )).toBe(null); + expect(console.warn.argsForCall.length).toBe(1); + expect(console.warn.argsForCall[0][0]).toContain('className'); + }); + it('should create markup for boolean properties', function() { expect(DOMPropertyOperations.createMarkupForProperty( 'checked',