Annex B (normative) Additional ECMAScript Features for Web Browsers
The ECMAScript language syntax and semantics defined in this annex are required when the ECMAScript
This annex describes various legacy features and other characteristics of web browser ECMAScript
These features are not considered part of the core ECMAScript language. Programmers should not use or assume the existence of these features and behaviours when writing new ECMAScript code. ECMAScript implementations are discouraged from implementing these features unless the implementation is part of a web browser or is required to run the same legacy ECMAScript code that web browsers encounter.
B.1 Additional Syntax
B.1.1 HTML-like Comments
The syntax and semantics of
Syntax
Similar to a
B.1.2 Regular Expressions Patterns
The syntax of
This alternative pattern grammar and semantics only changes the syntax and semantics of BMP patterns. The following grammar extensions include productions parameterized with the [UnicodeMode] parameter. However, none of these extensions change the syntax of Unicode patterns recognized when parsing with the [UnicodeMode] parameter present on the
Syntax
When the same left-hand sides occurs with both [+UnicodeMode] and [~UnicodeMode] guards it is to control the disambiguation priority.
B.1.2.1 Static Semantics: Early Errors
The semantics of
- It is a Syntax Error if any source text is matched by this production.
Additionally, the rules for the following productions are modified with the addition of the highlighted text:
-
It is a Syntax Error if
IsCharacterClass of the firstClassAtom istrue orIsCharacterClass of the secondClassAtom istrue and this production has a [UnicodeMode] parameter. -
It is a Syntax Error if
IsCharacterClass of the firstClassAtom isfalse andIsCharacterClass of the secondClassAtom isfalse and theCharacterValue of the firstClassAtom is larger than theCharacterValue of the secondClassAtom .
-
It is a Syntax Error if
IsCharacterClass ofClassAtomNoDash istrue orIsCharacterClass ofClassAtom istrue and this production has a [UnicodeMode] parameter. -
It is a Syntax Error if
IsCharacterClass ofClassAtomNoDash isfalse andIsCharacterClass ofClassAtom isfalse and theCharacterValue ofClassAtomNoDash is larger than theCharacterValue ofClassAtom .
B.1.2.2 Static Semantics: IsCharacterClass
The semantics of
- Return
false .
B.1.2.3 Static Semantics: CharacterValue
The semantics of
- Return the numeric value of U+005C (REVERSE SOLIDUS).
- Let ch be the code point matched by
ClassControlLetter . - Let i be the numeric value of ch.
- Return the remainder of dividing i by 32.
- Return the MV of
LegacyOctalEscapeSequence (see12.8.4.3 ).
B.1.2.4 Runtime Semantics: CompileSubpattern
The semantics of
Within the rule for
The rule for
The rule for
The rule for
B.1.2.5 Runtime Semantics: CompileAssertion
B.1.2.6 Runtime Semantics: CompileAtom
- Let A be the CharSet containing the single character
\U+005C (REVERSE SOLIDUS). - Return
CharacterSetMatcher (A,false , direction).
- Let ch be the character represented by
ExtendedPatternCharacter . - Let A be a one-element CharSet containing the character ch.
- Return
CharacterSetMatcher (A,false , direction).
B.1.2.7 Runtime Semantics: CompileToCharSet
The semantics of
The following two rules replace the corresponding rules of
- Let A be
CompileToCharSet of the firstClassAtom . - Let B be
CompileToCharSet of the secondClassAtom . - Let C be
CompileToCharSet ofClassRanges . - Let D be CharacterRangeOrUnion(A, B).
- Return the union of D and C.
- Let A be
CompileToCharSet ofClassAtomNoDash . - Let B be
CompileToCharSet ofClassAtom . - Let C be
CompileToCharSet ofClassRanges . - Let D be CharacterRangeOrUnion(A, B).
- Return the union of D and C.
In addition, the following rules are added to
- Let cv be the
CharacterValue of thisClassEscape . - Let c be the character whose character value is cv.
- Return the CharSet containing the single character c.
- Return the CharSet containing the single character
\U+005C (REVERSE SOLIDUS).
\c within a character class where it is not followed by an acceptable control character.B.1.2.7.1 CharacterRangeOrUnion ( A, B )
The abstract operation CharacterRangeOrUnion takes arguments A (a CharSet) and B (a CharSet) and returns a CharSet. It performs the following steps when called:
- If Unicode is
false , then- If A does not contain exactly one character or B does not contain exactly one character, then
- Let C be the CharSet containing the single character
-U+002D (HYPHEN-MINUS). - Return the union of CharSets A, B and C.
- Let C be the CharSet containing the single character
- If A does not contain exactly one character or B does not contain exactly one character, then
- Return
CharacterRange (A, B).
B.2 Additional Built-in Properties
When the ECMAScript
B.2.1 Additional Properties of the Global Object
The entries in
| Intrinsic Name | Global Name | ECMAScript Language Association |
|---|---|---|
|
|
escape
|
The escape function ( |
|
|
unescape
|
The unescape function ( |
B.2.1.1 escape ( string )
The escape function is a property of the
For those code units being replaced whose value is 0x00FF or less, a two-digit escape sequence of the form %xx is used. For those characters being replaced whose code unit value is greater than 0x00FF, a four-digit escape sequence of the form %uxxxx is used.
The escape function is the escape function is called with one argument string, the following steps are taken:
- Set string to ?
ToString (string). - Let length be the number of code units in string.
- Let R be the empty String.
- Let k be 0.
- Repeat, while k < length,
- Let char be the code unit (represented as a 16-bit unsigned
integer ) at index k within string. - If char is one of the code units in
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@*_+-./" , then- Let S be the String value containing the single code unit char.
- Else if char ≥ 256, then
- Let n be the numeric value of char.
- Let S be the
string-concatenation of:"%u" - the String representation of n, formatted as a four-digit uppercase hexadecimal number, padded to the left with zeroes if necessary
- Else,
Assert : char < 256.- Let n be the numeric value of char.
- Let S be the
string-concatenation of:"%" - the String representation of n, formatted as a two-digit uppercase hexadecimal number, padded to the left with a zero if necessary
- Set R to the
string-concatenation of R and S. - Set k to k + 1.
- Let char be the code unit (represented as a 16-bit unsigned
- Return R.
The encoding is partly based on the encoding described in RFC 1738, but the entire encoding specified in this standard is described above without regard to the contents of RFC 1738. This encoding does not reflect changes to RFC 1738 made by RFC 3986.
B.2.1.2 unescape ( string )
The unescape function is a property of the escape function is replaced with the code unit that it represents.
The unescape function is the unescape function is called with one argument string, the following steps are taken:
- Set string to ?
ToString (string). - Let length be the number of code units in string.
- Let R be the empty String.
- Let k be 0.
- Repeat, while k ≠ length,
- Let c be the code unit at index k within string.
- If c is the code unit 0x0025 (PERCENT SIGN), then
- Let hexEscape be the empty String.
- Let skip be 0.
- If k ≤ length - 6 and the code unit at index k + 1 within string is the code unit 0x0075 (LATIN SMALL LETTER U), then
- Set hexEscape to the
substring of string from k + 2 to k + 6. - Set skip to 5.
- Set hexEscape to the
- Else if k ≤ length - 3, then
- Set hexEscape to the
substring of string from k + 1 to k + 3. - Set skip to 2.
- Set hexEscape to the
- If hexEscape can be interpreted as an expansion of
HexDigits , then[~Sep] - Let hexIntegerLiteral be the
string-concatenation of"0x" and hexEscape. - Let n be !
ToNumber (hexIntegerLiteral). - Set c to the code unit whose value is ℝ(n).
- Set k to k + skip.
- Let hexIntegerLiteral be the
- Set R to the
string-concatenation of R and c. - Set k to k + 1.
- Return R.
B.2.2 Additional Properties of the String.prototype Object
B.2.2.1 String.prototype.substr ( start, length )
The substr method takes two arguments, start and length, and returns a
- Let O be ?
RequireObjectCoercible (this value). - Let S be ?
ToString (O). - Let size be the length of S.
- Let intStart be ?
ToIntegerOrInfinity (start). - If intStart is -∞, set intStart to 0.
- Else if intStart < 0, set intStart to
max (size + intStart, 0). - If length is
undefined , let intLength be size; otherwise let intLength be ?ToIntegerOrInfinity (length). - If intStart is +∞, intLength ≤ 0, or intLength is +∞, return the empty String.
- Let intEnd be
min (intStart + intLength, size). - If intStart ≥ intEnd, return the empty String.
- Return the
substring of S from intStart to intEnd.
The substr function is intentionally generic; it does not require that its
B.2.2.2 String.prototype.anchor ( name )
When the anchor method is called with argument name, the following steps are taken:
- Let S be the
this value. - Return ? CreateHTML(S,
"a" ,"name" , name).
B.2.2.2.1 CreateHTML ( string, tag, attribute, value )
The abstract operation CreateHTML takes arguments string, tag (a String), attribute (a String), and value and returns either a
- Let str be ?
RequireObjectCoercible (string). - Let S be ?
ToString (str). - Let p1 be the
string-concatenation of"<" and tag. - If attribute is not the empty String, then
- Let V be ?
ToString (value). - Let escapedV be the String value that is the same as V except that each occurrence of the code unit 0x0022 (QUOTATION MARK) in V has been replaced with the six code unit sequence
""" . - Set p1 to the
string-concatenation of:- p1
- the code unit 0x0020 (SPACE)
- attribute
- the code unit 0x003D (EQUALS SIGN)
- the code unit 0x0022 (QUOTATION MARK)
- escapedV
- the code unit 0x0022 (QUOTATION MARK)
- Let V be ?
- Let p2 be the
string-concatenation of p1 and">" . - Let p3 be the
string-concatenation of p2 and S. - Let p4 be the
string-concatenation of p3,"</" , tag, and">" . - Return p4.
B.2.2.3 String.prototype.big ( )
When the big method is called with no arguments, the following steps are taken:
- Let S be the
this value. - Return ? CreateHTML(S,
"big" ,"" ,"" ).
B.2.2.4 String.prototype.blink ( )
When the blink method is called with no arguments, the following steps are taken:
- Let S be the
this value. - Return ? CreateHTML(S,
"blink" ,"" ,"" ).
B.2.2.5 String.prototype.bold ( )
When the bold method is called with no arguments, the following steps are taken:
- Let S be the
this value. - Return ? CreateHTML(S,
"b" ,"" ,"" ).
B.2.2.6 String.prototype.fixed ( )
When the fixed method is called with no arguments, the following steps are taken:
- Let S be the
this value. - Return ? CreateHTML(S,
"tt" ,"" ,"" ).
B.2.2.7 String.prototype.fontcolor ( color )
When the fontcolor method is called with argument color, the following steps are taken:
- Let S be the
this value. - Return ? CreateHTML(S,
"font" ,"color" , color).
B.2.2.8 String.prototype.fontsize ( size )
When the fontsize method is called with argument size, the following steps are taken:
- Let S be the
this value. - Return ? CreateHTML(S,
"font" ,"size" , size).
B.2.2.9 String.prototype.italics ( )
When the italics method is called with no arguments, the following steps are taken:
- Let S be the
this value. - Return ? CreateHTML(S,
"i" ,"" ,"" ).
B.2.2.10 String.prototype.link ( url )
When the link method is called with argument url, the following steps are taken:
- Let S be the
this value. - Return ? CreateHTML(S,
"a" ,"href" , url).
B.2.2.11 String.prototype.small ( )
When the small method is called with no arguments, the following steps are taken:
- Let S be the
this value. - Return ? CreateHTML(S,
"small" ,"" ,"" ).
B.2.2.12 String.prototype.strike ( )
When the strike method is called with no arguments, the following steps are taken:
- Let S be the
this value. - Return ? CreateHTML(S,
"strike" ,"" ,"" ).
B.2.2.13 String.prototype.sub ( )
When the sub method is called with no arguments, the following steps are taken:
- Let S be the
this value. - Return ? CreateHTML(S,
"sub" ,"" ,"" ).
B.2.2.14 String.prototype.sup ( )
When the sup method is called with no arguments, the following steps are taken:
- Let S be the
this value. - Return ? CreateHTML(S,
"sup" ,"" ,"" ).
B.2.2.15 String.prototype.trimLeft ( )
The property
The initial value of the
B.2.2.16 String.prototype.trimRight ( )
The property
The initial value of the
B.2.3 Additional Properties of the Date.prototype Object
B.2.3.1 Date.prototype.getYear ( )
The getFullYear method is preferred for nearly all purposes, because it avoids the “year 2000 problem.”
When the getYear method is called with no arguments, the following steps are taken:
- Let t be ?
thisTimeValue (this value). - If t is
NaN , returnNaN . - Return
YearFromTime (LocalTime (t)) -1900 𝔽.
B.2.3.2 Date.prototype.setYear ( year )
The setFullYear method is preferred for nearly all purposes, because it avoids the “year 2000 problem.”
When the setYear method is called with one argument year, the following steps are taken:
- Let t be ?
thisTimeValue (this value). - Let y be ?
ToNumber (year). - If t is
NaN , set t to+0 𝔽; otherwise, set t toLocalTime (t). - If y is
NaN , then- Set the [[DateValue]] internal slot of
this Date object toNaN . - Return
NaN .
- Set the [[DateValue]] internal slot of
- Let yi be !
ToIntegerOrInfinity (y). - If 0 ≤ yi ≤ 99, let yyyy be
1900 𝔽 + 𝔽(yi). - Else, let yyyy be y.
- Let d be
MakeDay (yyyy,MonthFromTime (t), DateFromTime(t)). - Let date be
UTC (MakeDate (d,TimeWithinDay (t))). - Set the [[DateValue]] internal slot of
this Date object toTimeClip (date). - Return the value of the [[DateValue]] internal slot of
this Date object .
B.2.3.3 Date.prototype.toGMTString ( )
The toUTCString method is preferred. The toGMTString method is provided principally for compatibility with old code.
The initial value of the
B.2.4 Additional Properties of the RegExp.prototype Object
B.2.4.1 RegExp.prototype.compile ( pattern, flags )
When the compile method is called with arguments pattern and flags, the following steps are taken:
- Let O be the
this value. - Perform ?
RequireInternalSlot (O, [[RegExpMatcher]]). - If
Type (pattern) is Object and pattern has a [[RegExpMatcher]] internal slot, then- If flags is not
undefined , throw aTypeError exception. - Let P be pattern.[[OriginalSource]].
- Let F be pattern.[[OriginalFlags]].
- If flags is not
- Else,
- Let P be pattern.
- Let F be flags.
- Return ?
RegExpInitialize (O, P, F).
The compile method completely reinitializes the
B.3 Other Additional Features
B.3.1 Labelled Function Declarations
Prior to ECMAScript 2015, the specification of
-
It is a Syntax Error if any source text that is
strict mode code is matched by this production.
The
B.3.2 Block-Level Function Declarations Web Legacy Compatibility Semantics
Prior to ECMAScript 2015, the ECMAScript specification did not define the occurrence of a
-
A function is declared and only referenced within a single block.
-
One or more
FunctionDeclaration s whoseBindingIdentifier is the name f occur within the function code of an enclosing function g and that declaration is nested within aBlock . -
No other declaration of f that is not a
vardeclaration occurs within the function code of g. -
All occurrences of f as an
IdentifierReference are within theStatementList of theBlock containing the declaration of f.
-
One or more
-
A function is declared and possibly used within a single
Block but also referenced by an inner function definition that is not contained within that sameBlock .-
One or more
FunctionDeclaration s whoseBindingIdentifier is the name f occur within the function code of an enclosing function g and that declaration is nested within aBlock . -
No other declaration of f that is not a
vardeclaration occurs within the function code of g. -
There may be occurrences of f as an
IdentifierReference within theStatementList of theBlock containing the declaration of f. -
There is at least one occurrence of f as an
IdentifierReference within another function h that is nested within g and no other declaration of f shadows the references to f from within h. - All invocations of h occur after the declaration of f has been evaluated.
-
One or more
-
A function is declared and possibly used within a single block but also referenced within subsequent blocks.
-
One or more
FunctionDeclaration whoseBindingIdentifier is the name f occur within the function code of an enclosing function g and that declaration is nested within aBlock . -
No other declaration of f that is not a
vardeclaration occurs within the function code of g. -
There may be occurrences of f as an
IdentifierReference within theStatementList of theBlock containing the declaration of f. -
There is at least one occurrence of f as an
IdentifierReference within the function code of g that lexically follows theBlock containing the declaration of f.
-
One or more
The first use case is interoperable with the semantics of
ECMAScript 2015 interoperability for the second and third use cases requires the following extensions to the clause
If an ECMAScript implementation has a mechanism for reporting diagnostic warning messages, a warning should be produced when code contains a
B.3.2.1 Changes to FunctionDeclarationInstantiation
During
- If strict is
false , then- For each
FunctionDeclaration f that is directly contained in theStatementList of aBlock ,CaseClause , orDefaultClause , do- Let F be
StringValue of theBindingIdentifier of f. - If replacing the
FunctionDeclaration f with aVariableStatement that has F as aBindingIdentifier would not produce any Early Errors for func and F is not an element of parameterNames, then- NOTE: A var binding for F is only instantiated here if it is neither a VarDeclaredName, the name of a formal parameter, or another
FunctionDeclaration . - If initializedBindings does not contain F and F is not
"arguments" , then- Perform ! varEnv.CreateMutableBinding(F,
false ). - Perform ! varEnv.InitializeBinding(F,
undefined ). - Append F to instantiatedVarNames.
- Perform ! varEnv.CreateMutableBinding(F,
- When the
FunctionDeclaration f is evaluated, perform the following steps in place of theFunctionDeclaration Evaluation algorithm provided in15.2.6 :- Let fenv be the
running execution context 's VariableEnvironment. - Let benv be the
running execution context 's LexicalEnvironment. - Let fobj be ! benv.GetBindingValue(F,
false ). - Perform ! fenv.SetMutableBinding(F, fobj,
false ). - Return
unused .
- Let fenv be the
- NOTE: A var binding for F is only instantiated here if it is neither a VarDeclaredName, the name of a formal parameter, or another
- Let F be
- For each
B.3.2.2 Changes to GlobalDeclarationInstantiation
During
- Perform the following steps:
- Let strict be
IsStrict of script. - If strict is
false , then- Let declaredFunctionOrVarNames be the
list-concatenation of declaredFunctionNames and declaredVarNames. - For each
FunctionDeclaration f that is directly contained in theStatementList of aBlock ,CaseClause , orDefaultClause Contained within script, do- Let F be
StringValue of theBindingIdentifier of f. - If replacing the
FunctionDeclaration f with aVariableStatement that has F as aBindingIdentifier would not produce any Early Errors for script, then- If env.HasLexicalDeclaration(F) is
false , then- Let fnDefinable be ? env.CanDeclareGlobalVar(F).
- If fnDefinable is
true , then- NOTE: A var binding for F is only instantiated here if it is neither a VarDeclaredName nor the name of another
FunctionDeclaration . - If declaredFunctionOrVarNames does not contain F, then
- Perform ? env.CreateGlobalVarBinding(F,
false ). - Append F to declaredFunctionOrVarNames.
- Perform ? env.CreateGlobalVarBinding(F,
- When the
FunctionDeclaration f is evaluated, perform the following steps in place of theFunctionDeclaration Evaluation algorithm provided in15.2.6 :- Let genv be the
running execution context 's VariableEnvironment. - Let benv be the
running execution context 's LexicalEnvironment. - Let fobj be ! benv.GetBindingValue(F,
false ). - Perform ?
genv.SetMutableBinding (F, fobj,false ). - Return
unused .
- Let genv be the
- NOTE: A var binding for F is only instantiated here if it is neither a VarDeclaredName nor the name of another
- If env.HasLexicalDeclaration(F) is
- Let F be
- Let declaredFunctionOrVarNames be the
- Let strict be
B.3.2.3 Changes to EvalDeclarationInstantiation
During
- If strict is
false , then- Let declaredFunctionOrVarNames be the
list-concatenation of declaredFunctionNames and declaredVarNames. - For each
FunctionDeclaration f that is directly contained in theStatementList of aBlock ,CaseClause , orDefaultClause Contained within body, do- Let F be
StringValue of theBindingIdentifier of f. - If replacing the
FunctionDeclaration f with aVariableStatement that has F as aBindingIdentifier would not produce any Early Errors for body, then- Let bindingExists be
false . - Let thisEnv be lexEnv.
Assert : The following loop will terminate.- Repeat, while thisEnv is not the same as varEnv,
- If thisEnv is not an
object Environment Record , then- If ! thisEnv.HasBinding(F) is
true , then- Let bindingExists be
true .
- Let bindingExists be
- If ! thisEnv.HasBinding(F) is
- Set thisEnv to thisEnv.[[OuterEnv]].
- If thisEnv is not an
- If bindingExists is
false and varEnv is aglobal Environment Record , then- If varEnv.HasLexicalDeclaration(F) is
false , then- Let fnDefinable be ? varEnv.CanDeclareGlobalVar(F).
- Else,
- Let fnDefinable be
false .
- Let fnDefinable be
- If varEnv.HasLexicalDeclaration(F) is
- Else,
- Let fnDefinable be
true .
- Let fnDefinable be
- If bindingExists is
false and fnDefinable istrue , then- If declaredFunctionOrVarNames does not contain F, then
- If varEnv is a
global Environment Record , then- Perform ? varEnv.CreateGlobalVarBinding(F,
true ).
- Perform ? varEnv.CreateGlobalVarBinding(F,
- Else,
- Let bindingExists be ! varEnv.HasBinding(F).
- If bindingExists is
false , then- Perform ! varEnv.CreateMutableBinding(F,
true ). - Perform ! varEnv.InitializeBinding(F,
undefined ).
- Perform ! varEnv.CreateMutableBinding(F,
- Append F to declaredFunctionOrVarNames.
- If varEnv is a
- When the
FunctionDeclaration f is evaluated, perform the following steps in place of theFunctionDeclaration Evaluation algorithm provided in15.2.6 :- Let genv be the
running execution context 's VariableEnvironment. - Let benv be the
running execution context 's LexicalEnvironment. - Let fobj be ! benv.GetBindingValue(F,
false ). - Perform ?
genv.SetMutableBinding (F, fobj,false ). - Return
unused .
- Let genv be the
- If declaredFunctionOrVarNames does not contain F, then
- Let bindingExists be
- Let F be
- Let declaredFunctionOrVarNames be the
B.3.2.4 Changes to Block Static Semantics: Early Errors
The rules for the following production in
-
It is a Syntax Error if the
LexicallyDeclaredNames ofStatementList contains any duplicate entries, unless thesource text matched by this production is notstrict mode code and the duplicate entries are only bound by FunctionDeclarations. -
It is a Syntax Error if any element of the
LexicallyDeclaredNames ofStatementList also occurs in theVarDeclaredNames ofStatementList .
B.3.2.5 Changes to switch Statement Static Semantics: Early Errors
The rules for the following production in
-
It is a Syntax Error if the
LexicallyDeclaredNames ofCaseBlock contains any duplicate entries, unless thesource text matched by this production is notstrict mode code and the duplicate entries are only bound by FunctionDeclarations. -
It is a Syntax Error if any element of the
LexicallyDeclaredNames ofCaseBlock also occurs in theVarDeclaredNames ofCaseBlock .
B.3.2.6 Changes to BlockDeclarationInstantiation
During
- If ! env.HasBinding(dn) is
false , then- Perform ! env.CreateMutableBinding(dn,
false ).
- Perform ! env.CreateMutableBinding(dn,
During
- Perform the following steps:
- If the binding for fn in env is an uninitialized binding, then
- Perform ! env.InitializeBinding(fn, fo).
- Else,
Assert : d is aFunctionDeclaration .- Perform ! env.SetMutableBinding(fn, fo,
false ).
- If the binding for fn in env is an uninitialized binding, then
B.3.3 FunctionDeclarations in IfStatement Statement Clauses
The following augments the
This production only applies when parsing
B.3.4 VariableStatements in Catch Blocks
The content of subclause
-
It is a Syntax Error if
BoundNames ofCatchParameter contains any duplicate elements. -
It is a Syntax Error if any element of the
BoundNames ofCatchParameter also occurs in theLexicallyDeclaredNames ofBlock . -
It is a Syntax Error if any element of the
BoundNames ofCatchParameter also occurs in theVarDeclaredNames ofBlock unlessCatchParameter is .CatchParameter : BindingIdentifier
The var declarations that bind a name that is also bound by the var declarations will assign to the corresponding catch parameter rather than the var binding.
This modified behaviour also applies to var and function declarations introduced by
Step
- If thisEnv is not the
Environment Record for aCatch clause, throw aSyntaxError exception.
Step
- If thisEnv is not the
Environment Record for aCatch clause, let bindingExists betrue .
B.3.5 Initializers in ForIn Statement Heads
The following augments the
This production only applies when parsing
The
- Return
ContainsDuplicateLabels ofStatement with argument labelSet.
The
- Return
ContainsUndefinedBreakTarget ofStatement with argument labelSet.
The
- Return
ContainsUndefinedContinueTarget ofStatement with arguments iterationSet and « ».
The
- Return
false .
The
- Let names1 be the
BoundNames ofBindingIdentifier . - Let names2 be the
VarDeclaredNames ofStatement . - Return the
list-concatenation of names1 and names2.
The
- Let declarations1 be «
BindingIdentifier ». - Let declarations2 be the
VarScopedDeclarations ofStatement . - Return the
list-concatenation of declarations1 and declarations2.
The
- Let bindingId be
StringValue ofBindingIdentifier . - Let lhs be ?
ResolveBinding (bindingId). - If
IsAnonymousFunctionDefinition (Initializer ) istrue , then- Let value be ?
NamedEvaluation ofInitializer with argument bindingId.
- Let value be ?
- Else,
- Let rhs be the result of evaluating
Initializer . - Let value be ?
GetValue (rhs).
- Let rhs be the result of evaluating
- Perform ?
PutValue (lhs, value). - Let keyResult be ? ForIn/OfHeadEvaluation(« »,
Expression ,enumerate ). - Return ? ForIn/OfBodyEvaluation(
BindingIdentifier ,Statement , keyResult,enumerate ,varBinding , labelSet).
B.3.6 The [[IsHTMLDDA]] Internal Slot
An [[IsHTMLDDA]] internal slot may exist on typeof operator
Objects with an [[IsHTMLDDA]] internal slot are never created by this specification. However, the document.all object in web browsers is a document.all.
B.3.6.1 Changes to ToBoolean
The result column in
- If argument has an [[IsHTMLDDA]] internal slot, return
false . - Return
true .
B.3.6.2 Changes to IsLooselyEqual
During
B.3.6.3 Changes to the typeof Operator
The following step replaces step typeof
- If
Type (val) is Object and val has an [[IsHTMLDDA]] internal slot, return"undefined" .