Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Intent to unship: Use strict in function with non-simple parameters

68 views
Skip to first unread message

Tom Schuster

unread,
Oct 7, 2016, 8:01:35 AM10/7/16
to dev-pl...@lists.mozilla.org
To simplify parsing ES 2016 disallows "use strict" in functions with
non-simple parameters, like defaults or rest.

For example `function f(a = 1) { "use strict"; }` is going to start
throwing.

Chrome, JSC and Edge already made this change.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1272784
Link to standard:
https://tc39.github.io/ecma262/#sec-function-definitions-static-semantics-early-errors

Ehsan Akhgari

unread,
Oct 7, 2016, 11:15:04 AM10/7/16
to Tom Schuster, dev-pl...@lists.mozilla.org
On 2016-10-07 8:01 AM, Tom Schuster wrote:
> To simplify parsing ES 2016 disallows "use strict" in functions with
> non-simple parameters, like defaults or rest.
>
> For example `function f(a = 1) { "use strict"; }` is going to start
> throwing.
>
> Chrome, JSC and Edge already made this change.

Do we have any evidence to suggest that making this change doesn't break
webpages in Gecko, if they're using browser sniffing to parse code that
they don't parse in other engines?

Thanks,
Ehsan

Shu-yu Guo

unread,
Oct 7, 2016, 1:37:27 PM10/7/16
to Ehsan Akhgari, Tom Schuster, dev-pl...@lists.mozilla.org
No evidence either way. Given we've had non-compat parameter defaults for a
while, your worry is legit. We'll deal with web compat issues with JS as it
comes up -- unfortunately the reality is that until we ship something, we
have very little idea if it's breaking.

On Fri, Oct 7, 2016 at 8:14 AM, Ehsan Akhgari <ehsan....@gmail.com>
wrote:
> _______________________________________________
> dev-platform mailing list
> dev-pl...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>



--
shu
0 new messages