Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 335647 of ECMAScript 5 support in Mozilla

  • Revision slug: JavaScript/ECMAScript_5_support_in_Mozilla
  • Revision title: ECMAScript 5 support in Mozilla
  • Revision id: 335647
  • Created:
  • Creator: kohei.yoshino
  • Is current revision? No
  • Comment

Revision Content

ECMAScript 5.1, the latest edition of the standard upon which JavaScript is based, was approved in June 2011.

The JavaScript runtime used in the latest versions of Mozilla projects including both Firefox and Thunderbird has full support for ECMAScript 5.1 features. This article covers the features supported by different versions of Mozilla's JavaScript runtime.

Supported features

Added in JavaScript 1.8.5 (Gecko 2, Firefox 4 and later)

Firefox 4 has full ECMAScript 5 support including the Object.* methods and strict mode. See New in JavaScript 1.8.5.

Added in JavaScript 1.8.1 (Gecko 1.9.1, Firefox 3.5)

Improvements laid out by ECMAScript 5 have been made in the parsing algorithm that prevents evaluating XHTML as JavaScript code in certain circumstances.

Added in JavaScript 1.6 (Gecko 1.8, Firefox 1.5)

Array extras -- added methods offering several improved methods for manipulating arrays -- have been part of JavaScript since JavaScript 1.6. Now they've been standardized as part of ECMAScript 5.

See also

{{ languages( { "ja": "ja/JavaScript/ECMAScript_5_support_in_Mozilla","zh-cn": "zh-cn/JavaScript/ECMAScript_5_support_in_Mozilla"} ) }}

Revision Source

<p>ECMAScript 5.1, the latest edition of the standard upon which JavaScript is based, was approved in June 2011.</p>
<p>The JavaScript runtime used in the latest versions of Mozilla projects including both Firefox and Thunderbird has full support for ECMAScript 5.1 features. This article covers the features supported by different versions of Mozilla's JavaScript runtime.</p>
<h2 id="Supported_features">Supported features</h2>
<h3 id="Added_in_JavaScript_1.8.5_(Gecko_2.2C_Firefox_4_and_later)">Added in JavaScript 1.8.5 (Gecko 2, Firefox 4 and later)</h3>
<p>Firefox 4 has full ECMAScript 5 support including the <code>Object.*</code> methods and strict mode. See <a href="/en/JavaScript/New_in_JavaScript/1.8.5" title="en/JavaScript/New_in_JavaScript/1.8.5">New in JavaScript 1.8.5</a>.</p>
<h3 id="Added_in_JavaScript_1.8.1_(Gecko_1.9.1.2C_Firefox_3.5)">Added in JavaScript 1.8.1 (Gecko 1.9.1, Firefox 3.5)</h3>
<ul>
  <li><a class="internal" href="/En/Using_native_JSON" title="En/Using native JSON">Native JSON</a> support</li>
  <li><a class="internal" href="/en/JavaScript/Reference/Global_Objects/Object/GetPrototypeOf" title="En/Core JavaScript 1.5 Reference/Global Objects/Object/GetPrototypeOf"><code>Object.getPrototypeOf()</code></a>&nbsp;method.</li>
  <li><a class="internal" href="/en/JavaScript/Reference/Global_Objects/String/Trim" title="En/Core JavaScript 1.5 Reference/Global Objects/String/Trim"><code>String.trim()</code></a>&nbsp;method, which trims whitespace from both ends of the string.</li>
  <li>Gecko 1.9.1.4 updated the implementation of <a href="/En/Using_native_JSON#Converting_objects_into_JSON" title="En/Using native JSON#Converting objects into JSON"><code>JSON.stringify()</code></a>&nbsp;to be compliant with ECMAScript 5.</li>
</ul>
<p>Improvements laid out by ECMAScript 5 have been made in the parsing algorithm that prevents evaluating XHTML&nbsp;as JavaScript code in certain circumstances.</p>
<h3 id="Added_in_JavaScript_1.6_(Gecko_1.8.2C_Firefox_1.5)">Added in JavaScript 1.6 (Gecko 1.8, Firefox 1.5)</h3>
<p><a class="internal" href="/en/JavaScript/New_in_JavaScript/1.6#Array_extras" title="en/New in JavaScript 1.6#Array extras">Array extras</a> -- added methods offering several improved methods for manipulating arrays -- have been part of JavaScript since JavaScript 1.6. Now they've been standardized as part of ECMAScript 5.</p>
<h2 id="See_also">See also</h2>
<ul>
  <li><a class="external" href="https://www.ecmascript.org/" title="https://www.ecmascript.org/">ECMAScript web site</a></li>
  <li><a class="external" href="https://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf" title="https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf">ECMAScript 5.1 specification</a></li>
  <li>John&nbsp;Resig's post on <a class="external" href="https://ejohn.org/blog/objectgetprototypeof/" title="https://ejohn.org/blog/objectgetprototypeof/">Object.getPrototypeOf</a></li>
  <li>Michael J. Ryan's implementation of <a class="external" href="https://frugalcoder.us/post/2010/01/07/EcmaScript-5s-Date-Extensions.aspx" title="https://frugalcoder.us/post/2010/01/07/EcmaScript-5s-Date-Extensions.aspx">ECMAScript5 Dates in JavaScript</a></li>
</ul>
<p>{{ languages( { "ja": "ja/JavaScript/ECMAScript_5_support_in_Mozilla","zh-cn": "zh-cn/JavaScript/ECMAScript_5_support_in_Mozilla"} ) }}</p>
Revert to this revision