Chapter 5. Standardization: ECMAScript

After JavaScript came out, Microsoft implemented the same language, under the different name JScript, in Internet Explorer 3.0 (August 1996). Partially to keep Microsoft in check, Netscape decided to standardize JavaScript and asked the standards organization Ecma International to host the standard. Work on a specification called ECMA-262 started in November 1996. Because Sun (now Oracle) had a trademark on the term JavaScript, it couldn’t be the official name of the language to be standardized. Hence, ECMAScript was chosen, derived from JavaScript and Ecma. However, that name is used only to refer to versions of the language (where one refers to the specification). Everyone still calls the language JavaScript.

ECMA-262 is managed and evolved by Ecma’s Technical Committee 39 (TC39). Its members are companies such as Microsoft, Mozilla, and Google, which appoint employees to participate in committee work; examples include Brendan Eich, Allen Wirfs-Brock (editor of ECMA-262), and David Herman. To advance the design of ECMAScript, TC39 hosts discussions on open channels (such as the mailing list es-discuss) and holds regular meetings. The meetings are attended by TC39 members and invited experts. In early 2013, attendee numbers ranged from 15 to 25.

The following is a list of ECMAScript versions (or editions of ECMA-262) and their key features:

ECMAScript 1 (June 1997)
First edition
ECMAScript 2 (August 1998)
Editorial changes to align ECMA-262 with the standard ISO/IEC 16262
ECMAScript 3 (December 1999)
do-while, regular expressions, new string methods (concat, match, replace, slice, split with a regular expression, etc.), exception handling, and more
ECMAScript 4 (abandoned July 2008)

ECMAScript 4 was developed as the next version of JavaScript, with a prototype written in ML. However, TC39 could not agree on its feature set. To prevent an impasse, the committee met at the end of July 2008 and came to an accord, summarized in four points:

  1. Develop an incremental update of ECMAScript 3 (which became ECMAScript 5).
  2. Develop a major new version that does less than ECMAScript 4, but much more than the incremental update of ECMAScript 3. The code name for the new version is Harmony, due to the nature of the meeting in which it was conceived. Harmony will be split into ECMAScript 6 and ECMAScript 7.
  3. Features from ECMAScript 4 that would be dropped included packages, namespaces, and early binding.
  4. Other ideas were to be developed in consensus with all of TC39.

Thus, the ECMAScript 4 developers agreed to make Harmony less radical than ECMAScript 4, and the rest of TC39 agreed to keep moving things forward.

ECMAScript 5 (December 2009)
Adds a strict mode, getters and setters, new array methods, support for JSON, and more (see Chapter 25)
ECMAScript 5.1 (June 2011)
Editorial changes to align ECMA-262 with the third edition of the international standard ISO/IEC 16262:2011
ECMAScript 6
Currently in development, it is estimated to be ratified by the end of 2014. Most engines will probably support the most important ECMAScript 6 features at ratification. Complete support may take longer.

Reaching consensus and creating a standard is not always easy, but thanks to the collaborative efforts of the aforementioned parties, JavaScript is a truly open language, with implementations by multiple vendors that are remarkably compatible. That compatibility is made possible by a very detailed yet concrete specification. For example, the specification often uses pseudocode, and it is complemented by a test suite, test262, that checks an ECMAScript implementation for compliance. It is interesting to note that ECMAScript is not managed by the World Wide Web Consortium (W3C). TC39 and the W3C collaborate wherever there is overlap between JavaScript and HTML5.

Get Speaking JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.