Allowing for stricter subsets in future versions

David-Sarah Hopwood david.hopwood at industrial-designers.co.uk
Mon Oct 27 19:11:01 PDT 2008


It may be necessary in future to add additional incompatible restrictions
along similar lines to strict mode, for example to support the work on
'Secure ECMAScript'. In that case, it's very likely that code written
in such a subset should turn on the "strict" restrictions if it is
running on an ES3.1 implementation, plus the additional restrictions
if it is running on some later version. To do that it would be necessary
to say something like:

  "use strict"; "use stricter";

which is ugly and redundant. The redundancy can be avoided by specifying,
in ES3.1, that the strict literal that turns on strict mode only needs
to *start* with "use strict". For example, in that case

  "use stricter";
or
  "use strict+secure";

would be sufficient for code in the stricter subset. There is no
significant down-side if such a subset turns out not to be needed.

-- 
David-Sarah Hopwood


More information about the Es-discuss mailing list