Open michaelficarra opened 4 years ago
It seems reasonable to apply the same restriction for the same reasons.
@ljharb It's not quite the same reasons though. An implementation wouldn't have to re-parse the parameter list, they would just need to track the functions that they parsed in the parameter list until they've passed the directive prologue. This is a significantly smaller implementation burden.
We disallow the
"use strict"
directive in functions with non-simple parameter lists because it complicates the parsing of the parameter list. While the directives introduced by this proposal do not affect parsing, they do affect "earlier" code, e.g. functions defined in the parameter list. Is that a significant enough inconvenience for implementers that we want to disallow the commingling of these two features?/cc @bakkot who raised this question