ECMAScript
Encyclopedia
ECMAScript is the scripting language
Scripting language
A scripting language, script language, or extension language is a programming language that allows control of one or more applications. "Scripts" are distinct from the core code of the application, as they are usually written in a different language and are often created or at least modified by the...

 standardized by Ecma International
Ecma International
Ecma International is an international, private non-profit standards organization for information and communication systems. It acquired its name in 1994, when the European Computer Manufacturers Association changed its name to reflect the organization's global reach and activities...

 in the ECMA-262 specification
Specification (technical standard)
A specification is an explicit set of requirements to be satisfied by a material, product, or service. Should a material, product or service fail to meet one or more of the applicable specifications, it may be referred to as being out of specification;the abbreviation OOS may also be used...

 and ISO/IEC 16262. The language is widely used for client-side scripting
Client-side scripting
Client-side scripting generally refers to the class of computer programs on the web that are executed client-side, by the user's web browser, instead of server-side...

 on the web
World Wide Web
The World Wide Web is a system of interlinked hypertext documents accessed via the Internet...

, in the form of several well-known dialects such as JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

, JScript
JScript
JScript is a scripting language based on the ECMAScript standard that is used in Microsoft's Internet Explorer.JScript is implemented as a Windows Script engine. This means that it can be "plugged in" to any application that supports Windows Script, such as Internet Explorer, Active Server Pages,...

, and ActionScript
ActionScript
ActionScript is an object-oriented language originally developed by Macromedia Inc. . It is a dialect of ECMAScript , and is used primarily for the development of websites and software targeting the Adobe Flash Player platform, used on Web pages in the form of...

.

History

JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

 was originally developed by Brendan Eich
Brendan Eich
Brendan Eich is a computer programmer and creator of the JavaScript scripting language. He is the chief technology officer at the Mozilla Corporation.-Education:...

 of Netscape under the name Mocha, later LiveScript, and finally renamed to JavaScript. In December 1995, Sun Microsystems
Sun Microsystems
Sun Microsystems, Inc. was a company that sold :computers, computer components, :computer software, and :information technology services. Sun was founded on February 24, 1982...

 and Netscape announced JavaScript in a press release. In March 1996, Netscape Navigator
Netscape Navigator
Netscape Navigator was a proprietary web browser that was popular in the 1990s. It was the flagship product of the Netscape Communications Corporation and the dominant web browser in terms of usage share, although by 2002 its usage had almost disappeared...

 2.0 was out, featuring support for JavaScript.

Due to the widespread success of JavaScript as a client-side scripting language for web pages, Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

 developed a compatible dialect of the language, naming it JScript
JScript
JScript is a scripting language based on the ECMAScript standard that is used in Microsoft's Internet Explorer.JScript is implemented as a Windows Script engine. This means that it can be "plugged in" to any application that supports Windows Script, such as Internet Explorer, Active Server Pages,...

 to avoid trademark issues. JScript added new date methods to fix the non-Y2K
Year 2000 problem
The Year 2000 problem was a problem for both digital and non-digital documentation and data storage situations which resulted from the practice of abbreviating a four-digit year to two digits.In computer programs, the practice of representing the year with two...

-friendly methods in JavaScript, which were based on the Java Date class. JScript was included in Internet Explorer
Internet Explorer
Windows Internet Explorer is a series of graphical web browsers developed by Microsoft and included as part of the Microsoft Windows line of operating systems, starting in 1995. It was first released as part of the add-on package Plus! for Windows 95 that year...

 3.0, released in August 1996.

Netscape delivered JavaScript to Ecma International
Ecma International
Ecma International is an international, private non-profit standards organization for information and communication systems. It acquired its name in 1994, when the European Computer Manufacturers Association changed its name to reflect the organization's global reach and activities...

 for standardization and the work on the specification, ECMA-262, began in November 1996. The first edition of ECMA-262 was adopted by the Ecma General Assembly of June 1997. Several editions of the language standard have been published since then.

ECMAScript is the name of the scripting language standardized in ECMA-262. The name "ECMAScript" was a compromise between the organizations involved in standardizing the language, especially Netscape and Microsoft, whose disputes dominated the early standards sessions. Brendan Eich, the creator of JavaScript, commented that "ECMAScript was always an unwanted trade name that sounds like a skin disease."

While both JavaScript and JScript aim to be compatible with ECMAScript, they also provide additional features not described in the ECMA specifications.

Versions

There are five editions of ECMA-262 published. Work on a future edition, codenamed "Harmony", is in progress.
Edition Date published Differences to the previous edition Editor
1 June 1997 First edition Guy L. Steele, Jr.
Guy L. Steele, Jr.
Guy Lewis Steele Jr. , also known as "The Great Quux", and GLS , is an American computer scientist who has played an important role in designing and documenting several computer programming languages.-Biography:...

2 June 1998 Editorial changes to keep the specification fully aligned with ISO/IEC 16262 international standard Mike Cowlishaw
Mike Cowlishaw
Mike Cowlishaw is a retired IBM Fellow, a Visiting Professor at the Department of Computer Science at the University of Warwick, and is a Fellow of the Royal Academy of Engineering , the Institute of Engineering and Technology , and the British Computer Society.- Career at IBM :Cowlishaw joined IBM...

3 December 1999 Added regular expressions, better string handling, new control statements, try/catch exception handling, tighter definition of errors, formatting for numeric output and other enhancements Mike Cowlishaw
4 Abandoned Fourth Edition was abandoned, due to political differences concerning language complexity, with some of the work forming the basis of Fifth Edition and some forming the basis of ECMAScript Harmony.
5 December 2009 Adds "strict mode", a subset intended to provide more thorough error checking and avoid error-prone constructs. Clarifies many ambiguities in the 3rd edition specification, and accommodates behaviour of real-world implementations that differed consistently from that specification. Adds some new features, such as getters and setters, library support for JSON
JSON
JSON , or JavaScript Object Notation, is a lightweight text-based open standard designed for human-readable data interchange. It is derived from the JavaScript scripting language for representing simple data structures and associative arrays, called objects...

, and more complete reflection
Reflection (computer science)
In computer science, reflection is the process by which a computer program can observe and modify its own structure and behavior at runtime....

 on object properties.
Pratap Lakshman, Allen Wirfs-Brock
5.1 June 2011 This edition 5.1 of the ECMAScript Standard is fully aligned with third edition of the international standard ISO/IEC 16262:2011 Pratap Lakshman, Allen Wirfs-Brock
Harmony Work in progress Multiple new concepts and language features — see the section "Future development" below.


In June 2004, Ecma International published ECMA-357 standard, defining an extension to ECMAScript, known as E4X
E4X
ECMAScript for XML is a programming language extension that adds native XML support to ECMAScript . The goal is to provide an alternative to DOM interfaces that uses a simpler syntax for accessing XML documents. It also offers a new way of making XML visible...

 (ECMAScript for XML).

Ecma also defined a "Compact Profile" for ECMAScript — known as ES-CP, or ECMA 327 — which is designed for resource-constrained devices. Several of the dynamic features of ECMAScript (such as the eval
Eval
In some programming languages, eval is a function which evaluates a string as though it were an expression and returns a result; in others, it executes multiple lines of code as though they had been included instead of the line including the eval...

function) are made optional, thus allowing the runtime to make more assumptions about the behaviour of programs and therefore make more performance trade-offs when running the code. The HD DVD
HD DVD
HD DVD is a discontinued high-density optical disc format for storing data and high-definition video.Supported principally by Toshiba, HD DVD was envisioned to be the successor to the standard DVD format...

 standard was one place where the ECMAScript Compact Profile was used in favour of full ECMAScript in order to reduce processing and memory requirements on a device.

Features

The ECMAScript language includes structured
Structured programming
Structured programming is a programming paradigm aimed on improving the clarity, quality, and development time of a computer program by making extensive use of subroutines, block structures and for and while loops - in contrast to using simple tests and jumps such as the goto statement which could...

, dynamic
Dynamic programming language
Dynamic programming language is a term used broadly in computer science to describe a class of high-level programming languages that execute at runtime many common behaviors that other languages might perform during compilation, if at all...

, functional
Functional programming
In computer science, functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. It emphasizes the application of functions, in contrast to the imperative programming style, which emphasizes changes in state...

, and prototype-based
Prototype-based programming
Prototype-based programming is a style of object-oriented programming in which classes are not present, and behavior reuse is performed via a process of cloning existing objects that serve as prototypes. This model can also be known as classless, prototype-oriented or instance-based programming...

 features, as officially summarized here.

Dialects

ECMAScript is supported in many applications, especially web browser
Web browser
A web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier and may be a web page, image, video, or other piece of content...

s, where it is implemented by JavaScript, or, in the case of Internet Explorer, JScript. Dialects sometimes include extensions to the language, or to the standard library
Standard library
A standard library for a programming language is the library that is conventionally made available in every implementation of that language. In some cases, the library is described directly in the programming language specification; in other cases, the contents of the standard library are...

 and related API
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

s such as the W3C
World Wide Web Consortium
The World Wide Web Consortium is the main international standards organization for the World Wide Web .Founded and headed by Tim Berners-Lee, the consortium is made up of member organizations which maintain full-time staff for the purpose of working together in the development of standards for the...

-specified DOM
Document Object Model
The Document Object Model is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents. Aspects of the DOM may be addressed and manipulated within the syntax of the programming language in use...

. This means that applications written in one dialect may be incompatible with another, unless they are written to use only a common subset of supported features and APIs.
Application/Implementation Dialect and latest version ECMAScript edition
Mozilla Firefox
Mozilla Firefox
Mozilla Firefox is a free and open source web browser descended from the Mozilla Application Suite and managed by Mozilla Corporation. , Firefox is the second most widely used browser, with approximately 25% of worldwide usage share of web browsers...

, the Gecko
Gecko (layout engine)
Gecko is a free and open source layout engine used in many applications developed by Mozilla Foundation and the Mozilla Corporation , as well as in many other open source software projects....

 layout engine
Layout engine
A web browser engine, , is a software component that takes marked up content and formatting information and displays the formatted content on the screen. It "paints" on the content area of a window, which is displayed on a monitor or a printer...

, SpiderMonkey, and Rhino
Rhino (JavaScript engine)
Rhino is an open source JavaScript engine. It is developed entirely in Java and managed by the Mozilla Foundation. The Foundation also provides another implementation of JavaScript engine written in C known as SpiderMonkey....

The Mozilla implementations, (SpiderMonkey in the C programming language
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 and Rhino
Rhino (JavaScript engine)
Rhino is an open source JavaScript engine. It is developed entirely in Java and managed by the Mozilla Foundation. The Foundation also provides another implementation of JavaScript engine written in C known as SpiderMonkey....

 in the Java programming language
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

), are used in several third-party
Third-party software component
In computer programming, a third-party software component is a reusable software component developed to be either freely distributed or sold by an entity other than the original vendor of the development platform...

 programs, including the Yahoo! Widget Engine
Yahoo! Widget Engine
Yahoo! Widgets is a free application platform for Mac OS X and Microsoft Windows. The software was previously called Konfabulator, but after being acquired by computer services company Yahoo! it was rebranded. The name Konfabulator was subsequently reinstated as the name of the underlying rendering...

 (Konfabulator) and the Macintosh system-level scripting language JavaScript OSA
JavaScript OSA
JavaScript OSA, , is a freeware inter-process communication scripting language for the Macintosh computer....

.
JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

 1.8.5Mozilla manages the official version of JavaScript. Most non-Mozilla implementations claiming JavaScript "compliance" do not actually support most JavaScript extensions; rather, they target ECMA-262, edition 3.
ECMA-262, edition 5
Google Chrome
Google Chrome
Google Chrome is a web browser developed by Google that uses the WebKit layout engine. It was first released as a beta version for Microsoft Windows on September 2, 2008, and the public stable release was on December 11, 2008. The name is derived from the graphical user interface frame, or...

, the V8
V8 (JavaScript engine)
The Google V8 JavaScript Engine is an open source JavaScript engine developed by Google and ships with the Google Chrome web browser. Lars Bak is the head programmer....

 engine
JavaScript ECMA-262, edition 5V8 implements ECMAScript as specified in ECMA-262, 5th edition: V8 JavaScript Engine.
Internet Explorer
Internet Explorer
Windows Internet Explorer is a series of graphical web browsers developed by Microsoft and included as part of the Microsoft Windows line of operating systems, starting in 1995. It was first released as part of the add-on package Plus! for Windows 95 that year...

, the Trident
Trident (layout engine)
Trident is the name of the layout engine for the Microsoft Windows version of Internet Explorer.It was first introduced with the release of Internet Explorer version 4.0 in October 1997; it has been steadily upgraded and remains in use today...

 layout engine
JScript
JScript
JScript is a scripting language based on the ECMAScript standard that is used in Microsoft's Internet Explorer.JScript is implemented as a Windows Script engine. This means that it can be "plugged in" to any application that supports Windows Script, such as Internet Explorer, Active Server Pages,...

 9.0
ECMA-262, edition 5
Opera
Opera (web browser)
Opera is a web browser and Internet suite developed by Opera Software with over 200 million users worldwide. The browser handles common Internet-related tasks such as displaying web sites, sending and receiving e-mail messages, managing contacts, chatting on IRC, downloading files via BitTorrent,...

ECMAScriptOpera's implementation includes some JavaScript and JScript extensions: ECMAScript support in Opera Presto 2.3 ECMA-262, edition 5Full ECMAScript (JavaScript) 5.1 support in Opera 11.51+ : .
KHTML
KHTML
KHTML is the HTML layout engine developed by the KDE project. It is the engine used by the Konqueror web browser. A forked version of KHTML called WebKit is used by several web browsers, among them Safari and Google Chrome...

 layout engine, KDE
KDE
KDE is an international free software community producing an integrated set of cross-platform applications designed to run on Linux, FreeBSD, Microsoft Windows, Solaris and Mac OS X systems...

's Konqueror
Konqueror
Not to be confused with the Conqueror web browser.Konqueror is a web browser and file manager that provides file-viewer functionality for file systems such as local files, files on a remote ftp server and files in a disk image. It is a core part of the KDE desktop environment...

, and Apple Inc.'s Safari
Safari (web browser)
Safari is a web browser developed by Apple Inc. and included with the Mac OS X and iOS operating systems. First released as a public beta on January 7, 2003 on the company's Mac OS X operating system, it became Apple's default browser beginning with Mac OS X v10.3 "Panther". Safari is also the...

Apple
Apple Computer
Apple Inc. is an American multinational corporation that designs and markets consumer electronics, computer software, and personal computers. The company's best-known hardware products include the Macintosh line of computers, the iPod, the iPhone and the iPad...

's Safari uses JavaScriptCore which is based on the KDE KJS library.
JavaScript ECMA-262, edition 3
Appweb Web Server, Samba 4
Samba (software)
Samba is a free software re-implementation, originally developed by Andrew Tridgell, of the SMB/CIFS networking protocol. As of version 3, Samba provides file and print services for various Microsoft Windows clients and can integrate with a Windows Server domain, either as a Primary Domain...

Ejscript 0.9.9 ECMA-262, edition 3This implementation asserts to support some extensions proposed in drafts of ECMAScript edition 4 (and now ECMAScript Harmony): Ejscript Overview.
Microsoft .NET Framework
.NET Framework
The .NET Framework is a software framework that runs primarily on Microsoft Windows. It includes a large library and supports several programming languages which allows language interoperability...

JScript .NET
JScript .NET
JScript .NET is a .NET programming language developed by Microsoft as a natural successor to Microsoft's Active Scripting language JScript, which, in turn, started life as an implementation of JavaScript....

 8.0
ECMA-262, edition 3Microsoft asserts that JScript 8.0 supports "almost all of the features of the ECMAScript Edition 3 Language Specification" but does not list the unsupported features.
Adobe Flash
Adobe Flash
Adobe Flash is a multimedia platform used to add animation, video, and interactivity to web pages. Flash is frequently used for advertisements, games and flash animations for broadcast...

 and Adobe Flex
Adobe Flex
Adobe Flex is a software development kit released by Adobe Systems for the development and deployment of cross-platform rich Internet applications based on the Adobe Flash platform...

ActionScript
ActionScript
ActionScript is an object-oriented language originally developed by Macromedia Inc. . It is a dialect of ECMAScript , and is used primarily for the development of websites and software targeting the Adobe Flash Player platform, used on Web pages in the form of...

 3
ECMA-262, edition 3In addition to supporting ECMA-262 edition 3, ActionScript 3 also included support for extensions proposed in drafts of ECMAScript edition 4: The Kiwi Project: AS3 language 101 for C/C++ coders.
Adobe Acrobat
Adobe Acrobat
Adobe Acrobat is a family of application software developed by Adobe Systems to view, create, manipulate, print and manage files in Portable Document Format . All members of the family, except Adobe Reader , are commercial software, while the latter is available as freeware and can be downloaded...

JavaScript 1.7Adobe Acrobat 9.0 uses the SpiderMonkey 1.7 engine: JavaScript for Acrobat API Reference ECMA-262, edition 3
General purpose scripting language DMDScript 1.15 ECMA-262
OpenLaszlo Platform
OpenLaszlo
OpenLaszlo is an open source platform for the development and delivery of rich Internet applications. It is released under the Open Source Initiative-certified Common Public License ....

JavaScriptOpenLaszlo both uses an ECMAScript dialect as noted in the Developer's Guide: Appendix B: ECMAScript and can compile down to JavaScript targeted for the browser (the DHTML target). ECMA-262, edition 3As of version 4, OpenLaszlo implements standard ECMAScript edition 3 with some extensions proposed in drafts of ECMAScript edition 4: OpenLaszlo 4.
CriScript, JScript for game platforms CriScript 0.91.0 ECMA-262, edition 3
iCab
ICab
iCab is a web browser for the Macintosh by Alexander Clauss, derived from Crystal Atari Browser for Atari TOS compatible computers. It is the most recently actively developed browser for 68k-based Macintoshes that features tabbed browsing and one of a very few browsers that was still updated in...

InScript 3.22 (abandoned) ECMA-262, edition 3
Max/MSP JavaScript 1.5 ECMA-262, edition 3
ANT Galio 3
Fresco (web browser)
ANT Fresco was a proprietary, embedded web browser produced by , a software development firm headquartered in Cambridge, United Kingdom. Fresco was superseded by Galio in 2004....

JavaScript 1.5ANT Galio Browser claims support for JavaScript 1.5. ECMA-262, edition 3
KDE QtScript ECMA-262, edition 3
Caja ECMA-262, edition 3Caja emulates strict mode as specified in the ECMAScript edition 5 draft.
Objective-J
Objective-J
Objective-J is a programming language developed as part of the Cappuccino web development framework. Its syntax is nearly identical to the Objective-C syntax and it shares with JavaScript the same relationship that Objective-C has with the C programming language: that of being a strict, but small,...

ECMA-262, edition 3
WMLScript
WMLScript
WMLScript is the dialect of JavaScript used for WML pages and is part of the Wireless Application Protocol .WMLScript is a client-side scripting language and is very similar to JavaScript...

ECMA-262, edition 3

Version correspondence

The following table is based on tedster's history compilation forum post and Microsoft's JScript version information webpage. Items on the same line are approximately the same language.
JavaScript JScript ECMAScript
1.0 (Netscape 2.0, March 1996) 1.0 (IE 3.0 - early versions, August 1996)
1.1 (Netscape 3.0, August 1996) 2.0 (IE 3.0 - later versions, January 1997)
1.2 (Netscape 4.0-4.05, June 1997)
1.3 (Netscape 4.06-4.7x, October 1998) 3.0 (IE 4.0, Oct 1997) Edition 1 (June 1997) / Edition 2 (June 1998)
1.4 (Netscape Server only) 4.0 (Visual Studio 6, no IE release)
5.0 (IE 5.0, March 1999)
5.1 (IE 5.01)
1.5 (Netscape 6.0, Nov 2000; also
later Netscape and Mozilla
Mozilla
Mozilla is a term used in a number of ways in relation to the Mozilla.org project and the Mozilla Foundation, their defunct commercial predecessor Netscape Communications Corporation, and their related application software....

 releases)
5.5 (IE 5.5, July 2000) Edition 3 (December 1999)
5.6 (IE 6.0, October 2001)
1.6 (Gecko 1.8, Firefox 1.5, November 2005) Edition 3, with some compliant enhancements: E4X
E4X
ECMAScript for XML is a programming language extension that adds native XML support to ECMAScript . The goal is to provide an alternative to DOM interfaces that uses a simpler syntax for accessing XML documents. It also offers a new way of making XML visible...

, Array extras (e.g. Array.prototype.forEach), Array and String generics (New in JavaScript 1.6)
1.7 (Gecko 1.8.1, Firefox 2, October 2006) Edition 3 plus all JavaScript 1.6 enhancements, plus Pythonic
Python (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

 generators and array comprehensions ([a*a for (a in iter)]), block scope
Scope (programming)
In computer programming, scope is an enclosing context where values and expressions are associated. Various programming languages have various types of scopes. The type of scope determines what kind of entities it can contain and how it affects them—or semantics...

 with let, destructuring assignment (var [a,b]=[1,2]) (New in JavaScript 1.7)
1.8 (Gecko 1.9, Firefox 3, June 2008) Edition 3 plus all JavaScript 1.7 enhancements, plus expression closures (function(x) x * x), generator expressions, and more (New in JavaScript 1.8)
JScript .NET
JScript .NET
JScript .NET is a .NET programming language developed by Microsoft as a natural successor to Microsoft's Active Scripting language JScript, which, in turn, started life as an implementation of JavaScript....

 (ASP.NET
ASP.NET
ASP.NET is a Web application framework developed and marketed by Microsoft to allow programmers to build dynamic Web sites, Web applications and Web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages ...

; no IE release)
(JScript .NET is said to have been designed with the participation of other Ecma members)
JavaScript 2.0 (Work in progress) Harmony (Work in progress; see the section "ECMAScript Harmony" below).

Conformance tests

In 2010, Ecma International started developing a standards test for Ecma 262 ECMAScript.
Test262 is an ECMAScript conformance test suite that can be used to check how closely a JavaScript implementation follows the ECMAScript 5th Edition Specification. The test suite contains thousands of individual tests, each of which tests some specific requirements of the ECMAScript specification.

Development of Test262 is a project of Ecma Technical Committee 39 (TC39). The testing framework and individual tests are created by member organizations of TC39 and contributed to Ecma for use in Test262.

Important contributions were made by Google (Sputnik testsuite) and Microsoft who both contributed thousands of tests.

The Test262 testsuite already contains more than 11,000 tests and is still being developed further.

The following table shows current conformance results of browser products. Lower scores are better, although scores can not be compared as tests are not weighted.
Product Current version Test262 failed Beta/Preview version Test262 failed Test suite version (date)
Firefox 8.0 164/11029 Nightly 11.0a1 (2011-11-19) 160/11029 ES5 (2011-11-04)
Chrome 15.0.874.121 419/11108 17.0.955 207/11108 ES5 (2011-11-28)
Internet Explorer 9.0.8112.16421 323/11029 10.0 Preview 3 3/10978 ES5 (2011-11-04)
Safari 5.1.1 (7534.51.22) 774/11029 ES5 (2011-11-04)
Opera 11.52 (Build 1100) 3,821/11108 12.00 pre-alpha (Build 1174) 1/11108 ES5 (2011-11-28)

Future development

The proposed fourth edition of ECMA-262 (ECMAScript 4 or ES4) would have been the first major update to ECMAScript since the third edition was published in 1999. The specification (along with a reference implementation) was originally targeted for completion by October 2008. An overview of the language was released by the working group on October 22, 2007.

As of August 2008, the ECMAScript 4th edition proposal has been scaled back into a project codenamed ECMAScript Harmony.

Features under discussion

Features under discussion for a future edition (originally "ECMAScript 4"; now ECMAScript Harmony) include:
  • Classes
    Class (computer science)
    In object-oriented programming, a class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable these class instances to have state and behavior...

  • A module system
    Modular programming
    Modular programming is a software design technique that increases the extent to which software is composed of separate, interchangeable components called modules by breaking down program functions into modules, each of which accomplishes one function and contains everything necessary to accomplish...

  • Optional type annotations and static typing, probably using a structural type system
    Structural type system
    A structural type system is a major class of type system, in which type compatibility and equivalence are determined by the type's structure, and not by other characteristics such as its name or place of declaration. Structural systems are used to determine if types are equivalent and whether a...

  • Generators
    Generator (computer science)
    In computer science, a generator is a special routine that can be used to control the iteration behaviour of a loop. A generator is very similar to a function that returns an array, in that a generator has parameters, can be called, and generates a sequence of values...

     and iterator
    Iterator
    In computer programming, an iterator is an object that enables a programmer to traverse a container. Various types of iterators are often provided via a container's interface...

    s
  • Destructuring assignment
  • Algebraic data type
    Algebraic data type
    In computer programming, particularly functional programming and type theory, an algebraic data type is a datatype each of whose values is data from other datatypes wrapped in one of the constructors of the datatype. Any wrapped datum is an argument to the constructor...

    s


The intent of these features is partly to better support "programming in the large
Programming in the large
In software development, programming in the large and programming in the small describe two different approaches to writing software. The terms were coined by Frank DeRemer and Hans Kron in their 1975 paper "Programming-in-the large versus programming-in-the-small" Fred Brooks identifies that the...

", and to let programmers sacrifice some of the script's ability to be dynamic for performance. For example, Tamarin — the virtual machine for ActionScript developed and open sourced by Adobe — has JIT compilation
Just-in-time compilation
In computing, just-in-time compilation , also known as dynamic translation, is a method to improve the runtime performance of computer programs. Historically, computer programs had two modes of runtime operation, either interpreted or static compilation...

 support for certain classes of scripts.

Bug fixes and backwards compatibility

In addition to introducing new features, some ES3 bugs were proposed to be fixed in edition 4. These fixes and others, and support for JSON
JSON
JSON , or JavaScript Object Notation, is a lightweight text-based open standard designed for human-readable data interchange. It is derived from the JavaScript scripting language for representing simple data structures and associative arrays, called objects...

 encoding/decoding, have been folded into the ECMAScript, 5th Edition specification.

History

Work started on Edition 4 after the ES-CP (Compact Profile) specification was completed, and continued for approximately 18 months where slow progress was made balancing the theory of Netscape's JavaScript 2 specification with the implementation experience of Microsoft's JScript .NET. After some time, the focus shifted to the E4X
E4X
ECMAScript for XML is a programming language extension that adds native XML support to ECMAScript . The goal is to provide an alternative to DOM interfaces that uses a simpler syntax for accessing XML documents. It also offers a new way of making XML visible...

 standard.The update has not been without controversy. In late 2007, a debate between Eich, now the Mozilla Foundation
Mozilla Foundation
The Mozilla Foundation is a non-profit organization that exists to support and provide leadership for the open source Mozilla project. The organization sets the policies that govern development, operates key infrastructure and controls trademarks and other intellectual property...

's CTO, and Chris Wilson, Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

's platform architect for Internet Explorer
Internet Explorer
Windows Internet Explorer is a series of graphical web browsers developed by Microsoft and included as part of the Microsoft Windows line of operating systems, starting in 1995. It was first released as part of the add-on package Plus! for Windows 95 that year...

, became public on a number of blog
Blog
A blog is a type of website or part of a website supposed to be updated with new content from time to time. Blogs are usually maintained by an individual with regular entries of commentary, descriptions of events, or other material such as graphics or video. Entries are commonly displayed in...

s. Wilson cautioned that because the proposed changes to ECMAScript made it backwards incompatible in some respects to earlier versions of the language, the update amounted to "breaking the Web," and that stakeholders who opposed the changes were being "hidden from view". Eich responded by stating that Wilson seemed to be "repeating falsehoods in blogs" and denied that there was attempt to suppress dissent and challenging critics to give specific examples of incompatibility. He also pointed out that Microsoft Silverlight
Microsoft Silverlight
Microsoft Silverlight is an application framework for writing and running rich Internet applications, with features and purposes similar to those of Adobe Flash. The run-time environment for Silverlight is available as a plug-in for web browsers running under Microsoft Windows and Mac OS X...

 and Adobe AIR rely on C# and ActionScript
ActionScript
ActionScript is an object-oriented language originally developed by Macromedia Inc. . It is a dialect of ECMAScript , and is used primarily for the development of websites and software targeting the Adobe Flash Player platform, used on Web pages in the form of...

 3 respectively, both of which are larger and more complex than ECMAScript Edition 3.

ECMAScript, 5th Edition

Yahoo, Microsoft, Google, and other 4th edition dissenters formed their own subcommittee to design a less ambitious update of ECMAScript 3, tentatively named ECMAScript 3.1. This edition would focus on security and library updates with a large emphasis on compatibility. After the aforementioned public sparring, the ECMAScript 3.1 and ECMAScript 4 teams agreed on a compromise: the two editions would be worked on, in parallel, with coordination between the teams to ensure that ECMAScript 3.1 remains a strict subset of ECMAScript 4 in both semantics and syntax.

However, the differing philosophies in each team resulted in repeated breakages of the subset rule, and it remained doubtful that the ECMAScript 4 dissenters would ever support or implement ECMAScript 4 in the future. After over a year since the disagreement over the future of ECMAScript within the Ecma Technical Committee 39, the two teams reached a new compromise in July 2008: Ecma TC39 announced it would focus work on the ECMAScript 3.1 (later renamed to ECMAScript, 5th Edition) project with full collaboration of all parties, and it would target two interoperable implementations by early 2009. In April 2009, Ecma TC39 published the "final" draft of the 5th edition and announced that testing of interoperable implementations was expected to be completed by mid-July. On December 3, 2009, ECMA-262 5th edition was published.

ECMAScript Harmony

In the same announcement, Ecma TC39 also stated that the ECMAScript 4 proposal would be superseded by a new project, code-named ECMAScript Harmony. ECMAScript Harmony names the agreed design trajectory of post-ES5 editions. It will include syntactic extensions, but the changes will be more modest than ECMAScript 4 in both semantic and syntactic innovation. Packages, namespaces, and early binding from ECMAScript 4 are no longer included for planned releases. In addition, other goals and ideas from ECMAScript 4 are being rephrased to keep consensus in the committee; these include a notion of classes based on ECMAScript, 5th Edition (being an update to ECMAScript, 3rd edition). , there is no publicly announced release date for next edition within the ECMAScript Harmony trajectory. Depending on Ecma, that next edition may end up being called ECMAScript, 6th edition.

See also

  • ActionScript
    ActionScript
    ActionScript is an object-oriented language originally developed by Macromedia Inc. . It is a dialect of ECMAScript , and is used primarily for the development of websites and software targeting the Adobe Flash Player platform, used on Web pages in the form of...

  • Comparison of layout engines (ECMAScript)
    Comparison of layout engines (ECMAScript)
    The following tables compare ECMAScript support for a number of layout engines. Please see the individual products' articles for further information. This article is not all-inclusive or necessarily up-to-date...

  • Document Object Model
    Document Object Model
    The Document Object Model is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents. Aspects of the DOM may be addressed and manipulated within the syntax of the programming language in use...

  • E4X
    E4X
    ECMAScript for XML is a programming language extension that adds native XML support to ECMAScript . The goal is to provide an alternative to DOM interfaces that uses a simpler syntax for accessing XML documents. It also offers a new way of making XML visible...

  • JavaScript
    JavaScript
    JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

  • JScript
    JScript
    JScript is a scripting language based on the ECMAScript standard that is used in Microsoft's Internet Explorer.JScript is implemented as a Windows Script engine. This means that it can be "plugged in" to any application that supports Windows Script, such as Internet Explorer, Active Server Pages,...

  • Server-Side JavaScript
    Server-side JavaScript
    Server-side JavaScript refers to JavaScript that runs on the server-side. This term was coined because the language is predominantly used on the client-side, i.e. client-side JavaScript ....

  • List of ECMAScript engines
  • QML
    QML
    QML is a JavaScript-based, declarative language for designing user interface–centric applications. It is part of Qt Quick, the UI creation kit developed by Nokia within the Qt framework...

    (Qt Meta-Object Language)

External links


ISO Standard
Ecma Standards
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK