下面是 Firefox 发布版本的 JavaScript 日志更新情况。
async function
, async function expression
, and the await
keyword (bug 1185106).timeZone
option of date related APIs like DateTimeFormat
or Date.toLocaleString()
(bug 837961).SyntaxError
when using destructuring rest with trailing comma (bug 1041341).__proto__
properties are now allowed in object destructuring ({{ bug }}).Array.prototype.toLocaleString()
has been re-implemented to support the Intl API parameters "locales
" and "options
" ({{ bug }}).TypedArray
constructors now accept iterables to create new typed arrays ({{ bug }}).TypedArray.from()
, TypedArray.of()
, TypedArray.prototype.filter()
, TypedArray.prototype.map()
, TypedArray.prototype.slice()
, TypedArray.prototype.subarray()
now require that their this
values are valid Typed Array constructors ({{ bug }}).ArrayBuffer.slice()
method (not ArrayBuffer.prototype.slice()
) is deprecated and now presents a warning when used ({{ bug }}).let \u{61} = 123
", see {{ bug }}).To conform with ES2015, \u2e2f
and ⸯ
now throw when used as identifier, for details see {{ bug }} and {{ bug }}.
参阅:
Symbol.toStringTag
property has been implemented ({{ bug }}).TypedArray.prototype.toString()
and TypedArray.prototype.toLocaleString()
methods have been implemented ({{ bug }}).DateTimeFormat.prototype.formatToParts()
method is now available ({{ bug }}).const
and let
are now fully ES2015-compliant ({{ bug }}).const
in for...of
loops now has a fresh binding for each iteration and no longer throws a SyntaxError
({{ bug }}).for...of
loop.let
" as a label name is disallowed now ({{ bug }}).next()
method of the iterator protocol will now throw a TypeError
if the returned value is not an object ({{ bug }}).参阅:
Symbol.hasInstance
property has been implemented (bug 1054906).Object.getOwnPropertyDescriptors()
method has been implemented (bug 1245024).RegExp
with unicode and ignoreCase flags is changed to match recent draft spec. Now it doesn't match to K, S, k, s, and KELVIN SIGN (U+212A), and LATIN SMALL LETTER LONG S (U+017F) (bug 1281739).参阅:
getPrototypeOf()
and setPrototypeOf()
Proxy
traps have been implemented (bug 888969).RegExp.prototype[@@match]()
, RegExp.prototype[@@replace]()
, RegExp.prototype[@@search]()
, and RegExp.prototype[@@split]()
methods, and RegExp[@@species]
getter have been implemented (bug 887016).flags
argument of String.prototype.
match
/search
/replace
has been removed (bug 1108382).Date.parse()
method when parsing 2-digit years has been changed to be more interoperable with the Google Chrome browser (bug 1265136).参阅:
String.prototype.padStart()
and String.prototype.padEnd()
methods have been implemented (bug 1260509).Symbol.unscopables
and Array.prototype[@@unscopables]
properties have been implemented (bug 1054759 and bug 1258163).Symbol.isConcatSpreadable
symbol has been implemented (bug 1041586).Array[@@species]
getter has been implemented (bug 1165052).ArrayBuffer[@@species]
getter and %TypedArray%[@@species]
getter have been implemented (bug 1165053).Intl.getCanonicalLocales()
method of the ECMAScript Internationalization API draft has been implemented (bug 1263040).Proxy.create
and Proxy.createFunction()
) has been removed. Use the standard Proxy
object instead (bug 892903).String.prototype.contains()
method has been removed (it was deprecated since version 40). Use the String.prototype.includes()
method instead (bug 1103588).RegExp.multiline
property (not RegExp.prototype.multiline
) has been removed. Use the standard m flag instead (bug 1219757).__defineGetter__
and __defineSetter__
methods can no longer be called at the global scope without any object. (bug 1253016).参阅:
Object.values()
and Object.entries()
methods have been implemented (bug 1232639).Proxy.create
and Proxy.createFunction
) now presents a deprecation warning in the console and will be removed in a future version. Use the standard Proxy
object instead (bug 892903).flags
argument of String.prototype.
match
/search
/replace
has been dropped in non-release builds (bug 1245801).Proxy
enumerate trap for for...in
statements has been removed (bug 1246318).Array.prototype.indexOf()
and Array.prototype.lastIndexOf()
methods (and their TypedArray
equivalents) have been updated to never return -0
as per the ECMAScript specification (bug 1242043).参阅:
TypedArray.prototype.sort()
method has been implemented (bug 1121937).arguments[@@iterator]
has been implemented (bug 1067049).SharedArrayBuffer
and Atomics
objects. To use this experimental API set javascript.options.shared_memory
to true
in about:config.let
and const
variables now throws a SyntaxError
instead of a TypeError
as per the ECMAScript specification (bug 1198833).TypeError
(bug 603201).WeakMap.prototype.clear()
and WeakSet.prototype.clear()
methods have been removed (bug 1101817).RegExp.multiline
property is now deprecated (bug 1220457).参阅:
String.prototype.replace
does not restore RegExp static properties after executing function parameter anymore ({{ bug }}).Math.random()
has been updated to the better XorShift128+ algorithm ({{ bug }}).参阅:
Symbol.toPrimitive
, Symbol.prototype[@@toPrimitive]
, and Date.prototype[@@toPrimitive]
have been implemented (bug 1054756).let
and const
bindings in the global level have been made compliant with ES2015 semantics. See bug 589199 and the blog post "Breaking changes in let and const in Firefox Nightly 44". In addition, let
is now available to default Web JavaScript (strict and non-strict) and does not require a version opt-in anymore (bug 932517).Int8Array
) and ArrayBuffer
) constructors are called as a function without the new
operator, a TypeError
is now thrown as per the ES2015 specification (bug 980945, bug 1214936).RegExp
sticky flag now follows the ES2015 standard for anchored sticky regular expressions (bug 773687).let
blocks has been dropped (bug 1167029.Object.prototype.__noSuchMethod__
has been removed (bug 683218).参阅:
Array.prototype.includes()
and TypedArray.prototype.includes()
are now enabled by default (bug 1070767).arguments
objectarguments
object. The arguments
object is now lexically bound (inherited from the outer function). In most cases, rest parameters are a good alternative (...args) => args[i]
, see bug 889158.arguments
object in non-strict functions is only provided if the function does not contain any rest parameters, any default parameters or any destructured parameters (bug 1175394).参阅:
Reflect
object has been implemented (bug 987514).Proxy
handler.ownKeys()
trap has been updated to match the final ES2015 specification (bug 1049662).Map
, Set
, or WeakMap
without new
, will now throw a TypeError
(bug 1083752).参阅:
Date.prototype
is now an ordinary object, not a Date
instance anymore (bug 861219).Date.prototype.toString
is now a generic method (bug 861219).Symbol.species
has been added (bug 1131043).Map[@@species]
and Set[@@species]
getters have been added (bug 1131043).([a, b]) = [1, 2]
or ({a, b}) = { a: 1, b: 2 }
, are now considered invalid and will throw a SyntaxError
. See Jeff Walden's blog post for more details.new.target
syntax has been added (bug 1141865).参阅:
return
statement (including unreachable expression after semicolon-less return statements) will now show a warning in the console (bug 1005110, bug 1151931).Symbol.match
has been added (bug 1054755).Symbol.match
with a truthy value to String.prototype.startsWith
, String.prototype.endsWith
, and String.prototype.contains
now throws a TypeError
(bug 1054755).RegExp
function returns pattern itself if called without new
and pattern object has a property named Symbol.match
with a truthy value, and the pattern object's constructor
property equals to RegExp
function. (bug 1147817).\u{xxxxxx}
Unicode code point escapes have been added (bug 320500).String.prototype.contains
has been replaced with String.prototype.includes
, String.prototype.contains
is kept as an alias (bug 1102219).DataView
constructor is called as a function without the new
operator, a TypeError
is now thrown as per the ES2015 specification.get
trap were not working properly, has been fixed. If the get
trap in a Proxy
was not defined, Array.length
returned 0
and the set
trap didn't get called. A workaround was to add the get
trap even if was not necessary in your code. This issue has been fixed now (bug 895223).WeakMap.prototype
and WeakSet.prototype
have been updated to be just ordinary objects, per ES2015 specification (bug 1055473).参阅:
RegExp
constructor no longer throws when the first argument is a RegExp
and the second flags
argument is present (bug 1108949).Object.prototype.__noSuchMethod__
property is now deprecated and throws a console warning (see bug 1140428 and this platform announcement).Proxy
object has been updated to comply more with the ES2015 specification:
defineProperty
and set
handlers now need to explicitly return true
to be successful, otherwise a TypeError
exception will be thrown in strict mode (bug 1132522).window
object is set as the target, those handlers will now throw a TypeError
(bug 828137).=>
), a line terminator (\n
) is no longer allowed after arrow function arguments (() \n => {}
) (bug 1141392).RegExp.prototype.toString
is now a generic function (bug 1079919).flags
argument of String.prototype.match()
, String.prototype.search()
, and String.prototype.replace()
is now deprecated and throws a console warning (bug 1142351).Object.assign()
has been removed to conform with the latest ES2015 draft (bug 1103344).参阅:
Generator.prototype.return()
is implemented (bug 1115868).Setter
with a rest parameter is now a SyntaxError
(bug 1089632).name
property of functions is configurable now (bug 1084019).Array
methods have been implemented for typed arrays as well:
of()
and from()
methods (bug 896608).forEach()
method (bug 1107645).filter()
and map()
methods (bug 1121936).slice()
method (bug 1121935).Map
/Set
/WeakMap
constructor is called without new
(bug 1108930).get
, has
, and delete
methods of WeakMap
objects no longer throw when the key
parameter is not an object (bug 1127827).fallback
parameter for WeakMap.prototype.get()
has been removed (bug 1127827).set
" and "get
" are no longer invalid names (bug 1073809).RegExp.prototype.source
now returns "(?:)" instead of an empty string for empty regular expressions (bug 1130798).RegExp.prototype.source
and RegExp.prototype.toString()
now escape regular expression patterns properly (e.g. line terminators, "\n") (bug 1130860).Regexp
global
, ignoreCase
, multiline
, and sticky
properties are now prototype accessor properties rather than own data properties of RegExp
instances (bug 1120169).RegExp.prototype.source
property is now prototype accessor property rather than own data property of RegExp
instances (bug 1120169). Available only in non-Release version, due to bug 1150297.Function.prototype.toString()
now throws for Proxy
objects (bug 1100936).参阅:
Map
, Set
, WeakMap
and WeakSet
constructors now ignore null iterable (bug 1092538).Map
, Set
, WeakMap
and WeakSet
constructors now supports monkey-patched prototype.set
or prototype.add
(bug 804279).String.prototype.quote()
method has been removed (bug 1103181).RegExp.prototype.flags
property has been implemented (bug 1108467).Array
methods have been implemented for typed arrays as well:
every()
and some()
methods (bug 1116390).find()
and findIndex()
methods (bug 1078975).fill()
method (bug 1113722).indexOf()
and lastIndexOf()
methods (bug 1107601).join()
method (bug 1115817).reduce()
and reduceRight()
methods (bug 1117350).reverse()
method (bug 1111516).keys()
, values()
, and entries()
methods (bug 1119217).enumerate
trap is implemented (bug 783829).configurable
attribute of the Function.length
property is now true
per the ES2015 specification (bug 911142).Array.prototype.mapPar
, filterPar
and reducePar
methods, has been completely removed.参阅:
"@@iterator"
has been replaced with the real ES2015 well-known symbol Symbol.iterator
for the iterable interface property key (bug 918828).ToNumber(string)
now supports binary (0b
) and octal (0o
) literals, this is a potentially breaking change from ES5 (bug 1079120).
Number("0b11")
now returns 3
, not NaN
."0o11" == 9
now returns true
, not false
.const
declaration is now block-scoped and requires an initializer (bug 611388). It also can not be redeclared anymore (bug 1095439).
{const a=1}; a;
now throws a ReferenceError
and does not return 1
anymore due to block-scoping.const a;
now throws a SyntaxError
("missing = in const declaration"
): An initializer is required.const a = 1; a = 2;
now also throws a SyntaxError
("invalid assignment to const a").Array.prototype.includes
has been implemented, but for now, it is only enabled in Nightly builds (bug 1069063).delete
operator now triggers the "temporal dead zone" when using with let
and const
(bug 1074571).let
blocks and let
expressions are deprecated and will now log a warning in the console. Do not use them anymore, they will be removed in the future.参阅:
let
declarations has been implemented. In conformance with ES2015 let
semantics, the following situationslet
within the same scope in function bodies is now a syntax error.let
in function bodies before the declaration is reached and evaluated is now a runtime error.Symbols
(only available in the Nightly channel) have been updated to conform with recent specification changes:
String(Symbol("1"))
now no longer throws a TypeError
; instead a string ("Symbol(1)"
) gets returned (bug 1058396).[[Prototype]]
a single function, denoted %TypedArray%
in ES2015 (but otherwise not directly exposed). Each typed array prototype now inherits from %TypedArray%.prototype
. (%TypedArray%
and %TypedArray%.prototype
inherit from Function.prototype
and Object.prototype
, respectively, so that typed array constructors and instances still have the properties found on those objects.) Typed array function properties now reside on %TypedArray%.prototype
and work on any typed array. See TypedArray and bug 896116 for more information.__proto__:value
will mutate the [[Prototype]]
in the object literal syntax.__proto__() {}
will not overwrite the [[Prototype]]
anymore.参阅:
Object
method Object.assign()
has been implemented (bug 937855).String.raw()
method are now supported (bug 1038259, bug 1039774).WeakSet
has been added (bug 792439).TypeError
will be thrown now.Object(sym) == sym
returns true
now.TypedArray.prototype.move()
method (only available in former Nightly and Aurora channels) has been replaced with the now implemented standard ES2015 TypedArray.prototype.copyWithin()
method (bug 1021379).SyntaxError
as per ES2015 specification (bug 1041128).String.replace
), the matched text for a capturing group is now undefined
instead of the empty string when that capturing group didn't get consulted because quantifiers prevented its exercise (see bug 369778 and this example code). Note that due to web compatibility, RegExp.$N will still return an empty string (bug 1053944).参阅:
Number.toInteger()
has been removed (bug 1022396).Map.prototype.set()
, WeakMap.prototype.set()
and Set.prototype.add()
methods are now chainable, return their equivalent objects and no longer undefined
(bug 1031632).function f(x, y) { return {x, y}; }
is equivalent to function f(x, y) { return {x: x, y: y}; }
(bug 875002).yield
and yield*
has been updated to conform with the latest ES2015 specification (bug 981599).hasOwn
trap has been removed (bug 980565).参阅:
参阅:
New ECMAScript 2015 features implemented:
Array
built-in: Array.prototype.fill()
(bug 911147)Math
function: Math.clz32()
(bug 925123)String
built-in: String.prototype.normalize()
is available in Firefox Desktop (bug 918987).Object
method Object.setPrototypeOf()
.Number
constants: Number.MAX_SAFE_INTEGER
and Number.MIN_SAFE_INTEGER
.isExtensible
trap have been implemented (bug 978235).参阅:
[for (item of iterable) item]
and generator comprehensions (for (item of iterable) item)
have been implemented (bug 979865).Error.prototype.stack
property now contains column numbers (bug 762556) and has been improved when using Function()
and eval()
calls. This can help you to better debug minified or generated JavaScript code.Promise.cast()
method has been renamed to Promise.resolve()
(bug 966348).参阅:
String.prototype.codePointAt()
and String.prototype.fromCodePoint()
have been implemented (bug 918879).Map
and Set
objects now treat -0
and +0
as the same when checking for key and value equality.Promise
has been enabled by default (bug 918806).IteratorResult
object instead of throwing (bug 958951).JSON.parse()
now yields a more detailed error message containing the line and column number that caused the parsing error. This is useful when debugging large JSON data.ArrayBuffer.isView()
method has been added (bug 896105).参阅:
Array
methods have been implemented: Array.prototype.entries()
and Array.prototype.keys()
(bug 894658).Object.getOwnPropertyNames()
did not see unresolved properties of Error
objects has been fixed (bug 724768).参阅:
EcmaScript 2015 implementation continues!
Math.hypot()
has been implemented (bug 896264).yield*
expression is now implemented (bug 666396).MapIterator
, SetIterator
and ArrayIterator
objects now match the specification (bug 881226).StopIteration
.String.match
and String.replace
now reset RegExp.lastIndex
(bug 501739).参阅:
EcmaScript 2015 implementation continues!
{ value: foo, done: bool }
(bug 907744).Math
: Math.fround()
(bug 900125).SyntaxError
(bug 907958). function f(x=1, y)
. See bug 777060.GeneratorFunction
is implemented (bug 904701).参阅:
EcmaScript 2015 implementation continues!
Array.of()
is now implemented on Array
(bug 866849).Array.prototype.find()
and Array.prototype.findIndex()
has been added (bug 885553).Number.parseInt()
and Number.parseFloat()
have been implemented (bug 886949)Map.prototype.forEach()
and Set.prototype.forEach()
are now implemented (bug 866847).Math
: Math.log10()
, Math.log2()
, Math.log1p()
, Math.expm1()
, Math.cosh()
, Math.sinh()
, Math.tanh()
, Math.acosh()
, Math.asinh()
, Math.atanh()
, Math.trunc()
, Math.sign()
and Math.cbrt()
(bug 717379).0b10101010
, 0B1010
, 0o777
, 0O237
are now valid (bug 894026).Number.EPSILON
(bug 885798).参阅:
"use strict"
(bug 852762).String.prototype.repeat
JS method has been implemented (bug 815431).Set.prototype.values()
, Set.prototype.keys()
and Set.prototype.entries()
methods on Set
objects have been implemented (bug 869996).参阅:
Object.defineProperty
method can now be used to redefine the length
property of an Array
object.参阅:
arguments
in generator expressions is now inherited from enclosing lexical scope (bug 848051).preventExtensions
trap have been implemented (bug 789897).参阅:
参阅:
Weakmap.prototype.clear()
method, recently added to the Harmony (EcmaScript 2015) draft proposal has been added (bug 814562).Math.imul()
method, a C-style 32-bit multiplication function. Though proposed for Harmony (EcmaScript 2015) it has not yet accepted and still is non-standard (bug 808148).for each…in
statement has been deprecated and should not be used. Consider using the new for…of
statement (bug 804834).Map.prototype.keys()
, Map.prototype.values()
, and Map.prototype.entries()
has been added (bug 817368).参阅:
Map
and Set
objects have changed from having a size()
method to a size
property (bug 807001)Map
and Set
objects also have a clear() method now. (bug 805003)参阅:
contains()
method is now implemented on strings. This is unfortunately not compatible with Mootools 1.2, which expects different behavior from contains()
on strings but does not ensure it. Newer versions of Mootools fix this issue; sites should upgrade their Mootools version to something newer than 1.2.参阅:
String
object now offers Harmony startsWith
, endsWith
, and contains
methods (bug 772733).'"'
(quotation mark) (bug 352437).ParallelArray
object has been implemented (bug 778559).Map
/Set
(bug 725909).__exposedProps__
must now be set for Chrome JavaScript objects exposed to content. Attempts to access Chrome objects from content without __exposedProps__
set will fail silently (bug 553102).for..of
loops now work in terms of .iterator()
and .next()
(bug 725907).参阅:
Number
objects now offer isFinite()
, toInteger()
, and isInteger()
methods. (bug 761480, bug 761495)Array
initializers (bug 574130). Note it is not yet supported in calls (bug 762363).TypedArray.prototype.move()
method has been added (available in Aurora and Nightly channels only) (bug 730873).参阅:
DataView
interface from the Typed Arrays specification has been added. This provides low-level access to the data contained in an ArrayBuffer
.Number.isNaN()
, Number.toInteger()
, Number.isInteger()
, Number.isFinite()
has been added. (bug 749818, bug 761495, bug 761480).参阅:
No change.
参阅:
参阅:
ArrayBuffer.prototype.slice()
has been implemented.参阅:
No change.
参阅:
WeakMap.set()
now returns undefined
, instead of itself."use strict;"
).参阅:
No change.
参阅:
RegExp.exec()
and RegExp.test()
called with no arguments now match against the string "undefined".String.search()
and String.match()
called with no arguments or undefined
now match against the empty string and thus match every string.watch()
and unwatch()
methods.参阅:
Function.arity
property has been removed; use Function.length
instead.参阅:
new
operator on several built-in functions (eval, parseInt, Date.parse...) that should not have allowed it, according to the specification. This behavior is no longer supported. Using the new
operator in this way was never officially supported and was not widely done, so it's unlikely that this change affects you.参阅:
Function.prototype.isGenerator()
method is now supported; this lets you determine if a function is a generator.class
, enum
, export
, extends
, import
, and super
.参阅:
对于 Firefox 5 之前版本,请查看 old JavaScript versions。