I'm not sure what you mean by limited goto, but your example works since ES3 in JS. Underused part of the design: break from labeled block or if, no need for do-while(0) nonsense.

/be

Michał Wadas wrote:
I'm not sure if limited "goto" should be really considered harmful.
Dijkstra has written his essay on unlimited goto, that could jump from
any point in code to any other point in code.
I don't see reason why limited "goto" that is semantically equivalent
(or little more powerful) to
x: do {
continue x;
} while(false);

should be considered harmful (anyway - it's useful almost only for
implementing state machines).
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to