"Harmony is a super-set of ES5 strict"
brendan at mozilla.com
Fri Feb 25 09:39:01 PST 2011
On Feb 25, 2011, at 7:46 AM, Mike Shaver wrote:
> On Fri, Feb 25, 2011 at 7:36 AM, David Bruant <bruant at enseirb-matmeca.fr> wrote:
>> Does it mean that the "use strict" directive is implicit whenever an
>> ESHarmony feature is used? (this sounds wrong, but I'm asing the question
> It means that the semantics of Harmony are based on ES5-strict, not
> ES5-unstrict, yes. There will be no with, |this| will not be coerced
> to an object wrapper, etc.
David, I wonder why you wrote that "(this sounds wrong)" about Harmony implying "use strict".
Harmony built on ES5-strict assumes the semantics without need for a "use strict" as Mike noted, but there is a question of whether use strict; (with or without quotes) should be allowed in Harmony. We are not proposing to build a stricter-strict or "new strict" mode.
> I don't know, tbh, what it means for things like Proxies which can be
> implemented in ES5 contexts and therefore be accessed by non-strict
> code, but I would expect that their semantics (values of |this|, f.e.)
> would match those of strict mode, however they were called.
This is an issue in Firefox 4, I think it's just a bug: https://bugzilla.mozilla.org/show_bug.cgi?id=600693 (workaround is to "use strict" appropriately).
As far as the presence of new, detectible properties such as Proxy, no opt-in is needed and non-strict code can detect such additions. With modules you'll have to opt in, but proxies at least we prototyped as JSON and other additions were done: the old-fashioned way. No name collisions have been found yet.
More information about the es-discuss