Gozala/selfish — pull request #5 by posva (2014-10-07 19:32:09+00:00)
Title: Update define call for newer version of requirejs

Hello,
I know this is pretty old (about 3 years from last commit), but today I was optimizing my code with requirejs and `r.js` and I had this error when loading the page:

```
Uncaught Error: Mismatched anonymous define() module: function (e,t){t.Base=Object.freeze(Object.create(Object.prototype,{"new":{value:function(){var t=Object.create(this);return t.initialize.apply(t,arguments),t}},initialize:{value:function(){}},merge:{value:function(){var t={};return Array.prototype.forEach.call(arguments,function(e){Object.getOwnPropertyNames(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})}),Object.defineProperties(this,t),this}},extend:{value:function(){return Object.freeze(this.merge.apply(Object.create(this),arguments))}}}))}
```

Which is documented [here](http://requirejs.org/docs/errors.html#mismatch). I couldn't find much information about how to do this properly so I searched how to create AMD modules. This is when I discovered the `define` call is missing the module_id *optional* parameter. It turns out `r.js` doesn't like it when the module is anonymous so I added selfish as an identifier.

Please tell me what do you think about this and if there's any better solution :smile: