mbostock/d3 — Issue #464: Using a js compressor i ended up having syntax error
Author: ssaboum
Created: 2012-01-24 08:59:10+00:00
State: open

Hi,
I'm using a js/css compressor for all my static files, and compressing d3, d3.time and d3.chart, my js compressor transformed
i had to patch the following files in order for the libraries to still work, in d3.js :

```javascript
function arc(r, p, a) {
- return "A" + r + "," + r + " 0 " + +(a > Math.PI) + ",1 " + p;
+ return "A" + r + "," + r + " 0 " + "" +(a > Math.PI) + ",1 " + p;
}
```
and in d3.time.js :

```javascript
function d3_time_parseYear(date, string, i) {
d3_time_numberRe.lastIndex = 0;
var n = d3_time_numberRe.exec(string.substring(i, i + 2));
- return n ? (date.setFullYear(d3_time_century() + +n[0]), i += n[0].length) : -1;
+ return n ? (date.setFullYear(d3_time_century() + ""+n[0]), i += n[0].length) : -1;
}
```

Actually you can see the problem, the "+ +" syntax was compressed into a "++" which caused issues. I'm not a javascript guru, so the patch i used may very well not be accurate, but i was reluctant to delete the second "+" just in case lol.