[haXe] [js] end of function ';'

Ian Liu ian.liu88 at gmail.com
Sun Jan 28 13:34:06 CET 2007


I always had in my mind that this ';' is used there because it's a "masked"
end of line:

function foo() {
    ...
} // no ';'

a.onClick = foo; // there is a ';' cause it's end of line, so...

a.onClick = function() { ... }; // ... we put it here too

I would say that this is an inline function declaration, thats why the ';'
My knowledges in JavaScript are far away from being good, but it's the same
situation with Flash. When you auto-format your code with Flash IDE, Flash
puts ';' on your "inline" functions.

On 1/28/07, Marco Secchi <loziosecchi at gmail.com> wrote:
>
> Hi Nicolas/list, one quick question:
>
> When I compile a .js file with haXe, I've noticed that local functions
> haven't a ';' character at the end. Eg.:
>
> js = {}
> js.Boot = function() { }
>
> Shouldn't be the case to have (I'm not very good in js, so probably I'm
> wrong...):
>
> js = {};js.Boot = function() { };
>
> I'm saying this because I'm using a js compact function (all in one line),
> and it complains about this.
>
> thanks in advance,
>  Marco
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/haxe/attachments/20070128/115bf21b/attachment.htm


More information about the Haxe mailing list