emberjs/ember.js — pull request #1300 by jdjkelly (2012-08-20 19:15:42+00:00)
Title: bindAttr fails to render pathless class names in IE8

Ember's bindAttr helper relies on the bindClasses function to create the 'class=""' string for the element it's being called on. bindClasses gets passed the space separated string that we use in our Handlebars templates (ex. {{bindAttr class="thing:foo :baz"}}. When parsing the classes, bindClasses calls _parsePropertyPath, which uses split() to figure out the pathname and classname for the property.

In the past, split was passed a string to match against:

path.split(':')

Today, we're using:

path.split(/:/)

The problem with the regex implementation is that it returns inconsistent results in different browsers. Take the following:

":foo".split(/:/)

In Chrome, Safari, Firefox, and IE9 we get:

["", "foo"]

In IE8, we get:

["foo"]

This causes all non-property classes (not sure what the terminology is, but I suppose you could call them 'literal' classes in the form ":foo") passed to bindAttr to fail to render in IE8. Given that passing a string to split returns the most consistent results across all browsers, this pull request includes a commit that changes the relevant _parsePropertyPath line to:

path.split(':')