Can strict parameters shadow strict function names?

Andreas Rossberg rossberg at
Thu Jun 9 18:15:46 UTC 2016

On 9 June 2016 at 19:58, Bergi <a.d.bergi at> wrote:

> Mark S. Miller wrote:
>> var foo = function bar(bar) {'use strict'};
>> On all version of Safari/JSC I just tested, this code gives a
>> SyntaxError: Invalid parameters or function name in strict mode.
>> On all versions of Chrome/v8 and FF/SpiderMonkey I just tested, this code
>> is accepted without error.
>> Which behavior is incorrect?
> This appears to be a bug in Safari/JSC.
> Is this an ES5 vs ES2015 issue?
> No, both ES5 <> and ES6 <
> only have a syntax error if there are duplicate *parameter* names,
> regardless of the name of the function.

In particular, the function name is in its own singleton scope outside the
parameter scope. My guess is that this semantics was chosen so that
collision doesn't differ between function declarations and expressions.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list