kripken / box2d.js

Port of Box2D to JavaScript using Emscripten
1.33k stars 196 forks source link

why get_ and set_ when js has getter/setter definitions? #13

Closed Pomax closed 10 years ago

Pomax commented 11 years ago

JS supports automatic code execution on get/set by defining an object property explicitly (using Object.defineProperty). Why is the port using the non-box2d get and set API rather than taking advantage of JS getter/setter functionality to preserve the "universal" Box2d API?

kripken commented 11 years ago

JS getters and setters tend to be slower than regular function calls, or used to be when the bindings generator was written.