[Moo] mootools break 'for in' loop.

2013-05-27 Thread Iwan Budi Kusnanto
Hi, I use a library that use 'for in' loop. When using jquery, i have no problem with such loop. When try to switch to mootools, that 'for in' loop become broken. Any idea why it happens? -- Iwan Budi Kusnanto -- --- You received this message because you are subscribed to the Google Groups

Re: [Moo] mootools break 'for in' loop.

2013-05-27 Thread Sanford Whiteman
Please put an example in jsfiddle.net to check out. There is certainly nothing in Moo that will "break" for-in in JS. -- S. -- --- You received this message because you are subscribed to the Google Groups "MooTools Users" group. To unsubscribe from this group and stop receiving emails from it

Re: [Moo] mootools break 'for in' loop.

2013-05-27 Thread Iwan Budi Kusnanto
On Mon, May 27, 2013 at 2:55 PM, Sanford Whiteman wrote: > Please put an example in jsfiddle.net to check out. There is certainly > nothing in Moo that will "break" for-in in JS. Hi, Sorry,maybe 'failed' or 'not compatible' will be a better world. http://jsfiddle.net/4bwTc/1/ Commented code is

Re: [Moo] mootools break 'for in' loop.

2013-05-27 Thread Dimitar Christoff
On 27 May 2013 08:55, Sanford Whiteman wrote: > Please put an example in jsfiddle.net to check out. There is certainly > nothing in Moo that will "break" for-in in JS. > .. Er. Yes, there is, though it is not MooTools' fault. MooTools is prototypal. It extends natives, including Array. When ite

Re: [Moo] mootools break 'for in' loop.

2013-05-27 Thread Dimitar Christoff
see this PR they have: https://github.com/versatica/JsSIP/pull/92 On 27 May 2013 09:17, Iwan Budi Kusnanto wrote: > On Mon, May 27, 2013 at 2:55 PM, Sanford Whiteman > wrote: > > Please put an example in jsfiddle.net to check out. There is certainly > > nothing in Moo that will "break" for-in

Re: [Moo] mootools break 'for in' loop.

2013-05-27 Thread Sanford Whiteman
> .. Er. Yes, there is, though it is not MooTools' fault. Well yes, that isn't "breaking" the JS language construct, which would be quite a feat. Everybody should know to not use for-in on Arrays. -- S. -- --- You received this message because you are subscribed to the Google Groups "MooT

Re: [Moo] mootools break 'for in' loop.

2013-05-27 Thread Tor
I could be wrong here but it's because Mootools extends Array.prototype so you get more back from the for-in loop than you expect. That's the reason why Mootools has it's own Array.each implementation. Now that's why it breaks, how to get it sorted I can't help you with. / Tor On Monday, Ma

Re: [Moo] mootools break 'for in' loop.

2013-05-27 Thread Iwan Budi Kusnanto
On Mon, May 27, 2013 at 3:26 PM, Tor wrote: > I could be wrong here but it's because Mootools extends Array.prototype so > you get more back from the for-in loop than you expect. > That's the reason why Mootools has it's own Array.each implementation. > > Now that's why it breaks, how to get it so

Re: [Moo] mootools break 'for in' loop.

2013-05-27 Thread Dimitar Christoff
there is an easy way to monkey patch this if all you care about is ES5 compatible browsers. var foo = ['one','two'], key, enums = { enumerable: false }; for (key in foo){ console.log(key, foo[key]); } // protect enumerables under ES5 for (key in [])

Re: [Moo] mootools break 'for in' loop.

2013-05-27 Thread Sanford Whiteman
Very nice! -- --- You received this message because you are subscribed to the Google Groups "MooTools Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to mootools-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com

Re: [Moo] mootools break 'for in' loop.

2013-05-27 Thread Dimitar Christoff
oups. sorry, referenced foo. too early :( this is the actual polyfill i'd add after adding mootools. you can kind of detect if Object.defineProperty is there also. (function(){ // set mootools expandos to non-enumerables under ES5 var key, a = [], enums

Re: [Moo] Chains and delays

2013-05-27 Thread Sanford Whiteman
Sorry to leave your post hanging... you might consult the official demo code for chaining and delays -- http://jsfiddle.net/6YeKf/. -- Sandy -- --- You received this message because you are subscribed to the Google Groups "MooTools Users" group. To unsubscribe from this group and stop receivi

[Moo] I don't understand Request.Queue

2013-05-27 Thread dukeofgaming
So I'm trying to use Request.Queue for the first time, I tried something like the following: var request_queue = new Request.Queue(); request_queue.addRequest('someRequest', new Request({...})); request_queue.addRequest('someOtherRequest', new Request({...})); request_queue.runAll(); It doesn

Re: [Moo] I don't understand Request.Queue

2013-05-27 Thread Sanford Whiteman
Yep. other people are also concerned/confused: https://github.com/mootools/mootools-more/issues/1158?source=cc I think this thing works a bit strangely. You still have to send() your requests until there are too many concurrents, and only _then_ will the queue fill up. The queue wil