diff --git a/bench/tests/ECMA-262 b/bench/tests/ECMA-262 index 31097fd..dbe7255 100644 --- a/bench/tests/ECMA-262 +++ b/bench/tests/ECMA-262 @@ -1,4 +1,4 @@ -
+ @@ -57,8 +57,8 @@
This specification is developed on GitHub with the help of the -ECMAScript community. There are a number of ways to contribute to the +
This specification is developed on GitHub with the help of the +ECMAScript community. There are a number of ways to contribute to the development of this specification:
This Ecma Standard defines the ECMAScript 2019 Language. It is the -tenth edition of the ECMAScript Language Specification. Since +
This Ecma Standard defines the ECMAScript 2019 Language. It is the +tenth edition of the ECMAScript Language Specification. Since publication of the first edition in 1997, ECMAScript has grown to be one - of the world's most widely used general-purpose programming languages. -It is best known as the language embedded in web browsers but has also + of the world's most widely used general-purpose programming languages. +It is best known as the language embedded in web browsers but has also been widely adopted for server and embedded applications.
-ECMAScript is based on several originating technologies, the most -well-known being JavaScript (Netscape) and JScript (Microsoft). The -language was invented by Brendan Eich at Netscape and first appeared in -that company's Navigator 2.0 browser. It has appeared in all subsequent -browsers from Netscape and in all browsers from Microsoft starting with +
ECMAScript is based on several originating technologies, the most +well-known being JavaScript (Netscape) and JScript (Microsoft). The +language was invented by Brendan Eich at Netscape and first appeared in +that company's Navigator 2.0 browser. It has appeared in all subsequent +browsers from Netscape and in all browsers from Microsoft starting with Internet Explorer 3.0.
The development of the ECMAScript Language Specification started in - November 1996. The first edition of this Ecma Standard was adopted by + November 1996. The first edition of this Ecma Standard was adopted by the Ecma General Assembly of June 1997.
-That Ecma Standard was submitted to ISO/IEC JTC 1 for adoption -under the fast-track procedure, and approved as international standard -ISO/IEC 16262, in April 1998. The Ecma General Assembly of June 1998 -approved the second edition of ECMA-262 to keep it fully aligned with -ISO/IEC 16262. Changes between the first and the second edition are +
That Ecma Standard was submitted to ISO/IEC JTC 1 for adoption +under the fast-track procedure, and approved as international standard +ISO/IEC 16262, in April 1998. The Ecma General Assembly of June 1998 +approved the second edition of ECMA-262 to keep it fully aligned with +ISO/IEC 16262. Changes between the first and the second edition are editorial in nature.
-The third edition of the Standard introduced powerful regular -expressions, better string handling, new control statements, try/catch +
The third edition of the Standard introduced powerful regular +expressions, better string handling, new control statements, try/catch exception handling, tighter definition of errors, formatting for numeric output and minor changes in anticipation of future language growth. The - third edition of the ECMAScript standard was adopted by the Ecma + third edition of the ECMAScript standard was adopted by the Ecma General Assembly of December 1999 and published as ISO/IEC 16262:2002 in June 2002.
After publication of the third edition, ECMAScript achieved massive adoption in conjunction with the World Wide Web where it has become the programming language that is supported by essentially all web browsers. - Significant work was done to develop a fourth edition of ECMAScript. -However, that work was not completed and not published as the fourth -edition of ECMAScript but some of it was incorporated into the + Significant work was done to develop a fourth edition of ECMAScript. +However, that work was not completed and not published as the fourth +edition of ECMAScript but some of it was incorporated into the development of the sixth edition.
The fifth edition of ECMAScript (published as ECMA-262 5th - edition) codified de facto interpretations of the language -specification that have become common among browser implementations and + edition) codified de facto interpretations of the language +specification that have become common among browser implementations and added support for new features that had emerged since the publication of - the third edition. Such features include accessor properties, -reflective creation and inspection of objects, program control of -property attributes, additional array manipulation functions, support -for the JSON object encoding format, and a strict mode that provides -enhanced error checking and program security. The fifth edition was + the third edition. Such features include accessor properties, +reflective creation and inspection of objects, program control of +property attributes, additional array manipulation functions, support +for the JSON object encoding format, and a strict mode that provides +enhanced error checking and program security. The fifth edition was adopted by the Ecma General Assembly of December 2009.
The fifth edition was submitted to ISO/IEC JTC 1 for adoption under - the fast-track procedure, and approved as international standard -ISO/IEC 16262:2011. Edition 5.1 of the ECMAScript Standard incorporated -minor corrections and is the same text as ISO/IEC 16262:2011. The 5.1 + the fast-track procedure, and approved as international standard +ISO/IEC 16262:2011. Edition 5.1 of the ECMAScript Standard incorporated +minor corrections and is the same text as ISO/IEC 16262:2011. The 5.1 Edition was adopted by the Ecma General Assembly of June 2011.
-Focused development of the sixth edition started in 2009, as the -fifth edition was being prepared for publication. However, this was -preceded by significant experimentation and language enhancement design -efforts dating to the publication of the third edition in 1999. In a -very real sense, the completion of the sixth edition is the culmination +
Focused development of the sixth edition started in 2009, as the +fifth edition was being prepared for publication. However, this was +preceded by significant experimentation and language enhancement design +efforts dating to the publication of the third edition in 1999. In a +very real sense, the completion of the sixth edition is the culmination of a fifteen year effort. The goals for this addition included providing better support for large applications, library creation, and for use of - ECMAScript as a compilation target for other languages. Some of its -major enhancements included modules, class declarations, lexical block -scoping, iterators and generators, promises for asynchronous -programming, destructuring patterns, and proper tail calls. The -ECMAScript library of built-ins was expanded to support additional data -abstractions including maps, sets, and arrays of binary numeric values -as well as additional support for Unicode supplemental characters in + ECMAScript as a compilation target for other languages. Some of its +major enhancements included modules, class declarations, lexical block +scoping, iterators and generators, promises for asynchronous +programming, destructuring patterns, and proper tail calls. The +ECMAScript library of built-ins was expanded to support additional data +abstractions including maps, sets, and arrays of binary numeric values +as well as additional support for Unicode supplemental characters in strings and regular expressions. The built-ins were also made extensible via subclassing. The sixth edition provides the foundation for regular, - incremental language and library enhancements. The sixth edition was + incremental language and library enhancements. The sixth edition was adopted by the General Assembly of June 2015.
-ECMAScript 2016 was the first ECMAScript edition released under -Ecma TC39's new yearly release cadence and open development process. A -plain-text source document was built from the ECMAScript 2015 source -document to serve as the base for further development entirely on -GitHub. Over the year of this standard's development, hundreds of pull -requests and issues were filed representing thousands of bug fixes, -editorial fixes and other improvements. Additionally, numerous software -tools were developed to aid in this effort including Ecmarkup, -Ecmarkdown, and Grammarkdown. ES2016 also included support for a new +
ECMAScript 2016 was the first ECMAScript edition released under
+Ecma TC39's new yearly release cadence and open development process. A
+plain-text source document was built from the ECMAScript 2015 source
+document to serve as the base for further development entirely on
+GitHub. Over the year of this standard's development, hundreds of pull
+requests and issues were filed representing thousands of bug fixes,
+editorial fixes and other improvements. Additionally, numerous software
+tools were developed to aid in this effort including Ecmarkup,
+Ecmarkdown, and Grammarkdown. ES2016 also included support for a new
exponentiation operator and adds a new method to Array.prototype called includes
.
ECMAScript 2017 introduced Async Functions, Shared Memory, and +
ECMAScript 2017 introduced Async Functions, Shared Memory, and
Atomics along with smaller language and library enhancements, bug fixes,
- and editorial updates. Async functions improve the asynchronous
-programming experience by providing syntax for promise-returning
+ and editorial updates. Async functions improve the asynchronous
+programming experience by providing syntax for promise-returning
functions. Shared Memory and Atomics introduce a new Object.values
, Object.entries
, and Object.getOwnPropertyDescriptors
.
ECMAScript 2018 introduced support for asynchronous iteration via -the AsyncIterator protocol and async generators. It also included four -new regular expression features: the dotAll flag, named capture groups, +
ECMAScript 2018 introduced support for asynchronous iteration via +the AsyncIterator protocol and async generators. It also included four +new regular expression features: the dotAll flag, named capture groups, Unicode property escapes, and look-behind assertions. Lastly it included rest parameter and spread operator support for object properties.
This specification, the 10th edition, introduces a few new built-in functions: flat
and flatMap
on Array.prototype
for flattening arrays, Object.fromEntries
for directly turning the return value of Object.entries
into a new Object, and trimStart
and trimEnd
on String.prototype
as better-named alternatives to the widely implemented but non-standard String.prototype.trimLeft
and trimRight
built-ins. In addition, this specification includes a few minor updates
to syntax and semantics. Updated syntax includes optional catch binding
- parameters and allowing U+2028 (LINE SEPARATOR) and U+2029 (PARAGRAPH
-SEPARATOR) in string literals to align with JSON. Other updates include
+ parameters and allowing U+2028 (LINE SEPARATOR) and U+2029 (PARAGRAPH
+SEPARATOR) in string literals to align with JSON. Other updates include
requiring that Array.prototype.sort
be a stable sort, requiring that JSON.stringify return well-formed UTF-8 regardless of input, and clarifying Function.prototype.toString
by requiring that it either return the corresponding original source text or a standard placeholder.
Dozens of individuals representing many organizations have made -very significant contributions within Ecma TC39 to the development of +
Dozens of individuals representing many organizations have made +very significant contributions within Ecma TC39 to the development of this edition and to the prior editions. In addition, a vibrant community - has emerged supporting TC39's ECMAScript efforts. This community has -reviewed numerous drafts, filed thousands of bug reports, performed -implementation experiments, contributed test suites, and educated the -world-wide developer community about ECMAScript. Unfortunately, it is + has emerged supporting TC39's ECMAScript efforts. This community has +reviewed numerous drafts, filed thousands of bug reports, performed +implementation experiments, contributed test suites, and educated the +world-wide developer community about ECMAScript. Unfortunately, it is impossible to identify and acknowledge every person and organization who has contributed to this effort.
Allen Wirfs-Brock
ECMA-262, Project Editor, 6th Edition
-
+
Brian Terlson
ECMA-262, Project Editor, 7th through 10th Editions
-
+
A conforming implementation of ECMAScript must provide and support -all the types, values, objects, properties, functions, and program +
A conforming implementation of ECMAScript must provide and support +all the types, values, objects, properties, functions, and program syntax and semantics described in this specification.
-A conforming implementation of ECMAScript must interpret source -text input in conformance with the latest version of the Unicode +
A conforming implementation of ECMAScript must interpret source +text input in conformance with the latest version of the Unicode Standard and ISO/IEC 10646.
-A conforming implementation of ECMAScript that provides an +
A conforming implementation of ECMAScript that provides an application programming interface (API) that supports programs that need - to adapt to the linguistic and cultural conventions used by different -human languages and countries must implement the interface defined by -the most recent edition of ECMA-402 that is compatible with this + to adapt to the linguistic and cultural conventions used by different +human languages and countries must implement the interface defined by +the most recent edition of ECMA-402 that is compatible with this specification.
-A conforming implementation of ECMAScript may provide additional +
A conforming implementation of ECMAScript may provide additional types, values, objects, properties, and functions beyond those described - in this specification. In particular, a conforming implementation of -ECMAScript may provide properties not described in this specification, -and values for those properties, for objects that are described in this + in this specification. In particular, a conforming implementation of +ECMAScript may provide properties not described in this specification, +and values for those properties, for objects that are described in this specification.
-A conforming implementation of ECMAScript may support program and -regular expression syntax not described in this specification. In -particular, a conforming implementation of ECMAScript may support -program syntax that makes use of the “future reserved words” listed in +
A conforming implementation of ECMAScript may support program and
+regular expression syntax not described in this specification. In
+particular, a conforming implementation of ECMAScript may support
+program syntax that makes use of the “future reserved words” listed in
subclause
A conforming implementation of ECMAScript must not implement any +
A conforming implementation of ECMAScript must not implement any
extension that is listed as a Forbidden Extension in subclause
The following referenced documents are indispensable for the -application of this document. For dated references, only the edition -cited applies. For undated references, the latest edition of the +
The following referenced documents are indispensable for the +application of this document. For dated references, only the edition +cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.
ISO/IEC 10646 Information Technology – Universal Multiple-Octet - Coded Character Set (UCS) plus Amendment 1:2005, Amendment 2:2006, + Coded Character Set (UCS) plus Amendment 1:2005, Amendment 2:2006, Amendment 3:2008, and Amendment 4:2008, plus additional amendments and corrigenda, or successor
ECMA-402, ECMAScript 2015 Internationalization API Specification.
-
+
https://ecma-international.org/publications/standards/Ecma-402.htm
ECMA-404, The JSON Data Interchange Format.
-
+
https://ecma-international.org/publications/standards/Ecma-404.htm
This section contains a non-normative overview of the ECMAScript language.
-ECMAScript is an object-oriented programming language for -performing computations and manipulating computational objects within a -host environment. ECMAScript as defined here is not intended to be +
ECMAScript is an object-oriented programming language for +performing computations and manipulating computational objects within a +host environment. ECMAScript as defined here is not intended to be computationally self-sufficient; indeed, there are no provisions in this specification for input of external data or output of computed results. - Instead, it is expected that the computational environment of an -ECMAScript program will provide not only the objects and other -facilities described in this specification but also certain + Instead, it is expected that the computational environment of an +ECMAScript program will provide not only the objects and other +facilities described in this specification but also certain environment-specific objects, whose description and behaviour are beyond - the scope of this specification except to indicate that they may -provide certain properties that can be accessed and certain functions + the scope of this specification except to indicate that they may +provide certain properties that can be accessed and certain functions that can be called from an ECMAScript program.
-ECMAScript was originally designed to be used as a scripting -language, but has become widely used as a general-purpose programming -language. A scripting language is a programming language that -is used to manipulate, customize, and automate the facilities of an -existing system. In such systems, useful functionality is already -available through a user interface, and the scripting language is a -mechanism for exposing that functionality to program control. In this -way, the existing system is said to provide a host environment of -objects and facilities, which completes the capabilities of the -scripting language. A scripting language is intended for use by both +
ECMAScript was originally designed to be used as a scripting +language, but has become widely used as a general-purpose programming +language. A scripting language is a programming language that +is used to manipulate, customize, and automate the facilities of an +existing system. In such systems, useful functionality is already +available through a user interface, and the scripting language is a +mechanism for exposing that functionality to program control. In this +way, the existing system is said to provide a host environment of +objects and facilities, which completes the capabilities of the +scripting language. A scripting language is intended for use by both professional and non-professional programmers.
ECMAScript was originally designed to be a Web scripting language, - providing a mechanism to enliven Web pages in browsers and to perform -server computation as part of a Web-based client-server architecture. -ECMAScript is now used to provide core scripting capabilities for a -variety of host environments. Therefore the core language is specified + providing a mechanism to enliven Web pages in browsers and to perform +server computation as part of a Web-based client-server architecture. +ECMAScript is now used to provide core scripting capabilities for a +variety of host environments. Therefore the core language is specified in this document apart from any particular host environment.
-ECMAScript usage has moved beyond simple scripting and it is now -used for the full spectrum of programming tasks in many different +
ECMAScript usage has moved beyond simple scripting and it is now +used for the full spectrum of programming tasks in many different environments and scales. As the usage of ECMAScript has expanded, so has - the features and facilities it provides. ECMAScript is now a fully + the features and facilities it provides. ECMAScript is now a fully featured general-purpose programming language.
-Some of the facilities of ECMAScript are similar to those used in +
Some of the facilities of ECMAScript are similar to those used in other programming languages; in particular C, Java™, Self, and Scheme as described in:
ISO/IEC 9899:1996, Programming Languages – C.
@@ -303,21 +303,21 @@ other programming languages; in particular C, Java™, Self, and Scheme asA web browser provides an ECMAScript host environment for -client-side computation including, for instance, objects that represent -windows, menus, pop-ups, dialog boxes, text areas, anchors, frames, -history, cookies, and input/output. Further, the host environment -provides a means to attach scripting code to events such as change of -focus, page and image loading, unloading, error and abort, selection, -form submission, and mouse actions. Scripting code appears within the -HTML and the displayed page is a combination of user interface elements -and fixed and computed text and images. The scripting code is reactive +
A web browser provides an ECMAScript host environment for +client-side computation including, for instance, objects that represent +windows, menus, pop-ups, dialog boxes, text areas, anchors, frames, +history, cookies, and input/output. Further, the host environment +provides a means to attach scripting code to events such as change of +focus, page and image loading, unloading, error and abort, selection, +form submission, and mouse actions. Scripting code appears within the +HTML and the displayed page is a combination of user interface elements +and fixed and computed text and images. The scripting code is reactive to user interaction, and there is no need for a main program.
-A web server provides a different host environment for -server-side computation including objects representing requests, -clients, and files; and mechanisms to lock and share data. By using -browser-side and server-side scripting together, it is possible to -distribute computation between the client and server while providing a +
A web server provides a different host environment for +server-side computation including objects representing requests, +clients, and files; and mechanisms to lock and share data. By using +browser-side and server-side scripting together, it is possible to +distribute computation between the client and server while providing a customized user interface for a Web-based application.
Each Web browser and server that supports ECMAScript supplies its own host environment, completing the ECMAScript execution environment.
@@ -326,108 +326,108 @@ customized user interface for a Web-based application.The following is an informal overview of ECMAScript—not all parts - of the language are described. This overview is not part of the + of the language are described. This overview is not part of the standard proper.
-ECMAScript is object-based: basic language and host facilities -are provided by objects, and an ECMAScript program is a cluster of +
ECMAScript is object-based: basic language and host facilities
+are provided by objects, and an ECMAScript program is a cluster of
communicating objects. In ECMAScript, an object is a collection of zero or more properties each with attributes that determine how each property can be used—for example, when the Writable attribute for a property is set to
ECMAScript defines a collection of built-in objects that round out the definition of ECMAScript entities. These built-in objects include the Object
, Function
, Boolean
, Symbol
, and various Error
objects; objects that represent and manipulate numeric values including Math
, Number
, and Date
; the text processing objects String
and RegExp
; objects that are indexed collections of values including Array
- and nine different kinds of Typed Arrays whose elements all have a
+ and nine different kinds of Typed Arrays whose elements all have a
specific numeric data representation; keyed collections including Map
and Set
objects; objects supporting structured data including the JSON
object, ArrayBuffer
, SharedArrayBuffer
, and DataView
; objects supporting control abstractions including generator functions and Promise
objects; and reflection objects including Proxy
and Reflect
.
ECMAScript also defines a set of built-in operators. -ECMAScript operators include various unary operations, multiplicative -operators, additive operators, bitwise shift operators, relational -operators, equality operators, binary bitwise operators, binary logical +
ECMAScript also defines a set of built-in operators. +ECMAScript operators include various unary operations, multiplicative +operators, additive operators, bitwise shift operators, relational +operators, equality operators, binary bitwise operators, binary logical operators, assignment operators, and the comma operator.
-Large ECMAScript programs are supported by modules -which allow a program to be divided into multiple sequences of -statements and declarations. Each module explicitly identifies +
Large ECMAScript programs are supported by modules +which allow a program to be divided into multiple sequences of +statements and declarations. Each module explicitly identifies declarations it uses that need to be provided by other modules and which of its declarations are available for use by other modules.
ECMAScript syntax intentionally resembles Java syntax. ECMAScript - syntax is relaxed to enable it to serve as an easy-to-use scripting -language. For example, a variable is not required to have its type + syntax is relaxed to enable it to serve as an easy-to-use scripting +language. For example, a variable is not required to have its type declared nor are types associated with properties, and defined functions - are not required to have their declarations appear textually before + are not required to have their declarations appear textually before calls to them.
Even though ECMAScript includes syntax for class definitions, -ECMAScript objects are not fundamentally class-based such as those in -C++, Smalltalk, or Java. Instead objects may be created in various ways -including via a literal notation or via constructors which -create objects and then execute code that initializes all or part of +
Even though ECMAScript includes syntax for class definitions,
+ECMAScript objects are not fundamentally class-based such as those in
+C++, Smalltalk, or Java. Instead objects may be created in various ways
+including via a literal notation or via constructors which
+create objects and then execute code that initializes all or part of
them by assigning initial values to their properties. Each "prototype"
that is used to implement prototype-based inheritance and shared properties. Objects are created by using constructors in new expressions; for example, new Date(2009, 11)
creates a new Date object. Invoking a Date()
produces a string representation of the current date and time rather than an object.
Every object created by a "prototype"
property. Furthermore, a prototype may have a non-null implicit reference to its prototype, and so on; this is called the prototype chain.
- When a reference is made to a property in an object, that reference is
-to the property of that name in the first object in the prototype chain
-that contains a property of that name. In other words, first the object
-mentioned directly is examined for such a property; if that object
+ When a reference is made to a property in an object, that reference is
+to the property of that name in the first object in the prototype chain
+that contains a property of that name. In other words, first the object
+mentioned directly is examined for such a property; if that object
contains the named property, that is the property to which the reference
- refers; if that object does not contain the named property, the
+ refers; if that object does not contain the named property, the
prototype for that object is examined next; and so on.
In a class-based object-oriented language, in general, state is - carried by instances, methods are carried by classes, and inheritance + carried by instances, methods are carried by classes, and inheritance is only of structure and behaviour. In ECMAScript, the state and methods - are carried by objects, while structure, behaviour, and state are all + are carried by objects, while structure, behaviour, and state are all inherited.
-All objects that do not directly contain a particular property +
All objects that do not directly contain a particular property that their prototype contains share that property and its value. Figure 1 illustrates this:
CF is a new
expressions: cf1, cf2, cf3, cf4, and cf5. Each of these objects contains properties named q1
and q2
. The dashed lines represent the implicit prototype relationship; so, for example, cf3's prototype is CFp. The P1
and P2
, which are not visible to CFp, cf1, cf2, cf3, cf4, or cf5. The property named CFP1
in CFp is shared by cf1, cf2, cf3, cf4, and cf5 (but not by CF), as are any properties found in CFp's implicit prototype chain that are not named q1
, q2
, or CFP1
. Notice that there is no implicit prototype link between CF and CFp.
Unlike most class-based object languages, properties can be -added to objects dynamically by assigning values to them. That is, -constructors are not required to name or assign values to all or any of +
Unlike most class-based object languages, properties can be +added to objects dynamically by assigning values to them. That is, +constructors are not required to name or assign values to all or any of the constructed object's properties. In the above diagram, one could add a new shared property for cf1, cf2, cf3, cf4, and cf5 by assigning a new value to the property in CFp.
-Although ECMAScript objects are not inherently class-based, it -is often convenient to define class-like abstractions based upon a +
Although ECMAScript objects are not inherently class-based, it
+is often convenient to define class-like abstractions based upon a
common pattern of
The ECMAScript Language recognizes the possibility that some -users of the language may wish to restrict their usage of some features -available in the language. They might do so in the interests of +
The ECMAScript Language recognizes the possibility that some +users of the language may wish to restrict their usage of some features +available in the language. They might do so in the interests of security, to avoid what they consider to be error-prone features, to get - enhanced error checking, or for other reasons of their choosing. In -support of this possibility, ECMAScript defines a strict variant of the -language. The strict variant of the language excludes some specific -syntactic and semantic features of the regular ECMAScript language and -modifies the detailed semantics of some features. The strict variant -also specifies additional error conditions that must be reported by + enhanced error checking, or for other reasons of their choosing. In +support of this possibility, ECMAScript defines a strict variant of the +language. The strict variant of the language excludes some specific +syntactic and semantic features of the regular ECMAScript language and +modifies the detailed semantics of some features. The strict variant +also specifies additional error conditions that must be reported by throwing error exceptions in situations that are not specified as errors by the non-strict form of the language.
The strict variant of ECMAScript is commonly referred to as the strict mode - of the language. Strict mode selection and use of the strict mode -syntax and semantics of ECMAScript is explicitly made at the level of + of the language. Strict mode selection and use of the strict mode +syntax and semantics of ECMAScript is explicitly made at the level of individual ECMAScript source text units. Because strict mode is selected - at the level of a syntactic source text unit, strict mode only imposes -restrictions that have local effect within such a source text unit. -Strict mode does not restrict or modify any aspect of the ECMAScript -semantics that must operate consistently across multiple source text + at the level of a syntactic source text unit, strict mode only imposes +restrictions that have local effect within such a source text unit. +Strict mode does not restrict or modify any aspect of the ECMAScript +semantics that must operate consistently across multiple source text units. A complete ECMAScript program may be composed of both strict mode - and non-strict mode ECMAScript source text units. In this case, strict -mode only applies when actually executing code that is defined within a + and non-strict mode ECMAScript source text units. In this case, strict +mode only applies when actually executing code that is defined within a strict mode source text unit.
-In order to conform to this specification, an ECMAScript -implementation must implement both the full unrestricted ECMAScript +
In order to conform to this specification, an ECMAScript +implementation must implement both the full unrestricted ECMAScript language and the strict variant of the ECMAScript language as defined by - this specification. In addition, an implementation must support the -combination of unrestricted and strict mode source text units into a + this specification. In addition, an implementation must support the +combination of unrestricted and strict mode source text units into a single composite program.
object that provides shared properties for other objects
When a prototype
property for the purpose of resolving property references. The prototype
property can be referenced by the program expression constructor.prototype
,
- and properties added to an object's prototype are shared, through
-inheritance, by all objects sharing the prototype. Alternatively, a new
-object may be created with an explicitly specified prototype by using
+ and properties added to an object's prototype are shared, through
+inheritance, by all objects sharing the prototype. Alternatively, a new
+object may be created with an explicitly specified prototype by using
the Object.create
built-in function.
Object.create
built-in function.
object specified and supplied by an ECMAScript implementation
Standard built-in objects are defined in this specification. -An ECMAScript implementation may specify and supply additional kinds of +
Standard built-in objects are defined in this specification.
+An ECMAScript implementation may specify and supply additional kinds of
built-in objects. A built-in
Boolean
A Boolean object is created by using the Boolean
new
- expression, supplying a Boolean value as an argument. The resulting
-object has an internal slot whose value is the Boolean value. A Boolean
+ expression, supplying a Boolean value as an argument. The resulting
+object has an internal slot whose value is the Boolean value. A Boolean
object can be coerced to a Boolean value.
primitive value that is a finite ordered sequence of zero or more 16-bit unsigned integer values
A String value is a member of the String type. Each integer -value in the sequence usually represents a single 16-bit unit of UTF-16 -text. However, ECMAScript does not place any restrictions or -requirements on the values except that they must be 16-bit unsigned +
A String value is a member of the String type. Each integer +value in the sequence usually represents a single 16-bit unit of UTF-16 +text. However, ECMAScript does not place any restrictions or +requirements on the values except that they must be 16-bit unsigned integers.
member of the Object type that is an instance of the standard built-in String
A String object is created by using the String
new
- expression, supplying a String value as an argument. The resulting
-object has an internal slot whose value is the String value. A String
+ expression, supplying a String value as an argument. The resulting
+object has an internal slot whose value is the String value. A String
object can be coerced to a String value by calling the String
String
Number
A Number object is created by using the Number
new
- expression, supplying a number value as an argument. The resulting
-object has an internal slot whose value is the number value. A Number
+ expression, supplying a number value as an argument. The resulting
+object has an internal slot whose value is the number value. A Number
object can be coerced to a number value by calling the Number
Number
part of an object that associates a key (either a String value or a Symbol value) and a value
Depending upon the form of the property the value may be -represented either directly as a data value (a primitive value, an +
Depending upon the form of the property the value may be
+represented either directly as a data value (a primitive value, an
object, or a
method that is a built-in function
Standard built-in methods are defined in this specification, -and an ECMAScript implementation may specify and provide other +
Standard built-in methods are defined in this specification, +and an ECMAScript implementation may specify and provide other additional built-in methods.
The remainder of this specification is organized as follows:
Clause 5 defines the notational conventions used throughout the specification.
Clauses 6-9 define the execution environment within which ECMAScript programs operate.
-Clauses 10-16 define the actual ECMAScript programming language -including its syntactic encoding and the execution semantics of all +
Clauses 10-16 define the actual ECMAScript programming language +including its syntactic encoding and the execution semantics of all language features.
-Clauses 17-26 define the ECMAScript standard library. They -include the definitions of all of the standard objects that are +
Clauses 17-26 define the ECMAScript standard library. They +include the definitions of all of the standard objects that are available for use by ECMAScript programs as they execute.
-Clause 27 describes the memory consistency model of accesses on +
Clause 27 describes the memory consistency model of accesses on SharedArrayBuffer-backed memory and methods of the Atomics object.
@@ -715,26 +715,26 @@ SharedArrayBuffer-backed memory and methods of the Atomics object.A context-free grammar consists of a number of productions. Each production has an abstract symbol called a nonterminal as its left-hand side, and a sequence of zero or more nonterminal and terminal symbols as its right-hand side. For each grammar, the terminal symbols are drawn from a specified alphabet.
A chain production is a production that has exactly one nonterminal symbol on its right-hand side along with zero or more terminal symbols.
Starting from a sentence consisting of a single distinguished nonterminal, called the goal symbol, a given context-free grammar specifies a language, - namely, the (perhaps infinite) set of possible sequences of terminal + namely, the (perhaps infinite) set of possible sequences of terminal symbols that can result from repeatedly replacing any nonterminal in the - sequence with a right-hand side of a production for which the + sequence with a right-hand side of a production for which the nonterminal is the left-hand side.
A lexical grammar for ECMAScript is given in clause
Input elements other than white space and comments form the +
Input elements other than white space and comments form the
terminal symbols for the syntactic grammar for ECMAScript and are called
- ECMAScript tokens. These tokens are the reserved words,
-identifiers, literals, and punctuators of the ECMAScript language.
-Moreover, line terminators, although not considered to be tokens, also
-become part of the stream of input elements and guide the process of
+ ECMAScript tokens. These tokens are the reserved words,
+identifiers, literals, and punctuators of the ECMAScript language.
+Moreover, line terminators, although not considered to be tokens, also
+become part of the stream of input elements and guide the process of
automatic semicolon insertion (/*
…*/
regardless of whether it spans more than one line) is likewise simply discarded if it contains no line terminator; but if a
A RegExp grammar for ECMAScript is given in
Productions of the lexical and RegExp grammars are distinguished by having two colons “::” as separating punctuation. The lexical and RegExp grammars share some productions.
@@ -742,37 +742,37 @@ the syntactic grammar.Another grammar is used for translating Strings into numeric -values. This grammar is similar to the part of the lexical grammar +
Another grammar is used for translating Strings into numeric
+values. This grammar is similar to the part of the lexical grammar
having to do with numeric literals and has as its terminal symbols
Productions of the numeric string grammar are distinguished by having three colons “:::” as punctuation.
The syntactic grammar for ECMAScript is given in -clauses 11, 12, 13, 14, and 15. This grammar has ECMAScript tokens +
The syntactic grammar for ECMAScript is given in
+clauses 11, 12, 13, 14, and 15. This grammar has ECMAScript tokens
defined by the lexical grammar as its terminal symbols (
When a stream of code points is to be parsed as an ECMAScript
When a parse is successful, it constructs a parse tree, a rooted tree structure in which each node is a Parse Node. Each Parse Node is an instance
- of a symbol in the grammar; it represents a span of the source text
-that can be derived from that symbol. The root node of the parse tree,
+ of a symbol in the grammar; it represents a span of the source text
+that can be derived from that symbol. The root node of the parse tree,
representing the whole of the source text, is an instance of the parse's
New Parse Nodes are instantiated for each invocation of the -parser and never reused between parses even of identical source text. -Parse Nodes are considered the same Parse Node if and only -if they represent the same span of source text, are instances of the +
New Parse Nodes are instantiated for each invocation of the +parser and never reused between parses even of identical source text. +Parse Nodes are considered the same Parse Node if and only +if they represent the same span of source text, are instances of the same grammar symbol, and resulted from the same parser invocation.
Parsing the same String multiple times will lead to different Parse Nodes, e.g., as occurs in:
@@ -781,15 +781,15 @@ same grammar symbol, and resulted from the same parser invocation.Productions of the syntactic grammar are distinguished by having just one colon “:” as punctuation.
The syntactic grammar as presented in clauses 12, 13, 14 and 15
- is not a complete account of which token sequences are accepted as a
+ is not a complete account of which token sequences are accepted as a
correct ECMAScript
In certain cases, in order to avoid ambiguities, the syntactic +
In certain cases, in order to avoid ambiguities, the syntactic
grammar uses generalized productions that permit token sequences that do
not form a valid ECMAScript
Terminal symbols of the lexical, RegExp, and numeric string grammars are shown in fixed width
- font, both in the productions of the grammars and throughout this
-specification whenever the text directly refers to such a terminal
+ font, both in the productions of the grammars and throughout this
+specification whenever the text directly refers to such a terminal
symbol. These are to appear in a script exactly as written. All terminal
- symbol code points specified in this way are to be understood as the
-appropriate Unicode code points from the Basic Latin range, as opposed
+ symbol code points specified in this way are to be understood as the
+appropriate Unicode code points from the Basic Latin range, as opposed
to any similar-looking code points from other Unicode ranges.
Nonterminal symbols are shown in italic type. The -definition of a nonterminal (also called a “production”) is introduced -by the name of the nonterminal being defined followed by one or more -colons. (The number of colons indicates to which grammar the production -belongs.) One or more alternative right-hand sides for the nonterminal +
Nonterminal symbols are shown in italic type. The +definition of a nonterminal (also called a “production”) is introduced +by the name of the nonterminal being defined followed by one or more +colons. (The number of colons indicates to which grammar the production +belongs.) One or more alternative right-hand sides for the nonterminal then follow on succeeding lines. For example, the syntactic definition:
states that an
The subscripted suffix “opt”, which may appear after - a terminal or nonterminal, indicates an optional symbol. The -alternative containing the optional symbol actually specifies two -right-hand sides, one that omits the optional element and one that + a terminal or nonterminal, indicates an optional symbol. The +alternative containing the optional symbol actually specifies two +right-hand sides, one that omits the optional element and one that includes it. This means that:
so, in this example, the nonterminal
A production may be parameterized by a subscripted annotation of the form “[parameters]”, which may appear as a suffix to the nonterminal symbol defined by the production. “parameters” - may be either a single name or a comma separated list of names. A -parameterized production is shorthand for a set of productions defining -all combinations of the parameter names, preceded by an underscore, + may be either a single name or a comma separated list of names. A +parameterized production is shorthand for a set of productions defining +all combinations of the parameter names, preceded by an underscore, appended to the parameterized nonterminal symbol. This means that:
Multiple parameters produce a combinatory number of -productions, not all of which are necessarily referenced in a complete +
Multiple parameters produce a combinatory number of +productions, not all of which are necessarily referenced in a complete grammar.
References to nonterminals on the right-hand side of a production can also be parameterized. For example:
Prefixing a parameter name with “?” on a right-hand +
Prefixing a parameter name with “?” on a right-hand side nonterminal reference makes that parameter value dependent upon the - occurrence of the parameter name on the reference to the current + occurrence of the parameter name on the reference to the current production's left-hand side symbol. For example:
If a right-hand side alternative is prefixed with +
If a right-hand side alternative is prefixed with “[+parameter]” that alternative is only available if the named parameter - was used in referencing the production's nonterminal symbol. If a -right-hand side alternative is prefixed with “[~parameter]” that + was used in referencing the production's nonterminal symbol. If a +right-hand side alternative is prefixed with “[~parameter]” that alternative is only available if the named parameter was not used in referencing the production's nonterminal symbol. This means that:
When the words “one of” follow the colon(s) in a grammar - definition, they signify that each of the terminal symbols on the -following line or lines is an alternative definition. For example, the + definition, they signify that each of the terminal symbols on the +following line or lines is an alternative definition. For example, the lexical grammar for ECMAScript contains the production:
If the phrase “[empty]” appears as the right-hand side of a -production, it indicates that the production's right-hand side contains +
If the phrase “[empty]” appears as the right-hand side of a +production, it indicates that the production's right-hand side contains no terminals or nonterminals.
-If the phrase “[lookahead ∉ set]” appears in the -right-hand side of a production, it indicates that the production may -not be used if the immediately following input token sequence is a +
If the phrase “[lookahead ∉ set]” appears in the +right-hand side of a production, it indicates that the production may +not be used if the immediately following input token sequence is a member of the given set. The set can be written as - a comma separated list of one or two element terminal sequences + a comma separated list of one or two element terminal sequences enclosed in curly brackets. For convenience, the set can also be written - as a nonterminal, in which case it represents the set of all terminals + as a nonterminal, in which case it represents the set of all terminals to which that nonterminal could expand. If the set consists of a single terminal the phrase “[lookahead ≠ terminal]” may be used.
For example, given the definitions:
matches either the letter n
followed by one or more decimal digits the first of which is even, or a decimal digit not followed by another decimal digit.
Similarly, if the phrase “[lookahead ∈ set]” appears - in the right-hand side of a production, it indicates that the -production may only be used if the immediately following input token + in the right-hand side of a production, it indicates that the +production may only be used if the immediately following input token sequence is a member of the given set. If the set consists of a single terminal the phrase “[lookahead = terminal]” may be used.
If the phrase “[no
indicates that the production may not be used if a throw
token and the
Unless the presence of a
When an alternative in a production of the lexical grammar or -the numeric string grammar appears to be a multi-code point token, it +
When an alternative in a production of the lexical grammar or +the numeric string grammar appears to be a multi-code point token, it represents the sequence of code points that would make up such a token.
The right-hand side of a production may specify that certain expansions are not permitted by using the phrase “but not” and then indicating the expansions to be excluded. For example, the production:
means that the nonterminal
Finally, a few nonterminal symbols are described by a -descriptive phrase in sans-serif type in cases where it would be +
Finally, a few nonterminal symbols are described by a +descriptive phrase in sans-serif type in cases where it would be impractical to list all the alternatives:
The specification often uses a numbered list to specify steps in -an algorithm. These algorithms are used to precisely specify the +
The specification often uses a numbered list to specify steps in +an algorithm. These algorithms are used to precisely specify the required semantics of ECMAScript language constructs. The algorithms are not intended to imply the use of any specific implementation technique. - In practice, there may be more efficient algorithms available to + In practice, there may be more efficient algorithms available to implement a given feature.
-Algorithms may be explicitly parameterized, in which case the -names and usage of the parameters must be provided as part of the +
Algorithms may be explicitly parameterized, in which case the +names and usage of the parameters must be provided as part of the algorithm's definition.
-Algorithm steps may be subdivided into sequential substeps. -Substeps are indented and may themselves be further divided into -indented substeps. Outline numbering conventions are used to identify -substeps with the first level of substeps labelled with lower case -alphabetic characters and the second level of substeps labelled with -lower case roman numerals. If more than three levels are required these +
Algorithm steps may be subdivided into sequential substeps. +Substeps are indented and may themselves be further divided into +indented substeps. Outline numbering conventions are used to identify +substeps with the first level of substeps labelled with lower case +alphabetic characters and the second level of substeps labelled with +lower case roman numerals. If more than three levels are required these rules repeat with the fourth level using numeric labels. For example:
A step or substep may be written as an “if” predicate that -conditions its substeps. In this case, the substeps are only applied if +
A step or substep may be written as an “if” predicate that +conditions its substeps. In this case, the substeps are only applied if the predicate is true. If a step or substep begins with the word “else”, - it is a predicate that is the negation of the preceding “if” predicate + it is a predicate that is the negation of the preceding “if” predicate step at the same level.
A step may specify the iterative application of its substeps.
-A step that begins with “Assert:” asserts -an invariant condition of its algorithm. Such assertions are used to -make explicit algorithmic invariants that would otherwise be implicit. -Such assertions add no additional semantic requirements and hence need -not be checked by an implementation. They are used simply to clarify +
A step that begins with “Assert:” asserts +an invariant condition of its algorithm. Such assertions are used to +make explicit algorithmic invariants that would otherwise be implicit. +Such assertions add no additional semantic requirements and hence need +not be checked by an implementation. They are used simply to clarify algorithms.
Algorithm steps may declare named aliases for any value using the form “Let x be someValue”. These aliases are reference-like in that both x and someValue - refer to the same underlying data and modifications to either are -visible to both. Algorithm steps that want to avoid this reference-like + refer to the same underlying data and modifications to either are +visible to both. Algorithm steps that want to avoid this reference-like behaviour should explicitly make a copy of the right-hand side: “Let x be a copy of someValue” creates a shallow copy of someValue.
Once declared, an alias may be referenced in any subsequent steps and must not be referenced from steps prior to the alias's declaration. @@ -1082,52 +1082,52 @@ behaviour should explicitly make a copy of the right-hand side: “Let xIn order to facilitate their use in multiple parts of this specification, some algorithms, called abstract operations, are named and written in parameterized functional form so that they may be referenced by name from within other algorithms. Abstract operations - are typically referenced using a functional application style such as -OperationName(arg1, arg2). Some abstract -operations are treated as polymorphically dispatched methods of -class-like specification abstractions. Such method-like abstract -operations are typically referenced using a method application style + are typically referenced using a functional application style such as +OperationName(arg1, arg2). Some abstract +operations are treated as polymorphically dispatched methods of +class-like specification abstractions. Such method-like abstract +operations are typically referenced using a method application style such as someValue.OperationName(arg1, arg2).
A syntax-directed operation is a named operation -whose definition consists of algorithms, each of which is associated -with one or more productions from one of the ECMAScript grammars. A +
A syntax-directed operation is a named operation +whose definition consists of algorithms, each of which is associated +with one or more productions from one of the ECMAScript grammars. A production that has multiple alternative definitions will typically have - a distinct algorithm for each alternative. When an algorithm is -associated with a grammar production, it may reference the terminal and -nonterminal symbols of the production alternative as if they were -parameters of the algorithm. When used in this manner, nonterminal -symbols refer to the actual alternative definition that is matched when -parsing the source text. The source text matched by a -grammar production is the portion of the source text that starts at the -beginning of the first terminal that participated in the match and ends + a distinct algorithm for each alternative. When an algorithm is +associated with a grammar production, it may reference the terminal and +nonterminal symbols of the production alternative as if they were +parameters of the algorithm. When used in this manner, nonterminal +symbols refer to the actual alternative definition that is matched when +parsing the source text. The source text matched by a +grammar production is the portion of the source text that starts at the +beginning of the first terminal that participated in the match and ends at the end of the last terminal that participated in the match.
-When an algorithm is associated with a production alternative, -the alternative is typically shown without any “[ ]” grammar -annotations. Such annotations should only affect the syntactic -recognition of the alternative and have no effect on the associated +
When an algorithm is associated with a production alternative, +the alternative is typically shown without any “[ ]” grammar +annotations. Such annotations should only affect the syntactic +recognition of the alternative and have no effect on the associated semantics for the alternative.
-Syntax-directed operations are invoked with a parse node and, +
Syntax-directed operations are invoked with a parse node and, optionally, other parameters by using the conventions on steps 1, 3, and 4 in the following algorithm:
"value"
as the argument.
Unless explicitly specified otherwise, all chain productions +
Unless explicitly specified otherwise, all chain productions
have an implicit definition for every operation that might be applied to
- that production's left-hand side nonterminal. The implicit definition
+ that production's left-hand side nonterminal. The implicit definition
simply reapplies the same operation with the same parameters, if any, to
the
but the Evaluation operation does not associate an algorithm -with that production. In that case, the Evaluation operation implicitly +
but the Evaluation operation does not associate an algorithm +with that production. In that case, the Evaluation operation implicitly includes an association of the form:
Runtime Semantics: Evaluation
Context-free grammars are not sufficiently powerful to express -all the rules that define whether a stream of input elements form a +
Context-free grammars are not sufficiently powerful to express
+all the rules that define whether a stream of input elements form a
valid ECMAScript
Static Semantic Rules have names and typically are defined -using an algorithm. Named Static Semantic Rules are associated with -grammar productions and a production that has multiple alternative -definitions will typically have for each alternative a distinct +
Static Semantic Rules have names and typically are defined +using an algorithm. Named Static Semantic Rules are associated with +grammar productions and a production that has multiple alternative +definitions will typically have for each alternative a distinct algorithm for each applicable named static semantic rule.
Unless otherwise specified every grammar production alternative in this specification implicitly has a definition for a static semantic - rule named Contains which takes an argument named symbol -whose value is a terminal or nonterminal of the grammar that includes + rule named Contains which takes an argument named symbol +whose value is a terminal or nonterminal of the grammar that includes the associated production. The default definition of Contains is:
The above definition is explicitly over-ridden for specific productions.
A special kind of static semantic rule is an Early Error Rule.
Mathematical operations such as addition, subtraction, -negation, multiplication, division, and the mathematical functions -defined later in this clause should always be understood as computing -exact mathematical results on mathematical real numbers, which unless -otherwise noted do not include infinities and do not include a negative -zero that is distinguished from positive zero. Algorithms in this -standard that model floating-point arithmetic include explicit steps, -where necessary, to handle infinities and signed zero and to perform -rounding. If a mathematical operation or function is applied to a -floating-point number, it should be understood as being applied to the +
Mathematical operations such as addition, subtraction,
+negation, multiplication, division, and the mathematical functions
+defined later in this clause should always be understood as computing
+exact mathematical results on mathematical real numbers, which unless
+otherwise noted do not include infinities and do not include a negative
+zero that is distinguished from positive zero. Algorithms in this
+standard that model floating-point arithmetic include explicit steps,
+where necessary, to handle infinities and signed zero and to perform
+rounding. If a mathematical operation or function is applied to a
+floating-point number, it should be understood as being applied to the
exact mathematical value represented by that floating-point number; such
a floating-point number must be finite, and if it is
The mathematical function
Algorithms within this specification manipulate values each of +
Algorithms within this specification manipulate values each of which has an associated type. The possible value types are exactly those defined in this clause. Types are further subclassified into ECMAScript language types and specification types.
Within this specification, the notation “Type(x)” is used as shorthand for “the type of x” - where “type” refers to the ECMAScript language and specification types -defined in this clause. When the term “empty” is used as if it was + where “type” refers to the ECMAScript language and specification types +defined in this clause. When the term “empty” is used as if it was naming a value, it is equivalent to saying “no value of any type”.
An ECMAScript language type corresponds to values -that are directly manipulated by an ECMAScript programmer using the -ECMAScript language. The ECMAScript language types are Undefined, Null, +
An ECMAScript language type corresponds to values +that are directly manipulated by an ECMAScript programmer using the +ECMAScript language. The ECMAScript language types are Undefined, Null, Boolean, String, Symbol, Number, and Object. An ECMAScript language value is a value that is characterized by an ECMAScript language type.
The String type is the set of all ordered sequences of zero or -more 16-bit unsigned integer values (“elements”) up to a maximum length -of 253 - 1 elements. The String type is generally used to -represent textual data in a running ECMAScript program, in which case -each element in the String is treated as a UTF-16 code unit value. Each -element is regarded as occupying a position within the sequence. These -positions are indexed with nonnegative integers. The first element (if +
The String type is the set of all ordered sequences of zero or +more 16-bit unsigned integer values (“elements”) up to a maximum length +of 253 - 1 elements. The String type is generally used to +represent textual data in a running ECMAScript program, in which case +each element in the String is treated as a UTF-16 code unit value. Each +element is regarded as occupying a position within the sequence. These +positions are indexed with nonnegative integers. The first element (if any) is at index 0, the next element (if any) at index 1, and so on. The - length of a String is the number of elements (i.e., 16-bit values) -within it. The empty String has length zero and therefore contains no + length of a String is the number of elements (i.e., 16-bit values) +within it. The empty String has length zero and therefore contains no elements.
-ECMAScript operations that do not interpret String contents -apply no further semantics. Operations that do interpret String values -treat each element as a single UTF-16 code unit. However, ECMAScript -does not restrict the value of or relationships between these code +
ECMAScript operations that do not interpret String contents +apply no further semantics. Operations that do interpret String values +treat each element as a single UTF-16 code unit. However, ECMAScript +does not restrict the value of or relationships between these code units, so operations that further interpret String contents as sequences - of Unicode code points encoded in UTF-16 must account for ill-formed + of Unicode code points encoded in UTF-16 must account for ill-formed subsequences. Such operations apply special treatment to every code unit - with a numeric value in the inclusive range 0xD800 to 0xDBFF (defined + with a numeric value in the inclusive range 0xD800 to 0xDBFF (defined by the Unicode Standard as a leading surrogate, or more formally as a high-surrogate code unit) and every code unit with a numeric value in the inclusive range 0xDC00 to 0xDFFF (defined as a trailing surrogate, or more formally as a low-surrogate code unit) using the following rules:
The function String.prototype.normalize
(see String.prototype.localeCompare
(see
The rationale behind this design was to keep the -implementation of Strings as simple and high-performing as possible. If -ECMAScript source text is in Normalized Form C, string literals are -guaranteed to also be normalized, as long as they do not contain any +
The rationale behind this design was to keep the +implementation of Strings as simple and high-performing as possible. If +ECMAScript source text is in Normalized Form C, string literals are +guaranteed to also be normalized, as long as they do not contain any Unicode escape sequences.
In this specification, the phrase "the string-concatenation of A, B, @@ -1363,13 +1363,13 @@ Unicode escape sequences.
Well-known symbols are built-in Symbol values that are -explicitly referenced by algorithms of this specification. They are +
Well-known symbols are built-in Symbol values that are
+explicitly referenced by algorithms of this specification. They are
typically used as the keys of properties whose values serve as extension
- points of a specification algorithm. Unless otherwise specified,
+ points of a specification algorithm. Unless otherwise specified,
well-known symbols values are shared by all realms (
Within this specification a well-known symbol is referred to -by using a notation of the form @@name, where “name” is one of the +
Within this specification a well-known symbol is referred to
+by using a notation of the form @@name, where “name” is one of the
values listed in
If the initial values of a property's attributes are not +
If the initial values of a property's attributes are not
explicitly specified by this specification, the default value defined in
The actual semantics of objects, in ECMAScript, are specified via algorithms called internal methods. - Each object in an ECMAScript engine is associated with a set of -internal methods that defines its runtime behaviour. These internal -methods are not part of the ECMAScript language. They are defined by -this specification purely for expository purposes. However, each object -within an implementation of ECMAScript must behave as specified by the -internal methods associated with it. The exact manner in which this is + Each object in an ECMAScript engine is associated with a set of +internal methods that defines its runtime behaviour. These internal +methods are not part of the ECMAScript language. They are defined by +this specification purely for expository purposes. However, each object +within an implementation of ECMAScript must behave as specified by the +internal methods associated with it. The exact manner in which this is accomplished is determined by the implementation.
-Internal method names are polymorphic. This means that -different object values may perform different algorithms when a common +
Internal method names are polymorphic. This means that
+different object values may perform different algorithms when a common
internal method name is invoked upon them. That actual object upon which
an internal method is invoked is the “target” of the invocation. If, at
runtime, the implementation of an algorithm attempts to use an internal
method of an object that the object does not support, a
Internal slots correspond to internal state that is -associated with objects and used by various ECMAScript specification -algorithms. Internal slots are not object properties and they are not +
Internal slots correspond to internal state that is
+associated with objects and used by various ECMAScript specification
+algorithms. Internal slots are not object properties and they are not
inherited. Depending upon the specific internal slot specification, such
state may consist of values of any
Internal methods and internal slots are identified within +
Internal methods and internal slots are identified within this specification using names enclosed in double square brackets [[ ]].
The “Signature” column of
Return a |
||
[[DefineOwnProperty]] - + | (propertyKey, PropertyDescriptor) → Boolean - + |
Create or alter the own property, whose key is propertyKey, to have the state described by PropertyDescriptor. Return |
[[HasProperty]] - + | (propertyKey) → Boolean - + | - Return a Boolean value indicating whether this object + Return a Boolean value indicating whether this object already has either an own or inherited property whose key is propertyKey. - + |
[[Get]] - + | (propertyKey, Receiver) → any |
Return the value of the property whose key is propertyKey from this object. If any ECMAScript code must be executed to retrieve the property value, Receiver is used as the |
[[Set]] - + | (propertyKey, value, Receiver) → Boolean - + |
Set the value of the property whose key is propertyKey to value. If any ECMAScript code must be executed to set the property value, Receiver is used as the |
[[Delete]] - + | (propertyKey) → Boolean - + |
Remove the own property whose key is propertyKey from this object. Return |
[[OwnPropertyKeys]] - + |
( ) → |
Return a |
The Property Descriptor type is used to explain the
- manipulation and reification of Object property attributes. Values of
-the Property Descriptor type are Records. Each field's name is an
-attribute name and its value is a corresponding attribute value as
+ manipulation and reification of Object property attributes. Values of
+the Property Descriptor type are Records. Each field's name is an
+attribute name and its value is a corresponding attribute value as
specified in
Property Descriptor values may be further classified as data -Property Descriptors and accessor Property Descriptors based upon the -existence or use of certain fields. A data Property Descriptor is one -that includes any fields named either [[Value]] or [[Writable]]. An -accessor Property Descriptor is one that includes any fields named +
Property Descriptor values may be further classified as data
+Property Descriptors and accessor Property Descriptors based upon the
+existence or use of certain fields. A data Property Descriptor is one
+that includes any fields named either [[Value]] or [[Writable]]. An
+accessor Property Descriptor is one that includes any fields named
either [[Get]] or [[Set]]. Any Property Descriptor may have fields named
- [[Enumerable]] and [[Configurable]]. A Property Descriptor value may
-not be both a data Property Descriptor and an accessor Property
+ [[Enumerable]] and [[Configurable]]. A Property Descriptor value may
+not be both a data Property Descriptor and an accessor Property
Descriptor; however, it may be neither. A generic Property Descriptor is
- a Property Descriptor value that is neither a data Property Descriptor
-nor an accessor Property Descriptor. A fully populated Property
-Descriptor is one that is either an accessor Property Descriptor or a
-data Property Descriptor and that has all of the fields that correspond
+ a Property Descriptor value that is neither a data Property Descriptor
+nor an accessor Property Descriptor. A fully populated Property
+Descriptor is one that is either an accessor Property Descriptor or a
+data Property Descriptor and that has all of the fields that correspond
to the property attributes defined in either
The following
The
The Data Block specification type is used to -describe a distinct and mutable sequence of byte-sized (8 bit) numeric -values. A Data Block value is created with a fixed number of bytes that +
The Data Block specification type is used to +describe a distinct and mutable sequence of byte-sized (8 bit) numeric +values. A Data Block value is created with a fixed number of bytes that each have the initial value 0.
-For notational convenience within this specification, an -array-like syntax can be used to access the individual bytes of a Data -Block value. This notation presents a Data Block value as a 0-origined +
For notational convenience within this specification, an +array-like syntax can be used to access the individual bytes of a Data +Block value. This notation presents a Data Block value as a 0-origined integer-indexed sequence of bytes. For example, if db is a 5 byte Data Block value then db[2] can be used to access its 3rd byte.
A data block that resides in memory that can be referenced from multiple agents concurrently is designated a Shared Data Block. A Shared Data Block has an identity (for the purposes of equality testing Shared Data Block values) that is address-free: - it is tied not to the virtual addresses the block is mapped to in any -process, but to the set of locations in memory that the block -represents. Two data blocks are equal only if the sets of the locations -they contain are equal; otherwise, they are not equal and the -intersection of the sets of locations they contain is empty. Finally, + it is tied not to the virtual addresses the block is mapped to in any +process, but to the set of locations in memory that the block +represents. Two data blocks are equal only if the sets of the locations +they contain are equal; otherwise, they are not equal and the +intersection of the sets of locations they contain is empty. Finally, Shared Data Blocks can be distinguished from Data Blocks.
The semantics of Shared Data Blocks is defined using Shared Data Block events by the
Shared Data Block events are modeled by Records, defined in the
When the abstract operation CopyDataBlockBytes is called, the following steps are taken:
"Unordered"
, [[NoTear]]: "Unordered"
, [[NoTear]]: These operations are not a part of the ECMAScript language; they -are defined here to solely to aid the specification of the semantics of +
These operations are not a part of the ECMAScript language; they
+are defined here to solely to aid the specification of the semantics of
the ECMAScript language. Other, more specialized
The ECMAScript language implicitly performs automatic type -conversion as needed. To clarify the semantics of certain constructs it +
The ECMAScript language implicitly performs automatic type
+conversion as needed. To clarify the semantics of certain constructs it
is useful to define a set of conversion
"default"
."string"
."number"
."default"
, set hint to "number"
.When ToPrimitive is called with no hint, then it generally -behaves as if the hint were Number. However, objects may over-ride this -behaviour by defining a @@toPrimitive method. Of the objects defined in +
When ToPrimitive is called with no hint, then it generally
+behaves as if the hint were Number. However, objects may over-ride this
+behaviour by defining a @@toPrimitive method. Of the objects defined in
this specification only Date objects (see
Apply the following steps:
@@ -4600,7 +4600,7 @@ this specification only Date objects (seeThe terminal symbols of this grammar are all composed of +
The terminal symbols of this grammar are all composed of
characters in the Unicode Basic Multilingual Plane (BMP). Therefore, the
result of
0
digits.
-
+
+
or -
to indicate its sign.
-
+
Infinity
and -Infinity
are recognized as a The conversion of a String to a Number value is similar -overall to the determination of the Number value for a numeric literal +
The conversion of a String to a Number value is similar
+overall to the determination of the Number value for a numeric literal
(see
Once the exact MV for a String numeric literal has been -determined, it is then rounded to a value of the Number type. If the MV +
Once the exact MV for a String numeric literal has been
+determined, it is then rounded to a value of the Number type. If the MV
is 0, then the rounded value is "-"
, in which case the rounded value is
0
; or
-
+
Unlike the other ECMAScript integer conversion abstract -operation, ToUint8Clamp rounds rather than truncates non-integer values +
Unlike the other ECMAScript integer conversion abstract
+operation, ToUint8Clamp rounds rather than truncates non-integer values
and does not convert Math.round
which does “round half up” tie-breaking.
"undefined"
.
-
+
"null"
.
-
+
If argument is "true"
.
Apply the following steps:
@@ -5027,42 +5027,42 @@ and does not convert"NaN"
."0"
."-"
and ! "Infinity"
.The following observations may be useful as guidelines for -implementations, but are not part of the normative requirements of this +
The following observations may be useful as guidelines for +implementations, but are not part of the normative requirements of this Standard:
For implementations that provide more accurate conversions -than required by the rules above, it is recommended that the following +
For implementations that provide more accurate conversions +than required by the rules above, it is recommended that the following alternative version of step 5 be used as a guideline:
Implementers of ECMAScript may find useful the paper and -code written by David M. Gay for binary-to-decimal conversion of +
Implementers of ECMAScript may find useful the paper and +code written by David M. Gay for binary-to-decimal conversion of floating-point numbers:
-Gay, David M. Correctly Rounded Binary-Decimal and -Decimal-Binary Conversions. Numerical Analysis, Manuscript 90-10. +
Gay, David M. Correctly Rounded Binary-Decimal and
+Decimal-Binary Conversions. Numerical Analysis, Manuscript 90-10.
AT&T Bell Laboratories (Murray Hill, New Jersey). November 30, 1990.
Available as
-
+
http://ampl.com/REFS/abstracts.html#rounding. Associated code available as
-
+
http://netlib.sandia.gov/fp/dtoa.c and as
-
+
http://netlib.sandia.gov/fp/g_fmt.c and may also be found at the various netlib
mirror sites.
The comparison x < y, where x and y are values, produces
Step 3 differs from step 7 in the algorithm for the addition operator +
(
The comparison of Strings uses a simple lexicographic -ordering on sequences of code unit values. There is no attempt to use -the more complex, semantically oriented definitions of character or -string equality and collating order defined in the Unicode -specification. Therefore String values that are canonically equal -according to the Unicode standard could test as unequal. In effect this -algorithm assumes that both Strings are already in normalized form. -Also, note that for strings containing supplementary characters, -lexicographic ordering on sequences of UTF-16 code unit values differs +
The comparison of Strings uses a simple lexicographic +ordering on sequences of code unit values. There is no attempt to use +the more complex, semantically oriented definitions of character or +string equality and collating order defined in the Unicode +specification. Therefore String values that are canonically equal +according to the Unicode standard could test as unequal. In effect this +algorithm assumes that both Strings are already in normalized form. +Also, note that for strings containing supplementary characters, +lexicographic ordering on sequences of UTF-16 code unit values differs from that on sequences of code point values.
The abstract operation Get is used to retrieve the value of a +
The abstract operation Get is used to retrieve the value of a specific property of an object. The operation is called with arguments O and P where O is the object and P is the property key. This abstract operation performs the following steps:
The abstract operation GetV is used to retrieve the value of a specific property of an
The abstract operation CreateDataProperty is used to create a +
The abstract operation CreateDataProperty is used to create a new own property of an object. The operation is called with arguments O, P, and V where O is the object, P is the property key, and V is the value for the property. This abstract operation performs the following steps:
This abstract operation creates a property whose attributes -are set to the same defaults used for properties created by the +
This abstract operation creates a property whose attributes
+are set to the same defaults used for properties created by the
ECMAScript language assignment operator. Normally, the property will not
already exist. If it does exist and is not configurable or if O is not extensible, [[DefineOwnProperty]] will return
This abstract operation creates a property whose attributes -are set to the same defaults used for built-in methods and methods -defined using class declaration syntax. Normally, the property will not +
This abstract operation creates a property whose attributes
+are set to the same defaults used for built-in methods and methods
+defined using class declaration syntax. Normally, the property will not
already exist. If it does exist and is not configurable or if O is not extensible, [[DefineOwnProperty]] will return
This abstract operation creates a property whose attributes -are set to the same defaults used for properties created by the +
This abstract operation creates a property whose attributes
+are set to the same defaults used for properties created by the
ECMAScript language assignment operator. Normally, the property will not
already exist. If it does exist and is not configurable or if O is not extensible, [[DefineOwnProperty]] will return
The abstract operation DefinePropertyOrThrow is used to call -the [[DefineOwnProperty]] internal method of an object in a manner that +
The abstract operation DefinePropertyOrThrow is used to call
+the [[DefineOwnProperty]] internal method of an object in a manner that
will throw a
The abstract operation DeletePropertyOrThrow is used to remove a - specific own property of an object. It throws an exception if the + specific own property of an object. It throws an exception if the property is not configurable. The operation is called with arguments O and P where O is the object and P is the property key. This abstract operation performs the following steps:
The abstract operation HasProperty is used to determine whether - an object has a property with the specified property key. The property -may be either an own or inherited. A Boolean value is returned. The + an object has a property with the specified property key. The property +may be either an own or inherited. A Boolean value is returned. The operation is called with arguments O and P where O is the object and P is the property key. This abstract operation performs the following steps:
The abstract operation HasOwnProperty is used to determine +
The abstract operation HasOwnProperty is used to determine whether an object has an own property with the specified property key. A Boolean value is returned. The operation is called with arguments O and P where O is the object and P is the property key. This abstract operation performs the following steps:
The abstract operation SetIntegrityLevel is used to fix the set - of own properties of an object. This abstract operation performs the + of own properties of an object. This abstract operation performs the following steps:
"sealed"
or "frozen"
."sealed"
, then"frozen"
,The abstract operation TestIntegrityLevel is used to determine -if the set of own properties of an object are fixed. This abstract +
The abstract operation TestIntegrityLevel is used to determine +if the set of own properties of an object are fixed. This abstract operation performs the following steps:
"sealed"
or "frozen"
."frozen"
and The abstract operation IteratorStep with argument iteratorRecord requests the next value from iteratorRecord.[[Iterator]] by calling iteratorRecord.[[NextMethod]] and returns either
The abstract operation IteratorClose with arguments iteratorRecord and completion - is used to notify an iterator that it should perform any actions it + is used to notify an iterator that it should perform any actions it would normally perform when it has reached its completed state:
"return"
).The abstract operation AsyncIteratorClose with arguments iteratorRecord and completion - is used to notify an async iterator that it should perform any actions + is used to notify an async iterator that it should perform any actions it would normally perform when it has reached its completed state:
"return"
).A Lexical Environment is a specification type used to define the association of
An
The outer environment reference is used to model the logical -nesting of Lexical Environment values. The outer reference of a (inner) -Lexical Environment is a reference to the Lexical Environment that -logically surrounds the inner Lexical Environment. An outer Lexical -Environment may, of course, have its own outer Lexical Environment. A -Lexical Environment may serve as the outer environment for multiple +
The outer environment reference is used to model the logical
+nesting of Lexical Environment values. The outer reference of a (inner)
+Lexical Environment is a reference to the Lexical Environment that
+logically surrounds the inner Lexical Environment. An outer Lexical
+Environment may, of course, have its own outer Lexical Environment. A
+Lexical Environment may serve as the outer environment for multiple
inner Lexical Environments. For example, if a
A global environment is a Lexical Environment which does not have an outer environment. The
A module environment is a Lexical Environment that contains the bindings for the top level declarations of a
A function environment is a Lexical Environment that corresponds to the invocation of an ECMAScript this
binding. A super
method invocations.
Lexical Environments and
There are two primary kinds of Environment Record values used in this specification: declarative Environment Records and object Environment Records. Declarative Environment Records are used to define the effect of ECMAScript language syntactic elements such as
For specification purposes Environment Record values are values of the
Function Environment Records support all of the declarative
Method - + | Purpose - + |
---|---|
BindThisValue(V) - + | Set the [[ThisValue]] and record that it has been initialized. - + |
GetThisBinding() - + |
Return the value of this this binding. Throws a this binding has not been initialized.
-
+
|
GetSuperBase() - + |
Return the object that is the base for super property accesses bound in this super property accesses will produce runtime errors.
-
+
|
The behaviour of the additional concrete specification -methods for function Environment Records is defined by the following +
The behaviour of the additional concrete specification +methods for function Environment Records is defined by the following algorithms:
this
in global scope. Hosts may provide any ECMAScript Object value.
-
+
this
binding.
-
+
var
binding in the [[ObjectRecord]] component of a global var
. The String value N is the bound name. If D is function
binding in the [[ObjectRecord]] component of a global function
. The String value N is the bound name. V is the initialization value. If the Boolean argument D is The concrete
The concrete
The concrete
The concrete
The concrete
The concrete
The concrete
The concrete
Properties may exist upon a undefined
is an example of such a property.
The concrete
The concrete
The concrete
Global function declarations are always represented as own properties of the
A module
Module Environment Records support all of the declarative
Method - + | Purpose - + |
---|---|
CreateImportBinding(N, M, N2) - + |
Create an immutable indirect binding in a module |
GetThisBinding() - + |
Return the value of this this binding.
-
+
|
The behaviour of the additional concrete specification -methods for module Environment Records are defined by the following +
The behaviour of the additional concrete specification +methods for module Environment Records are defined by the following algorithms:
The concrete
Template objects are canonicalized separately for each
The abstract operation CreateIntrinsics with argument realmRec performs the following steps:
An execution context is a specification device that -is used to track the runtime evaluation of code by an ECMAScript -implementation. At any point in time, there is at most one execution +
An execution context is a specification device that
+is used to track the runtime evaluation of code by an ECMAScript
+implementation. At any point in time, there is at most one execution
context per
The execution context stack is used to track execution contexts. The
An execution context contains whatever implementation specific -state is necessary to track the execution progress of its associated +
An execution context contains whatever implementation specific
+state is necessary to track the execution progress of its associated
code. Each execution context has at least the state components listed in
Evaluation of code by the
The value of the
Execution contexts for ECMAScript code have the additional state components listed in
In most situations only the
An execution context is purely a specification mechanism and need - not correspond to any particular artefact of an ECMAScript -implementation. It is impossible for ECMAScript code to directly access + not correspond to any particular artefact of an ECMAScript +implementation. It is impossible for ECMAScript code to directly access or observe an execution context.
The ResolveBinding abstract operation is used to determine the binding of name passed as a String value. The optional argument env can be used to explicitly provide the
A Job is an abstract operation that initiates an ECMAScript -computation when no other ECMAScript computation is currently in +
A Job is an abstract operation that initiates an ECMAScript +computation when no other ECMAScript computation is currently in progress. A Job abstract operation may be defined to accept an arbitrary set of job parameters.
Execution of a Job can be initiated only when there is no
Field Name - + | Value - + | Meaning - + |
---|---|---|
[[Job]] - + | The name of a Job abstract operation - + | This is the abstract operation that is performed when execution of this PendingJob is initiated. - + |
[[Arguments]] - + |
A |
The |
[[Realm]] - + |
A |
The |
[[ScriptOrModule]] - + |
A |
The script or module for the initial |
[[HostDefined]] - + |
Any, default value is |
Field reserved for use by host environments that need to associate additional information with a pending Job. - + |
A Job Queue is a FIFO queue of PendingJob records. Each Job Queue
- has a name and the full set of available Job Queues are defined by an
-ECMAScript implementation. Every ECMAScript implementation has at least
+ has a name and the full set of available Job Queues are defined by an
+ECMAScript implementation. Every ECMAScript implementation has at least
the Job Queues defined in
Each
A request for the future execution of a Job is made by -enqueueing, on a Job Queue, a PendingJob record that includes a Job +
A request for the future execution of a Job is made by
+enqueueing, on a Job Queue, a PendingJob record that includes a Job
abstract operation name and any necessary argument values. When there is
no
The PendingJob records from a single Job Queue are always +
The PendingJob records from a single Job Queue are always
initiated in FIFO order. This specification does not define the order in
- which multiple Job Queues are serviced. An ECMAScript implementation
-may interweave the FIFO evaluation of the PendingJob records of a Job
+ which multiple Job Queues are serviced. An ECMAScript implementation
+may interweave the FIFO evaluation of the PendingJob records of a Job
Queue with the evaluation of the PendingJob records of one or more other
Job Queues. An implementation must define what occurs when there are no
The following
Once the values of [[Signifier]], [[IsLockFree1]], and [[IsLockFree2]] have been observed by any
The values of [[IsLockFree1]] and [[IsLockFree2]] are not -necessarily determined by the hardware, but may also reflect -implementation choices that can vary over time and between ECMAScript +
The values of [[IsLockFree1]] and [[IsLockFree2]] are not +necessarily determined by the hardware, but may also reflect +implementation choices that can vary over time and between ECMAScript implementations.
There is no [[IsLockFree4]] property: 4-byte atomic operations are always lock-free.
-In practice, if an atomic operation is implemented with any -type of lock the operation is not lock-free. Lock-free does not imply -wait-free: there is no upper bound on how many machine steps may be +
In practice, if an atomic operation is implemented with any +type of lock the operation is not lock-free. Lock-free does not imply +wait-free: there is no upper bound on how many machine steps may be required to complete a lock-free atomic operation.
That an atomic access of size n is lock-free does not imply anything about the (perceived) atomicity of non-atomic accesses of size n, specifically, non-atomic accesses may still be performed as a sequence of several separate memory accesses. See
In some environments it may not be reasonable for a given
An agent cluster is a maximal set of agents that can communicate by operating on shared memory.
Programs within different agents may share memory by -unspecified means. At a minimum, the backing memory for +
Programs within different agents may share memory by +unspecified means. At a minimum, the backing memory for SharedArrayBuffer objects can be shared among the agents in the cluster.
There may be agents that can communicate by message passing that cannot share memory; they are never in the same agent cluster.
@@ -7425,8 +7425,8 @@ SharedArrayBuffer objects can be shared among the agents in the cluster.All agents within a cluster must have the same value for the [[LittleEndian]] property in their respective
If different agents within an agent cluster have different -values of [[LittleEndian]] it becomes hard to use shared memory for +
If different agents within an agent cluster have different +values of [[LittleEndian]] it becomes hard to use shared memory for multi-byte data.
All agents within a cluster must have different values for the [[Signifier]] property in their respective
An embedding may deactivate (stop forward progress) or activate (resume forward progress) an
The purpose of the preceding restriction is to avoid a situation where an
The implication of the restriction is that it will not be -possible to share memory between agents that don't belong to the same +
The implication of the restriction is that it will not be +possible to share memory between agents that don't belong to the same suspend/wake collective within the embedding.
An embedding may terminate an
Examples of that type of termination are: operating systems or -users terminating agents that are running in separate processes; the +
Examples of that type of termination are: operating systems or
+users terminating agents that are running in separate processes; the
embedding itself terminating an
An agent cluster is a specification mechanism and need not +
An agent cluster is a specification mechanism and need not correspond to any particular artefact of an ECMAScript implementation.
All ordinary objects have an internal slot called [[Prototype]]. The value of this internal slot is either
Every ordinary object has a Boolean-valued [[Extensible]] -internal slot which is used to fulfill the extensibility-related +
Every ordinary object has a Boolean-valued [[Extensible]]
+internal slot which is used to fulfill the extensibility-related
internal method invariants specified in
In the following algorithm descriptions, assume O is an ordinary object, P is a property key value, V is any
Each ordinary object internal method delegates to a -similarly-named abstract operation. If such an abstract operation -depends on another internal method, then the internal method is invoked -on O rather than calling the similarly-named abstract -operation directly. These semantics ensure that exotic objects have -their overridden internal methods invoked when ordinary object internal +
Each ordinary object internal method delegates to a +similarly-named abstract operation. If such an abstract operation +depends on another internal method, then the internal method is invoked +on O rather than calling the similarly-named abstract +operation directly. These semantics ensure that exotic objects have +their overridden internal methods invoked when ordinary object internal methods are applied to them.
The loop in step 8 guarantees that there will be no +
The loop in step 8 guarantees that there will be no circularities in any prototype chain that only includes objects that use - the ordinary object definitions for [[GetPrototypeOf]] and + the ordinary object definitions for [[GetPrototypeOf]] and [[SetPrototypeOf]].
If
The abstract operation OrdinaryCreateFromConstructor creates an ordinary object whose [[Prototype]] value is retrieved from a prototype
property, if it exists. Otherwise the intrinsic named by intrinsicDefaultProto is used for [[Prototype]]. The optional internalSlotsList is a
The abstract operation GetPrototypeFromConstructor determines -the [[Prototype]] value that should be used to create an object +
The abstract operation GetPrototypeFromConstructor determines
+the [[Prototype]] value that should be used to create an object
corresponding to a specific prototype
property, if it exists. Otherwise the intrinsic named by intrinsicDefaultProto is used for [[Prototype]]. This abstract operation performs the following steps:
"prototype"
).ECMAScript function objects encapsulate parameterized ECMAScript -code closed over a lexical environment and support the dynamic +
ECMAScript function objects encapsulate parameterized ECMAScript
+code closed over a lexical environment and support the dynamic
evaluation of that code. An ECMAScript
ECMAScript function objects have the additional internal slots listed in
"normal"
, "classConstructor"
, "generator"
, "async"
, or "async generator"
.
-
+
"base"
or "derived"
.
-
+
this
references are interpreted within the formal parameters and code body of the function. this
refers to the super
, this is the object whose [[GetPrototypeOf]] provides the object where super
property lookups begin.
-
+
All ECMAScript function objects have the [[Call]] internal method - defined here. ECMAScript functions that are also constructors in + defined here. ECMAScript functions that are also constructors in addition have the [[Construct]] internal method.
When an
FunctionDeclarationInstantiation is performed as follows using arguments func and argumentsList. func is the
"arguments"
is an element of parameterNames, then"arguments"
is an element of functionNames or if "arguments"
is an element of lexicalNames, then"arguments"
, "arguments"
, "arguments"
, ao)."arguments"
appended.The built-in function objects defined in this specification may be implemented as either ECMAScript function objects (
If a built-in
Unless otherwise specified every built-in
The behaviour specified for each built-in function via algorithm +
The behaviour specified for each built-in function via algorithm
steps or other means is the specification of the function body behaviour
- for both [[Call]] and [[Construct]] invocations of the function.
-However, [[Construct]] invocation is not supported by all built-in
-functions. For each built-in function, when invoked with [[Call]], the
+ for both [[Call]] and [[Construct]] invocations of the function.
+However, [[Construct]] invocation is not supported by all built-in
+functions. For each built-in function, when invoked with [[Call]], the
[[Call]] thisArgument provides the "classConstructor"
.
Built-in function objects that are not identified as constructors
- do not implement the [[Construct]] internal method unless otherwise
+ do not implement the [[Construct]] internal method unless otherwise
specified in the description of a particular function. When a built-in new
expression the argumentsList parameter of the invoked [[Construct]] internal method provides the values for the built-in
Built-in functions that are not constructors do not have a prototype
property unless otherwise specified in the description of a particular function.
If a built-in
This specification defines several kinds of built-in exotic -objects. These objects generally behave similar to ordinary objects -except for a few specific situations. The following exotic objects use -the ordinary object internal methods except where it is explicitly +
This specification defines several kinds of built-in exotic +objects. These objects generally behave similar to ordinary objects +except for a few specific situations. The following exotic objects use +the ordinary object internal methods except where it is explicitly specified otherwise below:
A bound function is an
Bound function objects do not have the internal slots of ECMAScript function objects defined in
An Array object is an "length"
property whose value is always a nonnegative integer less than 232. The value of the "length"
property is numerically greater than the name of every own property whose name is an "length"
property is changed, if necessary, to be one more than the numeric value of that "length"
property is changed, every own property whose name is an "length"
or
A String
Array exotic objects provide an alternative definition for the -[[DefineOwnProperty]] internal method. Except for that internal method, +
Array exotic objects provide an alternative definition for the
+[[DefineOwnProperty]] internal method. Except for that internal method,
Array exotic objects provide all of the other essential internal methods
as specified in
If originalArray was created using the standard built-in Array
A String object is an "length"
whose value is the number of code unit elements in the encapsulated String value. Both the code unit data properties and the "length"
property are non-writable and non-configurable.
String exotic objects have the same internal slots as ordinary objects. They also have a [[StringData]] internal slot.
String exotic objects provide alternative definitions for the following internal methods. All of the other String
Most ECMAScript functions make an arguments object available to
- their code. Depending upon the characteristics of the function
+ their code. Depending upon the characteristics of the function
definition, its arguments object is either an ordinary object or an arguments
Arguments exotic objects have the same internal slots as -ordinary objects. They also have a [[ParameterMap]] internal slot. -Ordinary arguments objects also have a [[ParameterMap]] internal slot -whose value is always undefined. For ordinary argument objects the +
Arguments exotic objects have the same internal slots as
+ordinary objects. They also have a [[ParameterMap]] internal slot.
+Ordinary arguments objects also have a [[ParameterMap]] internal slot
+whose value is always undefined. For ordinary argument objects the
[[ParameterMap]] internal slot is only used by Object.prototype.toString
(
Arguments exotic objects provide alternative definitions for the following internal methods. All of the other arguments
The integer-indexed data properties of an arguments
The ParameterMap object and its property values are used as a - device for specifying the arguments object correspondence to argument + device for specifying the arguments object correspondence to argument bindings. The ParameterMap object and the objects that are the values of - its properties are not directly observable from ECMAScript code. An -ECMAScript implementation does not need to actually create or use such + its properties are not directly observable from ECMAScript code. An +ECMAScript implementation does not need to actually create or use such objects to implement the specified semantics.
Ordinary arguments objects define a non-configurable "callee"
which throws a "callee"
- property has a more specific meaning for arguments exotic objects,
-which are created only for some class of non-strict functions. The
-definition of this property in the ordinary variant exists to ensure
-that it is not defined in any other manner by conforming ECMAScript
+ property has a more specific meaning for arguments exotic objects,
+which are created only for some class of non-strict functions. The
+definition of this property in the ordinary variant exists to ensure
+that it is not defined in any other manner by conforming ECMAScript
implementations.
ECMAScript implementations of arguments exotic objects have historically contained an "caller"
. Prior to ECMAScript 2017, this specification included the definition of a throwing "caller"
- property on ordinary arguments objects. Since implementations do not
-contain this extension any longer, ECMAScript 2017 dropped the
+ property on ordinary arguments objects. Since implementations do not
+contain this extension any longer, ECMAScript 2017 dropped the
requirement for a throwing "caller"
accessor.
"caller"
accessor.
The abstract operation MakeArgGetter called with String name and
An ArgGetter function is an anonymous built-in function -with [[Name]] and [[Env]] internal slots. When an ArgGetter function +
An ArgGetter function is an anonymous built-in function +with [[Name]] and [[Env]] internal slots. When an ArgGetter function that expects no arguments is called it performs the following steps:
The abstract operation MakeArgSetter called with String name and
An ArgSetter function is an anonymous built-in function -with [[Name]] and [[Env]] internal slots. When an ArgSetter function is +
An ArgSetter function is an anonymous built-in function +with [[Name]] and [[Env]] internal slots. When an ArgSetter function is called with argument value it performs the following steps:
An Integer-Indexed exotic object is an
The abstract operation IntegerIndexedObjectCreate with arguments prototype and internalSlotsList is used to specify the creation of new
A module namespace object is an export *
export items. Each String-valued own property key is the StringValue of
- the corresponding exported binding name. These are the only
+ the corresponding exported binding name. These are the only
String-keyed properties of a module namespace
Module namespace objects have the internal slots defined in
Array.prototype.sort
using Module namespace exotic objects provide alternative definitions
- for all of the internal methods except [[GetPrototypeOf]], which
+ for all of the internal methods except [[GetPrototypeOf]], which
behaves as defined in
ResolveExport is idempotent and side-effect free. An -implementation might choose to pre-compute or cache the ResolveExport +
ResolveExport is idempotent and side-effect free. An
+implementation might choose to pre-compute or cache the ResolveExport
results for the [[Exports]] of each module namespace
Immutable prototype exotic objects have the same internal slots - as ordinary objects. They are exotic only in the following internal -methods. All other internal methods of immutable prototype exotic -objects that are not explicitly defined below are instead defined as in + as ordinary objects. They are exotic only in the following internal +methods. All other internal methods of immutable prototype exotic +objects that are not explicitly defined below are instead defined as in ordinary objects.
A proxy object is an
Internal Method - + | Handler Method - + |
---|---|
[[GetPrototypeOf]] - + |
getPrototypeOf
-
+
|
[[SetPrototypeOf]] - + |
setPrototypeOf
-
+
|
[[IsExtensible]] - + |
isExtensible
-
+
|
[[PreventExtensions]] - + |
preventExtensions
-
+
|
[[GetOwnProperty]] - + |
getOwnPropertyDescriptor
-
+
|
[[DefineOwnProperty]] - + |
defineProperty
-
+
|
[[HasProperty]] - + |
has
-
+
|
[[Get]] - + |
get
-
+
|
[[Set]] - + |
set
-
+
|
[[Delete]] - + |
deleteProperty
-
+
|
[[OwnPropertyKeys]] - + |
ownKeys
-
+
|
[[Call]] - + |
apply
-
+
|
[[Construct]] - + |
construct
-
+
|
When a handler method is called to provide the implementation of a - proxy object internal method, the handler method is passed the proxy's -target object as a parameter. A proxy's handler object does not -necessarily have a method corresponding to every essential internal -method. Invoking an internal method on the proxy results in the -invocation of the corresponding internal method on the proxy's target + proxy object internal method, the handler method is passed the proxy's +target object as a parameter. A proxy's handler object does not +necessarily have a method corresponding to every essential internal +method. Invoking an internal method on the proxy results in the +invocation of the corresponding internal method on the proxy's target object if the handler object does not have a method corresponding to the internal trap.
-The [[ProxyHandler]] and [[ProxyTarget]] internal slots of a -proxy object are always initialized when the object is created and -typically may not be modified. Some proxy objects are created in a +
The [[ProxyHandler]] and [[ProxyTarget]] internal slots of a
+proxy object are always initialized when the object is created and
+typically may not be modified. Some proxy objects are created in a
manner that permits them to be subsequently revoked. When a proxy is revoked, its [[ProxyHandler]] and [[ProxyTarget]] internal slots are set to
Because proxy objects permit the implementation of internal -methods to be provided by arbitrary ECMAScript code, it is possible to -define a proxy object whose handler methods violates the invariants +
Because proxy objects permit the implementation of internal
+methods to be provided by arbitrary ECMAScript code, it is possible to
+define a proxy object whose handler methods violates the invariants
defined in
In the following algorithm descriptions, assume O is an ECMAScript proxy object, P is a property key value, V is any
[[Get]] for proxy objects enforces the following invariants:
A Proxy
A Proxy
ECMAScript code is expressed using Unicode. ECMAScript source -text is a sequence of code points. All Unicode code point values from +
ECMAScript code is expressed using Unicode. ECMAScript source
+text is a sequence of code points. All Unicode code point values from
U+0000 to U+10FFFF, including surrogate code points, may occur in source
- text where permitted by the ECMAScript grammars. The actual encodings
-used to store and interchange ECMAScript source text is not relevant to
-this specification. Regardless of the external source text encoding, a
-conforming ECMAScript implementation processes the source text as if it
+ text where permitted by the ECMAScript grammars. The actual encodings
+used to store and interchange ECMAScript source text is not relevant to
+this specification. Regardless of the external source text encoding, a
+conforming ECMAScript implementation processes the source text as if it
was an equivalent sequence of
The components of a combining character sequence are treated as -individual Unicode code points even though a user might think of the +
The components of a combining character sequence are treated as +individual Unicode code points even though a user might think of the whole sequence as a single character.
In string literals, regular expression literals, template -literals and identifiers, any Unicode code point may also be expressed -using Unicode escape sequences that explicitly express a code point's -numeric value. Within a comment, such an escape sequence is effectively +
In string literals, regular expression literals, template +literals and identifiers, any Unicode code point may also be expressed +using Unicode escape sequences that explicitly express a code point's +numeric value. Within a comment, such an escape sequence is effectively ignored as part of the comment.
-ECMAScript differs from the Java programming language in the +
ECMAScript differs from the Java programming language in the
behaviour of Unicode escape sequences. In a Java program, if the Unicode
- escape sequence \u000A
, for example, occurs within a
-single-line comment, it is interpreted as a line terminator (Unicode
-code point U+000A is LINE FEED (LF)) and therefore the next code point
+ escape sequence \u000A
, for example, occurs within a
+single-line comment, it is interpreted as a line terminator (Unicode
+code point U+000A is LINE FEED (LF)) and therefore the next code point
is not part of the comment. Similarly, if the Unicode escape sequence \u000A
- occurs within a string literal in a Java program, it is likewise
-interpreted as a line terminator, which is not allowed within a string
+ occurs within a string literal in a Java program, it is likewise
+interpreted as a line terminator, which is not allowed within a string
literal—one must write \n
instead of \u000A
to
- cause a LINE FEED (LF) to be part of the String value of a string
-literal. In an ECMAScript program, a Unicode escape sequence occurring
+ cause a LINE FEED (LF) to be part of the String value of a string
+literal. In an ECMAScript program, a Unicode escape sequence occurring
within a comment is never interpreted and therefore cannot contribute to
- termination of the comment. Similarly, a Unicode escape sequence
-occurring within a string literal in an ECMAScript program always
+ termination of the comment. Similarly, a Unicode escape sequence
+occurring within a string literal in an ECMAScript program always
contributes to the literal and is never interpreted as a line terminator
or as a code point that might terminate the string literal.
eval
function. More precisely, if the parameter to the built-in eval
function is a String, it is treated as an ECMAScript eval
is the global code portion of that eval
is a Function
, Generator
, AsyncFunction
, and AsyncGenerator
constructors is strict mode code if the last argument is a String that when processed is a ECMAScript code that is not strict mode code is called non-strict code.
@@ -9395,12 +9395,12 @@ any source text that is parsed as the function code of a nestedAn ECMAScript implementation may support the evaluation of -function exotic objects whose evaluative behaviour is expressed in some +
An ECMAScript implementation may support the evaluation of
+function exotic objects whose evaluative behaviour is expressed in some
implementation-defined form of executable code other than via ECMAScript
code. Whether a
The source text of an ECMAScript
There are several situations where the identification of lexical -input elements is sensitive to the syntactic grammar context that is -consuming the input elements. This requires multiple goal symbols for +
There are several situations where the identification of lexical
+input elements is sensitive to the syntactic grammar context that is
+consuming the input elements. This requires multiple goal symbols for
the lexical grammar. The
The use of multiple lexical goals ensures that there are no +
The use of multiple lexical goals ensures that there are no
lexical ambiguities that would affect automatic semicolon insertion. For
- example, there are no syntactic grammar contexts where both a leading
+ example, there are no syntactic grammar contexts where both a leading
division or division-assignment, and a leading
a = b
/hi/g.exec(c).map(d);
@@ -9463,27 +9463,27 @@ division or division-assignment, and a leading The Unicode format-control characters (i.e., the characters in -category “Cf” in the Unicode Character Database such as LEFT-TO-RIGHT -MARK or RIGHT-TO-LEFT MARK) are control codes used to control the -formatting of a range of text in the absence of higher-level protocols +
The Unicode format-control characters (i.e., the characters in +category “Cf” in the Unicode Character Database such as LEFT-TO-RIGHT +MARK or RIGHT-TO-LEFT MARK) are control codes used to control the +formatting of a range of text in the absence of higher-level protocols for this (such as mark-up languages).
It is useful to allow format-control characters in source text to - facilitate editing and display. All format control characters may be + facilitate editing and display. All format control characters may be used within comments, and within string literals, template literals, and regular expression literals.
U+200C (ZERO WIDTH NON-JOINER) and U+200D (ZERO WIDTH JOINER) are
- format-control characters that are used to make necessary distinctions
+ format-control characters that are used to make necessary distinctions
when forming words or phrases in certain languages. In ECMAScript source
text these code points may also be used in an
U+FEFF (ZERO WIDTH NO-BREAK SPACE) is a format-control character +
U+FEFF (ZERO WIDTH NO-BREAK SPACE) is a format-control character
used primarily at the start of a text to mark it as Unicode and to allow
- detection of the text's encoding and byte order. <ZWNBSP>
+ detection of the text's encoding and byte order. <ZWNBSP>
characters intended for this purpose can sometimes also appear after the
- start of a text, for example as a result of concatenating files. In
-ECMAScript source text <ZWNBSP> code points are treated as white
+ start of a text, for example as a result of concatenating files. In
+ECMAScript source text <ZWNBSP> code points are treated as white
space characters (see
The special treatment of certain format-control characters +
The special treatment of certain format-control characters
outside of comments, string literals, and regular expression literals is
summarized in
U+200C
-
+
U+200D
-
+
U+FEFF
-
+
White space code points are used to improve source text +
White space code points are used to improve source text
readability and to separate tokens (indivisible lexical units) from each
- other, but are otherwise insignificant. White space code points may
-occur between any two tokens and at the start or end of input. White
+ other, but are otherwise insignificant. White space code points may
+occur between any two tokens and at the start or end of input. White
space code points may occur within a
The ECMAScript white space code points are listed in
Other than for the code points listed in
Like white space code points, line terminator code points are -used to improve source text readability and to separate tokens +
Like white space code points, line terminator code points are
+used to improve source text readability and to separate tokens
(indivisible lexical units) from each other. However, unlike white space
code points, line terminators have some influence over the behaviour of
- the syntactic grammar. In general, line terminators may occur between
-any two tokens, but there are a few places where they are forbidden by
-the syntactic grammar. Line terminators also affect the process of
+ the syntactic grammar. In general, line terminators may occur between
+any two tokens, but there are a few places where they are forbidden by
+the syntactic grammar. Line terminators also affect the process of
automatic semicolon insertion (
A line terminator can occur within a
Line terminators are included in the set of white space code points that are matched by the \s
class in regular expressions.
Comments can be either single or multi-line. Multi-line comments cannot nest.
Because a single-line comment can contain any Unicode code point except a //
marker to the end of the line. However, the
Comments behave like white space and are discarded except that, if a
This standard specifies specific code point additions: U+0024 (DOLLAR SIGN) and U+005F (LOW LINE) are permitted anywhere in an
Unicode escape sequences are permitted in an \
preceding the u
and { }
code units, if they appear, do not contribute code points to the \
Two
The nonterminal _
via
The sets of code points with Unicode properties “ID_Start” and -“ID_Continue” include, respectively, the code points with Unicode +
The sets of code points with Unicode properties “ID_Start” and +“ID_Continue” include, respectively, the code points with Unicode properties “Other_ID_Start” and “Other_ID_Continue”.
"$"
, or "_"
, or the "$"
, or "_"
, or the implements
-
+
package
-
+
protected
-
+
interface
-
+
private
-
+
public
-
+
A numeric literal stands for a value of the Number type. This - value is determined in two steps: first, a mathematical value (MV) is -derived from the literal; second, this mathematical value is rounded as + value is determined in two steps: first, a mathematical value (MV) is +derived from the literal; second, this mathematical value is rounded as described below.
Once the exact MV for a numeric literal has been determined, -it is then rounded to a value of the Number type. If the MV is 0, then +
Once the exact MV for a numeric literal has been determined,
+it is then rounded to a value of the Number type. If the MV is 0, then
the rounded value is 0
digit or the Number value for the MV of a literal produced by replacing each significant digit after the 20th with a 0
digit and then incrementing the literal at the 20th significant digit position. A digit is significant if it is not part of an
0
; or
-
+
0
A string literal is zero or more Unicode code points enclosed
in single or double quotes. Unicode code points may also be represented
by an escape sequence. All code points may appear literally in a string
- literal except for the closing quote code points, U+005C (REVERSE
-SOLIDUS), U+000D (CARRIAGE RETURN), and U+000A (LINE FEED). Any code
-points may appear in the form of an escape sequence. String literals
-evaluate to ECMAScript String values. When generating these String
+ literal except for the closing quote code points, U+005C (REVERSE
+SOLIDUS), U+000D (CARRIAGE RETURN), and U+000A (LINE FEED). Any code
+points may appear in the form of an escape sequence. String literals
+evaluate to ECMAScript String values. When generating these String
values Unicode code points are UTF-16 encoded as defined in The definition of the nonterminal
<LF> and <CR> cannot appear in a string literal, except as part of a \n
or \u000A
.
\n
or \u000A
.
A string literal stands for a value of the String type. The -String value (SV) of the literal is described in terms of code unit -values contributed by the various parts of the string literal. As part -of this process, some Unicode code points within the string literal are -interpreted as having a mathematical value (MV), as described below or +
A string literal stands for a value of the String type. The
+String value (SV) of the literal is described in terms of code unit
+values contributed by the various parts of the string literal. As part
+of this process, some Unicode code points within the string literal are
+interpreted as having a mathematical value (MV), as described below or
in
0x0022
-
+
"
-
+
\'
-
+
0x0027
-
+
'
-
+
\\
-
+
0x005C
-
+
\
-
+
The productions below describe the syntax for a regular +
The productions below describe the syntax for a regular
expression literal and are used by the input element scanner to find the
end of the regular expression literal. The source text comprising the
An implementation may extend the ECMAScript Regular Expression grammar defined in
Regular expression literals may not be empty; instead of +
Regular expression literals may not be empty; instead of
representing an empty regular expression literal, the code unit sequence
//
starts a single-line comment. To specify an empty regular expression, use: /(?:)/
.
A template literal component is interpreted as a sequence of -Unicode code points. The Template Value (TV) of a literal component is +
A template literal component is interpreted as a sequence of
+Unicode code points. The Template Value (TV) of a literal component is
described in terms of code unit values (SV,
Most ECMAScript statements and declarations must be terminated -with a semicolon. Such semicolons may always appear explicitly in the -source text. For convenience, however, such semicolons may be omitted -from the source text in certain situations. These situations are -described by saying that semicolons are automatically inserted into the +
Most ECMAScript statements and declarations must be terminated +with a semicolon. Such semicolons may always appear explicitly in the +source text. For convenience, however, such semicolons may be omitted +from the source text in certain situations. These situations are +described by saying that semicolons are automatically inserted into the source code token stream in those situations.
When, as the source text is parsed from left to right, a token (called the offending token) - is encountered that is not allowed by any production of the grammar, + is encountered that is not allowed by any production of the grammar, then a semicolon is automatically inserted before the offending token if one or more of the following conditions is true:
}
.
-
+
)
and the inserted semicolon would then be parsed as the terminating semicolon of a do-while statement (However, there is an additional overriding condition on the -preceding rules: a semicolon is never inserted automatically if the -semicolon would then be parsed as an empty statement or if that +
However, there is an additional overriding condition on the
+preceding rules: a semicolon is never inserted automatically if the
+semicolon would then be parsed as an empty statement or if that
semicolon would become one of the two semicolons in the header of a for
statement (see
The following are the only restricted productions in the grammar:
@@ -11651,26 +11651,26 @@ semicolon would become one of the two semicolons in the header of afor
When a ++
or --
token is encountered where the parser would treat it as a postfix operator, and at least one LineTerminator occurred between the preceding token and the ++
or --
token, then a semicolon is automatically inserted before the ++
or --
token.
-
+
When a continue
, break
, return
, throw
, or yield
token is encountered and a LineTerminator is encountered before the next token, a semicolon is automatically inserted after the continue
, break
, return
, throw
, or yield
token.
-
+
The resulting practical advice to ECMAScript programmers is:
-
A postfix
++
or --
operator should appear on the same line as its operand.
-
+
-
An
Expression in a return
or throw
statement or an AssignmentExpression in a yield
expression should start on the same line as the return
, throw
, or yield
token.
-
+
-
A
LabelIdentifier in a break
or continue
statement should be on the same line as the break
or continue
token.
-
+
forThe source
for (a; b
)
- is not a valid ECMAScript sentence and is not altered by
-automatic semicolon insertion because the semicolon is needed for the
+
is not a valid ECMAScript sentence and is not altered by
+automatic semicolon insertion because the semicolon is needed for the
header of a for
statement. Automatic semicolon insertion never inserts one of the two semicolons in the header of a for
statement.
The source
return
@@ -11715,17 +11715,17 @@ a + b;
if (a > b)
else c = d
is not a valid ECMAScript sentence and is not altered by automatic semicolon insertion before the else
- token, even though no production of the grammar applies at that point,
-because an automatically inserted semicolon would then be parsed as an
+ token, even though no production of the grammar applies at that point,
+because an automatically inserted semicolon would then be parsed as an
empty statement.
The source
a = b + c
(d + e).print()
- is not transformed by automatic semicolon insertion,
-because the parenthesized expression that begins the second line can be
+
is not transformed by automatic semicolon insertion,
+because the parenthesized expression that begins the second line can be
interpreted as an argument list for a function call:
a = b + c(d + e).print()
- In the circumstance that an assignment statement must begin
+
In the circumstance that an assignment statement must begin
with a left parenthesis, it is a good idea for the programmer to provide
an explicit semicolon at the end of the preceding statement rather than
to rely on automatic semicolon insertion.
@@ -11772,7 +11772,7 @@ with a left parenthesis, it is a good idea for the programmer to provide
-
It is a Syntax Error if the code matched by this production is contained in
strict mode code and the StringValue of Identifier is "arguments"
or "eval"
.
-
+
@@ -11787,7 +11787,7 @@ with a left parenthesis, it is a good idea for the programmer to provide
-
It is a Syntax Error if the code matched by this production is contained in
strict mode code .
-
+
@@ -11802,7 +11802,7 @@ with a left parenthesis, it is a good idea for the programmer to provide
-
It is a Syntax Error if the
goal symbol of the syntactic grammar is Module .
-
+
@@ -11811,7 +11811,7 @@ with a left parenthesis, it is a good idea for the programmer to provide
-
It is a Syntax Error if this production has a [Yield] parameter.
-
+
@@ -11820,7 +11820,7 @@ with a left parenthesis, it is a good idea for the programmer to provide
-
It is a Syntax Error if this production has an [
Await ] parameter.
-
+
@@ -11835,11 +11835,11 @@ with a left parenthesis, it is a good idea for the programmer to provide
-
It is a Syntax Error if this production has a [Yield] parameter and StringValue of
Identifier is "yield"
.
-
+
-
It is a Syntax Error if this production has an [
Await ] parameter and StringValue of Identifier is "await"
.
-
+
@@ -11848,15 +11848,15 @@ with a left parenthesis, it is a good idea for the programmer to provide
-
It is a Syntax Error if this phrase is contained in
strict mode code and the StringValue of IdentifierName is: "implements"
, "interface"
, "let"
, "package"
, "private"
, "protected"
, "public"
, "static"
, or "yield"
.
-
+
-
It is a Syntax Error if the
goal symbol of the syntactic grammar is Module and the StringValue of IdentifierName is "await"
.
-
+
-
It is a Syntax Error if StringValue of
IdentifierName is the same String value as the StringValue of any ReservedWord except for yield
or await
.
-
+
Note
@@ -12021,7 +12021,7 @@ with a left parenthesis, it is a good idea for the programmer to provide
Supplemental Syntax
When processing an instance of the production
-
+
PrimaryExpression[Yield, Await] : CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
@@ -12184,19 +12184,19 @@ with a left parenthesis, it is a good idea for the programmer to provide
12.2.5Array Initializer
Note
An ArrayLiteral
- is an expression describing the initialization of an Array object,
-using a list, of zero or more expressions each of which represents an
-array element, enclosed in square brackets. The elements need not be
-literals; they are evaluated each time the array initializer is
+ is an expression describing the initialization of an Array object,
+using a list, of zero or more expressions each of which represents an
+array element, enclosed in square brackets. The elements need not be
+literals; they are evaluated each time the array initializer is
evaluated.
Array elements may be elided at the beginning, middle or end of
- the element list. Whenever a comma in the element list is not preceded
+ the element list. Whenever a comma in the element list is not preceded
by an AssignmentExpression
- (i.e., a comma at the beginning or after another comma), the missing
-array element contributes to the length of the Array and increases the
-index of subsequent elements. Elided array elements are not defined. If
-an element is elided at the end of an array, that element does not
+ (i.e., a comma at the beginning or after another comma), the missing
+array element contributes to the length of the Array and increases the
+index of subsequent elements. Elided array elements are not defined. If
+an element is elided at the end of an array, that element does not
contribute to the length of the Array.
Syntax
@@ -12263,8 +12263,8 @@ contribute to the length of the Array.
Note
CreateDataProperty
is used to ensure that own properties are defined for the array even if
- the standard built-in Array prototype object has been modified in a
-manner that would preclude the creation of new own properties using
+ the standard built-in Array prototype object has been modified in a
+manner that would preclude the creation of new own properties using
[[Set]].
@@ -12292,10 +12292,10 @@ manner that would preclude the creation of new own properties using
12.2.6Object Initializer
Note 1
- An object initializer is an expression describing the
-initialization of an Object, written in a form resembling a literal. It
-is a list of zero or more pairs of property keys and associated values,
-enclosed in curly brackets. The values need not be literals; they are
+
An object initializer is an expression describing the
+initialization of an Object, written in a form resembling a literal. It
+is a list of zero or more pairs of property keys and associated values,
+enclosed in curly brackets. The values need not be literals; they are
evaluated each time the object initializer is evaluated.
Syntax
@@ -12338,8 +12338,8 @@ evaluated each time the object initializer is evaluated.
Note 3
In certain contexts, ObjectLiteral is used as a cover grammar for a more restricted secondary grammar. The CoverInitializedName
- production is necessary to fully cover these secondary grammars.
-However, use of this production results in an early Syntax Error in
+ production is necessary to fully cover these secondary grammars.
+However, use of this production results in an early Syntax Error in
normal contexts where an actual ObjectLiteral is expected.
@@ -12351,7 +12351,7 @@ normal contexts where an actual MethodDefinition is true .
-
+
In addition to describing an actual object initializer the ObjectLiteral productions are also used as a cover grammar for ObjectAssignmentPattern and may be recognized as part of a CoverParenthesizedExpressionAndArrowParameterList . When ObjectLiteral appears in a context where ObjectAssignmentPattern is required the following Early Error rules are not applied. In addition, they are not applied when initially parsing a CoverParenthesizedExpressionAndArrowParameterList or CoverCallExpressionAndAsyncArrowHead .
@@ -12361,7 +12361,7 @@ normal contexts where an actual Note
@@ -12569,11 +12569,11 @@ normal contexts where an actual RegularExpressionLiteral cannot be recognized using the goal symbol Pattern of the ECMAScript RegExp grammar specified in 21.2.1 .
-
+
It is a Syntax Error if FlagText of RegularExpressionLiteral contains any code points other than "g"
, "i"
, "m"
, "s"
, "u"
, or "y"
, or if it contains the same code point more than once.
-
+
@@ -12615,11 +12615,11 @@ normal contexts where an actual TemplateLiteral with argument false is greater than 232 - 1.
-
+
It is a Syntax Error if the [Tagged] parameter was not set and NoSubstitutionTemplate Contains NotEscapeSequence .
-
+
@@ -12629,7 +12629,7 @@ normal contexts where an actual TemplateHead Contains NotEscapeSequence .
-
+
@@ -12639,7 +12639,7 @@ normal contexts where an actual TemplateTail Contains NotEscapeSequence .
-
+
@@ -12650,7 +12650,7 @@ normal contexts where an actual TemplateMiddle Contains NotEscapeSequence .
-
+
@@ -12715,8 +12715,8 @@ normal contexts where an actual Note 2
Each TemplateLiteral in the program code of a realm is associated with a unique template object that is used in the evaluation of tagged Templates (12.2.9.6 ).
- The template objects are frozen and the same template object is used
-each time a specific tagged Template is evaluated. Whether template
+ The template objects are frozen and the same template object is used
+each time a specific tagged Template is evaluated. Whether template
objects are created lazily upon first evaluation of the TemplateLiteral or eagerly prior to first evaluation is an implementation choice that is not observable to ECMAScript code.
Note 3
@@ -12803,11 +12803,11 @@ objects are created lazily upon first evaluation of the
-
It is a Syntax Error if
CoverParenthesizedExpressionAndArrowParameterList is not covering a ParenthesizedExpression .
-
+
-
All Early Error rules for
ParenthesizedExpression and its derived productions also apply to CoveredParenthesizedExpression of CoverParenthesizedExpressionAndArrowParameterList .
-
+
@@ -13068,38 +13068,38 @@ objects are created lazily upon first evaluation of the
Properties are accessed by name, using either the dot notation:
or the bracket notation:
The dot notation is explained by the following syntactic conversion:
is identical in its behaviour to
and similarly
is identical in its behaviour to
where <identifier-name-string> is the result of evaluating StringValue of IdentifierName .
@@ -13311,11 +13311,11 @@ objects are created lazily upon first evaluation of the
-
It is an early
Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid .
-
+
-
It is an early Syntax Error if AssignmentTargetType of
LeftHandSideExpression is strict .
-
+
@@ -13326,11 +13326,11 @@ objects are created lazily upon first evaluation of the
-
It is an early
Reference Error if AssignmentTargetType of UnaryExpression is invalid .
-
+
-
It is an early Syntax Error if AssignmentTargetType of
UnaryExpression is strict .
-
+
@@ -13476,11 +13476,11 @@ objects are created lazily upon first evaluation of the
It is a Syntax Error if the UnaryExpression is contained in strict mode code and the derived UnaryExpression is
PrimaryExpression : IdentifierReference
.
-
+
It is a Syntax Error if the derived UnaryExpression is
-
+
PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList
@@ -13539,111 +13539,111 @@ objects are created lazily upon first evaluation of the
Type of val
-
+
Result
-
+
Undefined
-
+
"undefined"
-
+
Null
-
+
"object"
-
+
Boolean
-
+
"boolean"
-
+
Number
-
+
"number"
-
+
String
-
+
"string"
-
+
Symbol
-
+
"symbol"
-
+
Object (ordinary and does not implement [[Call]])
-
+
"object"
-
+
Object (standard exotic and does not implement [[Call]])
-
+
"object"
-
+
Object (implements [[Call]])
-
+
"function"
-
+
Object (non-standard exotic and does not implement [[Call]])
-
+
Implementation-defined. Must not be "undefined"
, "boolean"
, "function"
, "number"
, "symbol"
, or "string"
.
-
+
@@ -13757,7 +13757,7 @@ objects are created lazily upon first evaluation of the
12.6.4Applying the **
Operator
Returns an implementation-dependent approximation of the result of raising base to the power exponent.
-
+
- If exponent is
NaN , the result is NaN .
@@ -13832,45 +13832,45 @@ objects are created lazily upon first evaluation of the
12.7.3.1Applying the *
Operator
The *
MultiplicativeOperator
- performs multiplication, producing the product of its operands.
-Multiplication is commutative. Multiplication is not always associative
+ performs multiplication, producing the product of its operands.
+Multiplication is commutative. Multiplication is not always associative
in ECMAScript, because of finite precision.
The result of a floating-point multiplication is governed by the rules of IEEE 754-2008 binary double-precision arithmetic:
-
If either operand is
NaN , the result is NaN .
-
+
-
The sign of the result is positive if both operands have the
same sign, negative if the operands have different signs.
-
+
-
Multiplication of an infinity by a zero results in
NaN .
-
+
-
- Multiplication of an infinity by an infinity results in an
+ Multiplication of an infinity by an infinity results in an
infinity. The sign is determined by the rule already stated above.
-
+
-
- Multiplication of an infinity by a finite nonzero value
+ Multiplication of an infinity by a finite nonzero value
results in a signed infinity. The sign is determined by the rule already
stated above.
-
+
-
In the remaining cases, where neither an infinity nor
NaN
- is involved, the product is computed and rounded to the nearest
-representable value using IEEE 754-2008 round to nearest, ties to even
-mode. If the magnitude is too large to represent, the result is then an
-infinity of appropriate sign. If the magnitude is too small to
+ is involved, the product is computed and rounded to the nearest
+representable value using IEEE 754-2008 round to nearest, ties to even
+mode. If the magnitude is too large to represent, the result is then an
+infinity of appropriate sign. If the magnitude is too small to
represent, the result is then a zero of appropriate sign. The ECMAScript
- language requires support of gradual underflow as defined by IEEE
+ language requires support of gradual underflow as defined by IEEE
754-2008.
-
+
@@ -13878,60 +13878,60 @@ represent, the result is then a zero of appropriate sign. The ECMAScript
12.7.3.2Applying the /
Operator
The /
MultiplicativeOperator
- performs division, producing the quotient of its operands. The left
+ performs division, producing the quotient of its operands. The left
operand is the dividend and the right operand is the divisor. ECMAScript
- does not perform integer division. The operands and result of all
-division operations are double-precision floating-point numbers. The
-result of division is determined by the specification of IEEE 754-2008
+ does not perform integer division. The operands and result of all
+division operations are double-precision floating-point numbers. The
+result of division is determined by the specification of IEEE 754-2008
arithmetic:
-
If either operand is
NaN , the result is NaN .
-
+
-
The sign of the result is positive if both operands have the
same sign, negative if the operands have different signs.
-
+
-
Division of an infinity by an infinity results in
NaN .
-
+
-
Division of an infinity by a zero results in an infinity. The sign is determined by the rule already stated above.
-
+
-
Division of an infinity by a nonzero finite value results in
- a signed infinity. The sign is determined by the rule already stated
+ a signed infinity. The sign is determined by the rule already stated
above.
-
+
-
Division of a finite value by an infinity results in zero. The sign is determined by the rule already stated above.
-
+
-
Division of a zero by a zero results in
NaN ; division of zero by any other finite value results in zero, with the sign determined by the rule already stated above.
-
+
-
- Division of a nonzero finite value by a zero results in a
-signed infinity. The sign is determined by the rule already stated
+ Division of a nonzero finite value by a zero results in a
+signed infinity. The sign is determined by the rule already stated
above.
-
+
-
In the remaining cases, where neither an infinity, nor a zero, nor
NaN
- is involved, the quotient is computed and rounded to the nearest
-representable value using IEEE 754-2008 round to nearest, ties to even
-mode. If the magnitude is too large to represent, the operation
-overflows; the result is then an infinity of appropriate sign. If the
-magnitude is too small to represent, the operation underflows and the
-result is a zero of the appropriate sign. The ECMAScript language
+ is involved, the quotient is computed and rounded to the nearest
+representable value using IEEE 754-2008 round to nearest, ties to even
+mode. If the magnitude is too large to represent, the operation
+overflows; the result is then an infinity of appropriate sign. If the
+magnitude is too small to represent, the operation underflows and the
+result is a zero of the appropriate sign. The ECMAScript language
requires support of gradual underflow as defined by IEEE 754-2008.
-
+
@@ -13945,46 +13945,46 @@ requires support of gradual underflow as defined by IEEE 754-2008.
In C and C++, the remainder operator accepts only integral operands; in ECMAScript, it also accepts floating-point operands.
The result of a floating-point remainder operation as computed by the %
- operator is not the same as the “remainder” operation defined by IEEE
+ operator is not the same as the “remainder” operation defined by IEEE
754-2008. The IEEE 754-2008 “remainder” operation computes the remainder
- from a rounding division, not a truncating division, and so its
-behaviour is not analogous to that of the usual integer remainder
-operator. Instead the ECMAScript language defines %
on
+ from a rounding division, not a truncating division, and so its
+behaviour is not analogous to that of the usual integer remainder
+operator. Instead the ECMAScript language defines %
on
floating-point operations to behave in a manner analogous to that of the
- Java integer remainder operator; this may be compared with the C
+ Java integer remainder operator; this may be compared with the C
library function fmod.
The result of an ECMAScript floating-point remainder operation is determined by the rules of IEEE arithmetic:
-
If either operand is
NaN , the result is NaN .
-
+
-
The sign of the result equals the sign of the dividend.
-
+
-
If the dividend is an infinity, or the divisor is a zero, or both, the result is
NaN .
-
+
-
If the dividend is finite and the divisor is an infinity, the result equals the dividend.
-
+
-
If the dividend is a zero and the divisor is nonzero and finite, the result is the same as the dividend.
-
+
-
In the remaining cases, where neither an infinity, nor a zero, nor
NaN
- is involved, the floating-point remainder r from a dividend n and a
+ is involved, the floating-point remainder r from a dividend n and a
divisor d is defined by the mathematical relation r = n - (d × q) where q
- is an integer that is negative only if n/d is negative and positive
-only if n/d is positive, and whose magnitude is as large as possible
-without exceeding the magnitude of the true mathematical quotient of n
-and d. r is computed and rounded to the nearest representable value
+ is an integer that is negative only if n/d is negative and positive
+only if n/d is positive, and whose magnitude is as large as possible
+without exceeding the magnitude of the true mathematical quotient of n
+and d. r is computed and rounded to the nearest representable value
using IEEE 754-2008 round to nearest, ties to even mode.
-
+
No hint is provided in the calls to
The -
operator performs subtraction when applied
- to two operands of numeric type, producing the difference of its
-operands; the left operand is the minuend and the right operand is the
+ to two operands of numeric type, producing the difference of its
+operands; the left operand is the minuend and the right operand is the
subtrahend. Given numeric operands a
and b
, it is always the case that a - b
produces the same result as a + (-b)
.
a
and b
, it is alwa
The result of evaluating a relational operator is always of -type Boolean, reflecting whether the relationship named by the operator +
The result of evaluating a relational operator is always of +type Boolean, reflecting whether the relationship named by the operator holds between its two operands.
The result of evaluating an equality operator is always of type - Boolean, reflecting whether the relationship named by the operator + Boolean, reflecting whether the relationship named by the operator holds between its two operands.
"" + a == "" + b
.
-
+
+a == +b
.
-
+
!a == !b
.
-
+
A != B
is equivalent to !(A == B)
.
-
+
A == B
is equivalent to B == A
, except in the order of evaluation of A
and B
.
-
+
The equality operator is not always transitive. For example, -there might be two distinct String objects, each representing the same +
The equality operator is not always transitive. For example,
+there might be two distinct String objects, each representing the same
String value; each String object would be considered equal to the String
value by the ==
operator, but the two String objects would not be equal to each other. For example:
new String("a") == "a"
and "a" == new String("a")
are both new String("a") == new String("a")
is Comparison of Strings uses a simple equality test on -sequences of code unit values. There is no attempt to use the more -complex, semantically oriented definitions of character or string -equality and collating order defined in the Unicode specification. -Therefore Strings values that are canonically equal according to the +
Comparison of Strings uses a simple equality test on +sequences of code unit values. There is no attempt to use the more +complex, semantically oriented definitions of character or string +equality and collating order defined in the Unicode specification. +Therefore Strings values that are canonically equal according to the Unicode standard could test as unequal. In effect this algorithm assumes that both Strings are already in normalized form.
The grammar for a
At the top level of a function, or script, function -declarations are treated like var declarations rather than like lexical +
At the top level of a function, or script, function +declarations are treated like var declarations rather than like lexical declarations.
When a
BlockDeclarationInstantiation is performed as follows using arguments code and env. code is the
"let"
.
-
+
When
When
With parameters value, environment, and propertyName.
When
If
"let"
.
-
+
When the abstract operation EnumerateObjectProperties is called with argument O, the following steps are taken:
next
method iterates over all the String-valued keys of enumerable properties of O.
- The iterator object is never directly accessible to ECMAScript code.
-The mechanics and order of enumerating the properties is not specified
+ The iterator object is never directly accessible to ECMAScript code.
+The mechanics and order of enumerating the properties is not specified
but must conform to the rules specified below.
The iterator's throw
and return
methods are next
- method processes object properties to determine whether the property
-key should be returned as an iterator value. Returned property keys do
-not include keys that are Symbols. Properties of the target object may
-be deleted during enumeration. A property that is deleted before it is
-processed by the iterator's next
method is ignored. If new
-properties are added to the target object during enumeration, the newly
-added properties are not guaranteed to be processed in the active
+ method processes object properties to determine whether the property
+key should be returned as an iterator value. Returned property keys do
+not include keys that are Symbols. Properties of the target object may
+be deleted during enumeration. A property that is deleted before it is
+processed by the iterator's next
method is ignored. If new
+properties are added to the target object during enumeration, the newly
+added properties are not guaranteed to be processed in the active
enumeration. A next
method at most once in any enumeration.
Enumerating the properties of the target object includes
-enumerating properties of its prototype, and the prototype of the
-prototype, and so on, recursively; but a property of a prototype is not
-processed if it has the same name as a property that has already been
-processed by the iterator's next
method. The values of
-[[Enumerable]] attributes are not considered when determining if a
-property of a prototype object has already been processed. The
-enumerable property names of prototype objects must be obtained by
-invoking EnumerateObjectProperties passing the prototype object as the
+
Enumerating the properties of the target object includes
+enumerating properties of its prototype, and the prototype of the
+prototype, and so on, recursively; but a property of a prototype is not
+processed if it has the same name as a property that has already been
+processed by the iterator's next
method. The values of
+[[Enumerable]] attributes are not considered when determining if a
+property of a prototype object has already been processed. The
+enumerable property names of prototype objects must be obtained by
+invoking EnumerateObjectProperties passing the prototype object as the
argument. EnumerateObjectProperties must obtain the own property keys of
- the target object by calling its [[OwnPropertyKeys]] internal method.
+ the target object by calling its [[OwnPropertyKeys]] internal method.
Property attributes of the target object must be obtained by calling its
[[GetOwnProperty]] internal method.
A break
and continue
statements. ECMAScript has no goto
statement. A
Evaluating a
A
The
"eval"
or "arguments"
.
-
+
"*default*"
is used within this specification as
- a synthetic name for hoistable anonymous functions that are defined
+ a synthetic name for hoistable anonymous functions that are defined
using export declarations.
The ExpectedArgumentCount of a
With parameters iteratorRecord and environment.
When
When the production
-
+
When
An arguments
, super
, this
, or new.target
. Any reference to arguments
, super
, this
, or new.target
within an super
, the super
is always contained within a non-super
is accessible via the scope that is captured by the
"eval"
or "arguments"
.
-
+
"*default*"
is used within this specification as
- a synthetic name for hoistable anonymous functions that are defined
+ a synthetic name for hoistable anonymous functions that are defined
using export declarations.
"*default*"
is used within this specification as
- a synthetic name for hoistable anonymous functions that are defined
+ a synthetic name for hoistable anonymous functions that are defined
using export declarations.
"constructor"
.
-
+
"constructor"
and HasDirectSuper of "constructor"
and SpecialMethod of "prototype"
.
-
+
"*default*"
».
*default*
"
- is used within this specification as a synthetic name for hoistable
+ is used within this specification as a synthetic name for hoistable
anonymous functions that are defined using export declarations.A tail position call must either release any transient internal resources associated with the currently executing function
For example, a tail position call should only grow an -implementation's activation record stack by the amount that the size of -the target function's activation record exceeds the size of the calling +
For example, a tail position call should only grow an +implementation's activation record stack by the amount that the size of +the target function's activation record exceeds the size of the calling function's activation record. If the target function's activation record is smaller, then the total size of the stack should decrease.
super
unless the source code containing super
is eval code that is being processed by a super
within An implementation may parse script source text and analyse it - for Early Error conditions prior to evaluation of ParseScript for that -script source text. However, the reporting of any errors must be -deferred until the point where this specification actually performs + for Early Error conditions prior to evaluation of ParseScript for that +script source text. However, the reporting of any errors must be +deferred until the point where this specification actually performs ParseScript upon that source text.
Early errors specified in
Unlike explicit var or function declarations, properties that are directly created on the
super
.
-
+
The duplicate ExportedNames rule implies that multiple export default
A Module Record encapsulates structural -information about the imports and exports of a single module. This +
A Module Record encapsulates structural +information about the imports and exports of a single module. This information is used to link the imports and exports of sets of connected - modules. A Module Record includes four fields that are only used when + modules. A Module Record includes four fields that are only used when evaluating a module.
For specification purposes Module Record values are values of the
Module Record defines the fields listed in
Return the binding of a name exported by this module. Bindings are represented by a ResolvedBinding Record, of the form { [[Module]]: "ambiguous"
if multiple bindings were found.
Prepare the module for evaluation by transitively resolving all module dependencies and creating a module
If this module has already been evaluated successfully, return
Instantiate must have completed successfully prior to invoking this method.
A Cyclic Module Record -is used to represent information about a module that can participate in +
A Cyclic Module Record
+is used to represent information about a module that can participate in
dependency cycles with other modules that are subclasses of the
In addition to the fields defined in
"instantiating"
, "instantiated"
, "evaluating"
, "evaluated"
(in that order) as the module progresses throughout its lifecycle.
-
+
"evaluated"
.
-
+
"instantiating"
or "evaluating"
,
this nonnegative number records the point at which the module was first
- visited during the ongoing depth-first traversal of the dependency
+ visited during the ongoing depth-first traversal of the dependency
graph.
-
+
"instantiating"
or "evaluating"
, this is either the module's own [[DFSIndex]] or that of an "earlier" module in the same strongly connected component.
-
+
The InnerModuleInstantiation abstract operation is used by Instantiate to perform the actual instantiation process for the "instantiated"
together.
This abstract operation performs the following steps:
@@ -21624,8 +21624,8 @@ components (SCCs), such that all modules in an SCC transition to"instanti
The Evaluate concrete method of a Cyclic Module Record implements the corresponding Module Record abstract method.
Evaluate transitions this module's [[Status]] from "instantiated"
to "evaluated"
.
- If execution results in an exception, that exception is
-recorded in the [[EvaluationError]] field and rethrown by future
+
If execution results in an exception, that exception is
+recorded in the [[EvaluationError]] field and rethrown by future
invocations of Evaluate.
This abstract method performs the following steps (most of the work is done by the auxiliary function InnerModuleEvaluation ):
@@ -21641,7 +21641,7 @@ invocations of Evaluate.
This abstract operation performs the following steps:
- If module is not a
Cyclic Module Record , then- Perform ? module.Evaluate().
- Return index.
- If module.[[Status]] is
"evaluated"
, then- If module.[[EvaluationError]] is
undefined , return index. - Otherwise return module.[[EvaluationError]].
- If module.[[Status]] is
"evaluating"
, return index. Assert : module.[[Status]] is "instantiated"
.- Set module.[[Status]] to
"evaluating"
. - Set module.[[DFSIndex]] to index.
- Set module.[[DFSAncestorIndex]] to index.
- Increase index by 1.
- Append module to stack.
- For each String required that is an element of module.[[RequestedModules]], do
- Let requiredModule be !
HostResolveImportedModule (module, required). - NOTE:
- Instantiate must be completed successfully prior to invoking this
+ Instantiate must be completed successfully prior to invoking this
method, so every requested module is guaranteed to resolve successfully.
- Set index to ?
InnerModuleEvaluation (requiredModule, stack, index). Assert : requiredModule.[[Status]] is either "evaluating"
or "evaluated"
.Assert : requiredModule.[[Status]] is "evaluating"
if and only if requiredModule is in stack.- If requiredModule.[[Status]] is
"evaluating"
, thenAssert : requiredModule is a Cyclic Module Record .- Set module.[[DFSAncestorIndex]] to
min (module.[[DFSAncestorIndex]], requiredModule.[[DFSAncestorIndex]]).
- Perform ? module.
ExecuteModule (). Assert : module occurs exactly once in stack.Assert : module.[[DFSAncestorIndex]] is less than or equal to module.[[DFSIndex]].- If module.[[DFSAncestorIndex]] equals module.[[DFSIndex]], then
- Let done be
false . - Repeat, while done is
false ,- Let requiredModule be the last element in stack.
- Remove the last element of stack.
- Set requiredModule.[[Status]] to
"evaluated"
. - If requiredModule and module are the same
Module Record , set done to true .
- Return index.
@@ -21650,8 +21650,8 @@ method, so every requested module is guaranteed to resolve successfully.
15.2.1.16.3Example Cyclic Module Record Graphs
- This non-normative section gives a series of examples of
-the instantiation and evaluation of a few common module graphs, with a
+
This non-normative section gives a series of examples of
+the instantiation and evaluation of a few common module graphs, with a
specific focus on how errors can occur.
First consider the following simple module graph:
@@ -21661,28 +21661,28 @@ specific focus on how errors can occur.
Let's first assume that there are no error conditions. When a host first calls A.Instantiate(), this will complete successfully by assumption, and recursively instantiate modules B and C as well, such that A.[[Status]] = B.[[Status]] = C.[[Status]] = "instantiated"
.
- This preparatory step can be performed at any time. Later, when the
-host is ready to incur any possible side effects of the modules, it can
+ This preparatory step can be performed at any time. Later, when the
+host is ready to incur any possible side effects of the modules, it can
call A.Evaluate(), which will complete successfully (again by assumption), recursively having evaluated first C and then B. Each module's [[Status]] at this point will be "evaluated
".
Consider then cases involving instantiation errors. If "uninstantiated"
. C's [[Status]] has become "instantiated"
, though.
Finally, consider a case involving evaluation errors. If "evaluated"
. C will also become "evaluated"
but, in contrast to A and B,
- will remain without an [[EvaluationError]], as it successfully
+ will remain without an [[EvaluationError]], as it successfully
completed evaluation. Storing the exception ensures that any time a host
tries to reuse A or B by calling their Evaluate()
- method, it will encounter the same exception. (Hosts are not required
-to reuse Cyclic Module Records; similarly, hosts are not required to
-expose the exception objects thrown by these methods. However, the
+ method, it will encounter the same exception. (Hosts are not required
+to reuse Cyclic Module Records; similarly, hosts are not required to
+expose the exception objects thrown by these methods. However, the
specification enables such uses.)
The difference here between instantiation and evaluation -errors is due to how evaluation must be only performed once, as it can -cause side effects; it is thus important to remember whether evaluation -has already been performed, even if unsuccessfully. (In the error case, -it makes sense to also remember the exception because otherwise -subsequent Evaluate() calls would have to synthesize a new one.) -Instantiation, on the other hand, is side-effect-free, and thus even if +
The difference here between instantiation and evaluation +errors is due to how evaluation must be only performed once, as it can +cause side effects; it is thus important to remember whether evaluation +has already been performed, even if unsuccessfully. (In the error case, +it makes sense to also remember the exception because otherwise +subsequent Evaluate() calls would have to synthesize a new one.) +Instantiation, on the other hand, is side-effect-free, and thus even if it fails, it can be retried at a later time with no issues.
Now consider a different type of error condition:
@@ -21692,11 +21692,11 @@ it fails, it can be retried at a later time with no issues.In this scenario, module A declares a dependency on some other module, but no "uninstantiated"
.
Lastly, consider a module graph with a cycle:
@@ -21711,9 +21711,9 @@ throw from"instantiating"
). Hence both A and B become "uninstantiated"
. Note that C is left as "instantiated"
.
- Finally, consider a case where A has an -evaluation error; for example, its source code throws an exception. In -that case, the evaluation-time analog of the above steps still occurs, +
Finally, consider a case where A has an
+evaluation error; for example, its source code throws an exception. In
+that case, the evaluation-time analog of the above steps still occurs,
including the early return from the second call to "evaluating"
). Hence both A and B become "evaluated"
and the exception is recorded in both A and B's [[EvaluationError]] fields, while C is left as "evaluated"
with no [[EvaluationError]].
A Source Text Module Record is used to represent information about a module that was defined from ECMAScript source text (
"*"
indicates that the import request is for the target module's namespace object.
-
+
import v from "mod";
-
+
"mod"
-
+
"default"
-
+
"v"
-
+
import * as ns from "mod";
-
+
"mod"
-
+
"*"
-
+
"ns"
-
+
import {x} from "mod";
-
+
"mod"
-
+
"x"
-
+
"x"
-
+
import {x as v} from "mod";
-
+
"mod"
-
+
"x"
-
+
"v"
-
+
import "mod";
-
+
"*"
indicates that the export request is for all exported bindings.
-
+
export var v;
-
+
"v"
-
+
"v"
-
+
export default function f(){}
-
+
"default"
-
+
"f"
-
+
export default function(){}
-
+
"default"
-
+
"*default*"
-
+
export default 42;
-
+
"default"
-
+
"*default*"
-
+
export {x};
-
+
"x"
-
+
"x"
-
+
export {v as x};
-
+
"x"
-
+
"v"
-
+
export {x} from "mod";
-
+
"x"
-
+
"mod"
-
+
"x"
-
+
export {v as x} from "mod";
-
+
"x"
-
+
"mod"
-
+
"v"
-
+
export * from "mod";
-
+
"mod"
-
+
"*"
-
+
"*"
, then"*"
, then"uninstantiated"
, [[EvaluationError]]: An implementation may parse module source text and -analyse it for Early Error conditions prior to the evaluation of -ParseModule for that module source text. However, the reporting of any -errors must be deferred until the point where this specification +
An implementation may parse module source text and +analyse it for Early Error conditions prior to the evaluation of +ParseModule for that module source text. However, the reporting of any +errors must be deferred until the point where this specification actually performs ParseModule upon that source text.
The ResolveExport concrete method of a
ResolveExport attempts to resolve an imported binding to -the actual defining module and local binding name. The defining module +
ResolveExport attempts to resolve an imported binding to
+the actual defining module and local binding name. The defining module
may be the module represented by the
If a defining module is found, a "ambiguous"
is returned.
This abstract method performs the following steps:
@@ -22375,20 +22375,20 @@ was found or the request is found to be circular,Multiple different referencingModule, specifier pairs may map to the same
The only way GetModuleNamespace can throw is via one of the triggered
An implementation may parse a sourceText as a
"implements"
, "interface"
, "let"
, "package"
, "private"
, "protected"
, "public"
, or "static"
.
-
+
It is not necessary to treat export default
An implementation must report most errors at the time the relevant ECMAScript language construct is evaluated. An early error is an error that can be detected and reported prior to the evaluation of any construct in the eval
is called and prevent evaluation of the eval code. All errors that are not early errors are runtime errors.
An implementation must report as an
An implementation shall not treat other kinds of errors as early -errors even if the compiler can prove that a construct cannot execute -without error under any circumstances. An implementation may issue an -early warning in such a case, but it should not report the error until +
An implementation shall not treat other kinds of errors as early +errors even if the compiler can prove that a construct cannot execute +without error under any circumstances. An implementation may issue an +early warning in such a case, but it should not report the error until the relevant construct is actually executed.
An implementation shall report all errors as specified, except for the following:
eval
, using a regular expression literal, or using the Function
or RegExp
HostReportErrors is an implementation-defined abstract operation -that allows host environments to report parsing errors, early errors, +
HostReportErrors is an implementation-defined abstract operation +that allows host environments to report parsing errors, early errors, and runtime errors.
-An implementation of HostReportErrors must complete normally in -all cases. The default implementation of HostReportErrors is to +
An implementation of HostReportErrors must complete normally in +all cases. The default implementation of HostReportErrors is to unconditionally return an empty normal completion.
"caller"
or "arguments"
. Such own properties also must not be created for function objects defined using an Function
Generator
AsyncFunction
bind
method also must not be created with such own properties.
-
+
"caller"
the value of that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a "caller"
.
-
+
Object.prototype.toLocaleString
, Array.prototype.toLocaleString
, Number.prototype.toLocaleString
, Date.prototype.toLocaleDateString
, Date.prototype.toLocaleString
, Date.prototype.toLocaleTimeString
, String.prototype.localeCompare
, .prototype.toLocaleString
.
-
+
:
to immediately follow source text that matches the There are certain built-in objects available whenever an ECMAScript
Unless specified otherwise, a built-in object that is callable as a function is a built-in
Many built-in objects are functions: they can be invoked with +
Many built-in objects are functions: they can be invoked with
arguments. Some of them furthermore are constructors: they are functions
- intended for use with the new
operator. For each built-in
-function, this specification describes the arguments required by that
+ intended for use with the new
operator. For each built-in
+function, this specification describes the arguments required by that
function and the properties of that new
expression that invokes that
Unless otherwise specified in the description of a particular function, if a built-in function or this
value” and “NewTarget” have the meanings given in
Unless otherwise specified in the description of a particular function, if a built-in function or
Implementations that add additional capabilities to the set of -built-in functions are encouraged to do so by adding new functions +
Implementations that add additional capabilities to the set of +built-in functions are encouraged to do so by adding new functions rather than adding new parameters to existing functions.
Unless otherwise specified every built-in function and every built-in Function.prototype
(
Unless otherwise specified every built-in prototype object has the +
Unless otherwise specified every built-in prototype object has the
Object prototype object, which is the initial value of the expression Object.prototype
(
Built-in function objects that are not identified as constructors -do not implement the [[Construct]] internal method unless otherwise +
Built-in function objects that are not identified as constructors +do not implement the [[Construct]] internal method unless otherwise specified in the description of a particular function.
Each built-in function defined in this specification is created by calling the
Every built-in "length"
- property whose value is an integer. Unless otherwise specified, this
-value is equal to the largest number of named arguments shown in the
-subclause headings for the function description. Optional parameters
+ property whose value is an integer. Unless otherwise specified, this
+value is equal to the largest number of named arguments shown in the
+subclause headings for the function description. Optional parameters
(which are indicated with brackets: [
]
) or rest parameters (which are shown using the form «...name») are not included in the default argument count.
For example, the map
property of the Array prototype object is described under the subclause
heading «Array.prototype.map (callbackFn [ , thisArg])» which shows the
- two named arguments callbackFn and thisArg, the latter being optional;
+ two named arguments callbackFn and thisArg, the latter being optional;
therefore the value of the "length"
property of that
Unless otherwise specified, the "length"
property of a built-in
Every built-in name
- property whose value is a String. Unless otherwise specified, this
-value is the name that is given to the function in this specification.
-For functions that are specified as properties of objects, the name
+ property whose value is a String. Unless otherwise specified, this
+value is the name that is given to the function in this specification.
+For functions that are specified as properties of objects, the name
value is the "get "
or "set "
prepended to the name
property is explicitly specified for each built-in functions whose property key is a Symbol value.
Unless otherwise specified, the name
property of a built-in
Every other
new
operator.
"derived"
, let inDerivedConstructor be eval
function.The eval code cannot instantiate variable or function +
The eval code cannot instantiate variable or function
bindings in the variable environment of the calling context that invoked
- the eval if the calling context is evaluating formal parameter
-initializers or if either the code of the calling context or the eval
+ the eval if the calling context is evaluating formal parameter
+initializers or if either the code of the calling context or the eval
code is let
, const
, or class
declarations are always instantiated in a new LexicalEnvironment.
let
HostEnsureCanCompileStrings is an implementation-defined -abstract operation that allows host environments to block certain -ECMAScript functions which allow developers to compile strings into +
HostEnsureCanCompileStrings is an implementation-defined +abstract operation that allows host environments to block certain +ECMAScript functions which allow developers to compile strings into ECMAScript code.
An implementation of HostEnsureCanCompileStrings may complete - normally or abruptly. Any abrupt completions will be propagated to its + normally or abruptly. Any abrupt completions will be propagated to its callers. The default implementation of HostEnsureCanCompileStrings is to unconditionally return an empty normal completion.
@@ -23289,8 +23289,8 @@ callers. The default implementation of HostEnsureCanCompileStrings is to #sec-variablestatements-in-catch-blocks accordingly. -->eval
will not create a global var declaration that would be shadowed by a global lexical declaration.parseFloat
may interpret only a leading portion of string
as a Number value; it ignores any code units that cannot be interpreted
- as part of the notation of a decimal literal, and no indication is
+ as part of the notation of a decimal literal, and no indication is
given that any such code units were ignored.
The parseInt
function is the %parseInt% intrinsic object. When the parseInt
function is called, the following steps are taken:
"0x"
or "0X"
, thenparseInt
may interpret only a leading portion of string
- as an integer value; it ignores any code units that cannot be
-interpreted as part of the notation of an integer, and no indication is
+ as an integer value; it ignores any code units that cannot be
+interpreted as part of the notation of an integer, and no indication is
given that any such code units were ignored.
Uniform Resource Identifiers, or URIs, are Strings that -identify resources (e.g. web pages or files) and transport protocols by -which to access them (e.g. HTTP or FTP) on the Internet. The ECMAScript -language itself does not provide any support for using URIs except for +
Uniform Resource Identifiers, or URIs, are Strings that
+identify resources (e.g. web pages or files) and transport protocols by
+which to access them (e.g. HTTP or FTP) on the Internet. The ECMAScript
+language itself does not provide any support for using URIs except for
functions that encode and decode URIs as described in
Many implementations of ECMAScript provide additional -functions and methods that manipulate web pages; these functions are +
Many implementations of ECMAScript provide additional +functions and methods that manipulate web pages; these functions are beyond the scope of this standard.
A URI is composed of a sequence of components separated by component separators. The general form is:
:
/
;
?
where the italicized names represent components and “:
”, “/
”, “;
” and “?
” are reserved for use as separators. The encodeURI
and decodeURI
functions are intended to work with complete URIs; they assume that any
reserved code units in the URI are intended to have special meaning and
so are not encoded. The encodeURIComponent
and decodeURIComponent
functions are intended to work with the individual component parts of a
- URI; they assume that any reserved code units represent text and so
-must be encoded so that they are not interpreted as reserved code units
+ URI; they assume that any reserved code units represent text and so
+must be encoded so that they are not interpreted as reserved code units
when the component is part of a complete URI.
The following lexical grammar specifies the form of encoded URIs.
The above syntax is based upon RFC 2396 and does not reflect changes introduced by the more recent RFC 3986.
When a code unit to be included in a URI is not listed above -or is not intended to have the special meaning sometimes given to the -reserved code units, that code unit must be encoded. The code unit is +
When a code unit to be included in a URI is not listed above
+or is not intended to have the special meaning sometimes given to the
+reserved code units, that code unit must be encoded. The code unit is
transformed into its UTF-8 encoding, with "%xx"
.
"%xx"
.
This syntax of Uniform Resource Identifiers is based upon - RFC 2396 and does not reflect the more recent RFC 3986 which replaces -RFC 2396. A formal description and implementation of UTF-8 is given in + RFC 2396 and does not reflect the more recent RFC 3986 which replaces +RFC 2396. A formal description and implementation of UTF-8 is given in RFC 3629.
In UTF-8, characters are encoded using sequences of 1 to 6 - octets. The only octet of a sequence of one has the higher-order bit + octets. The only octet of a sequence of one has the higher-order bit set to 0, the remaining 7 bits being used to encode the character value. - In a sequence of n octets, n > 1, the initial octet has the n -higher-order bits set to 1, followed by a bit set to 0. The remaining -bits of that octet contain bits from the value of the character to be + In a sequence of n octets, n > 1, the initial octet has the n +higher-order bits set to 1, followed by a bit set to 0. The remaining +bits of that octet contain bits from the value of the character to be encoded. The following octets all have the higher-order bit set to 1 and the following bit set to 0, leaving 6 bits in each to contain bits from the character to be encoded. The possible UTF-8 encodings of ECMAScript @@ -23452,33 +23452,33 @@ encoded. The following octets all have the higher-order bit set to 1 and
0x0000 - 0x007F
-
+
00000000 0zzzzzzz
@@ -23496,7 +23496,7 @@ encoded. The following octets all have the higher-order bit set to 1 and
0x0080 - 0x07FF
-
+
00000yyy yyzzzzzz
@@ -23515,7 +23515,7 @@ encoded. The following octets all have the higher-order bit set to 1 and
0x0800 - 0xD7FF
-
+
xxxxyyyy yyzzzzzz
@@ -23535,19 +23535,19 @@ encoded. The following octets all have the higher-order bit set to 1 and
0xD800 - 0xDBFF
-
+
0xDC00 - 0xDFFF
-
+
110110vv vvwwwwxx
110111yy yyzzzzzz
0xD800 - 0xDBFF
-
+
0xDC00 - 0xDFFF
-
+
URIError
-
+
0xDC00 - 0xDFFF
-
+
URIError
-
+
0xE000 - 0xFFFF
-
+
xxxxyyyy yyzzzzzz
@@ -23630,19 +23630,19 @@ encoded. The following octets all have the higher-order bit set to 1 and
Where
-
+
uuuuu = vvvv + 1
-
+
to account for the addition of 0x10000 as in section 3.8 of the Unicode Standard (Surrogates).
The above transformation combines each
RFC 3629 prohibits the decoding of invalid UTF-8 octet -sequences. For example, the invalid sequence C0 80 must not decode into -the code unit 0x0000. Implementations of the Decode algorithm are +
RFC 3629 prohibits the decoding of invalid UTF-8 octet
+sequences. For example, the invalid sequence C0 80 must not decode into
+the code unit 0x0000. Implementations of the Decode algorithm are
required to throw a
The decodeURI
function computes a new version of
a URI in which each escape sequence and UTF-8 encoding of the sort that
- might be introduced by the encodeURI
function is replaced
-with the UTF-16 encoding of the code points that it represents. Escape
+ might be introduced by the encodeURI
function is replaced
+with the UTF-16 encoding of the code points that it represents. Escape
sequences that could not have been introduced by encodeURI
are not replaced.
The decodeURI
function is the %decodeURI% intrinsic object. When the decodeURI
function is called with one argument encodedURI, the following steps are taken:
"#"
.encodeURI
are not
The decodeURIComponent
function computes a new
+
The decodeURIComponent
function computes a new
version of a URI in which each escape sequence and UTF-8 encoding of the
sort that might be introduced by the encodeURIComponent
function is replaced with the UTF-16 encoding of the code points that it represents.
The decodeURIComponent
function is the %decodeURIComponent% intrinsic object. When the decodeURIComponent
function is called with one argument encodedURIComponent, the following steps are taken:
The encodeURI
function computes a new version of a UTF-16 encoded (
The encodeURI
function is the %encodeURI% intrinsic object. When the encodeURI
function is called with one argument uri, the following steps are taken:
"#"
.The encodeURIComponent
function computes a new version of a UTF-16 encoded (
The encodeURIComponent
function is the %encodeURIComponent% intrinsic object. When the encodeURIComponent
function is called with one argument uriComponent, the following steps are taken:
A CreateDataPropertyOnObject function is an anonymous -built-in function. When a CreateDataPropertyOnObject function is called +
A CreateDataPropertyOnObject function is an anonymous +built-in function. When a CreateDataPropertyOnObject function is called with arguments key and value, the following steps are taken:
The ordering of steps 1 and 2 is chosen to ensure that any -exception that would have been thrown by step 1 in previous editions of +
The ordering of steps 1 and 2 is chosen to ensure that any
+exception that would have been thrown by step 1 in previous editions of
this specification will continue to be thrown even if the
The ordering of steps 1 and 2 is chosen to ensure that any -exception that would have been thrown by step 1 in previous editions of +
The ordering of steps 1 and 2 is chosen to ensure that any
+exception that would have been thrown by step 1 in previous editions of
this specification will continue to be thrown even if the
Historically, this function was occasionally used to access
- the String value of the [[Class]] internal slot that was used in
-previous editions of this specification as a nominal type tag for
+ the String value of the [[Class]] internal slot that was used in
+previous editions of this specification as a nominal type tag for
various built-in objects. The above definition of toString
preserves compatibility for legacy code that uses toString
- as a test for those specific kinds of built-in objects. It does not
+ as a test for those specific kinds of built-in objects. It does not
provide a reliable type testing mechanism for other kinds of built-in or
program defined objects. In addition, programs can use @@toStringTag in
ways that will invalidate the reliability of such legacy type tests.
Function
property of the Function(…)
is equivalent to the object creation expression new Function(…)
with the same arguments.extends
clause of a class definition. Subclass constructors that intend to inherit the specified Function
behaviour must include a super
call to the Function
Function
. There is no syntactic means to create instances of Function
subclasses except for the built-in GeneratorFunction
, AsyncFunction
, and AsyncGeneratorFunction
subclasses.Function
. T
"normal"
, args).
It is permissible but not necessary to have one argument +
It is permissible but not necessary to have one argument for each formal parameter to be specified. For example, all three of the following expressions produce the same result:
new Function("a", "b", "c", "return a+b+c")
@@ -24253,8 +24253,8 @@ for each formal parameter to be specified. For example, all three of the
are applied. Parsing and early error detection may be interweaved in an implementation-dependent manner.- If strict is
true and IsSimpleParameterList of parameters is false , throw a SyntaxError exception. - If any element of the BoundNames of parameters also occurs in the LexicallyDeclaredNames of body, throw a
SyntaxError exception. - If body Contains
SuperCall is true , throw a SyntaxError exception. - If parameters Contains
SuperCall is true , throw a SyntaxError exception. - If body Contains
SuperProperty is true , throw a SyntaxError exception. - If parameters Contains
SuperProperty is true , throw a SyntaxError exception. - If kind is
"generator"
or "async generator"
, then- If parameters Contains
YieldExpression is true , throw a SyntaxError exception.
- If kind is
"async"
or "async generator"
, then- If parameters Contains
AwaitExpression is true , throw a SyntaxError exception.
- If strict is
true , then- If BoundNames of parameters contains any duplicate elements, throw a
SyntaxError exception.
- Let proto be ?
GetPrototypeFromConstructor (newTarget, fallbackProto). - Let F be
FunctionAllocate (proto, strict, kind). - Let realmF be F.[[Realm]].
- Let scope be realmF.[[GlobalEnv]].
- Perform
FunctionInitialize (F, Normal , parameters, body, scope). - If kind is
"generator"
, then- Let prototype be
ObjectCreate (%GeneratorPrototype% ). - Perform
DefinePropertyOrThrow (F, "prototype"
, PropertyDescriptor { [[Value]]: prototype, [[Writable]]: true , [[Enumerable]]: false , [[Configurable]]: false }).
- Else if kind is
"async generator"
, then- Let prototype be
ObjectCreate (%AsyncGeneratorPrototype% ). - Perform
DefinePropertyOrThrow (F, "prototype"
, PropertyDescriptor { [[Value]]: prototype, [[Writable]]: true , [[Enumerable]]: false , [[Configurable]]: false }).
- Else if kind is
"normal"
, perform MakeConstructor (F). - NOTE: Async functions are not constructable and do not have a [[Construct]] internal method or a
"prototype"
property. - Perform
SetFunctionName (F, "anonymous"
). - Let prefix be the prefix associated with kind in
Table 47 . - Let sourceText be the
string-concatenation of prefix, " anonymous("
, P, 0x000A (LINE FEED), ") {"
, 0x000A (LINE FEED), bodyText, 0x000A (LINE FEED), and "}"
. - Set F.[[SourceText]] to sourceText.
- Return F.
Note
- A prototype
property is created for every
-non-async function created using CreateDynamicFunction to provide for
+
A prototype
property is created for every
+non-async function created using CreateDynamicFunction to provide for
the possibility that the function will be used as a constructor .
@@ -24341,8 +24341,8 @@ the possibility that the function will be used as a 19.2.3.3Function.prototype.call ( thisArg, ...args )
When the call
method is called with argument thisArg and zero or more args, the following steps are taken:
- Let func be the
this value. - If
IsCallable (func) is false , throw a TypeError exception. - Let argList be a new empty
List . - If
- this method was called with more than one argument, then in left to
-right order, starting with the second argument, append each argument as
+ this method was called with more than one argument, then in left to
+right order, starting with the second argument, append each argument as
the last element of argList.
- Perform
PrepareForTailCall (). - Return ?
Call (func, thisArg, argList).
Note 1
@@ -24397,8 +24397,8 @@ the last element of argList.- Perform
19.2.4.1length
The value of the "length"
property is an integer
- that indicates the typical number of arguments expected by the
-function. However, the language permits the function to be invoked with
+ that indicates the typical number of arguments expected by the
+function. However, the language permits the function to be invoked with
some other number of arguments. The behaviour of a function when invoked
on a number of arguments other than the number specified by its "length"
property depends on the function. This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: true }.
@@ -24406,7 +24406,7 @@ some other number of arguments. The behaviour of a function when invoked
19.2.4.2name
The value of the name
property is a String that is descriptive of the function. The name has no semantic significance but is typically a variable or property name
- that is used to refer to the function at its point of definition in
+ that is used to refer to the function at its point of definition in
ECMAScript code. This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: true }.
Anonymous functions objects that do not have a contextual name associated with them by this specification do not have a name
own property but inherit the name
property of %FunctionPrototype% .
@@ -24425,14 +24425,14 @@ ECMAScript code. This property has the attributes { [[Writable]]: false
19.2.5HostHasSourceTextAvailable ( func )
- HostHasSourceTextAvailable is an implementation-defined
-abstract operation that allows host environments to prevent the source
+
HostHasSourceTextAvailable is an implementation-defined
+abstract operation that allows host environments to prevent the source
text from being provided for a given function.
- An implementation of HostHasSourceTextAvailable must complete
+
An implementation of HostHasSourceTextAvailable must complete
normally in all cases. This operation must be deterministic with respect
to its parameters. Each time it is called with a specific func
as its argument, it must return the same completion record. The default
- implementation of HostHasSourceTextAvailable is to unconditionally
+ implementation of HostHasSourceTextAvailable is to unconditionally
return a normal completion with a value of true .
@@ -24510,9 +24510,9 @@ return a normal completion with a value of true .
19.3.4Properties of Boolean Instances
- Boolean instances are ordinary objects that inherit properties
-from the Boolean prototype object. Boolean instances have a
-[[BooleanData]] internal slot. The [[BooleanData]] internal slot is the
+
Boolean instances are ordinary objects that inherit properties
+from the Boolean prototype object. Boolean instances have a
+[[BooleanData]] internal slot. The [[BooleanData]] internal slot is the
Boolean value represented by this Boolean object.
@@ -24560,7 +24560,7 @@ Boolean value represented by this Boolean object.
- Let stringKey be ?
ToString (key). - For each element e of the GlobalSymbolRegistry
List , do- If
SameValue (e.[[Key]], stringKey) is true , return e.[[Symbol]].
Assert : GlobalSymbolRegistry does not currently contain an entry for stringKey.- Let newSymbol be a new unique Symbol value whose [[Description]] value is stringKey.
- Append the
Record { [[Key]]: stringKey, [[Symbol]]: newSymbol } to the GlobalSymbolRegistry List . - Return newSymbol.
The GlobalSymbolRegistry is a List
- that is globally available. It is shared by all realms. Prior to the
+ that is globally available. It is shared by all realms. Prior to the
evaluation of any ECMAScript code it is initialized as a new empty List . Elements of the GlobalSymbolRegistry are Records with the structure defined in Table 48 .
Table 48: GlobalSymbolRegistry Record Fields