emberjs/ember.js — pull request #9951 by dontfidget (2014-12-17 00:58:16+00:00)
Title: avoid bad dereference of first element in empty array

This pull request fixes a breakage on android 2.3 stock browser that was introduced in ember 1.6. As far as I can tell (short of reading the entire 3 page ecmascript definition of `arguments`), you should be able dereference `arguments` with an non-existent key and expect `undefined` (just like any array or object), so that isn't actually the problem. It seems that assigning to a named argument in the android stock browser will actually put the value into the arguments array. So on android 2.3, the following will display "duck":

```
(function duck(name) {
name = 'duck';
alert(arguments[0]);
})();
```

whereas on everything else it seems to display "undefined". Overwriting a named argument does not change `arguments.length` however, which is why this fix works. I couldn't find a reported android bug but I'm not sure exactly where to look, so if anyone has any tips please let me know. Also, please let me know if this could be added as a patch on ember 1.8.1 or 1.9, because I'm trying to deliver code that works on android 2.3 and iOS8 (you don't want my job... ;). Thanks, Andrew