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 726455 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: 726455
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment

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
Object.create() Creates a new object with the specified prototype object and properties. {{bug("492840")}}
Object.defineProperty() Adds the named property described by a given descriptor to an object.
Object.defineProperties() Adds the named properties described by the given descriptors to an object.
Object.getOwnPropertyDescriptor() Returns a property descriptor for a named property on an object. {{bug("505587")}}
Object.keys() Returns an array of all enumerable properties on an object. {{bug("307791")}}
Object.getOwnPropertyNames() Returns an array of all enumerable and non-enumerable properties on an object. {{bug("518663")}}
Object.preventExtensions() Prevents any extensions of an object. {{bug("492849")}}
Object.isExtensible() Determine if extending of an object is allowed. {{bug("492849")}}
Object.seal() Prevents other code from deleting properties of an object. {{bug("492845")}}
Object.isSealed() Determine if an object is sealed. {{bug("492845")}}
Object.freeze() Freezes an object: other code can't delete or change any properties. {{bug("492844")}}
Object.isFrozen() Determine if an object was frozen. {{bug("492844")}}
Array.isArray() Checks if a variable is an array. {{bug("510537")}}
Date.prototype.toJSON() Returns a JSON format string for a Date object.
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")}}
  • Function.apply() can accept any array-like object as the arguments list, instead of only true arrays.
  • strict mode support
  • 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
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><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create" title="JavaScript/Reference/Global Objects/Object/Create">Object.create()</a></code></td>
   <td>Creates a new object with the specified prototype object and properties. {{bug("492840")}}</td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty" title="JavaScript/Reference/Global Objects/Object/DefineProperty">Object.defineProperty()</a></code></td>
   <td>Adds the named property described by a given descriptor to an object.</td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties" title="JavaScript/Reference/Global Objects/Object/DefineProperties">Object.defineProperties()</a></code></td>
   <td>Adds the named properties described by the given descriptors to an object.</td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor" title="JavaScript/Reference/Global Objects/Object/GetOwnPropertyDescriptor">Object.getOwnPropertyDescriptor()</a></code></td>
   <td>Returns a property descriptor for a named property on an object. {{bug("505587")}}</td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys" title="JavaScript/Reference/Global Objects/Object/keys"><code>Object.keys()</code></a></td>
   <td>Returns an array of all enumerable properties on an object. {{bug("307791")}}</td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames" title="JavaScript/Reference/Global Objects/Object/getOwnPropertyNames"><code>Object.getOwnPropertyNames()</code></a></td>
   <td>Returns an array of all enumerable and non-enumerable properties on an object. {{bug("518663")}}</td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/preventExtensions" title="JavaScript/Reference/Global Objects/Object/preventExtensions"><code>Object.preventExtensions()</code></a></td>
   <td>Prevents any extensions of an object. {{bug("492849")}}</td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible" title="JavaScript/Reference/Global Objects/Object/isExtensible"><code>Object.isExtensible()</code></a></td>
   <td>Determine if extending of an object is allowed. {{bug("492849")}}</td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal" title="JavaScript/Reference/Global Objects/Object/seal"><code>Object.seal()</code></a></td>
   <td>Prevents other code from deleting properties of an object. {{bug("492845")}}</td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed" title="JavaScript/Reference/Global Objects/Object/isSealed"><code>Object.isSealed()</code></a></td>
   <td>Determine if an object is sealed. {{bug("492845")}}</td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze" title="JavaScript/Reference/Global Objects/Object/freezed"><code>Object.freeze()</code></a></td>
   <td>Freezes an object: other code can't delete or change any properties. {{bug("492844")}}</td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen" title="JavaScript/Reference/Global Objects/Object/isFrozen"><code>Object.isFrozen()</code></a></td>
   <td>Determine if an object was frozen. {{bug("492844")}}</td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray" title="JavaScript/Reference/Global Objects/Array/isArray"><code>Array.isArray()</code></a></td>
   <td>Checks if a variable is an array. {{bug("510537")}}</td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON" title="JavaScript/Reference/Global Objects/Date/toJSON"><code>Date.prototype.toJSON()</code></a></td>
   <td>Returns a JSON format string for a <code>Date</code> object.</td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind" title="JavaScript/Reference/Global_Objects/Function/bind"><code>Function.prototype.bind()</code></a></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><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply" title="JavaScript/Reference/Global Objects/Function/apply"><code>Function.apply()</code></a> 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><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString" title="JavaScript/Reference/Global Objects/Array/toString"><code>Array.toString()</code></a> 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><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy" title="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Proxy">Proxy</a></code></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 <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date" title="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date">Date</a> 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 <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse" title="Using native JSON"><code>JSON.parse()</code></a>.</li>
</ul>
Revert to this revision