On 19/01/2006 09:14, Olov Johansson wrote:
Nested functions (with lexical scope and closures) is indeed in the
standard.
Ignore VK.
As Richard said, the difference lies in when the function objects would
be created. The scope chain and other behavioural features remain the same.
function outer() {
inner();
function inner() {
}
}
would work as expected because the nested function, inner, would have
been created before execution of the function body had started.
function outer() {
inner();
var inner = function() {};
}
would fail. The local variable, inner, would exist (variable
declarations, like function declarations, occur before execution) but
the function object would not have been created, and a reference
assigned, until execution had reached that point in the function body.
[snip]
Mike
When replying through Google Groups, please do not use the 'Reply' link
at the end of the post. Instead, activate 'show options' at the top of
the post you want to reply to, and use 'Reply' from there. That post
will now be quoted.
--
Michael Winter
Prefix subject with [News] before replying by e-mail.