I'm going to vacation, so tomorrow I won't be online, will answer later
if something.
Happy New Year again for everyone ;)
Dmitry.
On 02.01.2011 1:27, Dmitry A. Soshnikov wrote:
On 02.01.2011 1:22, Garrett Smith wrote:
On 1/1/11, Dmitry A. Soshnikov<[email protected]> wrote:
On 02.01.2011 0:27, Garrett Smith wrote:
On 1/1/11, Dmitry A. Soshnikov<[email protected]> wrote:
On 01.01.2011 4:01, Garrett Smith wrote:
The correct answer is that it's function declaration! And from this
step, there are two reasons of the issue.
No, that is not true at all. It is not a FunctionDeclaration. It is
nothing, and so unless there is a syntax extension going on, it is a
SyntaxError.
True-true ;)
In your case (example above) the `SyntaxError` is because the
_name of
the FD_ is missing:
You call it an FD but how can it be an FD when there is no identifier?
The thing is that the _parser_ treat it as a FD. Your (mine, other)
meaning is irrelevant here. For the parser it's a FD and it fails
because doesn't see a name for the FD.
Said the FD optimist. Well it almost happened.
Then again: There is no FD.
For the parser, it begins as an FD, with `function` then whitespace,
but then an unexpected token of `(` is encoutered and that's not a
valid token for an Identifier. Thus an FD is not parsed.
No matter, the parser tries to parse a FD there. Again, if you worry
about wrong explanations -- repeat, as I said first, the explanations
were incomplete. And wrong in respect of explaining syntax error. If
to see from the other side starting that "we need an expression
statement here, and bla-bla-bla about cannot start with a function
keyword", then it's completely OK.
I could go allegorical about things that coulda woulda shoulda almost,
but never were.
I didn't understand this, sorry.
Dmitry.
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]