The problem is with:
gravity: function(value) {
if (value !== undefined) {
this._world.SetGravity(new b2Vec2(value.x, value.y));
}
var v = this._world.GetGravity();
return {x: v.x, y: v.y};
},
I had to change
this._world.SetGravity(new b2Vec2(0, value));
to
this._world.SetGravity(new b2Vec2(value.x, value.y));
It asks for {x,y} but if you send in {x: 0, y: 20} for example, it thinks y is now an object until the above fix is applied.
The problem is with:
I had to change
to
It asks for {x,y} but if you send in {x: 0, y: 20} for example, it thinks y is now an object until the above fix is applied.