danishgoel / box2dweb

Automatically exported from code.google.com/p/box2dweb
0 stars 0 forks source link

Flash.Utils.Dictionary #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This article might help with replacing the dictionary issue, albeit trading 
some performance for simplicity ..

http://yuiblog.com/blog/2006/09/26/for-in-intrigue/

for (name in obj) {
    if (obj.hasOwnProperty(name)) {
        ...
    }
}

Original issue reported on code.google.com by ushiferr...@gmail.com on 28 Sep 2010 at 1:23

GoogleCodeExporter commented 9 years ago
Thanks for your suggestion, but the problem is, that this has to be done for 
every object. Even if a Box2Dweb user defines an object, he has to use your 
solution.

I noticed that, in constrast to my expectations, valueOf neither appears in 
for-in-iterations using Mozilla Firefox nor using Google Chrome.

It would be great, if someone will test the behaviour in Opera. I used the 
following code in Firefox and Chrome:

var x = {"a": 1, "b": 2}; for(var p in x) { console.log(x[p]); }

Original comment by Uli.He...@googlemail.com on 29 Sep 2010 at 3:04

GoogleCodeExporter commented 9 years ago
marked as invalid, see comment above

Original comment by Uli.He...@googlemail.com on 29 Oct 2010 at 2:49