下面是Firefox发布版本的JavaScript日志更新情况。
Firefox 52
New features
- Support for the async functions has been added. This adds
async function,async function expression, and theawaitkeyword (bug 1185106). - Implemented ES2017 trailing commas in functions (bug 1303788).
- Implemented rest parameter destructuring (bug 1243717).
- The exponentiation operator (**) is now enabled by default (bug 1291212).
- You can now use IANA time zone names in the
timeZoneoption of date related APIs likeDateTimeFormatorDate.toLocaleString()(bug 837961).
Changes and removals
- Array destructuring now throws a
SyntaxErrorwhen using destructuring rest with trailing comma (bug 1041341). - Duplicate
__proto__properties are now allowed in object destructuring (bug 1204024). Array.prototype.toLocaleString()has been re-implemented to support the Intl API parameters "locales" and "options" (bug 1130636).TypedArrayconstructors now accept iterables to create new typed arrays (bug 1232266).TypedArray.from(),TypedArray.of(),TypedArray.prototype.filter(),TypedArray.prototype.map(),TypedArray.prototype.slice(),TypedArray.prototype.subarray()now require that theirthisvalues are valid Typed Array constructors (bug 1122396).- The non-standard
ArrayBuffer.slice()method (notArrayBuffer.prototype.slice()) is deprecated and now presents a warning when used (bug 1316913). - Unicode code point escapes can now also be used as identifiers (e.g. "
let \u{61} = 123", see bug 1314037). -
To conform with ES2015,
\u2e2fandⸯnow throw when used as identifier, for details see bug 917436 and bug 1197230.
参阅:
Firefox 51
- The ES2015
Symbol.toStringTagproperty has been implemented (bug 1114580). - The ES2015
TypedArray.prototype.toString()andTypedArray.prototype.toLocaleString()methods have been implemented (bug 1121938). - The
DateTimeFormat.prototype.formatToParts()method is now available (bug 1289340). constandletare now fully ES2015-compliant (bug 950547).- Using
constinfor...ofloops now has a fresh binding for each iteration and no longer throws aSyntaxError(bug 1101653). - The deprecated for each...in loop now presents a warning in the console (bug 1293205). Please migrate your code to use the standardized
for...ofloop. - Generator functions can't have a label anymore and "
let" as a label name is disallowed now (bug 1288459). - Deprecated legacy generator functions will now throw when used in method definitions (bug 1199296).
- The
next()method of the iterator protocol will now throw aTypeErrorif the returned value is not an object (bug 1016936). - Child-indexed pseudo-class selectors should match without a parent (bug 1300374).
参阅:
Firefox 50
- The ES2015
Symbol.hasInstanceproperty has been implemented (bug 1054906). - The ES2017
Object.getOwnPropertyDescriptors()method has been implemented (bug 1245024). - The behavior of \W in
RegExpwith 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).
参阅:
Firefox 49
- The ES2015
getPrototypeOf()andsetPrototypeOf()Proxytraps have been implemented (bug 888969). - The ES2015
RegExp.prototype[@@match](),RegExp.prototype[@@replace](),RegExp.prototype[@@search](), andRegExp.prototype[@@split]()methods, andRegExp[@@species]getter have been implemented (bug 887016). - The deprecated, non-standard
flagsargument ofString.prototype.match/search/replacehas been removed (bug 1108382). - The behavior of the
Date.parse()method when parsing 2-digit years has been changed to be more interoperable with the Google Chrome browser (bug 1265136).
参阅:
Firefox 48
New APIs
- The
String.prototype.padStart()andString.prototype.padEnd()methods have been implemented (bug 1260509). - The ES2015
Symbol.unscopablesandArray.prototype[@@unscopables]properties have been implemented (bug 1054759 and bug 1258163). - The ES2015
Symbol.isConcatSpreadablesymbol has been implemented (bug 1041586). - The ES2015
Array[@@species]getter has been implemented (bug 1165052). - The ES2015
ArrayBuffer[@@species]getter and%TypedArray%[@@species]getter have been implemented (bug 1165053). - The
Intl.getCanonicalLocales()method of the ECMAScript Internationalization API draft has been implemented (bug 1263040).
Deprecations and removals
- The deprecated old Proxy API (
Proxy.createandProxy.createFunction()) has been removed. Use the standardProxyobject instead (bug 892903). - The
String.prototype.contains()method has been removed (it was deprecated since version 40). Use theString.prototype.includes()method instead (bug 1103588). - The non-standard
RegExp.multilineproperty (notRegExp.prototype.multiline) has been removed. Use the standard m flag instead (bug 1219757). - The
__defineGetter__and__defineSetter__methods can no longer be called at the global scope without any object. (bug 1253016).
参阅:
Firefox 47
- The new ES2017
Object.values()andObject.entries()methods have been implemented (bug 1232639). - The deprecated old Proxy API (
Proxy.createandProxy.createFunction) now presents a deprecation warning in the console and will be removed in a future version. Use the standardProxyobject instead (bug 892903). - Support for the deprecated non-standard
flagsargument ofString.prototype.match/search/replacehas been dropped in non-release builds (bug 1245801). - As per the new ES2016 specification, the
Proxyenumerate trap forfor...instatements has been removed (bug 1246318). - The
Array.prototype.indexOf()andArray.prototype.lastIndexOf()methods (and theirTypedArrayequivalents) have been updated to never return-0as per the ECMAScript specification (bug 1242043).
参阅:
Firefox 46
- The ES2015 RegExp unicode (u) flag has been implemented (bug 1135377).
- The ES2015 block-level functions have been implemented (bug 1071646).
- The ES2015
TypedArray.prototype.sort()method has been implemented (bug 1121937). - The ES2015
arguments[@@iterator]has been implemented (bug 1067049). - The experimental EcmaScript Shared Memory API has been implemented. See the
SharedArrayBufferandAtomicsobjects. To use this experimental API setjavascript.options.shared_memorytotruein about:config. - Redeclaration of
letandconstvariables now throws aSyntaxErrorinstead of aTypeErroras per the ECMAScript specification (bug 1198833). - In Strict mode, setting properties on primitive values will now throw a
TypeError(bug 603201). - The non-standard
WeakMap.prototype.clear()andWeakSet.prototype.clear()methods have been removed (bug 1101817). - The non-standard, static
RegExp.multilineproperty is now deprecated (bug 1220457). - Built-in accessor function names now have a "get" or "set" prefix (bug 1180290, bug 1235656).
- JS1.7/JS1.8 (legacy) array comprehensions and JS1.7/JS1.8 (legacy) generator comprehensions have been removed (bug 1220564).
参阅:
Firefox 45
- ES2015 Classes are now enabled by default (bug 1197932).
- Expression closures are deprecated and will now present a warning in the console (bug 995610).
String.prototype.replacedoes not restore RegExp static properties after executing function parameter anymore (bug 1226936).Math.random()has been updated to the better XorShift128+ algorithm (bug 322529).
参阅:
Firefox 44
New APIs
Symbol.toPrimitive,Symbol.prototype[@@toPrimitive], andDate.prototype[@@toPrimitive]have been implemented (bug 1054756).
Changes
- The
letandconstbindings 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,letis now available to default Web JavaScript (strict and non-strict) and does not require a version opt-in anymore (bug 932517). - If typed arrays' (like
Int8Array) andArrayBuffer) constructors are called as a function without thenewoperator, aTypeErroris now thrown as per the ES2015 specification (bug 980945, bug 1214936). - The
RegExpsticky flag now follows the ES2015 standard for anchored sticky regular expressions (bug 773687). - The JavaScript shell (SpiderMonkey's REPL) now defaults to the default, Web-compatible JS version (and not JS1.7+ anymore) (bug 1192329).
Removals
- Support for the non-standard
letblocks has been dropped (bug 1167029. - The non-standard and deprecated property
Object.prototype.__noSuchMethod__has been removed (bug 683218).
参阅:
Firefox 43
New APIs
- The new ES2016 methods
Array.prototype.includes()andTypedArray.prototype.includes()are now enabled by default (bug 1070767).
Changes regarding the arguments object
- To match the ES2015 specification, arrow functions no longer have their own
argumentsobject. Theargumentsobject is now lexically bound (inherited from the outer function). In most cases, rest parameters are a good alternative(...args) => args[i], see bug 889158. - The arguments object is now allowed in conjunction with rest parameters (bug 1133298).
- From now on, a mapped
argumentsobject 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).
Other changes
- Generators and generator methods are no longer constructable as per ES2016 (bug 1191486).
参阅:
Firefox 42
- The
Reflectobject has been implemented (bug 987514). - The implementation of the
Proxyhandler.ownKeys()trap has been updated to match the final ES2015 specification (bug 1049662). - Calling
Map,Set, orWeakMapwithoutnew, will now throw aTypeError(bug 1083752).
参阅:
Firefox 41
Date.prototypeis now an ordinary object, not aDateinstance anymore (bug 861219).Date.prototype.toStringis now a generic method (bug 861219).Symbol.specieshas been added (bug 1131043).Map[@@species]andSet[@@species]getters have been added (bug 1131043).- Non-standard let expression support has been dropped (bug 1023609).
- Destructured parameters with default value assignment are now supported (bug 1018628).
- Per ES2015, curly braces are required for method definitions. Syntax without them will fail from now on (bug 1150855).
- Method definitions (except for generator methods) are not constructable anymore (bug 1059908 and bug 1166950).
- As part of ES2015 specification compliance, parenthesized destructuring patterns, like
([a, b]) = [1, 2]or({a, b}) = { a: 1, b: 2 }, are now considered invalid and will throw aSyntaxError. See Jeff Walden's blog post for more details. - The
new.targetsyntax has been added (bug 1141865).
参阅:
Firefox 40
- Unreachable code after
returnstatement (including unreachable expression after semicolon-less return statements) will now show a warning in the console (bug 1005110, bug 1151931). Symbol.matchhas been added (bug 1054755).- Passing an object which has a property named
Symbol.matchwith a truthy value toString.prototype.startsWith,String.prototype.endsWith, andString.prototype.containsnow throws aTypeError(bug 1054755). RegExpfunction returns pattern itself if called withoutnewand pattern object has a property namedSymbol.matchwith a truthy value, and the pattern object'sconstructorproperty equals toRegExpfunction. (bug 1147817).- Support for the non-standard JS1.7 destructuring for-in has been dropped (bug 1083498).
- Non-standard initializer expressions in for...in loops are now ignored and will present a warning in the console. (bug 748550 and bug 1164741).
\u{xxxxxx}Unicode code point escapes have been added (bug 320500).String.prototype.containshas been replaced withString.prototype.includes,String.prototype.containsis kept as an alias (bug 1102219).- If the
DataViewconstructor is called as a function without thenewoperator, aTypeErroris now thrown as per the ES2015 specification. - An issue regressed in Firefox 21, where proxyfied arrays without the
gettrap were not working properly, has been fixed. If thegettrap in aProxywas not defined,Array.lengthreturned0and thesettrap didn't get called. A workaround was to add thegettrap even if was not necessary in your code. This issue has been fixed now (bug 895223). WeakMap.prototypeandWeakSet.prototypehave been updated to be just ordinary objects, per ES2015 specification (bug 1055473).
参阅:
Firefox 39
- The
RegExpconstructor no longer throws when the first argument is aRegExpand the secondflagsargument is present (bug 1108949). - The
Object.prototype.__noSuchMethod__property is now deprecated and throws a console warning (see bug 1140428 and this platform announcement). - The implementation of the
Proxyobject has been updated to comply more with the ES2015 specification:- The
definePropertyandsethandlers now need to explicitly returntrueto be successful, otherwise aTypeErrorexception will be thrown in strict mode (bug 1132522). - If the
windowobject is set as the target, those handlers will now throw aTypeError(bug 828137).
- The
- When using arrow functions (
=>), a line terminator (\n) is no longer allowed after arrow function arguments (() \n => {}) (bug 1141392). RegExp.prototype.toStringis now a generic function (bug 1079919).- The non-standard
flagsargument ofString.prototype.match(),String.prototype.search(), andString.prototype.replace()is now deprecated and throws a console warning (bug 1142351). - The try/catch behavior of
Object.assign()has been removed to conform with the latest ES2015 draft (bug 1103344).
参阅:
Firefox 38
Generator.prototype.return()is implemented (bug 1115868).Setterwith a rest parameter is now aSyntaxError(bug 1089632).- The
nameproperty of functions is configurable now (bug 1084019). - Several
Arraymethods have been implemented for typed arrays as well:- The
of()andfrom()methods (bug 896608). - The
forEach()method (bug 1107645). - The
filter()andmap()methods (bug 1121936). - The
slice()method (bug 1121935).
- The
- Duplicated parameter name is no longer allowed when rest-parameter is present (bug 1096376).
- Duplicated parameter name is no longer allowed in arrow functions (bug 1096377).
- Duplicated parameter name is no longer allowed in concise method definitions (bug 1096378).
- Warning is shown when
Map/Set/WeakMapconstructor is called withoutnew(bug 1108930). - The
get,has, anddeletemethods ofWeakMapobjects no longer throw when thekeyparameter is not an object (bug 1127827). - The optional and non-standard second
fallbackparameter forWeakMap.prototype.get()has been removed (bug 1127827). - When defining a generator method, "
set" and "get" are no longer invalid names (bug 1073809). RegExp.prototype.sourcenow returns "(?:)" instead of an empty string for empty regular expressions (bug 1130798).RegExp.prototype.sourceandRegExp.prototype.toString()now escape regular expression patterns properly (e.g. line terminators, "\n") (bug 1130860).- The
Regexpglobal,ignoreCase,multiline, andstickyproperties are now prototype accessor properties rather than own data properties ofRegExpinstances (bug 1120169). - The
RegExp.prototype.sourceproperty is now prototype accessor property rather than own data property ofRegExpinstances (bug 1120169). Available only in non-Release version, due to bug 1150297. Function.prototype.toString()now throws forProxyobjects (bug 1100936).
参阅:
Firefox 37
- The
Map,Set,WeakMapandWeakSetconstructors now ignore null iterable (bug 1092538). - The
Map,Set,WeakMapandWeakSetconstructors now supports monkey-patchedprototype.setorprototype.add(bug 804279). - The Non-standard
String.prototype.quote()method has been removed (bug 1103181). - The
RegExp.prototype.flagsproperty has been implemented (bug 1108467). - Several
Arraymethods have been implemented for typed arrays as well:- The
every()andsome()methods (bug 1116390). - The
find()andfindIndex()methods (bug 1078975). - The
fill()method (bug 1113722). - The
indexOf()andlastIndexOf()methods (bug 1107601). - The
join()method (bug 1115817). - The
reduce()andreduceRight()methods (bug 1117350). - The
reverse()method (bug 1111516). - The
keys(),values(), andentries()methods (bug 1119217).
- The
- ES2015 Proxy
enumeratetrap is implemented (bug 783829). - The
configurableattribute of theFunction.lengthproperty is nowtrueper the ES2015 specification (bug 911142). - The development of ParallelJS (PJS) has been discontinued due to the limited future prospects, little attention and code complexity. The experimental implementation that had been enabled only on the Nightly channel, including the
Array.prototype.mapPar,filterParandreduceParmethods, has been completely removed.
参阅:
Firefox 36
- The ECMAScript 2015 Symbol data type has been enabled by default (was available in the Nightly channel since version 33) (bug 1066322):
- The old placeholder string
"@@iterator"has been replaced with the real ES2015 well-known symbolSymbol.iteratorfor the iterable interface property key (bug 918828). - The spec-internal abstract operation
ToNumber(string)now supports binary (0b) and octal (0o) literals, this is a potentially breaking change from ES5 (bug 1079120).Number("0b11")now returns3, notNaN."0o11" == 9now returnstrue, notfalse.
- The
constdeclaration 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 aReferenceErrorand does not return1anymore due to block-scoping.const a;now throws aSyntaxError("missing = in const declaration"): An initializer is required.const a = 1; a = 2;now also throws aSyntaxError("invalid assignment to const a").
- The ES2016 method
Array.prototype.includeshas been implemented, but for now, it is only enabled in Nightly builds (bug 1069063). - The
deleteoperator now triggers the "temporal dead zone" when using withletandconst(bug 1074571). - The non-standard
letblocks andletexpressions are deprecated and will now log a warning in the console. Do not use them anymore, they will be removed in the future. - WeakMap constructor now handles optional iterable argument (bug 1092537).
参阅:
Firefox 35
- The "temporal dead zone" for
letdeclarations has been implemented. In conformance with ES2015letsemantics, the following situations
now throw errors. See also this newsgroup announcement and bug 1001090.- Redeclaring existing variables or arguments using
letwithin the same scope in function bodies is now a syntax error. - Using a variable declared using
letin function bodies before the declaration is reached and evaluated is now a runtime error.
- Redeclaring existing variables or arguments using
- ES2015
Symbols(only available in the Nightly channel) have been updated to conform with recent specification changes:String(Symbol("1"))now no longer throws aTypeError; instead a string ("Symbol(1)") gets returned (bug 1058396).
- The various TypedArray constructors now have as their
[[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%.prototypeinherit fromFunction.prototypeandObject.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%.prototypeand work on any typed array. See TypedArray and bug 896116 for more information. - ES2015 semantics for prototype mutations using object literals have been implemented (bug 1061853).
- Now only a single member notated as
__proto__:valuewill mutate the[[Prototype]]in the object literal syntax. - Method members like
__proto__() {}will not overwrite the[[Prototype]]anymore.
- Now only a single member notated as
参阅:
Firefox 34
- The ES2015 syntax for computed property names on object literals has been implemented (bug 924688).
- This includes getter and setter method names as well (bug 1048384) and can also be used with destructuring.
- The ES2015 shorthand syntax for defining methods on objects has been implemented (bug 924672).
- The ES2015
ObjectmethodObject.assign()has been implemented (bug 937855). - ES2015 template strings and the
String.raw()method are now supported (bug 1038259, bug 1039774). - A new ES2015 object
WeakSethas been added (bug 792439). - ES2015 Symbols (only available in the Nightly channel) have been updated to conform with recent specification changes (bug 1042602):
- When trying to convert a symbol to a number, a
TypeErrorwill be thrown now. - When using loose equality,
Object(sym) == symreturnstruenow.
- When trying to convert a symbol to a number, a
- The experimental
TypedArray.prototype.move()method (only available in former Nightly and Aurora channels) has been replaced with the now implemented standard ES2015TypedArray.prototype.copyWithin()method (bug 1021379). - In strict mode, setting a duplicate property name in object literals will no longer throw a
SyntaxErroras per ES2015 specification (bug 1041128). - In regular expressions (including
String.replace), the matched text for a capturing group is nowundefinedinstead 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). - The ES2015 spread operator is now supported in destructuring (bug 933276).
- Destructuring now uses iterator protocol instead of array-like protocol (bug 933276).
- (bug 978279).
参阅:
Firefox 33
- The non-standard method
Number.toInteger()has been removed (bug 1022396). - The
Map.prototype.set(),WeakMap.prototype.set()andSet.prototype.add()methods are now chainable, return their equivalent objects and no longerundefined(bug 1031632). - A default parameter is evaluated before function declarations inside the function body, so those functions cannot be referred from default parameter (bug 1022962).
- Shorthand properties are now allowed in object literals: if not explicitly defined, property keys are initialized by variables of the same name. E.g.
function f(x, y) { return {x, y}; }is equivalent tofunction f(x, y) { return {x: x, y: y}; }(bug 875002). - The parsing of
yieldandyield*has been updated to conform with the latest ES2015 specification (bug 981599). - The non-standard
hasOwntrap has been removed (bug 980565).
参阅:
Firefox 32
- The following new ECMAScript 2015 built-in methods got implemented:
参阅:
Firefox 31
New ECMAScript 2015 features implemented:
- New
Arraybuilt-in:Array.prototype.fill()(bug 911147) - New
Mathfunction:Math.clz32()(bug 925123) - New
Stringbuilt-in:String.prototype.normalize()is available in Firefox Desktop (bug 918987). - New
ObjectmethodObject.setPrototypeOf(). - New
Numberconstants:Number.MAX_SAFE_INTEGERandNumber.MIN_SAFE_INTEGER. - The ES2015 Proxy
isExtensibletrap have been implemented (bug 978235).
参阅:
Firefox 30
- New ES2015-compatible array comprehensions
[for (item of iterable) item]and generator comprehensions(for (item of iterable) item)have been implemented (bug 979865). - Typed arrays are now extensible and support new named properties (bug 695438).
- The
Error.prototype.stackproperty now contains column numbers (bug 762556) and has been improved when usingFunction()andeval()calls. This can help you to better debug minified or generated JavaScript code. - The
Promise.cast()method has been renamed toPromise.resolve()(bug 966348).
参阅:
Firefox 29
- New ECMAScript 2015 String methods:
String.prototype.codePointAt()andString.prototype.fromCodePoint()have been implemented (bug 918879). - The ECMAScript Internationalization API (ECMA-402) has been implemented and is now enabled by default in Firefox Desktop (bug 853301):
- To match the updated ECMAScript 2015 draft specification, the
MapandSetobjects now treat-0and+0as the same when checking for key and value equality. Promisehas been enabled by default (bug 918806).- Completed generators now return an
IteratorResultobject instead of throwing (bug 958951). - A malformed JSON string parsed by
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. - The
ArrayBuffer.isView()method has been added (bug 896105).
参阅:
Firefox 28
- ECMAScript 2015 implementation continues:
- New
Arraymethods have been implemented:Array.prototype.entries()andArray.prototype.keys()(bug 894658).
- New
- A bug causing that
Object.getOwnPropertyNames()did not see unresolved properties ofErrorobjects has been fixed (bug 724768).
参阅:
Firefox 27
EcmaScript 2015 implementation continues!
- The spread operator is now supported in Function calls (bug 762363).
- The mathematical function
Math.hypot()has been implemented (bug 896264). - The
yield*expression is now implemented (bug 666396). - The
MapIterator,SetIteratorandArrayIteratorobjects now match the specification (bug 881226). - for..of loops now expect the ES2015 standard iterator protocol moving away from SpiderMonkey old iterator protocol using
StopIteration. String.matchandString.replacenow resetRegExp.lastIndex(bug 501739).
参阅:
Firefox 26
EcmaScript 2015 implementation continues!
- The ECMAScript 2015 compliant syntax for Generators (yield) has been implemented (bug 666399).
- Generator/Iterator results are now boxed like
{ value: foo, done: bool }(bug 907744). - New mathematical methods have been implemented on
Math:Math.fround()(bug 900125). - The reserved words cannot be used for function names:such a usage now throws a
SyntaxError(bug 907958). - The default parameter syntax has been updated to allow parameters without defaults after default parameters, such as
function f(x=1, y). See bug 777060. GeneratorFunctionis implemented (bug 904701).
参阅:
Firefox 25
EcmaScript 2015 implementation continues!
- The method
Array.of()is now implemented onArray(bug 866849). - Support for the methods
Array.prototype.find()andArray.prototype.findIndex()has been added (bug 885553). - The methods
Number.parseInt()andNumber.parseFloat()have been implemented (bug 886949) - The methods
Map.prototype.forEach()andSet.prototype.forEach()are now implemented (bug 866847). - New mathematical methods have been implemented on
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()andMath.cbrt()(bug 717379). - Support for binary and octal integer literals has been added:
0b10101010,0B1010,0o777,0O237are now valid (bug 894026). - The machine epsilon constant, that is the smallest representible number that added to 1 will not be 1, is now available as
Number.EPSILON(bug 885798). - Typed arrays have been updated to no longer search in the prototype chain for indexed properties (bug 829896).
参阅:
Firefox 24
- Arrow functions are no longer automatically in strict mode unless explicitly requested with
"use strict"(bug 852762). - The
String.prototype.repeatJS method has been implemented (bug 815431). - The
Set.prototype.values(),Set.prototype.keys()andSet.prototype.entries()methods onSetobjects have been implemented (bug 869996).
参阅:
Firefox 23
- The
Object.definePropertymethod can now be used to redefine thelengthproperty of anArrayobject. - The option to disable JavaScript, including the options to allow moving windows/replace context menu, have been removed. You may still disable JavaScript by double clicking the "javascript.enabled" option in about:config.
参阅:
Firefox 22
- Asm.js optimizations are enabled, making it possible to compile C/C++ applications to a subset of JavaScript for better performance.
- ES2015 Arrow Function syntax has been implemented (bug 846406).
- The new Object.is function has been added (bug 839979).
argumentsin generator expressions is now inherited from enclosing lexical scope (bug 848051).- The ES2015 Proxy
preventExtensionstrap have been implemented (bug 789897).
参阅:
Firefox 21
- E4X, an ancient JavaScript extension, has been removed. Implemented only in Gecko, it never got significant traction (bug 788293).
- parseInt no longer treats strings with leading "0" as octal (bug 786135).
参阅:
Firefox 20
- Support for the
Weakmap.prototype.clear()method, recently added to the Harmony (EcmaScript 2015) draft proposal has been added (bug 814562). - Support for the
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). - Web apps using draggable text with Kinetic 3.x are working, even when using the Cairo canvas backend (bug 835064).
- The
for each…instatement has been deprecated and should not be used. Consider using the newfor…ofstatement (bug 804834). - Support for the
Map.prototype.keys(),Map.prototype.values(), andMap.prototype.entries()has been added (bug 817368).
参阅:
Firefox 19
MapandSetobjects have changed from having asize()method to asizeproperty (bug 807001)MapandSetobjects also have a clear() method now. (bug 805003)
参阅:
Firefox 18
- Harmony's (ECMAScript 2015) Direct Proxies have been landed (bug 703537). Warning: the implementation contains a couple of known bugs, missing features and misalignements with the current state of the spec. Do not rely on it for production code.
- The ECMAScript 2015
contains()method is now implemented on strings. This is unfortunately not compatible with Mootools 1.2, which expects different behavior fromcontains()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.
参阅:
Firefox 17
Stringobject now offers HarmonystartsWith,endsWith, andcontainsmethods (bug 772733).- The String methods link and anchor now escape the
'"'(quotation mark) (bug 352437). - Experimental support for strawman
ParallelArrayobject has been implemented (bug 778559). - Support to iterate
Map/Set(bug 725909). - Disabled E4X for web content by default (bug 778851).
__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..ofloops now work in terms of.iterator()and.next()(bug 725907).
参阅:
Firefox 16
Numberobjects now offerisFinite(),toInteger(), andisInteger()methods. (bug 761480, bug 761495)- The Harmony spread operator is now supported in
Arrayinitializers (bug 574130). Note it is not yet supported in calls (bug 762363). - The experimental
TypedArray.prototype.move()method has been added (available in Aurora and Nightly channels only) (bug 730873).
参阅:
Firefox 15
- Support for the
DataViewinterface from the Typed Arrays specification has been added. This provides low-level access to the data contained in anArrayBuffer. - Support for new ECMAScript 2015 built-ins:
Number.isNaN(),Number.toInteger(),Number.isInteger(),Number.isFinite()has been added. (bug 749818, bug 761495, bug 761480). - Support for ECMAScript 2015 default parameters has been added. (bug 757676).
- Support for ECMAScript 2015 rest parameters has been added. (bug 574132).
参阅:
Firefox 14
No change.
参阅:
Firefox 13
参阅:
Firefox 12
- Support for sharp variables (a Netscape non-standard extension) has been dropped.
ArrayBuffer.prototype.slice()has been implemented.
参阅:
Firefox 11
No change.
参阅:
Firefox 10
- The method
WeakMap.set()now returnsundefined, instead of itself. - A bug was introduced in regular expression handling in Firefox 7; this has been fixed. See bug 683838 if you want the gory details.
- You can no longer use E4X syntax while in ECMAScript 5 strict mode (that is, after
"use strict;").
参阅:
Firefox 9
No change.
参阅:
Firefox 8
RegExp.exec()andRegExp.test()called with no arguments now match against the string "undefined".String.search()andString.match()called with no arguments orundefinednow match against the empty string and thus match every string.- Support for watchlists has been implemented with the new (non-standard)
watch()andunwatch()methods.
参阅:
Firefox 7
- The
Function.arityproperty has been removed; useFunction.lengthinstead.
参阅:
Firefox 6
- In the past, it was possible to use the
newoperator 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 thenewoperator in this way was never officially supported and was not widely done, so it's unlikely that this change affects you. - ECMAScript 2015 WeakMaps have been added as a prototype implementation.
参阅:
Firefox 5
- Regular expressions are no longer callable as if they were functions; this change has been made in concert with the WebKit team to ensure compatibility (see WebKit bug 28285. This feature had existed for a long time but was never documented (at least, not here on MDC).
- The
Function.prototype.isGenerator()method is now supported; this lets you determine if a function is a generator. - The following reserved words were previously only treated as reserved when in strict mode; now they're always treated as reserved:
class,enum,export,extends,import, andsuper. - DOM documents created in chrome code may no longer be exposed to sandboxed scripts.
- The JSON parser has been re-written for improved speed and compliance. This includes a fix for bug 572279.
参阅:
更早版本
对于Firefox 5之前版本,请查看 old JavaScript versions。