Yep, thanks, I aware about FSs. For the complete and detailed explanation you may check "ES3. Ch5. Functions." http://dmitrysoshnikov.com/ecmascript/chapter-5-functions/ (where all this stuff -- FD, FE, NFE, FS, etc is discussed in detail).

FYI: ES6 (Harmony) will standardize FSs. So currently the advice to avoid them (throw in ES5 strict) seems a bit confusing, taking into account that ES6 will be based on strict ES5. One could think that FSs should be banned also in ES6 -- but no, they will be standardize.

Currently FSs extension implemented in most implementations. Firefox's way seems quite logical and exactly this way is chosen for ES6. Other implementations just create FD as mentioned.

BESEN implementation doesn't support FS though.

P.S.: the article is mostly academical and explains the theoretical and practical rationale (and reasons) of the "hoisting" concept. Exact FSs behavior is a bit irrelevant here. Though, if to consider exactly JS engines implementations, yes, FSs can be hoisted as simple FDs in all implementations except Firefox.

Dmitry.

On 08.02.2011 0:18, DaveC wrote:
I think it worth a further nod wrt function statements inside of a
block statement.

ECMAScript allows syntactic extensions, one such extension is to allow
function statements inside of a block statement currently Mozilla is
the only vendor (*I think*) that has added this extension - so I would
advise against it's use as the behaviour it will inconsistent across
browsers.

See this explanation on clj http://bit.ly/eu5rqw

Cheers,
Dave

On Feb 7, 7:53 pm, "Dmitry A. Soshnikov"<[email protected]>
wrote:
Thanks, Jose!

On 07.02.2011 22:39, Jose Antonio Perez wrote:







Great article 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]

--
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]

Reply via email to