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 995395 of New in JavaScript 1.8.5

  • Revision slug: Web/JavaScript/New_in_JavaScript/1.8.5
  • Revision title: New in JavaScript 1.8.5
  • Revision id: 995395
  • Created:
  • Creator: fscholz
  • Is current revision? Yes
  • Comment minor cleaning

Revision Content

{{jsSidebar("New_in_JS")}}

The following is a changelog for JavaScript 1.8.5. This version was included in Firefox 4.

New features in JavaScript 1.8.5

New functions

Function Description
{{jsxref("Object.create()")}} Creates a new object with the specified prototype object and properties. {{bug("492840")}}
{{jsxref("Object.defineProperty()")}} Adds the named property described by a given descriptor to an object.
{{jsxref("Object.defineProperties()")}} Adds the named properties described by the given descriptors to an object.
{{jsxref("Object.getOwnPropertyDescriptor()")}} Returns a property descriptor for a named property on an object. {{bug("505587")}}
{{jsxref("Object.keys()")}} Returns an array of all enumerable properties on an object. {{bug("307791")}}
{{jsxref("Object.getOwnPropertyNames()")}} Returns an array of all enumerable and non-enumerable properties on an object. {{bug("518663")}}
{{jsxref("Object.preventExtensions()")}} Prevents any extensions of an object. {{bug("492849")}}
{{jsxref("Object.isExtensible()")}} Determine if extending of an object is allowed. {{bug("492849")}}
{{jsxref("Object.seal()")}} Prevents other code from deleting properties of an object. {{bug("492845")}}
{{jsxref("Object.isSealed()")}} Determine if an object is sealed. {{bug("492845")}}
{{jsxref("Object.freeze()")}} Freezes an object: other code can't delete or change any properties. {{bug("492844")}}
{{jsxref("Object.isFrozen()")}} Determine if an object was frozen. {{bug("492844")}}
{{jsxref("Array.isArray()")}} Checks if a variable is an array. {{bug("510537")}}
{{jsxref("Date.prototype.toJSON()")}} Returns a JSON format string for a Date object.
{{jsxref("Function.prototype.bind()")}} Creates a new function that, when called, itself calls this function in the context provided (with a given sequence of arguments) {{bug("429507")}}

New ECMAScript5 features

  • get and set operators now allows the identifier to be numeric or a string. {{bug("520696")}}
  • {{jsxref("Function.apply()")}} can accept any array-like object as the arguments list, instead of only true arrays.
  • strict mode support
  • {{jsxref("Array.toString()")}} now works even on non-arrays by either returning the result of calling its join() method if one is available or by calling its toString() method.

Other standardization work

Various non-standard syntaxes for defining getters and setters have been removed; ECMAScript 5 defined syntax has not been changed. These were all pretty esoteric and rarely used; if this affects you, see this blog post for details.

New objects

Object Description
{{jsxref("Proxy")}} Offers support for creating Object and Function proxies that enable meta-programming in JavaScript.

Changed functionality in JavaScript 1.8.5

Revision Source

<div>{{jsSidebar("New_in_JS")}}</div>

<p>The following is a changelog for JavaScript 1.8.5. This version was included in <a href="/en-US/Firefox/Releases/4">Firefox 4</a>.</p>

<h2 id="New_features_in_JavaScript_1.8.5">New features in JavaScript 1.8.5</h2>

<h3 id="New_functions">New functions</h3>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Function</th>
   <th scope="col">Description</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{jsxref("Object.create()")}}</td>
   <td>Creates a new object with the specified prototype object and properties. {{bug("492840")}}</td>
  </tr>
  <tr>
   <td>{{jsxref("Object.defineProperty()")}}</td>
   <td>Adds the named property described by a given descriptor to an object.</td>
  </tr>
  <tr>
   <td>{{jsxref("Object.defineProperties()")}}</td>
   <td>Adds the named properties described by the given descriptors to an object.</td>
  </tr>
  <tr>
   <td>{{jsxref("Object.getOwnPropertyDescriptor()")}}</td>
   <td>Returns a property descriptor for a named property on an object. {{bug("505587")}}</td>
  </tr>
  <tr>
   <td>{{jsxref("Object.keys()")}}</td>
   <td>Returns an array of all enumerable properties on an object. {{bug("307791")}}</td>
  </tr>
  <tr>
   <td>{{jsxref("Object.getOwnPropertyNames()")}}</td>
   <td>Returns an array of all enumerable and non-enumerable properties on an object. {{bug("518663")}}</td>
  </tr>
  <tr>
   <td>{{jsxref("Object.preventExtensions()")}}</td>
   <td>Prevents any extensions of an object. {{bug("492849")}}</td>
  </tr>
  <tr>
   <td>{{jsxref("Object.isExtensible()")}}</td>
   <td>Determine if extending of an object is allowed. {{bug("492849")}}</td>
  </tr>
  <tr>
   <td>{{jsxref("Object.seal()")}}</td>
   <td>Prevents other code from deleting properties of an object. {{bug("492845")}}</td>
  </tr>
  <tr>
   <td>{{jsxref("Object.isSealed()")}}</td>
   <td>Determine if an object is sealed. {{bug("492845")}}</td>
  </tr>
  <tr>
   <td>{{jsxref("Object.freeze()")}}</td>
   <td>Freezes an object: other code can't delete or change any properties. {{bug("492844")}}</td>
  </tr>
  <tr>
   <td>{{jsxref("Object.isFrozen()")}}</td>
   <td>Determine if an object was frozen. {{bug("492844")}}</td>
  </tr>
  <tr>
   <td>{{jsxref("Array.isArray()")}}</td>
   <td>Checks if a variable is an array. {{bug("510537")}}</td>
  </tr>
  <tr>
   <td>{{jsxref("Date.prototype.toJSON()")}}</td>
   <td>Returns a JSON format string for a <code>Date</code> object.</td>
  </tr>
  <tr>
   <td>{{jsxref("Function.prototype.bind()")}}</td>
   <td>Creates a new function that, when called, itself calls this function in the context provided (with a given sequence of arguments) {{bug("429507")}}</td>
  </tr>
 </tbody>
</table>

<h3 id="New_ECMAScript5_features">New ECMAScript5 features</h3>

<ul>
 <li><code><a href="/en-US/docs/Web/JavaScript/Reference/Operators/get" title="JavaScript/Reference/Operators/Special Operators/get Operator">get</a></code> and <code><a href="/en-US/docs/Web/JavaScript/Reference/Operators/set" title="JavaScript/Reference/Operators/Special Operators/set Operator">set</a></code> operators now allows the identifier to be numeric or a string. {{bug("520696")}}</li>
 <li>{{jsxref("Function.apply()")}} can accept any array-like object as the arguments list, instead of only true arrays.</li>
 <li><a href="/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode" title="JavaScript/Strict mode">strict mode support</a></li>
 <li>{{jsxref("Array.toString()")}} now works even on non-arrays by either returning the result of calling its <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join" title="JavaScript/Reference/Global Objects/Array/join"><code>join()</code></a> method if one is available or by calling its <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString" title="JavaScript/Reference/Global Objects/Object/toString"><code>toString()</code></a> method.</li>
</ul>

<h3 id="Other_standardization_work">Other standardization work</h3>

<p>Various non-standard syntaxes for defining getters and setters have been removed; ECMAScript 5 defined syntax has not been changed. These were all pretty esoteric and rarely used; if this affects you, see <a class="external" href="https://whereswalden.com/2010/04/16/more-spidermonkey-changes-ancient-esoteric-very-rarely-used-syntax-for-creating-getters-and-setters-is-being-removed/" title="https://whereswalden.com/2010/04/16/more-spidermonkey-changes-ancient-esoteric-very-rarely-used-syntax-for-creating-getters-and-setters-is-being-removed/">this blog post</a> for details.</p>

<h3 id="New_objects">New objects</h3>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Object</th>
   <th scope="col">Description</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{jsxref("Proxy")}}</td>
   <td>Offers support for creating <code>Object</code> and <code>Function</code> proxies that enable meta-programming in JavaScript.</td>
  </tr>
 </tbody>
</table>

<h2 id="Changed_functionality_in_JavaScript_1.8.5">Changed functionality in JavaScript 1.8.5</h2>

<ul>
 <li>ISO 8601 support in <code>Date</code>: The {{jsxref("Date")}} object's <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse" title="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/parse">parse()</a> method now supports simple ISO 8601 format date strings.</li>
 <li>Global objects made read only: The <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN" title="JavaScript/Reference/Global Objects/NaN"><code>NaN</code></a>, <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity" title="JavaScript/Reference/Global Objects/Infinity"><code>Infinity</code></a>, and <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined" title="JavaScript/Reference/Global Objects/undefined"><code>undefined</code></a> global objects have been made read only, per the ECMAScript 5 specification.</li>
 <li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/Parent" title="JavaScript/Reference/Global Objects/Object/Parent"><code>obj.__parent__</code></a> and <code>obj.__count__</code> become obsolete. Some information about why: <a class="external" href="https://whereswalden.com/2010/05/07/spidermonkey-change-du-jour-the-special-__parent__-property-has-been-removed/" title="https://whereswalden.com/2010/05/07/spidermonkey-change-du-jour-the-special-__parent__-property-has-been-removed/">SpiderMonkey change du jour: the special __parent__ property has been removed</a> {{bug("551529")}} &amp; {{bug("552560")}}.</li>
 <li>Trailing commas no longer accepted in&nbsp;{{jsxref("JSON.parse()")}}.</li>
</ul>
Revert to this revision