dynjs/dynjs — pull request #123 by malaporte (2014-07-03 07:21:17+00:00)
Title: Fix functionExpression() incorrectly prohibiting the use of an identifier

I was trying to load a few modules from npm using Nodyn, and some of those caused syntax errors. After a few checks, I noticed that the dynjs parser wrongly prohibits the following syntax:

var f = function foo() { ... }

As specified in http://www.ecma-international.org/ecma-262/5.1/#sec-13 it is OK to include an optional identifier within a function expression.

I've checked that after my change the parser still rejects stuff like this in strict mode (the check was already made elsewhere):

for (;;) { function foo() { ... } }

I've also verified that the optional identifier is only visible inside the function (for recursive calls).

If I missed something I'll be happy to fix it.