Перевод не завершен. Пожалуйста, помогите перевести эту статью с английского.
Далее приведён список изменений в JavaScript 1.8.5. Эта версия была включена в Firefox 4.
Что нового в JavaScript 1.8.5
Новые функции
Фуникция | Описание |
---|---|
Object.create() |
Создаёт новый обЪект с указанным прототипом и свойствами. ошибка 492840 |
Object.defineProperty() |
Добавляет свойство с переданным дескриптором к объекту. |
Object.defineProperties() |
Добавляет свойства с переданными дескрипторами к объекту. |
Object.getOwnPropertyDescriptor() |
Возвращает дескриптор свойства переданного объекта. ошибка 505587 |
Object.keys() |
Возвращает массив всех перечисляемых свойств объекта. ошибка 307791 |
Object.getOwnPropertyNames() |
Возвращает массив всех перечисляемых и не перечисляемых свойств объекта. ошибка 518663 |
Object.preventExtensions() |
Prevents any extensions of an object. ошибка 492849 |
Object.isExtensible() |
Determine if extending of an object is allowed. ошибка 492849 |
Object.seal() |
Prevents other code from deleting properties of an object. ошибка 492845 |
Object.isSealed() |
Determine if an object is sealed. ошибка 492845 |
Object.freeze() |
Freezes an object: other code can't delete or change any properties. ошибка 492844 |
Object.isFrozen() |
Determine if an object was frozen. ошибка 492844 |
Array.isArray() |
Checks if a variable is an array. ошибка 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) ошибка 429507 |
Новые возможности ECMAScript5
get
иset
operators now allows the identifier to be numeric or a string. ошибка 520696Function.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 itsjoin()
method if one is available or by calling itstoString()
method.
Другая работа по стандартизации
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.
Новые обЪекты
Объект | Описание |
---|---|
Proxy |
Offers support for creating Object and Function proxies that enable meta-programming in JavaScript. |
Функциональность, изменённая в JavaScript 1.8.5
- ISO 8601 support in
Date:
The 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 ошибка 551529 & ошибка 552560.- Trailing commas no longer accepted in
JSON.parse()
.
Метки документа и участники
Обновлялась последний раз:
RokkerRuslan,