The --harmony
flag enables ES Harmony features. it seems that --harmony
enables new ECMA features in the language, based on the v8
, proxies, weak maps, sets, maps, typeof semantics, and block scoping are available when this flag is being used and these are extended features and after extending these features you can use for example let
(for block scoping) with strict mode
enabled only because it's based on it, otherwise it will throw
SyntaxError: Illegal let declaration outside extended mode.
Extended Mode : When you are using new ECMA
features (ECMAScript 5), you are in the extended mode of the language and in this mode ECMAScript’s new features (extended code) and syntax could be used only in strict mode
Concept of “extended code” that means code that may use new Es.next
syntax.
Harmony :
"Harmony" is the name of the major upgrade to JavaScript due to arrive by the end of 2013. In 2008, after much controversy, the ECMA Technical Committee 39, that had been charged with creating the next generation of JavaScript, agreed to work together on a "Harmony" update to JavaScript and it has been in development since then.
A number of the proposed features of Harmony are supported by Google's implementation. These include block scoped bindings and the addition of the let keyword, efficient maps and sets to remove the need to "abuse objects as dictionaries", weak maps for garbage collectable key/value tables and proxies which can simulate any JavaScript object or function to enable customisation.
Some good reads here and hear. Also from Chromium Blog.
Also from Paul Irish :
François Beaufort (originally shared): A new flag named Enable
Experimental JavaScript appeared in the chrome://flags page of the
last Chromium build. This flag enables web pages to use experimental
JavaScript features.
To use extended mode/harmony features now in Chrome
we have to enable this and we can enable this by navigating to chrome://flags
and can toggle (enable/disable) on "Experimental JavaScript features".