behdad / box2d

Automatically exported from code.google.com/p/box2d
2 stars 12 forks source link

Using bad js practice #193

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using Box2dWeb-2.1a.2.js

On line 2498:

      for (var each in __this.m_moveBuffer) {

__this.m_moveBuffer is an Array.  You should not use 'for ... in' with Array in 
js - if you extend the Array prototype (a common practice) then this code will 
break.

Instead, the code could read:

for (var each = 0; each < __this.m_moveBuffer.length; each++) {

I don't know if this error appears other places in the codebase, but this is 
the one that's breaking my code right now.

Original issue reported on code.google.com by congy...@gmail.com on 21 Apr 2011 at 1:33

GoogleCodeExporter commented 9 years ago
Sorry, wrong project.

Original comment by congy...@gmail.com on 21 Apr 2011 at 1:36

GoogleCodeExporter commented 9 years ago
Wrong language

Original comment by erinca...@gmail.com on 25 Jun 2011 at 7:48