This works though
function ret(message) {
if (message) {
throw message;
}
return 0;
}
(function f() { var a = false || ret("this is bad code") })()
Can't say I recommend it...
A
On 15/03/06, Nickolay Ponomarev <[EMAIL PROTECTED]> wrote:
> Paul Tomlin wrote:
> >> We could argue about it, but that doesn't lead anywhere. However,
> >> the question he asked still interests me, and I don't know the answer:
> >>
> >> Is the construct shown above correct, and officially supported in
> >> javascript, or is it not?
> >
> > Indeed. I'm tempted to look at the ECMA spec, though it always gives me
> > headaches and never guarantees that it's implemented.
>
> I'll save you some headaches.
>
> > (function f() { var a = false || return 1 })()
> SyntaxError: syntax error
>
> Nickolay
> _______________________________________________
> Project_owners mailing list
> [email protected]
> http://mozdev.org/mailman/listinfo/project_owners
>
_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners