Re: ES6 “modes” and user-friendliness

David Herman dherman at mozilla.com
Mon Jan 16 23:01:50 PST 2012


On Jan 16, 2012, at 10:30 PM, Axel Rauschmayer wrote:

> Lastly, there is one aspect of automatic language version detection that I still don’t understand: With David Herman’s solution, I’d expect browsers to first scan all of the code and then determine what semantics to use (at least conceptually/abstractly, possibly not in the actual implementation):
> - Found ES6 language feature => ES6 semantics (a few breaking changes, if any)
> - Found "use strict" => ES5.strict semantics
> - None of the above => ES3 semantics

I think you've misunderstood. There's nothing in my New Year's email about "getting ES6 semantics" when you find an occurrence of a particular feature (that kind of thing was just a side conversation in the mega-thread, and a very ill-conceived one IMO). The proposal is that within the context of a module, you get a few small changes to the semantics **for the code within the module** -- and nothing else. There's no scanning for particular features. There's no language version detection. There's no versioning at all. ES6 is an update to the language like every other edition of ECMA-262 has been. Browsers don't have ES3 modes and ES6 modes. They just have ECMAScript.

Dave



More information about the es-discuss mailing list