mozilla / shumway

Shumway is a Flash VM and runtime written in JavaScript
Apache License 2.0
3.68k stars 397 forks source link

mistake in amf.js #1171

Open Ri0n opened 10 years ago

Ri0n commented 10 years ago

I believe there is a mistake in avm2/amf.js::readAmf3Data::AMF3_OBJECT_MARKER there are two "for" loops in this section and internal one rewrites "j" variable of external.

Ri0n commented 10 years ago

first I thought each new declaration creates new scope in its code block but then I checked this var i = 10; if (true) { var i = 20; }; alert(i); and it showed 20. so variable is really rewritten.

mbebenita commented 10 years ago

The joys of JavaScript, vardeclarations are not block scoped. Please submit a pull request with the fix if you can, thanks.