ECMAScript
ECMAScript is a
scripting programming language, standardized by
Ecma International in the
ECMA-262 specification. The language is widely used on the
web, and is often referred to as
JavaScript or
JScript, although those two languages are extensions of the ECMA-262 standard.
Please see the
JavaScript article for an overview of the language.
In December 1995
Sun Microsystems and
Netscape Communications Corporation introduced [
1]
JavaScript. In March 1996 Netscape Communications Corporation released
Netscape Navigator 2.0, which featured support for JavaScript. Due to the de facto success of JavaScript as a client-side scripting language for web pages,
Microsoft developed a "roughly" compatible language known as JScript, which was included in
Internet Explorer 3.0, released in August 1996.
Netscape submitted the JavaScript specification to
Ecma International for standardization; 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.
ECMAScript is the name of the scripting language standardized in ECMA-262. Both JavaScript and JScript technologies aim to be compatible with ECMAScript, while providing additional features not described in the ECMA specification.
There are three editions of ECMA-262 published, and the work on the fourth edition is in progress.
| Edition | Date published!Differences to the previous edition |
|---|
| 1 | June 1997 | First edition |
| 2 | June 1998 | Editorial changes to keep the specification fully aligned with ISO/IEC 16262 international standard. |
| 3 | December 1999 | Powerful regular expressions, better string handling, new control statements, try/catch exception handling, tighter definition of errors, formatting for numeric output and other. |
| 4 | Work in progress | Maybe explicit class definitions, packages and namespaces, optional static typing, better exposure of previously internal features (properties, key enumerability), and more? |
In June 2004 Ecma International published ECMA-357 standard, defining an extension to ECMAScript, known as
E4X (ECMAScript for XML).
ECMAScript is supported in many applications, especially
web browsers. The binding with
DOM is added for manipulating the document.
Note (1): The latest versions of SpiderMonkey 1.8 and Firefox 1.5 have partial support of
E4X [
2] and a few other features, see
New in JavaScript 1.6.
Note (2): Microsoft claims that JScript 8.0 supports "almost all of the features of the ECMAScript Edition 3 Language Specification" but does not list the unsupported features.
Note (3): In addition to supporting ECMA-262 revision 3, ActionScript 2 also included support of properties, methods, and mechanisms that were
proposed in early draft specifications of as yet unseen versions of ECMAScript. It remains to be seen if ActionScript will stay
in sync with future changes to the ECMAScript specifications.
Note (4): As stated by OpenLaszlo, it partially implements revision 3 of ECMA-262 [
3]
The Mozilla implementations, (
SpiderMonkey in the
C programming language and
Rhino in the
Java programming language), are used in several
third-party programs, including
Konfabulator and the Macintosh system-level scripting language
JavaScript OSA.
Apple's
Safari uses
JavaScriptCore which is based on the
KDE KJS library.
The following table is based on [
4] and [
5]; items on the same line are approximately the same language.
| JavaScript | JScript!ECMAScript |
|---|
| 1.0 (Netscape 2.0, Mar 1996) | 1.0 (IE 3.0 - early versions, Aug 1996) |
| 1.1 (Netscape 3.0, Aug 1996) | 2.0 (IE 3.0 - later versions, Jan 1997) |
| 1.2 (Netscape 4.0, Jun 1997) |
| 1.3 (Netscape 4.5, Oct 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, Mar 1999) |
| 5.1 (IE 5.01) |
1.5 (Netscape 6.0, Nov 2000; also later Netscape and Mozilla releases) | 5.5 (IE 5.5, Jul 2000) | edition 3 (Dec 1999) |
| 5.6 (IE 6.0, Oct 2001) |
| 1.6 (Gecko 1.8, Firefox 1.5, November 2005) | edition 3, with some compliant enhancements: E4X, Array extras (e.g. Array.prototype.forEach), Array and String generics [6] |
| 1.7 (Gecko 1.8.1, Firefox 2.0, Fall 2006), an extension of JavaScript 1.6 (under development) | edition 3 plus all JavaScript 1.6 enhancements, plus Pythonic generators and array comprehensions ([a*a for (a in iter)]), block scope with let, destructuring assignment (var [a,b]=[1,2]) [7] |
| JScript .NET (ASP.NET; no IE release) | (JScript .NET is said to be designed with the participation of other ECMA members) |
| JavaScript 2.0 (an old "Netscape proposal") | edition 4 (work in progress) |
The current work on the fourth edition of ECMAScript has received some criticism, as there is thought to be a concerted effort by the organization to change the language from a
prototype-based programming language into a more traditional
class-based programming one, in essence, changing the very nature of how JavaScript treats relationships between objects. JavaScript is often
championed by prototype-based language advocates, as it is the best known language with this object-oriented feature.
ActionScript version 2.0 is an example of a ECMAScript implementation which is already more class-based than prototype-based.
*
List of ECMAScript engines*
Standard ECMA-262 ECMAScript Language Specification 3rd edition (December 1999)*
Standard ECMA-290 ECMAScript Components Specification (June 1999)*
Standard ECMA-327 ECMAScript 3rd Edition Compact Profile (June 2001)*
Standard ECMA-357 ECMAScript for XML (E4X) Specification (June 2004)