matthewp/thingjs — pull request #1 by paldepind (2012-09-29 11:33:23+00:00)
Title: Fixed bug causing first init function argument to be accidentally overridden

thing.js has a bug where the first argument after the init boolean will be overridden in case the optional propertiesObject argument it left out.

The problem is demonstrated by the following test:
```javascript
var a = {
init: function(name) {
this.name = name;
},
sayHi: function() {
alert("Hello, my name is " + this.name);
}
}

var obj = Thing.create(a, true, "Simon");
obj.sayHi();
```
This code will alert "Hello, my name is true". Expected behavior is "Hello, my name is Simon".

The commit in this pull request contains a possible fix for the problem. Instead of modifying the arguments array, which causes the bug, it instead defines a local variable.