Earlier quoted context omitted.
It’s about strictness scoping. https://old.reddit.com/r/webdev/comments/v877zq/why_cant_you... gives a decent explanation, and https://github.com/rwaldron/tc39-notes/blob/d0c651b358b361b0... is good and technical.
That seems weird to me. Does strict mode affect parsing? I thought that parsing completed before execution, so why couldn’t the parser generate the same AST for these two functions? (a) => a === undefined ? 1 : a (a = 1) => a
Actually, yes. default parameter values could contain things that are allowed in sloppy mode and are syntax errors in strict mode. For instance, a leading zero in numbers without explicitly specifying the base, duplicate property names, the with statement, new reserved words and using delete on a variable name.
You need to disallow those in the parameter values in strict mode, but you only know this after encountering the "use strict" marking in the function body if you were not already in strict mode. You can make a parser able to do this, but it is more complex. I guess they decided that this complexity is not worth it.