There Is No Javascript
Copyright © 2005–2012 Thomas Lahn <js@PointedEars.de> (contributors)
Last modified: 2012-02-05T01:44:46+00:00
Available online at http://PointedEars.de/scripts/test/es-matrix/
Many people talk about JavaScript as if it was a fully specified and universally implemented programming language. But that is in fact only the name of one implementation (at the time of writing, not even the widest distributed one) of a standard for an extensible programming language, ECMAScript, which is enjoying several implementations that are widely distributed (primarily, but not solely, through web browsers). This common misconception reaches so far as some rather knowledgable people – out of lazyness or ignorance – choose to refer to this pseudo-language using an alternate capitalization, like “Javascript” or “javascript” in an attempt to distinguish it from the original, JavaScript™ (an example of this can still be seen in the comp.lang.javascript FAQ). This is rather unsurprising since JavaScript is, as Douglas Crockford put it so aptly, the world's most misunderstood programming language.
However, either terminology is misleading; both should first be deprecated, and eventually abolished. The former kind, because it simply misses the point: for example, JavaScript is not JScript. The latter kind, because it is oversimplifying the issue, thereby shadowing the problems that are likely to occur if script code is not written with the existence of different implementations in mind. It is also potentially ambiguous, and leads to odd notation in English and other languages (like "javascript" at the beginning of a sentence, where it should be capitalized by convention, or in the midst of a sentence where it should be capitalized as well because it is a proper noun, after all). Such oversimplifying talk from supposed experts is potentially and evidentially harmful, not only for the experts themselves, but also for the beginners which are mislead and confused by this. It is a Bad Idea™ to keep people in the dark!
In order to achieve greater understanding of this topic, it is important to realize the similarities and the differences between implementations, the advantages and the bugs of each implementation. Differences are pointed out best using different words, not similar ones. For an analogy, you would never call a cat a dog just because both are implementations of the concept “animal” and both are equipped with a tail. Yet this describes exactly what often happens when people are discussing ECMAScript-based script programming: for example, they say “JavaScript” (any capitalization) and mean, often without providing that context information, ECMAScript-based scripting in IE or IIS, that is, Microsoft JScript instead! Who is to tell how the script must look like that they are talking about without further inquiry, then?
Therefore, for lack of a better alternative, the precise and equally concise term ECMAScript implementation(s) should be used when talking about features that several implementations (ought to) have in common (per the ECMAScript Language Specification). And whenever it was talked about one particular implementation, its proper name should be used, like Netscape/Mozilla.org JavaScript or simply JavaScript (if there is doubt, "™" might be added to emphasize that the implementation is meant). In all other instances, the term “JavaScript” (any capitalization) should not be used.
This overview began as a comparison of different “JavaScript” features and, as time passed and understanding grew, evolved into a comparison between the major ECMAScript implementations, detailing the differences, the quirks and the bugs. It has served its author (and its dedicated readers) for years in writing client-side scripts that work cross-browser, and helped to see the distinction between core language features, and APIs with language binding, like the DOM. (The features of the latter API will be compared in another Matrix.)
Whenever you read from this author that key line from arguably the most groundbreaking hacker movie ―“The Matrix has you!”― a suggestion is being considered as a contribution to this overview. See below.
The following table lists all features of ECMAScript implementations that are not part of the first versions/editions of all of these languages, with the version/edition that introduced it; furthermore, information about features that have been deprecated is included. That means if a language feature is not listed here, you can consider it to be universally supported.
In addition, features have been highlighted with a greenish background color if this author considers them safe to use without prior feature test even when they do not appear to be formally specified or to be supported among all versions of all implementations considered here. This is based on the fact that all minimum versions of the implementations that a feature requires can be considered obsolete because the user agents known to implement them can be considered obsolete (see the respective version information for details). Note that this assessment is likely to be subject to change as more implementations are evaluated. If taken as a recommendation for design decisions, it should be taken as a light one.
The content of this table is based on what could be found in vendor's online documentations to date and on occasions where the respective features could be tested; it does not claim to be accurate or complete (please note how each feature is marked). Any correction/addition as to how things really are is welcome and will be credited where it is due.
Since both of these were regressions, this author deems it necessary not to cover any of them with a workaround.
| G↑ | This method is intentionally specified or implemented as generic;
it does not require that its this
value be an object of the same type. Therefore, it can be
transferred to other kinds of objects for use as a method. |
|---|---|
| V↑ | Version needs to be declared in order to use this feature |
| 1↑ |
|
| 2↑ | Opera 5.02 to 7.02 read escaped newline |
| 3↑ | deprecated since 1.4 for comparison of two
JSObject objects; use the
JSObject.equals
method instead |
| 4↑ | 5.02 and 6.06 show length 2, should be 1 |
| 5↑ | deprecated since 1.3 |
| 6↑ | see Function.prototype.caller |
| 7↑ | Only in standards document mode |
| 8↑ | Since 1.3: returns the new length of the array rather than the last element added to the array. |
| 9↑ | Opera 6.06 does not support negative values for start |
| 10↑ | 1.1: Does not work on some platforms; converts undefined elements to null |
| 11↑ | 1.2: Sorts undefined elements to the end of the array |
| 12↑ | 1.8: Stable sort |
| 13↑ | since 1.3: returns an array containing the removed elements |
| 14↑ | deprecated since 1.4 |
| 15↑ | deprecated since 1.4; use
arguments instead |
| 16↑ | deprecated since 1.4; use
arguments.callee
instead |
| 17↑ | deprecated since 1.4; use
arguments.length
instead |
| 18↑ | tested in 1.8.2 only |
| 19↑ | tested in 5.0 and 6.0 only, 8.x and 9.x Preview contributed by LRN |
| 20↑ | Safari 4.0.5 contributed by LRN |
| 21↑ | 9.52 contributed by LRN |
| 22↑ | Does not support negative values [test case] |
| 23↑ | removed in 1.4; Gecko DOM feature since 1.5 |
| 24↑ | removed in 1.4; Gecko DOM feature since 1.5 |
| 25↑ | removed in 1.4; Gecko DOM feature since 1.5 |
| JavaScript | 1.0 | 1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 | 1.7 | 1.8 | 1.8.1 | 1.8.2 | 1.8.5 | 1.8.6 | 2.0 (historic) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1)↑ Version information from the JavaScript Guides and References; release dates from about: documents, mozilla.org and Wikipedia. | ||||||||||||||
| Implementations | ||||||||||||||
| Netscape/Mozilla.org SpiderMonkey (in C) | 1.0 | 1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 | 1.7 | 1.8 | 1.8.1 (TraceMonkey) | 1.8.2 | 1.8.5 (JägerMonkey) | 1.8.6 | |
| Mozilla.org Epimetheus (in C++) | + | |||||||||||||
| Netscape/Mozilla.org Rhino (in Java) | 1.4R3 (1999) | 1.5R1–1.5R5 (2000–2004) | 1.6R1–1.6R7 (2004–2007) | 1.7R1–1.7R2 (2008–2009) | 1.7R3 (2011‑06‑03) | |||||||||
| Layout Engines | ||||||||||||||
| Netscape/Mozilla.org NGLayout/Gecko | 0.6–1.8a6 | 1.8b1–1.8 | 1.8.1 | 1.9 | 1.9.1 | 1.9.2 | 1.9.3, 2.0 | 5.0 | ||||||
| Web Browsers | ||||||||||||||
| Netscape Navigator/Browser † | Navigator 2.0 † (1996) | 3.0 † (1996) | 4.0–4.05 † (1997) | 4.06–4.8 † (1998–2002) | - | Navigator 6.x – Browser 8.1.3 † (2000–2007) |
- | Navigator 9.0b1 – 9.0.0.6 † (2007–2008) |
||||||
| Mozilla Phoenix/Firebird/Firefox | Phoenix 0.1 – Firefox 1.0.8 † (2002–2006) |
Firefox 1.5a1–1.5.0.12 † (2005–2007) |
2.0b1–2.0.0.18 † (2006–2008) |
3.0a2–3.0.19 † (2007–2010) |
3.1a1–3.5.19 † (2008–2011) |
3.6a1–3.6.19 (2010‑01‑21 – 2011‑07‑11) |
3.7a1–4.0.1 † (2010–2011) |
5.0–5.0.1 (2011‑06‑21 – 2011‑07‑11) |
||||||
| Other Clients | ||||||||||||||
| Mozilla Application Suite † | 0.6–1.8a6–1.7.13 † (2000–2006) |
1.8b1 † (2005) |
||||||||||||
| Mozilla SeaMonkey | 1.0a–1.0.9 † (2005–2007) |
1.1a–1.1.19 † (2006–2010) |
2.0a1–2.0.12 (2008‑10‑05 – 2011‑03‑02) |
2.1a1–2.1 (2010‑05‑18 – 2011‑06‑10) |
2.2b1–2.2 (2011‑06‑22 – 2011‑07‑07) |
|||||||||
| Mozilla Thunderbird | 0.1–1.0.8 † (2003–2006) |
1.1a1–1.5.0.14 † (2005–2007) |
2.0a1–2.0.0.24 † (2006–2010) |
3.0a1, 3.0a2 † (2008) |
3.0a3–3.0.11 † (2008–2010) |
3.1a1–3.1.12 (2010‑02‑03 – 2011‑08‑16) |
3.3a1–3.3a3 (2010‑11‑23 – 2011‑01‑20) |
5.0b1–5.0 (2011‑06‑02 – 2011‑06‑28) |
||||||
| Web Servers | ||||||||||||||
| Netscape
Enterprise Server/ iPlanet Web Server/ Sun ONE Web Server/ Sun Java System Web Server |
2.0 | 3.0 | 4.0/4.1 (1999) | 6.0 | ||||||||||
| NihonSoft firecat | 1.0.x Beta4 (2008) | |||||||||||||
| JScript | 1.0 | 2.0 | 3.0 | 3.1.3510 | 4.0 | 5.0 | 5.1.5010 | 5.5.6330 | 5.6.6626 – 5.6.8819 | 5.7.5730 | 5.7.17184 | 5.8.18241 | 7.0 (.NET) | 7.1 (.NET) | 8.0 | 9.0.16421 (Chakra) | 10.0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2)↑
Version information from MSDN Library;
release dates from MSDN Library, blooberry.com and Wikipedia,
end-of-life (†) dates from support.microsoft.com. Note that the language version supported by an environment may be greater than specified here due to security updates. When in doubt, use the script engine test above to determine the true version. |
|||||||||||||||||
| Implementations | |||||||||||||||||
| Microsoft .NET Framework | 1.0 (2002-01) | 1.1 (2003) | 2.0–3.5 SP1 (2005–2008) | 4.0— (2010-04-12—) | |||||||||||||
| Web Browsers | |||||||||||||||||
| Microsoft Internet Explorer | 3.0 † (1996-08 CE) |
4.0 † (1997-09) |
4.01 † (1997-11) |
5.0 † (1999-03 – 2005-06) |
5.01 † | 5.5 † (2000-07 – 2005-12) |
6.0 for Win9x/NT/XP † (2001-10) |
7.0 for WinXP+ (2006-10) |
8.0 beta 1 for WinXP SP2+ (2008-03) |
8.0 beta 2 for WinXP SP2+ (2008-08) |
9.0 for Vista SP2+ / Server 2008 (2011‑03‑14) |
||||||
| Web Servers | |||||||||||||||||
| Microsoft Internet Information Server/Services | 4.0 † (1998–2002) |
5.1–6.0 † (2000–2005) |
7.0 (2008) |
7.5 (2009) |
|||||||||||||
| Operating Systems | |||||||||||||||||
| Microsoft Windows | NT 4.0 † (1996) |
2000 † (2000-02 – 2005-06) |
Me † (2000-09 – 2005-12) |
XP (2001-10) |
Vista (2008-03) |
7 (2009-10) |
|||||||||||
| Microsoft Windows Server | 2003 (2003-04) |
2008 (2008-02) |
2008 R2 (2009-09) |
2008 | 2008 R2 | ||||||||||||
| IDEs | |||||||||||||||||
| Microsoft Visual Studio | 6.0 † (1998–2005) |
.NET 7.0 (2002) |
.NET 7.1 (2003) |
8.0–9.0 (2005–2008) |
10.0— (2010-04-12—) |
||||||||||||
| V8 0.3 | 0.4 | 1.2 | 1.3 | 2.0 | 2.1 | 2.2 | 2.3.11.22 | 2.4.9.19 | 2.5.9.6 | 3.0.12.18 | 3.1.4.0 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Google Chrome | 0.2–1.0 (2008-09 CE—2008-12) |
2.0 (2009-05) |
3.0 (2009-10) |
4.0.249 (2010-01-25) |
5.0.307 (2010-01-30) |
5.0.342 (2010-04-07) |
6.0.466.0 (2010-07-15) |
7.0.517 (2010-10-21) |
8.0.552 (2010-12-02) |
9.0.597 (2011-02-03) |
10.0.648 (2011-03-11) |
11.0.672 (2011-03-08) |
| JavaScriptCore 48–312.6 | 412–419.13 | 522.11–523.10 | 525.13 | 525.19 | 525.27.1 | 530.17 | 531.9 | 531.21.8 | 531.22.7 | 533.16 | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Apple Safari | 0.8–1.3.2 † (2003–2006 CE) |
2.0–2.0.4 (2005-04 – 2006-01) |
3.0–3.0.4 (2007-06 – 2007-10) |
3.1 (2008-03) |
3.1.2 (2008-06) |
3.2.1 (2008-11) |
4.0 (2009-06) |
4.0.3 (2009-08) |
4.0.4 (2009-11) |
4.0.5 (2010-03-11) |
5.0 (2010-06-07) |
| Opera ECMAScript 3.60 | 5.02 | 6.06 | 7.02 | 8.0 | 9.27 | 9.52 | 9.62 | 9.64 | 10.10 | 10.50 | 10.51 | 10.54 | 10.63 | 11.50 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Implementations | |||||||||||||||
| Linear A | Linear B | Futhark | Carakan | ||||||||||||
| Layout Engines | |||||||||||||||
| Elektra | Presto 1.0 | 2.0 | 2.1 | 2.1.1 | 2.4 | 2.5 | 2.6 | 2.7 | |||||||
| Web Browsers | |||||||||||||||
| Opera Browser | 3.60 † (1999-05) |
5.02 † (2000-12) |
6.06 (2001-11) |
7.02 (2003–2005) |
8.0 (2005–2008) |
9.27 (2008) |
9.52 (2008) |
9.62 (2008–2009) |
9.64 (2009) |
10.10 (2009–2010) |
10.50 (2010-03-02) |
10.51 (2010-03-22) |
10.54 (2010-06-21) |
10.63 (2010-10-12) |
11.50 (2011-06-28) |
| ActionScript 1.0 | 2.0 | |||||||
|---|---|---|---|---|---|---|---|---|
| 3)↑ Version information from Macromedia | ||||||||
| Macromedia Flash | 5.0–MX (2000–2003) | 7.1.1 (MX 2004)— (2004—) | ||||||
The following table provides a rough overview of ECMAScript Editions and relations between them and versions of their implementations. Note that conforming implementations are allowed to extend ECMAScript, so these are by no means 1:n relations; instead, this is the result of a comparison of most common language features.
See Language Features above for details.
| ECMAScript Edition 1 | 2 | 3 | 4 (Working Draft; abandoned) |
5 | 6 ("Harmony", Working Draft) |
|
|---|---|---|---|---|---|---|
| June 1997 | August 1998 | December 1999 – March 2000 | August 2000 – June 2003 – 2008 | April 2009 – December 2009 | April 2009— | |
| ActionScript | 2.0 (2004) | 3.0 (2008—) | ||||
| JavaScript | 1.1, 1.3, 1.4 | 1.5–1.8.1.x | 2.0 | 1.8.1— (2008-05—) | ||
| JavaScriptCore | ||||||
| JScript | 1.0 (1996) | 5.5— (2000—) | 7.0— (2000—) | |||
| KJS | 1.0 | - | ||||
| Opera | 6.0 (2001-12) | |||||
| V8 | 0.3 | |||||
| ECMAScript for XML (E4X) | |
|---|---|
| June 2004 | |
| ActionScript | 2.0 |
| JavaScript | 1.6+ |
| JavaScriptCore | - |
| JScript | - |
| KJS | - |
| Opera | - |
| V8 | - |
| Date | 1996 | 1997 | 1998 | 1999 | 2000 | 2001 | 2002 | 2003 | 2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011 | |||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1996-03 | 1996-08 | 1997-06 | 1998-08 | 1999-05 | 2000-11 | 2002-08 | 2004-11 | 2006-07 | 2007-02 | 2007-04 | 2007-06 | 2007-08 | 2008-02 | 2008-07 | 2010-01 | 2010-03 | 2011-03 | ||||||||||||||||||||||||||||||||||||||||
| JavaScript | 1.0 | 1.1 | 1.2 | 1.3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1.4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1.5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1.6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1.7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1.8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1.8.1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1.8.2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Rhino | 1.4R3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Netscape | Navigator 2.0 | 3.0 | 4.0 – 4.05 | 4.06 – 4.8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Navigator 6.x – Browser 8.1.3 | Navigator 9.0b1 – 9.0.0.6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| JScript | 1.0 | 3.0 | 3.1 | 4.0 – 4.1 | 5.0 | 5.1 | 5.5 | 5.6 | 5.7 | 5.8 | |||||||||||||||||||||||||||||||||||||||||||||||
| Internet Explorer | 3.0 | 4.0 | 4.01 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ECMAScript | 1 | 2 | 3 | 4 | 5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Opera | 3.60 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||