jashkenas/coffee-script — Issue #1973: Use of Array.prototype for __slice throws on Array declaration
Author: jed
Created: 2011-12-26 13:12:02+00:00
State: open

This CoffeeScript

```coffeescript
class Array
[@...]
```

compiles to this JavaScript

```javascript
var Array,
__slice = Array.prototype.slice;

Array = (function() {

function Array() {}

__slice.call(Array);

return Array;

})();
```

which throws because `Array` is `undefined` here.

Wouldn't it be safer to use `[].slice` instead, since it will always work?