Hi,

> "$break" has been deprecated?

Yup.

> Where is that documented?

I don't know, I only know because Tobie mentioned it to me once. I'm
sure it's mentioned in a thread here somewhere. You'll note it's
disappeared from the documentation. ECMAScript 5th edition's `forEach`
(which is pretty much equivalent) doesn't have the concept of breaking
early (you have to use `every` or `some` if you want to break early --
it's done via a return value).

> What are we supposed to use instead?

Enumerable has `all`, which is very like ECMAScript5's `every` in that
it stops when you return `false` out of the callback (but ECMAScript5
defines that the callback gets all three arguments; I don't think
Enumerable makes that guarantee). Enumerable also has `any` which
(like ECMAScript5's `some`) stops when you return `true` out of the
callback. In both cases, using a return value is probably cleaner and
less resource-intensive than throwing an exception. But if you really
like throwing `$break`, you can define it yourself if/when Prototype
actually drops support for it (1.7 still seems to have it, but I bet
the next major version aligns with ECMAScript5). It's easily done. :-)

HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com

On Feb 1, 11:51 am, Bertilo Wennergren <[email protected]> wrote:
> On Tue, Feb 1, 2011 at 12:35, T.J. Crowder <[email protected]> wrote:
> > (now that `$break` has been deprecated).
>
> "$break" has been deprecated? Where is that documented?
> What are we supposed to use instead?
>
> --
> Bertilo Wennergren
> [email protected]http://bertilow.com

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to