jrburke/r.js — Issue #91: r.js appears to mistake /* in a quoted JS string to be a comment
Author: johnloy
Created: 2012-02-06 22:14:22+00:00
State: open

I'm compiling jquery-ujs.js (the Rails jQuery driver) into my application.js file as a dependency, and it contains the following code:

```javascript
beforeSend: function(xhr, settings) {
if (settings.dataType === undefined) {
xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
}
return rails.fire(element, 'ajax:beforeSend', [xhr, settings]);
},
```
On Gentoo OS, using node 0.6.9 with r.js, the /* part of the quoted string appears to be mistaken for the beginning of a comment and ends up at the top of the compiled output. The first line of the file is:

```javascript
/*;q=0.5, "+e.accepts.script),c.fire(d,"ajax:beforeSend",[a,e])} // ...and so on
```

The odd thing is that I'm not seeing this problem on my Mac (Lion). Is it possible Node or r.js could be behaving differently based on the OS?