Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #36573

Re: "use strict"; in a recent Firefox

Newsgroups comp.lang.javascript
Date 2019-05-04 07:58 -0700
References <use-strict-20190502195737@ram.dialup.fu-berlin.de> <stvnce9jnc6pdb6kfku6sf2aa8nauciiqu@4ax.com> <ab288b65-a363-48da-be52-4491f2f98889@googlegroups.com> <j56rce9gd8hmrsv6vrmr9cbv67t6j7t8g8@4ax.com>
Message-ID <3feeea75-db0c-4b6c-ab61-d07e208dd6de@googlegroups.com> (permalink)
Subject Re: "use strict"; in a recent Firefox
From Julio Di Egidio <julio@diegidio.name>

Show all headers | View raw


On Saturday, 4 May 2019 15:51:21 UTC+2, John G Harris  wrote:
> On Sat, 4 May 2019 05:16:19 -0700 (PDT), Julio Di Egidio
> <julio@diegidio.name> wrote:
> >On Friday, 3 May 2019 10:46:10 UTC+2, John G Harris  wrote:
> >> On 2 May 2019 19:01:49 GMT, ram@zedat.fu-berlin.de (Stefan Ram) wrote:
> >> 
> >> >  I read on a webpage that duplicate keys were detected in
> >> >  strict mode. I cannot see this with a recent Firefox:
> >> >
> >> >|>> "use strict"; ({ a: 2, a: 3 })
> >> >|<- Object { a: 3 }
> >> >
> >> >  . Ok, so, the explanation is:
> >> >
> >> >  Duplicate keys are now legal since ES6, even in strict mode!
> >> 
> >> It's a duplicate assignment to a property. It's redundent, but it
> >> doesn't sound very contraversial even though it's likely to be a
> >> typing error.
> >
> >Another improvement...
>   <snip>

BTW, as usual, you just snip my actual objection to you and your nonsense
about what's actually controversial.

> Not an improvement. It appeared in ES5, when strict first appeared,
> and taken out in ES6.

FYI, that's the opposite of not just what I know but also what Ram's
just said above:

  "Duplicate keys are now legal since ES6, even in strict mode!"

Get a grip, either one or the other...

> A problem in the ES5 version was that in strict mode the semantics of
>   a = { b:5, b,7 };
> 
> were differenct from the semantics of
>   a = { }; a.b=5; a.b=7;

Total nonsense: besides that a difference per se isn't any problem, if
duplicate keys are *not* allowed, not only it's arguably *less* error
prone, it's also fuck all to do with semantics, for what you rather get
is a *syntax error*.

> It's better to look for possible typing errors with a lint program.

It's better to write good code to begin with, and linting is well known
*not* to be any panacea nor any license to be sloppy or incompetent,
in fact rather take it cum grano salis.

Julio

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: "use strict"; in a recent Firefox John G Harris <niam@jghnorth.org.uk.invalid> - 2019-05-03 09:46 +0100
  Re: "use strict"; in a recent Firefox Julio Di Egidio <julio@diegidio.name> - 2019-05-04 05:16 -0700
    Re: "use strict"; in a recent Firefox John G Harris <niam@jghnorth.org.uk.invalid> - 2019-05-04 14:51 +0100
      Re: "use strict"; in a recent Firefox Julio Di Egidio <julio@diegidio.name> - 2019-05-04 07:58 -0700
        Re: "use strict"; in a recent Firefox Julio Di Egidio <julio@diegidio.name> - 2019-05-04 08:10 -0700
        Re: "use strict"; in a recent Firefox John G Harris <niam@jghnorth.org.uk.invalid> - 2019-05-04 19:02 +0100
          Re: "use strict"; in a recent Firefox Julio Di Egidio <julio@diegidio.name> - 2019-05-05 05:02 -0700
          Re: "use strict"; in a recent Firefox Julio Di Egidio <julio@diegidio.name> - 2019-05-05 05:09 -0700

csiph-web