Fwd: Syntax of UseStrictDirectives

Jon Zeppieri jaz at bu.edu
Fri May 22 18:01:06 PDT 2009

And again, I sent from the non-subscribed address...

---------- Forwarded message ----------
From: Jon Zeppieri <zeppieri at gmail.com>
Date: Fri, May 22, 2009 at 8:59 PM
Subject: Re: Syntax of UseStrictDirectives
To: Allen Wirfs-Brock <Allen.Wirfs-Brock at microsoft.com>
Cc: Jon Zeppieri <jaz at bu.edu>, Brendan Eich <brendan at mozilla.org>,
"es5-discuss at mozilla.org" <es5-discuss at mozilla.org>

On May 22, 2009, at 7:51 PM, Allen Wirfs-Brock <Allen.Wirfs-Brock at microsoft.com
 > wrote:

>> -----Original Message-----
>> From: es5-discuss-bounces at mozilla.org [mailto:es5-discuss-
>> bounces at mozilla.org] On Behalf Of Jon Zeppieri
>> Strict mode really wants new syntax, and ES5 won't add new syntax.
>> So-- and I realize this is a fait accompli, but-- why is strict mode
>> in ES5, when the pragma syntax to support it properly isn't?
> Resig presents a pretty good discussion of why strict mode, and the
> string literal based use strict directive is valuable:
> http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/

Yes, I've read his post, and it's a good write-up.  But it doesn't
really address my question.  (Then again, I wasn't very clear, so
that's my fault.)

So, my point:  if strict mode were deferred to ES6, then there could
be a single, non-kludgy pragma syntax for using it.

The obvious rejoinder is that if strict mode were deferred, existing
code bases that need to support older browsers wouldn't be able to use
it (or, rather, they would have to hold off on using it for quite some
time).  That's true, but it's also true of every other feature in ES6,
as well.

More information about the es5-discuss mailing list