{{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
andset
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 itstoString()
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
- ISO 8601 support in
Date
: The {{jsxref("Date")}} object's parse() method now supports simple ISO 8601 format date strings. - Global objects made read only: The
NaN
,Infinity
, andundefined
global objects have been made read only, per the ECMAScript 5 specification. obj.__parent__
andobj.__count__
become obsolete. Some information about why: SpiderMonkey change du jour: the special __parent__ property has been removed {{bug("551529")}} & {{bug("552560")}}.- Trailing commas no longer accepted in {{jsxref("JSON.parse()")}}.