emberjs/ember.js — pull request #2796 by uzzz (2013-06-05 15:02:04+00:00)
Title: Assert null and undefined keyName in get() and set()

I had piece of code something like this one

```javascript
function(param) {
obj.get(param);
}
```

So key was dynamic, and it worked ok with old ember version, but with new version of ember (when become possible to pass paths to get() and set()) this code started to throw exceptions. And I spent some time debugging to figure out what is wrong (it wasn't easy). I think it would be nice to warn user if he passes null or undefined so he get instead of

```javascript
obj = Ember.Object.create()
Class {constructor: function, toString: function, reopen: function, isInstance: true, init: function…}
obj.set(null)
TypeError: Cannot call method 'indexOf' of null
obj.set(undefined)
TypeError: Cannot call method 'indexOf' of undefined
obj.get(null)
TypeError: Cannot call method 'indexOf' of null
obj.get(undefined)
TypeError: Cannot call method 'indexOf' of undefined
```

these nice assertions:
```javascript
obj = Ember.Object.create()
Class {constructor: function, toString: function, reopen: function, isInstance: true, init: function…}
obj.set(null)
Error: assertion failed: Cannot call set with null key.
obj.set(undefined)
Error: assertion failed: Cannot call set with undefined key.
obj.get(null)
Error: assertion failed: Cannot call get with null key.
obj.get(undefined)
Error: assertion failed: Cannot call get with undefined key.
```