Merge pull request #330 from spicyj/warn-class-for

Warn for 'class' and 'for' property names
This commit is contained in:
Paul O’Shannessy
2013-09-10 16:21:33 -07:00
2 changed files with 16 additions and 2 deletions
+6 -2
View File
@@ -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;
@@ -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',