facebook/react — pull request #347 by jakubmal (2013-09-14 11:01:45+00:00)
Title: Phantomjs fix

Hey,
Phantomjs is failing because apparently it (v1.9.2) doesn't have Function.prototype.bind.
The issue was noticed thanks to @tomelm, who was [testing with Poltergeist (RoR gem)](https://github.com/facebook/react-rails/issues/10) https://github.com/facebook/react-rails/issues/10

It can be reproduced easily if you have phantomjs:
```
page = require('webpage').create()
page.open 'http://facebook.github.io/react/index.html', (status) ->
phantom.exit()
```

fails with:
```
TypeError: 'undefined' is not a function (evaluating 'RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/)')

http://facebook.github.io/react/js/react.min.js:18
http://facebook.github.io/react/js/react.min.js:18 in r
http://facebook.github.io/react/js/react.min.js:18
http://facebook.github.io/react/js/react.min.js:19
http://facebook.github.io/react/js/react.min.js:18 in r
http://facebook.github.io/react/js/react.min.js:18
http://facebook.github.io/react/js/react.min.js:18
http://facebook.github.io/react/js/react.min.js:18 in r
http://facebook.github.io/react/js/react.min.js:18
http://facebook.github.io/react/js/react.min.js:20
http://facebook.github.io/react/js/react.min.js:18
http://facebook.github.io/react/js/react.min.js:20
```

and all subsequent errors are a result of this one.

After switching to custom binding function it appears to be working in phantomjs and poltergeist. All tests are passing. I don't think there is any reason for regression testing here.

I just noticed that same thing is happening to JSXTransformer.