ECMAScript 6 support in Mozilla

  • Revision slug: Web/JavaScript/ECMAScript_6_support_in_Mozilla
  • Revision title: ECMAScript 6 support in Mozilla
  • Revision id: 469909
  • Created:
  • Creator: fbender
  • Is current revision? No
  • Comment

Revision Content

ECMAScript 6 is the next version of the standard, code-named "Harmony" or "ES.next". Specification drafts can be found on the official wiki. If you wish to send feedback about the standard, do it on es-discuss.

TC39 Consensus is marked by three levels:

Consensus Ongoing Discussion Controversial

These represent an estimate of the current state of consensus in TC39 of the features and their design. The three levels mean:

  • Consensus: no major remaining disagreements over the design
  • Ongoing discussion: the feature has consensus but there are aspects of the design that are still being discussed
  • Controversial: there remain significant disagreements about the design

Features already supported in Firefox

Syntax

Feature Version Feature and Implementation Comment TC39 Consensus
const JS 1.5 Not compliant with the current specification: scoped like var not let Consensus
let (global scope) JS 1.7 Not compliant with the current specification Ongoing Discussion
let (local scope) JS 1.7 Not compliant with the current specification Consensus
Destructuring assignment JS 1.7 Not compliant with the current specification Consensus
for...of statement {{fx_minversion_inline("13", '1')}}   Consensus
Iterators and generators ? Not compliant with the current specification Consensus
Rest parameters {{fx_minversion_inline("15", '1')}}   Consensus
Default parameters {{fx_minversion_inline("15", '1')}}   Consensus
Spread operator of Array {{fx_minversion_inline("16", '1')}} Not compliant with the current specification, but the bug is in the specification, not the Firefox implementation Consensus
Spread operator of Function calls {{fx_minversion_inline("27", '1')}} Not compliant with the current specification, but the bug is in the specification, not the Firefox implementation Consensus
Arrow functions {{fx_minversion_inline("22", '1')}}   Consensus
Binary and octal integer literals {{fx_minversion_inline("25", '1')}} Binary: 0b010101 or 0B010101; Octal: 0o7170 or 0O7170 Consensus

Standard library

Feature Version Feature Comment TC39 Consensus
Map {{fx_minversion_inline("13", '1')}} A new type of collections Consensus
Map Iteration {{fx_minversion_inline("17", '1')}} Iterable in for-of Consensus
Map.forEach     Consensus
Map.entries {{fx_minversion_inline("20", '1')}}   Consensus
Map.keys {{fx_minversion_inline("20", '1')}}   Consensus
Map.values {{fx_minversion_inline("20", '1')}}   Consensus
Set {{fx_minversion_inline("13", '1')}} A new type of collections Consensus
Set Iteration {{fx_minversion_inline("17", '1')}} Iterable in for-of Consensus
Set methods {{fx_minversion_inline("26", '1')}} forEach, entries, keys, values Consensus
Array Iteration {{fx_minversion_inline("13", '1')}} Iterable in for-of Consensus
Array.from()     Consensus
Array.of() {{fx_minversion_inline("25", '1')}}   Consensus
WeakMap {{fx_minversion_inline("6", '1')}} A new type of collections Consensus
weakmap.clear() {{fx_minversion_inline("20", '1')}}   Controversial
Proxy {{fx_minversion_inline("18", '1')}} Current implementation may differ from latest specification. Ongoing Discussion
RegExp sticky (y) flag {{fx_minversion_inline("3", '1')}}   Consensus
Number.isNaN() {{fx_minversion_inline("16", '1')}}   Consensus
Number.isFinite() {{fx_minversion_inline("16", '1')}}   Consensus
Number.isInteger() {{fx_minversion_inline("16", '1')}}   ?
Number.parseInt() {{fx_minversion_inline("25", '1')}}   ?
Number.parseFloat() {{fx_minversion_inline("25", '1')}}   ?
Number.EPSILON {{fx_minversion_inline("25", '1')}} The smallest interval between two representable numbers. Consensus
string.startsWith() {{fx_minversion_inline("17", '1')}}   Consensus
string.endsWith() {{fx_minversion_inline("17", '1')}}   Consensus
string.contains() {{fx_minversion_inline("17", '1')}}   Consensus
string.repeat() {{fx_minversion_inline("24", '1')}}   Consensus
Object.is {{fx_minversion_inline("22", '1')}}   Ongoing Discussion
Math.imul {{fx_minversion_inline("20", '1')}} C-like 32-bit integer multiplication Consensus
New Math functions {{fx_minversion_inline("25", '1')}} log10, log2, log1p, expm1, cosh, sinh, tanh, acosh, asinh, atanh, hypot, trunc, sign ?
Math.fround {{fx_minversion_inline("26", '1')}} Rounds to the nearest single-precision float (Float32) ?

Features not yet supported

  • is and isnt operator {{obsolete_inline}}
  • Number.toInteger {{obsolete_inline}}
  • Modules
  • Symbols

See also

Revision Source

<p>ECMAScript 6 is the next version of the standard, code-named "Harmony" or "ES.next". <a href="http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts">Specification drafts can be found on the official wiki</a>. If you wish to send feedback about the standard, do it on <a href="https://mail.mozilla.org/listinfo/es-discuss">es-discuss</a>.</p>
<p>TC39 Consensus is marked by three levels:</p>
<table>
  <tbody>
    <tr>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
      <td style="background:yellow;">Ongoing Discussion</td>
      <td style="background:orange;">Controversial</td>
    </tr>
  </tbody>
</table>
<p>These represent an estimate of the current state of consensus in TC39 of the features and their design. The three levels mean:</p>
<ul>
  <li><strong>Consensus:</strong> no major remaining disagreements over the design</li>
  <li><strong>Ongoing discussion:</strong> the feature has consensus but there are aspects of the design that are still being discussed</li>
  <li><strong>Controversial:</strong> there remain significant disagreements about the design</li>
</ul>
<h2 id="Features_already_supported_in_Firefox">Features already supported in Firefox</h2>
<h3 id="Syntax">Syntax</h3>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">Feature</th>
      <th scope="col">Version</th>
      <th scope="col">Feature and Implementation Comment</th>
      <th scope="col">TC39 Consensus</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Statements/const">const</a></code></td>
      <td>JS 1.5</td>
      <td style="background-color: rgb(255, 255, 0);"><em>Not compliant with the current specification</em><em>: scoped like var not let</em></td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Statements/let">let</a></code> (global scope)</td>
      <td>JS 1.7</td>
      <td style="background-color: rgb(255, 255, 0);"><em>Not compliant with the current specification</em></td>
      <td style="background:yellow;">Ongoing Discussion</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Statements/let">let</a></code> (local scope)</td>
      <td>JS 1.7</td>
      <td style="background-color: rgb(255, 255, 0);"><em>Not compliant with the current specification</em></td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><a href="/en-US/docs/Web/JavaScript/New_in_JavaScript/1.7#Destructuring_assignment_%28Merge_into_own_page.2Fsection%29">Destructuring assignment</a></td>
      <td>JS 1.7</td>
      <td style="background-color: rgb(255, 255, 0);"><em>Not compliant with the current specification</em></td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Statements/for...of">for...of</a></code> statement</td>
      <td>{{fx_minversion_inline("13", '1')}}</td>
      <td>&nbsp;</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><a href="/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators">Iterators and generators</a></td>
      <td>?</td>
      <td style="background-color: rgb(255, 255, 0);"><em>Not compliant with the current specification</em></td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><a href="/en-US/docs/Web/JavaScript/Reference/rest_parameters">Rest parameters</a></td>
      <td>{{fx_minversion_inline("15", '1')}}</td>
      <td>&nbsp;</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><a href="/en-US/docs/Web/JavaScript/Reference/default_parameters">Default parameters</a></td>
      <td>{{fx_minversion_inline("15", '1')}}</td>
      <td>&nbsp;</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><a href="/en-US/docs/Web/JavaScript/Reference/Spread_operator"><span>Spread operator</span></a> of Array</td>
      <td>{{fx_minversion_inline("16", '1')}}</td>
      <td style="background-color: rgb(0, 158, 115); color: #fff"><em>Not compliant with the current specification, but <a href="https://bugs.ecmascript.org/show_bug.cgi?id=1113" title="https://bugs.ecmascript.org/show_bug.cgi?id=1113">the bug is in the specification</a>, not the Firefox implementation</em></td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><a href="/en-US/docs/Web/JavaScript/Reference/Spread_operator"><span>Spread operator</span></a> of Function calls</td>
      <td>{{fx_minversion_inline("27", '1')}}</td>
      <td style="background-color: rgb(0, 158, 115); color: #fff"><em>Not compliant with the current specification, but <a href="https://bugs.ecmascript.org/show_bug.cgi?id=1113" title="https://bugs.ecmascript.org/show_bug.cgi?id=1113">the bug is in the specification</a>, not the Firefox implementation</em></td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><a href="/en-US/docs/Web/JavaScript/Reference/arrow_functions">Arrow functions</a></td>
      <td>{{fx_minversion_inline("22", '1')}}</td>
      <td>&nbsp;</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td>Binary and octal integer literals</td>
      <td>{{fx_minversion_inline("25", '1')}}</td>
      <td>Binary: <code>0b010101</code> or <code>0B010101</code>; Octal: <code>0o7170</code> or <code>0O7170</code></td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
  </tbody>
</table>
<h3 id="Standard_library">Standard library</h3>
<table class="standard-table">
  <tbody>
    <tr>
      <th scope="col">Feature</th>
      <th scope="col">Version</th>
      <th scope="col">Feature Comment</th>
      <th scope="col">TC39&nbsp;<span style="line-height: 1.572;">Consensus</span></th>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map">Map</a></code></td>
      <td>{{fx_minversion_inline("13", '1')}}</td>
      <td>A new type of collections</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map">Map</a></code> Iteration</td>
      <td>{{fx_minversion_inline("17", '1')}}</td>
      <td>Iterable in <code>for</code>-<code>of</code></td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code>Map.forEach</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code>Map.entries</code></td>
      <td>{{fx_minversion_inline("20", '1')}}</td>
      <td>&nbsp;</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code>Map.keys</code></td>
      <td>{{fx_minversion_inline("20", '1')}}</td>
      <td>&nbsp;</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code>Map.values</code></td>
      <td>{{fx_minversion_inline("20", '1')}}</td>
      <td>&nbsp;</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set">Set</a></code></td>
      <td>{{fx_minversion_inline("13", '1')}}</td>
      <td>A new type of collections</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set">Set</a></code> Iteration</td>
      <td>{{fx_minversion_inline("17", '1')}}</td>
      <td>Iterable in for-of</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set">Set methods</a></code></td>
      <td>{{fx_minversion_inline("26", '1')}}</td>
      <td><code>forEach</code>, <code>entries</code>, <code>keys</code>, <code>values</code></td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></code> Iteration</td>
      <td>{{fx_minversion_inline("13", '1')}}</td>
      <td>Iterable in <code>for</code>-<code>of</code></td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code>Array.from()</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code>Array.of()</code></td>
      <td>{{fx_minversion_inline("25", '1')}}</td>
      <td>&nbsp;</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap">WeakMap</a></code></td>
      <td>{{fx_minversion_inline("6", '1')}}</td>
      <td>A new type of collections</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap">weakmap.clear()</a></code></td>
      <td>{{fx_minversion_inline("20", '1')}}</td>
      <td>&nbsp;</td>
      <td style="background:orange;">Controversial</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy">Proxy</a></code></td>
      <td>{{fx_minversion_inline("18", '1')}}</td>
      <td style="background-color: rgb(255, 255, 0);"><em>Current implementation may differ from latest specification.</em></td>
      <td style="background:yellow;">Ongoing Discussion</td>
    </tr>
    <tr>
      <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp"><span class="external text"><code>RegExp</code> sticky (<code>y</code>) flag</span></a></td>
      <td><span style="line-height: normal;">{{fx_minversion_inline("3", '1')}}</span></td>
      <td>&nbsp;</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN">Number.isNaN()</a></code></td>
      <td>{{fx_minversion_inline("16", '1')}}</td>
      <td>&nbsp;</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite"><code>Number.isFinite()</code></a></td>
      <td>{{fx_minversion_inline("16", '1')}}</td>
      <td>&nbsp;</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger"><code>Number.isInteger()</code></a></td>
      <td>{{fx_minversion_inline("16", '1')}}</td>
      <td>&nbsp;</td>
      <td>?</td>
    </tr>
    <tr>
      <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseInt" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseInt"><code>Number.parseInt()</code></a></td>
      <td>{{fx_minversion_inline("25", '1')}}</td>
      <td>&nbsp;</td>
      <td>?</td>
    </tr>
    <tr>
      <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseFloat" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseFloat"><code>Number.parseFloat()</code></a></td>
      <td>{{fx_minversion_inline("25", '1')}}</td>
      <td>&nbsp;</td>
      <td>?</td>
    </tr>
    <tr>
      <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON" title="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON"><code>Number.EPSILON</code></a></td>
      <td>{{fx_minversion_inline("25", '1')}}</td>
      <td>The smallest interval between two representable numbers.</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith">string.startsWith()</a></code></td>
      <td>{{fx_minversion_inline("17", '1')}}</td>
      <td>&nbsp;</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith">string.endsWith()</a></code></td>
      <td>{{fx_minversion_inline("17", '1')}}</td>
      <td>&nbsp;</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/contains">string.contains()</a></code></td>
      <td>{{fx_minversion_inline("17", '1')}}</td>
      <td>&nbsp;</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat">string.repeat()</a></code></td>
      <td>{{fx_minversion_inline("24", '1')}}</td>
      <td>&nbsp;</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is">Object.is</a></code></td>
      <td>{{fx_minversion_inline("22", '1')}}</td>
      <td>&nbsp;</td>
      <td style="background:yellow;">Ongoing Discussion</td>
    </tr>
    <tr>
      <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul">Math.imul</a></code></td>
      <td>{{fx_minversion_inline("20", '1')}}</td>
      <td>C-like 32-bit integer multiplication</td>
      <td style="background:rgb(0,158,115); color:rgb(240, 255, 240);">Consensus</td>
    </tr>
    <tr>
      <td>New <code>Math</code> functions</td>
      <td>{{fx_minversion_inline("25", '1')}}</td>
      <td><code>log10</code>, <code>log2</code>, <code>log1p</code>, <code>expm1</code>, <code>cosh</code>, <code>sinh</code>, <code>tanh</code>, <code>acosh</code>, <code>asinh</code>, <code>atanh</code>, <code>hypot</code>, <code>trunc</code>, <code>sign</code></td>
      <td>?</td>
    </tr>
    <tr>
      <td><a href="/en-US/docs/JavaScript/Reference/Global_Objects/Math/fround" title="/en-US/docs/JavaScript/Reference/Global_Objects/Math/fround"><code>Math.fround</code></a></td>
      <td>{{fx_minversion_inline("26", '1')}}</td>
      <td>Rounds to the nearest single-precision float (Float32)</td>
      <td>?</td>
    </tr>
  </tbody>
</table>
<h2 id="Features_not_yet_supported">Features not yet supported</h2>
<ul>
  <li><code>is</code> and <code>isnt</code> operator {{obsolete_inline}}</li>
  <li><code>Number.toInteger</code> {{obsolete_inline}}</li>
  <li>Modules</li>
  <li>Symbols</li>
</ul>
<h2 id="See_also">See also</h2>
<ul>
  <li><a href="http://www.ecmascript.org/">ECMAScript web site</a></li>
  <li><a href="http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts">ECMAScript 6 specification drafts</a></li>
  <li><a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=694100">Mozilla Harmony tracking bug</a></li>
  <li><a href="/en-US/docs/Web/JavaScript/ECMAScript_5_support_in_Mozilla">ECMAScript 5 support in Mozilla</a></li>
  <li><a href="http://kangax.github.io/es5-compat-table/es6" title="http://kangax.github.io/es5-compat-table">ECMAScript 6 support across browsers</a></li>
</ul>
Revert to this revision