On Wed, 17 Nov 2021 at 17:20, Daniel Gruno <[email protected]> wrote: > > On 17/11/2021 12.26, sebb wrote: > > There are lots of places where the Javascript code uses var when it > > should be using let (or const?) > > > > Is there any reason to keep the var type for local variables? > > > > I think it would make it easier to find errors if variables were > > scoped as tightly as possible. > > Also for const to be used where possible. > > Agreed. Most of the use of var is from a time where let and const were > not as widely supported as they are now.
OK > I think we should aim for following the ECMAScript 2018 spec, judging > from the feature set we use, and not necessarily support older systems > that do not have this minimum requirement. It looks like the code uses some ES 2017 features already; not sure if it uses 2018 yet. Probably OK to require 2018, though it may cause issues for some Windows users. I also think we should try to use strict mode; this is likely to catch more errors. > > > > Sebb > > >
