mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 13:21:55 +00:00
1234 lines
158 KiB
HTML
1234 lines
158 KiB
HTML
<!DOCTYPE html><html lang="en-GB-oxendict"><head><meta name="viewport" content="width=device-width, initial-scale=1"><meta charset="utf-8"><meta property="og:image" content="https://tc39.es/ecmarkup/ecma-logo.png"><meta property="og:title" content="ECMAScript® 2026 Language Specification"><meta property="og:description" content="Introduction
|
||
This Ecma Standard defines the ECMAScript 2026 Language. It is the seventeenth edition of the ECMAScript Language Specification. ECMAScript is based on several originating technologies, the most well-known being JavaScript (Netscape) and JScript (Microsoft). The language was invent">
|
||
<link rel="icon" href="../img/favicon.ico">
|
||
<link rel="stylesheet" href="../assets/css/ecmarkup.css"><link rel="stylesheet" href="../assets/css/print.css" media="print">
|
||
|
||
<title>ECMAScript® 2026 Language Specification</title><script src="../assets/js/multipage.js?cache=Wu2V1pj2" defer=""></script><script src="../assets/js/ecmarkup.js?cache=BPFBckdu" defer=""></script><link rel="canonical" href="../#sec-additional-ecmascript-features-for-web-browsers"></head>
|
||
<body><div id="spec-container"><emu-annex id="sec-additional-ecmascript-features-for-web-browsers" namespace="annexB" normative="">
|
||
<h1><span class="secnum">Annex B <span class="annex-kind">(normative)</span></span> Additional ECMAScript Features for Web Browsers</h1>
|
||
<p>The ECMAScript language syntax and semantics defined in this annex are required when the ECMAScript <emu-xref href="#host" id="_ref_17371"><a href="overview.html#host">host</a></emu-xref> is a web browser. The content of this annex is normative but optional if the ECMAScript <emu-xref href="#host" id="_ref_17372"><a href="overview.html#host">host</a></emu-xref> is not a web browser.</p>
|
||
<p>Some features defined in this annex are specified in this annex, and some are specified in the main body of this document.</p>
|
||
<p>When a feature is specified in the main body, each point where it affects the document is marked with the words "<emu-xref href="#sec-conformance" id="_ref_17373"><a href="conformance.html#sec-conformance">Normative Optional</a></emu-xref>" in a coloured box. Moreover, where the feature involves particular wording in an algorithm or <emu-xref href="#early-error" id="_ref_17374"><a href="error-handling-and-language-extensions.html#early-error">early error</a></emu-xref> rule, this is guarded by the condition that “<dfn variants="otherwise supports" tabindex="-1">the host supports</dfn>” the relevant feature. Web browsers are required to support all such features.</p>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>This annex describes various legacy features and other characteristics of web browser ECMAScript <emu-xref href="#host" id="_ref_17375"><a href="overview.html#host">hosts</a></emu-xref>. All of the language features and behaviours specified in this annex have one or more undesirable characteristics and in the absence of legacy usage would be removed from this specification. However, the usage of these features by large numbers of existing web pages means that web browsers must continue to support them. The specifications in this annex define the requirements for interoperable implementations of these legacy features.</p>
|
||
<p>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.</p>
|
||
</div></emu-note>
|
||
|
||
<emu-annex id="sec-additional-syntax">
|
||
<h1><span class="secnum">B.1</span> Additional Syntax</h1>
|
||
|
||
<emu-annex id="sec-html-like-comments">
|
||
<h1><span class="secnum">B.1.1</span> HTML-like Comments</h1>
|
||
<p>The syntax and semantics of <emu-xref href="#sec-comments" id="_ref_853"><a href="ecmascript-language-lexical-grammar.html#sec-comments">12.4</a></emu-xref> is extended as follows except that this extension is not allowed when parsing source text using the <emu-xref href="#sec-context-free-grammars" id="_ref_17376"><a href="notational-conventions.html#sec-context-free-grammars">goal symbol</a></emu-xref> <emu-nt id="_ref_24581"><a href="ecmascript-language-scripts-and-modules.html#prod-Module">Module</a></emu-nt>:</p>
|
||
<h2>Syntax</h2>
|
||
<emu-grammar type="definition"><emu-production name="InputElementHashbangOrRegExp" type="lexical" id="prod-annexB-InputElementHashbangOrRegExp">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-InputElementHashbangOrRegExp">InputElementHashbangOrRegExp</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="fctcswat">
|
||
<emu-nt id="_ref_24582"><a href="ecmascript-language-lexical-grammar.html#prod-WhiteSpace">WhiteSpace</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ozmczrck">
|
||
<emu-nt id="_ref_24583"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ft16wloj">
|
||
<emu-nt id="_ref_24584"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-Comment">Comment</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="gxwilro0">
|
||
<emu-nt id="_ref_24585"><a href="ecmascript-language-lexical-grammar.html#prod-CommonToken">CommonToken</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="pcfv_yin">
|
||
<emu-nt id="_ref_24586"><a href="ecmascript-language-lexical-grammar.html#prod-HashbangComment">HashbangComment</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="mbzy6lvr">
|
||
<emu-nt id="_ref_24587"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionLiteral">RegularExpressionLiteral</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="s4ncj2pm">
|
||
<emu-nt id="_ref_24588"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-HTMLCloseComment">HTMLCloseComment</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="Comment" type="lexical" id="prod-annexB-Comment">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-Comment">Comment</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="sieyeref">
|
||
<emu-nt id="_ref_24589"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-MultiLineComment">MultiLineComment</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="sscrkqcd">
|
||
<emu-nt id="_ref_24590"><a href="ecmascript-language-lexical-grammar.html#prod-SingleLineComment">SingleLineComment</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="gpoosgoq">
|
||
<emu-nt id="_ref_24591"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineHTMLOpenComment">SingleLineHTMLOpenComment</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="-88cuq48">
|
||
<emu-nt id="_ref_24592"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineHTMLCloseComment">SingleLineHTMLCloseComment</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="x2zjsk6z">
|
||
<emu-nt id="_ref_24593"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineDelimitedComment">SingleLineDelimitedComment</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="MultiLineComment" type="lexical" id="prod-annexB-MultiLineComment">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-MultiLineComment">MultiLineComment</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="99bxtrdo">
|
||
<emu-t>/*</emu-t>
|
||
<emu-nt optional="" id="_ref_24594"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-FirstCommentLine">FirstCommentLine</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_24595"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt>
|
||
<emu-nt optional="" id="_ref_24596"><a href="ecmascript-language-lexical-grammar.html#prod-MultiLineCommentChars">MultiLineCommentChars</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-t>*/</emu-t>
|
||
<emu-nt optional="" id="_ref_24597"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-HTMLCloseComment">HTMLCloseComment</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="FirstCommentLine" type="lexical" id="prod-annexB-FirstCommentLine">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-FirstCommentLine">FirstCommentLine</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="rwqqakko">
|
||
<emu-nt id="_ref_24598"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineDelimitedCommentChars">SingleLineDelimitedCommentChars</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="SingleLineHTMLOpenComment" type="lexical" id="prod-annexB-SingleLineHTMLOpenComment">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineHTMLOpenComment">SingleLineHTMLOpenComment</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="2e6mrqmm">
|
||
<emu-t><!--</emu-t>
|
||
<emu-nt optional="" id="_ref_24599"><a href="ecmascript-language-lexical-grammar.html#prod-SingleLineCommentChars">SingleLineCommentChars</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="SingleLineHTMLCloseComment" type="lexical" id="prod-annexB-SingleLineHTMLCloseComment">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineHTMLCloseComment">SingleLineHTMLCloseComment</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="wdv3xq9f">
|
||
<emu-nt id="_ref_24600"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminatorSequence">LineTerminatorSequence</a></emu-nt>
|
||
<emu-nt id="_ref_24601"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-HTMLCloseComment">HTMLCloseComment</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="SingleLineDelimitedComment" type="lexical" id="prod-annexB-SingleLineDelimitedComment">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineDelimitedComment">SingleLineDelimitedComment</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="-jxen_rq">
|
||
<emu-t>/*</emu-t>
|
||
<emu-nt optional="" id="_ref_24602"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineDelimitedCommentChars">SingleLineDelimitedCommentChars</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-t>*/</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="HTMLCloseComment" type="lexical" id="prod-annexB-HTMLCloseComment">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-HTMLCloseComment">HTMLCloseComment</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="doh0xpzb">
|
||
<emu-nt optional="" id="_ref_24603"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-WhiteSpaceSequence">WhiteSpaceSequence</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-nt optional="" id="_ref_24604"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineDelimitedCommentSequence">SingleLineDelimitedCommentSequence</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-t>--></emu-t>
|
||
<emu-nt optional="" id="_ref_24605"><a href="ecmascript-language-lexical-grammar.html#prod-SingleLineCommentChars">SingleLineCommentChars</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="SingleLineDelimitedCommentChars" type="lexical" id="prod-annexB-SingleLineDelimitedCommentChars">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineDelimitedCommentChars">SingleLineDelimitedCommentChars</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="srrki4i5">
|
||
<emu-nt id="_ref_24606"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineNotAsteriskChar">SingleLineNotAsteriskChar</a></emu-nt>
|
||
<emu-nt optional="" id="_ref_24607"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineDelimitedCommentChars">SingleLineDelimitedCommentChars</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ru60gzv_">
|
||
<emu-t>*</emu-t>
|
||
<emu-nt optional="" id="_ref_24608"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLinePostAsteriskCommentChars">SingleLinePostAsteriskCommentChars</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="SingleLineNotAsteriskChar" type="lexical" id="prod-annexB-SingleLineNotAsteriskChar">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineNotAsteriskChar">SingleLineNotAsteriskChar</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="xx2apkej">
|
||
<emu-nt id="_ref_24609"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not one of <emu-t>*</emu-t> or <emu-nt id="_ref_24610"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt></emu-gmod>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="SingleLinePostAsteriskCommentChars" type="lexical" id="prod-annexB-SingleLinePostAsteriskCommentChars">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLinePostAsteriskCommentChars">SingleLinePostAsteriskCommentChars</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="p4bbdmqr">
|
||
<emu-nt id="_ref_24611"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineNotForwardSlashOrAsteriskChar">SingleLineNotForwardSlashOrAsteriskChar</a></emu-nt>
|
||
<emu-nt optional="" id="_ref_24612"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineDelimitedCommentChars">SingleLineDelimitedCommentChars</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ru60gzv_">
|
||
<emu-t>*</emu-t>
|
||
<emu-nt optional="" id="_ref_24613"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLinePostAsteriskCommentChars">SingleLinePostAsteriskCommentChars</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="SingleLineNotForwardSlashOrAsteriskChar" type="lexical" id="prod-annexB-SingleLineNotForwardSlashOrAsteriskChar">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineNotForwardSlashOrAsteriskChar">SingleLineNotForwardSlashOrAsteriskChar</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="9cpftoim">
|
||
<emu-nt id="_ref_24614"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not one of <emu-t>/</emu-t> or <emu-t>*</emu-t> or <emu-nt id="_ref_24615"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt></emu-gmod>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="WhiteSpaceSequence" type="lexical" id="prod-annexB-WhiteSpaceSequence">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-WhiteSpaceSequence">WhiteSpaceSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="r3bi9ks0">
|
||
<emu-nt id="_ref_24616"><a href="ecmascript-language-lexical-grammar.html#prod-WhiteSpace">WhiteSpace</a></emu-nt>
|
||
<emu-nt optional="" id="_ref_24617"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-WhiteSpaceSequence">WhiteSpaceSequence</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="SingleLineDelimitedCommentSequence" type="lexical" id="prod-annexB-SingleLineDelimitedCommentSequence">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineDelimitedCommentSequence">SingleLineDelimitedCommentSequence</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="97egrzky">
|
||
<emu-nt id="_ref_24618"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineDelimitedComment">SingleLineDelimitedComment</a></emu-nt>
|
||
<emu-nt optional="" id="_ref_24619"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-WhiteSpaceSequence">WhiteSpaceSequence</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-nt optional="" id="_ref_24620"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineDelimitedCommentSequence">SingleLineDelimitedCommentSequence</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<p>Similar to a <emu-nt id="_ref_24621"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-MultiLineComment">MultiLineComment</a></emu-nt> that contains a line terminator code point, a <emu-nt id="_ref_24622"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SingleLineHTMLCloseComment">SingleLineHTMLCloseComment</a></emu-nt> is considered to be a <emu-nt id="_ref_24623"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> for purposes of parsing by the syntactic grammar.</p>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-regular-expressions-patterns">
|
||
<h1><span class="secnum">B.1.2</span> Regular Expressions Patterns</h1>
|
||
<p>The syntax of <emu-xref href="#sec-patterns" id="_ref_854"><a href="text-processing.html#sec-patterns">22.2.1</a></emu-xref> is modified and extended as follows. These changes introduce ambiguities that are broken by the ordering of grammar productions and by contextual information. When parsing using the following grammar, each alternative is considered only if previous production alternatives do not match.</p>
|
||
<p>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 <emu-xref href="#sec-context-free-grammars" id="_ref_17377"><a href="notational-conventions.html#sec-context-free-grammars">goal symbol</a></emu-xref>.</p>
|
||
<h2>Syntax</h2>
|
||
<emu-grammar type="definition"><emu-production name="Term" params="UnicodeMode, UnicodeSetsMode, NamedCaptureGroups" type="lexical" id="prod-annexB-Term">
|
||
<emu-nt params="UnicodeMode, UnicodeSetsMode, NamedCaptureGroups"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-Term">Term</a><emu-mods><emu-params>[UnicodeMode, UnicodeSetsMode, NamedCaptureGroups]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="o3l8dfe8" constraints="+UnicodeMode"><emu-constraints>[+UnicodeMode]</emu-constraints>
|
||
<emu-nt params="+UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups" id="_ref_24624"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-Assertion">Assertion</a><emu-mods><emu-params>[+UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="hwwssbot" constraints="+UnicodeMode"><emu-constraints>[+UnicodeMode]</emu-constraints>
|
||
<emu-nt params="+UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups" id="_ref_24625"><a href="text-processing.html#prod-Atom">Atom</a><emu-mods><emu-params>[+UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_24626"><a href="text-processing.html#prod-Quantifier">Quantifier</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="iwmljpx0" constraints="+UnicodeMode"><emu-constraints>[+UnicodeMode]</emu-constraints>
|
||
<emu-nt params="+UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups" id="_ref_24627"><a href="text-processing.html#prod-Atom">Atom</a><emu-mods><emu-params>[+UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="62vacxzc" constraints="~UnicodeMode"><emu-constraints>[~UnicodeMode]</emu-constraints>
|
||
<emu-nt params="?NamedCaptureGroups" id="_ref_24628"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-QuantifiableAssertion">QuantifiableAssertion</a><emu-mods><emu-params>[?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_24629"><a href="text-processing.html#prod-Quantifier">Quantifier</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="bdgod5jf" constraints="~UnicodeMode"><emu-constraints>[~UnicodeMode]</emu-constraints>
|
||
<emu-nt params="~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups" id="_ref_24630"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-Assertion">Assertion</a><emu-mods><emu-params>[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="x9p9spup" constraints="~UnicodeMode"><emu-constraints>[~UnicodeMode]</emu-constraints>
|
||
<emu-nt params="?NamedCaptureGroups" id="_ref_24631"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ExtendedAtom">ExtendedAtom</a><emu-mods><emu-params>[?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_24632"><a href="text-processing.html#prod-Quantifier">Quantifier</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="-fqfvuat" constraints="~UnicodeMode"><emu-constraints>[~UnicodeMode]</emu-constraints>
|
||
<emu-nt params="?NamedCaptureGroups" id="_ref_24633"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ExtendedAtom">ExtendedAtom</a><emu-mods><emu-params>[?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="Assertion" params="UnicodeMode, UnicodeSetsMode, NamedCaptureGroups" type="lexical" id="prod-annexB-Assertion">
|
||
<emu-nt params="UnicodeMode, UnicodeSetsMode, NamedCaptureGroups"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-Assertion">Assertion</a><emu-mods><emu-params>[UnicodeMode, UnicodeSetsMode, NamedCaptureGroups]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="5yeieuod">
|
||
<emu-t>^</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="emlmkqfm">
|
||
<emu-t>$</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="axxsqknu">
|
||
<emu-t>\b</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="lnx_opbv">
|
||
<emu-t>\B</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="gm31ql7g" constraints="+UnicodeMode"><emu-constraints>[+UnicodeMode]</emu-constraints>
|
||
<emu-t>(?=</emu-t>
|
||
<emu-nt params="+UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups" id="_ref_24634"><a href="text-processing.html#prod-Disjunction">Disjunction</a><emu-mods><emu-params>[+UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="wqfwj-x1" constraints="+UnicodeMode"><emu-constraints>[+UnicodeMode]</emu-constraints>
|
||
<emu-t>(?!</emu-t>
|
||
<emu-nt params="+UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups" id="_ref_24635"><a href="text-processing.html#prod-Disjunction">Disjunction</a><emu-mods><emu-params>[+UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="avwhjn5v" constraints="~UnicodeMode"><emu-constraints>[~UnicodeMode]</emu-constraints>
|
||
<emu-nt params="?NamedCaptureGroups" id="_ref_24636"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-QuantifiableAssertion">QuantifiableAssertion</a><emu-mods><emu-params>[?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="mvzyfsps">
|
||
<emu-t>(?<=</emu-t>
|
||
<emu-nt params="?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups" id="_ref_24637"><a href="text-processing.html#prod-Disjunction">Disjunction</a><emu-mods><emu-params>[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="i9jfixsb">
|
||
<emu-t>(?<!</emu-t>
|
||
<emu-nt params="?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups" id="_ref_24638"><a href="text-processing.html#prod-Disjunction">Disjunction</a><emu-mods><emu-params>[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="QuantifiableAssertion" params="NamedCaptureGroups" type="lexical" id="prod-annexB-QuantifiableAssertion">
|
||
<emu-nt params="NamedCaptureGroups"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-QuantifiableAssertion">QuantifiableAssertion</a><emu-mods><emu-params>[NamedCaptureGroups]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="nh8ex4qo">
|
||
<emu-t>(?=</emu-t>
|
||
<emu-nt params="~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups" id="_ref_24639"><a href="text-processing.html#prod-Disjunction">Disjunction</a><emu-mods><emu-params>[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="mp-zwpth">
|
||
<emu-t>(?!</emu-t>
|
||
<emu-nt params="~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups" id="_ref_24640"><a href="text-processing.html#prod-Disjunction">Disjunction</a><emu-mods><emu-params>[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="ExtendedAtom" params="NamedCaptureGroups" type="lexical" id="prod-annexB-ExtendedAtom">
|
||
<emu-nt params="NamedCaptureGroups"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ExtendedAtom">ExtendedAtom</a><emu-mods><emu-params>[NamedCaptureGroups]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="lljkc4zd">
|
||
<emu-t>.</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="veow4kfz">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt params="~UnicodeMode, ?NamedCaptureGroups" id="_ref_24641"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-AtomEscape">AtomEscape</a><emu-mods><emu-params>[~UnicodeMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="3hxbxljo">
|
||
<emu-t>\</emu-t>
|
||
<emu-gann>[lookahead = <emu-t>c</emu-t>]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="_y_hqhcp">
|
||
<emu-nt params="~UnicodeMode, ~UnicodeSetsMode" id="_ref_24642"><a href="text-processing.html#prod-CharacterClass">CharacterClass</a><emu-mods><emu-params>[~UnicodeMode, ~UnicodeSetsMode]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="mqkgby0e">
|
||
<emu-t>(</emu-t>
|
||
<emu-nt params="~UnicodeMode" optional="" id="_ref_24643"><a href="text-processing.html#prod-GroupSpecifier">GroupSpecifier</a><emu-mods><emu-params>[~UnicodeMode]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-nt params="~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups" id="_ref_24644"><a href="text-processing.html#prod-Disjunction">Disjunction</a><emu-mods><emu-params>[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="1suivg_l">
|
||
<emu-t>(?</emu-t>
|
||
<emu-nt id="_ref_24645"><a href="text-processing.html#prod-RegularExpressionModifiers">RegularExpressionModifiers</a></emu-nt>
|
||
<emu-t>:</emu-t>
|
||
<emu-nt params="~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups" id="_ref_24646"><a href="text-processing.html#prod-Disjunction">Disjunction</a><emu-mods><emu-params>[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="gth2mjgo">
|
||
<emu-t>(?</emu-t>
|
||
<emu-nt id="_ref_24647"><a href="text-processing.html#prod-RegularExpressionModifiers">RegularExpressionModifiers</a></emu-nt>
|
||
<emu-t>-</emu-t>
|
||
<emu-nt id="_ref_24648"><a href="text-processing.html#prod-RegularExpressionModifiers">RegularExpressionModifiers</a></emu-nt>
|
||
<emu-t>:</emu-t>
|
||
<emu-nt params="~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups" id="_ref_24649"><a href="text-processing.html#prod-Disjunction">Disjunction</a><emu-mods><emu-params>[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="u9cvu_c3">
|
||
<emu-nt id="_ref_24650"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-InvalidBracedQuantifier">InvalidBracedQuantifier</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="i6ekw12q">
|
||
<emu-nt id="_ref_24651"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ExtendedPatternCharacter">ExtendedPatternCharacter</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="InvalidBracedQuantifier" type="lexical" id="prod-annexB-InvalidBracedQuantifier">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-InvalidBracedQuantifier">InvalidBracedQuantifier</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="qn2ibvok">
|
||
<emu-t>{</emu-t>
|
||
<emu-nt params="~Sep" id="_ref_24652"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a><emu-mods><emu-params>[~Sep]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>}</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="tij_jhmn">
|
||
<emu-t>{</emu-t>
|
||
<emu-nt params="~Sep" id="_ref_24653"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a><emu-mods><emu-params>[~Sep]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>,}</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="bthfi5pb">
|
||
<emu-t>{</emu-t>
|
||
<emu-nt params="~Sep" id="_ref_24654"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a><emu-mods><emu-params>[~Sep]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>,</emu-t>
|
||
<emu-nt params="~Sep" id="_ref_24655"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigits">DecimalDigits</a><emu-mods><emu-params>[~Sep]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>}</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="ExtendedPatternCharacter" type="lexical" id="prod-annexB-ExtendedPatternCharacter">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ExtendedPatternCharacter">ExtendedPatternCharacter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="pqi8yfef">
|
||
<emu-nt id="_ref_24656"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not one of <emu-t>^</emu-t></emu-gmod>
|
||
<emu-t>$</emu-t>
|
||
<emu-t>\</emu-t>
|
||
<emu-t>.</emu-t>
|
||
<emu-t>*</emu-t>
|
||
<emu-t>+</emu-t>
|
||
<emu-t>?</emu-t>
|
||
<emu-t>(</emu-t>
|
||
<emu-t>)</emu-t>
|
||
<emu-t>[</emu-t>
|
||
<emu-t>|</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="AtomEscape" params="UnicodeMode, NamedCaptureGroups" type="lexical" id="prod-annexB-AtomEscape">
|
||
<emu-nt params="UnicodeMode, NamedCaptureGroups"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-AtomEscape">AtomEscape</a><emu-mods><emu-params>[UnicodeMode, NamedCaptureGroups]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="unvsy4gw" constraints="+UnicodeMode"><emu-constraints>[+UnicodeMode]</emu-constraints>
|
||
<emu-nt id="_ref_24657"><a href="text-processing.html#prod-DecimalEscape">DecimalEscape</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="xdwyknsm" constraints="~UnicodeMode"><emu-constraints>[~UnicodeMode]</emu-constraints>
|
||
<emu-nt id="_ref_24658"><a href="text-processing.html#prod-DecimalEscape">DecimalEscape</a></emu-nt>
|
||
<emu-gmod>but only if the <emu-xref aoid="CapturingGroupNumber" id="_ref_17378"><a href="text-processing.html#sec-patterns-static-semantics-capturing-group-number">CapturingGroupNumber</a></emu-xref> of <emu-nt id="_ref_24659"><a href="text-processing.html#prod-DecimalEscape">DecimalEscape</a></emu-nt> is ≤ <emu-xref aoid="CountLeftCapturingParensWithin" id="_ref_17379"><a href="text-processing.html#sec-countleftcapturingparenswithin">CountLeftCapturingParensWithin</a></emu-xref>(the <emu-nt id="_ref_24660"><a href="text-processing.html#prod-Pattern">Pattern</a></emu-nt> containing <emu-nt id="_ref_24661"><a href="text-processing.html#prod-DecimalEscape">DecimalEscape</a></emu-nt>)</emu-gmod>
|
||
</emu-rhs>
|
||
<emu-rhs a="1dlni0cs">
|
||
<emu-nt params="?UnicodeMode" id="_ref_24662"><a href="text-processing.html#prod-CharacterClassEscape">CharacterClassEscape</a><emu-mods><emu-params>[?UnicodeMode]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="u07pzamz">
|
||
<emu-nt params="?UnicodeMode, ?NamedCaptureGroups" id="_ref_24663"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-CharacterEscape">CharacterEscape</a><emu-mods><emu-params>[?UnicodeMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="jsb3w65g" constraints="+NamedCaptureGroups"><emu-constraints>[+NamedCaptureGroups]</emu-constraints>
|
||
<emu-t>k</emu-t>
|
||
<emu-nt params="?UnicodeMode" id="_ref_24664"><a href="text-processing.html#prod-GroupName">GroupName</a><emu-mods><emu-params>[?UnicodeMode]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="CharacterEscape" params="UnicodeMode, NamedCaptureGroups" type="lexical" id="prod-annexB-CharacterEscape">
|
||
<emu-nt params="UnicodeMode, NamedCaptureGroups"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-CharacterEscape">CharacterEscape</a><emu-mods><emu-params>[UnicodeMode, NamedCaptureGroups]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="-i5xcal8">
|
||
<emu-nt id="_ref_24665"><a href="text-processing.html#prod-ControlEscape">ControlEscape</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="lf4h7vn-">
|
||
<emu-t>c</emu-t>
|
||
<emu-nt id="_ref_24666"><a href="ecmascript-language-lexical-grammar.html#prod-AsciiLetter">AsciiLetter</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="br2d94cy">
|
||
<emu-t>0</emu-t>
|
||
<emu-gann>[lookahead ∉ <emu-nt id="_ref_24667"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>]</emu-gann>
|
||
</emu-rhs>
|
||
<emu-rhs a="qacbhaps">
|
||
<emu-nt id="_ref_24668"><a href="ecmascript-language-lexical-grammar.html#prod-HexEscapeSequence">HexEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="swcse7so">
|
||
<emu-nt params="?UnicodeMode" id="_ref_24669"><a href="text-processing.html#prod-RegExpUnicodeEscapeSequence">RegExpUnicodeEscapeSequence</a><emu-mods><emu-params>[?UnicodeMode]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="-xli1f79" constraints="~UnicodeMode"><emu-constraints>[~UnicodeMode]</emu-constraints>
|
||
<emu-nt id="_ref_24670"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalEscapeSequence">LegacyOctalEscapeSequence</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="b0ey0idr">
|
||
<emu-nt params="?UnicodeMode, ?NamedCaptureGroups" id="_ref_24671"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-IdentityEscape">IdentityEscape</a><emu-mods><emu-params>[?UnicodeMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="IdentityEscape" params="UnicodeMode, NamedCaptureGroups" type="lexical" id="prod-annexB-IdentityEscape">
|
||
<emu-nt params="UnicodeMode, NamedCaptureGroups"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-IdentityEscape">IdentityEscape</a><emu-mods><emu-params>[UnicodeMode, NamedCaptureGroups]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="_sxoisew" constraints="+UnicodeMode"><emu-constraints>[+UnicodeMode]</emu-constraints>
|
||
<emu-nt id="_ref_24672"><a href="text-processing.html#prod-SyntaxCharacter">SyntaxCharacter</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="iiubx3hh" constraints="+UnicodeMode"><emu-constraints>[+UnicodeMode]</emu-constraints>
|
||
<emu-t>/</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="ie232_wq" constraints="~UnicodeMode"><emu-constraints>[~UnicodeMode]</emu-constraints>
|
||
<emu-nt params="?NamedCaptureGroups" id="_ref_24673"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SourceCharacterIdentityEscape">SourceCharacterIdentityEscape</a><emu-mods><emu-params>[?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="SourceCharacterIdentityEscape" params="NamedCaptureGroups" type="lexical" id="prod-annexB-SourceCharacterIdentityEscape">
|
||
<emu-nt params="NamedCaptureGroups"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-SourceCharacterIdentityEscape">SourceCharacterIdentityEscape</a><emu-mods><emu-params>[NamedCaptureGroups]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="olipppeh" constraints="~NamedCaptureGroups"><emu-constraints>[~NamedCaptureGroups]</emu-constraints>
|
||
<emu-nt id="_ref_24674"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not <emu-t>c</emu-t></emu-gmod>
|
||
</emu-rhs>
|
||
<emu-rhs a="x29lk3qs" constraints="+NamedCaptureGroups"><emu-constraints>[+NamedCaptureGroups]</emu-constraints>
|
||
<emu-nt id="_ref_24675"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not one of <emu-t>c</emu-t> or <emu-t>k</emu-t></emu-gmod>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="ClassAtomNoDash" params="UnicodeMode, NamedCaptureGroups" type="lexical" id="prod-annexB-ClassAtomNoDash">
|
||
<emu-nt params="UnicodeMode, NamedCaptureGroups"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassAtomNoDash">ClassAtomNoDash</a><emu-mods><emu-params>[UnicodeMode, NamedCaptureGroups]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="7n5ukjeb">
|
||
<emu-nt id="_ref_24676"><a href="ecmascript-language-source-code.html#prod-SourceCharacter">SourceCharacter</a></emu-nt> <emu-gmod>but not one of <emu-t>\</emu-t> or <emu-t>]</emu-t> or <emu-t>-</emu-t></emu-gmod>
|
||
</emu-rhs>
|
||
<emu-rhs a="lyw9nyqw">
|
||
<emu-t>\</emu-t>
|
||
<emu-nt params="?UnicodeMode, ?NamedCaptureGroups" id="_ref_24677"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassEscape">ClassEscape</a><emu-mods><emu-params>[?UnicodeMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="3hxbxljo">
|
||
<emu-t>\</emu-t>
|
||
<emu-gann>[lookahead = <emu-t>c</emu-t>]</emu-gann>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="ClassEscape" params="UnicodeMode, NamedCaptureGroups" type="lexical" id="prod-annexB-ClassEscape">
|
||
<emu-nt params="UnicodeMode, NamedCaptureGroups"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassEscape">ClassEscape</a><emu-mods><emu-params>[UnicodeMode, NamedCaptureGroups]</emu-params></emu-mods></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="ayxoiyyq">
|
||
<emu-t>b</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="7_g4l0lw" constraints="+UnicodeMode"><emu-constraints>[+UnicodeMode]</emu-constraints>
|
||
<emu-t>-</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="eahv3obf" constraints="~UnicodeMode"><emu-constraints>[~UnicodeMode]</emu-constraints>
|
||
<emu-t>c</emu-t>
|
||
<emu-nt id="_ref_24678"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassControlLetter">ClassControlLetter</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="1dlni0cs">
|
||
<emu-nt params="?UnicodeMode" id="_ref_24679"><a href="text-processing.html#prod-CharacterClassEscape">CharacterClassEscape</a><emu-mods><emu-params>[?UnicodeMode]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="u07pzamz">
|
||
<emu-nt params="?UnicodeMode, ?NamedCaptureGroups" id="_ref_24680"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-CharacterEscape">CharacterEscape</a><emu-mods><emu-params>[?UnicodeMode, ?NamedCaptureGroups]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
<emu-production name="ClassControlLetter" type="lexical" id="prod-annexB-ClassControlLetter">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassControlLetter">ClassControlLetter</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="s4me4hlz">
|
||
<emu-nt id="_ref_24681"><a href="ecmascript-language-lexical-grammar.html#prod-DecimalDigit">DecimalDigit</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="b1zllonv">
|
||
<emu-t>_</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>When the same left-hand sides occurs with both [+UnicodeMode] and [~UnicodeMode] guards it is to control the disambiguation priority.</p>
|
||
</div></emu-note>
|
||
|
||
<emu-annex id="sec-patterns-static-semantics-early-errors-annexb">
|
||
<h1><span class="secnum">B.1.2.1</span> Static Semantics: Early Errors</h1>
|
||
<p>The semantics of <emu-xref href="#sec-patterns-static-semantics-early-errors" id="_ref_855"><a href="text-processing.html#sec-patterns-static-semantics-early-errors">22.2.1.1</a></emu-xref> is extended as follows:</p>
|
||
<emu-grammar><emu-production name="ExtendedAtom" type="lexical" collapsed="">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ExtendedAtom">ExtendedAtom</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="u9cvu_c3"><emu-nt id="_ref_24682"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-InvalidBracedQuantifier">InvalidBracedQuantifier</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<ul>
|
||
<li>
|
||
It is a Syntax Error if any source text is matched by this production.
|
||
</li>
|
||
</ul>
|
||
<p>Additionally, the rules for the following productions are modified with the addition of the <ins>highlighted</ins> text:</p>
|
||
<emu-grammar><emu-production name="NonemptyClassRanges" type="lexical" collapsed="">
|
||
<emu-nt><a href="text-processing.html#prod-NonemptyClassRanges">NonemptyClassRanges</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="2bs-sw8o">
|
||
<emu-nt id="_ref_24683"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt>
|
||
<emu-t>-</emu-t>
|
||
<emu-nt id="_ref_24684"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt>
|
||
<emu-nt id="_ref_24685"><a href="text-processing.html#prod-ClassContents">ClassContents</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<ul>
|
||
<li>
|
||
It is a Syntax Error if <emu-xref aoid="IsCharacterClass" id="_ref_17380"><a href="text-processing.html#sec-patterns-static-semantics-is-character-class">IsCharacterClass</a></emu-xref> of the first <emu-nt id="_ref_24686"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt> is <emu-val>true</emu-val> or <emu-xref aoid="IsCharacterClass" id="_ref_17381"><a href="text-processing.html#sec-patterns-static-semantics-is-character-class">IsCharacterClass</a></emu-xref> of the second <emu-nt id="_ref_24687"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt> is <emu-val>true</emu-val> <ins>and this production has a <sub>[UnicodeMode]</sub> parameter</ins>.
|
||
</li>
|
||
<li>
|
||
It is a Syntax Error if <emu-xref aoid="IsCharacterClass" id="_ref_17382"><a href="text-processing.html#sec-patterns-static-semantics-is-character-class">IsCharacterClass</a></emu-xref> of the first <emu-nt id="_ref_24688"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt> is <emu-val>false</emu-val>, <emu-xref aoid="IsCharacterClass" id="_ref_17383"><a href="text-processing.html#sec-patterns-static-semantics-is-character-class">IsCharacterClass</a></emu-xref> of the second <emu-nt id="_ref_24689"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt> is <emu-val>false</emu-val>, and the <emu-xref aoid="CharacterValue" id="_ref_17384"><a href="text-processing.html#sec-patterns-static-semantics-character-value">CharacterValue</a></emu-xref> of the first <emu-nt id="_ref_24690"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt> is strictly greater than the <emu-xref aoid="CharacterValue" id="_ref_17385"><a href="text-processing.html#sec-patterns-static-semantics-character-value">CharacterValue</a></emu-xref> of the second <emu-nt id="_ref_24691"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt>.
|
||
</li>
|
||
</ul>
|
||
<emu-grammar><emu-production name="NonemptyClassRangesNoDash" type="lexical" collapsed="">
|
||
<emu-nt><a href="text-processing.html#prod-NonemptyClassRangesNoDash">NonemptyClassRangesNoDash</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="udwlha-v">
|
||
<emu-nt id="_ref_24692"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassAtomNoDash">ClassAtomNoDash</a></emu-nt>
|
||
<emu-t>-</emu-t>
|
||
<emu-nt id="_ref_24693"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt>
|
||
<emu-nt id="_ref_24694"><a href="text-processing.html#prod-ClassContents">ClassContents</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<ul>
|
||
<li>
|
||
It is a Syntax Error if <emu-xref aoid="IsCharacterClass" id="_ref_17386"><a href="text-processing.html#sec-patterns-static-semantics-is-character-class">IsCharacterClass</a></emu-xref> of <emu-nt id="_ref_24695"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassAtomNoDash">ClassAtomNoDash</a></emu-nt> is <emu-val>true</emu-val> or <emu-xref aoid="IsCharacterClass" id="_ref_17387"><a href="text-processing.html#sec-patterns-static-semantics-is-character-class">IsCharacterClass</a></emu-xref> of <emu-nt id="_ref_24696"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt> is <emu-val>true</emu-val> <ins>and this production has a <sub>[UnicodeMode]</sub> parameter</ins>.
|
||
</li>
|
||
<li>
|
||
It is a Syntax Error if <emu-xref aoid="IsCharacterClass" id="_ref_17388"><a href="text-processing.html#sec-patterns-static-semantics-is-character-class">IsCharacterClass</a></emu-xref> of <emu-nt id="_ref_24697"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassAtomNoDash">ClassAtomNoDash</a></emu-nt> is <emu-val>false</emu-val>, <emu-xref aoid="IsCharacterClass" id="_ref_17389"><a href="text-processing.html#sec-patterns-static-semantics-is-character-class">IsCharacterClass</a></emu-xref> of <emu-nt id="_ref_24698"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt> is <emu-val>false</emu-val>, and the <emu-xref aoid="CharacterValue" id="_ref_17390"><a href="text-processing.html#sec-patterns-static-semantics-character-value">CharacterValue</a></emu-xref> of <emu-nt id="_ref_24699"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassAtomNoDash">ClassAtomNoDash</a></emu-nt> is strictly greater than the <emu-xref aoid="CharacterValue" id="_ref_17391"><a href="text-processing.html#sec-patterns-static-semantics-character-value">CharacterValue</a></emu-xref> of <emu-nt id="_ref_24700"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt>.
|
||
</li>
|
||
</ul>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-countleftcapturingparens-annexb">
|
||
<h1><span class="secnum">B.1.2.2</span> Static Semantics: CountLeftCapturingParensWithin and CountLeftCapturingParensBefore</h1>
|
||
<p>In the definitions of <emu-xref aoid="CountLeftCapturingParensWithin" id="_ref_17392"><a href="text-processing.html#sec-countleftcapturingparenswithin">CountLeftCapturingParensWithin</a></emu-xref> and <emu-xref aoid="CountLeftCapturingParensBefore" id="_ref_17393"><a href="text-processing.html#sec-countleftcapturingparensbefore">CountLeftCapturingParensBefore</a></emu-xref>, references to “<emu-grammar><emu-production name="Atom" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="text-processing.html#prod-Atom">Atom</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="lnltxn63">
|
||
<emu-t>(</emu-t>
|
||
<emu-nt optional="" id="_ref_24701"><a href="text-processing.html#prod-GroupSpecifier">GroupSpecifier</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_24702"><a href="text-processing.html#prod-Disjunction">Disjunction</a></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> ” are to be interpreted as meaning “<emu-grammar><emu-production name="Atom" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="text-processing.html#prod-Atom">Atom</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="lnltxn63">
|
||
<emu-t>(</emu-t>
|
||
<emu-nt optional="" id="_ref_24703"><a href="text-processing.html#prod-GroupSpecifier">GroupSpecifier</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_24704"><a href="text-processing.html#prod-Disjunction">Disjunction</a></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> ” or “<emu-grammar><emu-production name="ExtendedAtom" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ExtendedAtom">ExtendedAtom</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="lnltxn63">
|
||
<emu-t>(</emu-t>
|
||
<emu-nt optional="" id="_ref_24705"><a href="text-processing.html#prod-GroupSpecifier">GroupSpecifier</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
|
||
<emu-nt id="_ref_24706"><a href="text-processing.html#prod-Disjunction">Disjunction</a></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> ”.</p>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-patterns-static-semantics-is-character-class-annexb">
|
||
<h1><span class="secnum">B.1.2.3</span> Static Semantics: IsCharacterClass</h1>
|
||
<p>The semantics of <emu-xref href="#sec-patterns-static-semantics-is-character-class" id="_ref_856"><a href="text-processing.html#sec-patterns-static-semantics-is-character-class">22.2.1.6</a></emu-xref> is extended as follows:</p>
|
||
<emu-grammar><emu-production name="ClassAtomNoDash" type="lexical" collapsed="">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassAtomNoDash">ClassAtomNoDash</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="3hxbxljo">
|
||
<emu-t>\</emu-t>
|
||
<emu-gann>[lookahead = <emu-t>c</emu-t>]</emu-gann>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-patterns-static-semantics-character-value-annexb">
|
||
<h1><span class="secnum">B.1.2.4</span> Static Semantics: CharacterValue</h1>
|
||
<p>The semantics of <emu-xref href="#sec-patterns-static-semantics-character-value" id="_ref_857"><a href="text-processing.html#sec-patterns-static-semantics-character-value">22.2.1.7</a></emu-xref> is extended as follows:</p>
|
||
<emu-grammar><emu-production name="ClassAtomNoDash" type="lexical" collapsed="">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassAtomNoDash">ClassAtomNoDash</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="3hxbxljo">
|
||
<emu-t>\</emu-t>
|
||
<emu-gann>[lookahead = <emu-t>c</emu-t>]</emu-gann>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return the numeric value of U+005C (REVERSE SOLIDUS).</li></ol></emu-alg>
|
||
<emu-grammar><emu-production name="ClassEscape" type="lexical" collapsed="">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassEscape">ClassEscape</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="nh-f7aun">
|
||
<emu-t>c</emu-t>
|
||
<emu-nt id="_ref_24707"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassControlLetter">ClassControlLetter</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Let <var>ch</var> be the code point matched by <emu-nt id="_ref_24708"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassControlLetter">ClassControlLetter</a></emu-nt>.</li><li>Let <var>i</var> be the numeric value of <var>ch</var>.</li><li>Return the remainder of dividing <var>i</var> by 32.</li></ol></emu-alg>
|
||
<emu-grammar><emu-production name="CharacterEscape" type="lexical" collapsed="">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-CharacterEscape">CharacterEscape</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="6mwrfc1u"><emu-nt id="_ref_24709"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalEscapeSequence">LegacyOctalEscapeSequence</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return the MV of <emu-nt id="_ref_24710"><a href="ecmascript-language-lexical-grammar.html#prod-LegacyOctalEscapeSequence">LegacyOctalEscapeSequence</a></emu-nt> (see <emu-xref href="#sec-string-literals-static-semantics-mv" id="_ref_858"><a href="ecmascript-language-lexical-grammar.html#sec-string-literals-static-semantics-mv">12.9.4.3</a></emu-xref>).</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-compilesubpattern-annexb" oldids="sec-regular-expression-patterns-semantics"><span id="sec-regular-expression-patterns-semantics"></span>
|
||
<h1><span class="secnum">B.1.2.5</span> Runtime Semantics: CompileSubpattern</h1>
|
||
<p>The semantics of <emu-xref aoid="CompileSubpattern" id="_ref_17394"><a href="text-processing.html#sec-compilesubpattern">CompileSubpattern</a></emu-xref> is extended as follows:</p>
|
||
|
||
<p>The rule for <emu-grammar><emu-production name="Term" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-Term">Term</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="_vyhfqa_">
|
||
<emu-nt id="_ref_24711"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-QuantifiableAssertion">QuantifiableAssertion</a></emu-nt>
|
||
<emu-nt id="_ref_24712"><a href="text-processing.html#prod-Quantifier">Quantifier</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the same as for <emu-grammar><emu-production name="Term" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-Term">Term</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="rk7qpcwj">
|
||
<emu-nt id="_ref_24713"><a href="text-processing.html#prod-Atom">Atom</a></emu-nt>
|
||
<emu-nt id="_ref_24714"><a href="text-processing.html#prod-Quantifier">Quantifier</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> but with <emu-nt id="_ref_24715"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-QuantifiableAssertion">QuantifiableAssertion</a></emu-nt> substituted for <emu-nt id="_ref_24716"><a href="text-processing.html#prod-Atom">Atom</a></emu-nt>.</p>
|
||
<p>The rule for <emu-grammar><emu-production name="Term" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-Term">Term</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="dpvmg_nc">
|
||
<emu-nt id="_ref_24717"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ExtendedAtom">ExtendedAtom</a></emu-nt>
|
||
<emu-nt id="_ref_24718"><a href="text-processing.html#prod-Quantifier">Quantifier</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the same as for <emu-grammar><emu-production name="Term" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-Term">Term</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="rk7qpcwj">
|
||
<emu-nt id="_ref_24719"><a href="text-processing.html#prod-Atom">Atom</a></emu-nt>
|
||
<emu-nt id="_ref_24720"><a href="text-processing.html#prod-Quantifier">Quantifier</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> but with <emu-nt id="_ref_24721"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ExtendedAtom">ExtendedAtom</a></emu-nt> substituted for <emu-nt id="_ref_24722"><a href="text-processing.html#prod-Atom">Atom</a></emu-nt>.</p>
|
||
<p>The rule for <emu-grammar><emu-production name="Term" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-Term">Term</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="lwdcmhgw"><emu-nt id="_ref_24723"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ExtendedAtom">ExtendedAtom</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> is the same as for <emu-grammar><emu-production name="Term" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-Term">Term</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="qd3tqxbs"><emu-nt id="_ref_24724"><a href="text-processing.html#prod-Atom">Atom</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> but with <emu-nt id="_ref_24725"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ExtendedAtom">ExtendedAtom</a></emu-nt> substituted for <emu-nt id="_ref_24726"><a href="text-processing.html#prod-Atom">Atom</a></emu-nt>.</p>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-compileassertion-annexb">
|
||
<h1><span class="secnum">B.1.2.6</span> Runtime Semantics: CompileAssertion</h1>
|
||
<p><emu-xref aoid="CompileAssertion" id="_ref_17395"><a href="text-processing.html#sec-compileassertion">CompileAssertion</a></emu-xref> rules for the <emu-grammar><emu-production name="Assertion" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-Assertion">Assertion</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="fbtayxzo">
|
||
<emu-t>(?=</emu-t>
|
||
<emu-nt id="_ref_24727"><a href="text-processing.html#prod-Disjunction">Disjunction</a></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> and <emu-grammar><emu-production name="Assertion" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-Assertion">Assertion</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="uwxc-jvg">
|
||
<emu-t>(?!</emu-t>
|
||
<emu-nt id="_ref_24728"><a href="text-processing.html#prod-Disjunction">Disjunction</a></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> productions are also used for the <emu-nt id="_ref_24729"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-QuantifiableAssertion">QuantifiableAssertion</a></emu-nt> productions, but with <emu-nt id="_ref_24730"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-QuantifiableAssertion">QuantifiableAssertion</a></emu-nt> substituted for <emu-nt id="_ref_24731"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-Assertion">Assertion</a></emu-nt>.</p>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-compileatom-annexb">
|
||
<h1><span class="secnum">B.1.2.7</span> Runtime Semantics: CompileAtom</h1>
|
||
<p><emu-xref aoid="CompileAtom" id="_ref_17396"><a href="text-processing.html#sec-compileatom">CompileAtom</a></emu-xref> rules for the <emu-nt id="_ref_24732"><a href="text-processing.html#prod-Atom">Atom</a></emu-nt> productions except for <emu-grammar><emu-production name="Atom" type="lexical" collapsed="" class=" inline">
|
||
<emu-nt><a href="text-processing.html#prod-Atom">Atom</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="vv9sxhyc"><emu-nt id="_ref_24733"><a href="text-processing.html#prod-PatternCharacter">PatternCharacter</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> are also used for the <emu-nt id="_ref_24734"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ExtendedAtom">ExtendedAtom</a></emu-nt> productions, but with <emu-nt id="_ref_24735"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ExtendedAtom">ExtendedAtom</a></emu-nt> substituted for <emu-nt id="_ref_24736"><a href="text-processing.html#prod-Atom">Atom</a></emu-nt>. The following rules, with parameter <var>direction</var>, are also added:</p>
|
||
<emu-grammar><emu-production name="ExtendedAtom" type="lexical" collapsed="">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ExtendedAtom">ExtendedAtom</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="3hxbxljo">
|
||
<emu-t>\</emu-t>
|
||
<emu-gann>[lookahead = <emu-t>c</emu-t>]</emu-gann>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Let <var>A</var> be the <emu-xref href="#pattern-charset" id="_ref_17397"><a href="text-processing.html#pattern-charset">CharSet</a></emu-xref> containing the single character <code>\</code> U+005C (REVERSE SOLIDUS).</li><li>Return <emu-xref aoid="CharacterSetMatcher" id="_ref_17398"><a href="text-processing.html#sec-runtime-semantics-charactersetmatcher-abstract-operation">CharacterSetMatcher</a></emu-xref>(<var>rer</var>, <var>A</var>, <emu-val>false</emu-val>, <var>direction</var>).</li></ol></emu-alg>
|
||
<emu-grammar><emu-production name="ExtendedAtom" type="lexical" collapsed="">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ExtendedAtom">ExtendedAtom</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="i6ekw12q"><emu-nt id="_ref_24737"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ExtendedPatternCharacter">ExtendedPatternCharacter</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Let <var>ch</var> be the character represented by <emu-nt id="_ref_24738"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ExtendedPatternCharacter">ExtendedPatternCharacter</a></emu-nt>.</li><li>Let <var>A</var> be a one-element <emu-xref href="#pattern-charset" id="_ref_17399"><a href="text-processing.html#pattern-charset">CharSet</a></emu-xref> containing the character <var>ch</var>.</li><li>Return <emu-xref aoid="CharacterSetMatcher" id="_ref_17400"><a href="text-processing.html#sec-runtime-semantics-charactersetmatcher-abstract-operation">CharacterSetMatcher</a></emu-xref>(<var>rer</var>, <var>A</var>, <emu-val>false</emu-val>, <var>direction</var>).</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-compiletocharset-annexb">
|
||
<h1><span class="secnum">B.1.2.8</span> Runtime Semantics: CompileToCharSet</h1>
|
||
<p>The semantics of <emu-xref href="#sec-compiletocharset" id="_ref_859"><a href="text-processing.html#sec-compiletocharset">22.2.2.9</a></emu-xref> is extended as follows:</p>
|
||
|
||
<p>The following two rules replace the corresponding rules of <emu-xref aoid="CompileToCharSet" id="_ref_17401"><a href="text-processing.html#sec-compiletocharset">CompileToCharSet</a></emu-xref>.</p>
|
||
<emu-grammar><emu-production name="NonemptyClassRanges" type="lexical" collapsed="">
|
||
<emu-nt><a href="text-processing.html#prod-NonemptyClassRanges">NonemptyClassRanges</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="2bs-sw8o">
|
||
<emu-nt id="_ref_24739"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt>
|
||
<emu-t>-</emu-t>
|
||
<emu-nt id="_ref_24740"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt>
|
||
<emu-nt id="_ref_24741"><a href="text-processing.html#prod-ClassContents">ClassContents</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Let <var>A</var> be <emu-xref aoid="CompileToCharSet" id="_ref_17402"><a href="text-processing.html#sec-compiletocharset">CompileToCharSet</a></emu-xref> of the first <emu-nt id="_ref_24742"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt> with argument <var>rer</var>.</li><li>Let <var>B</var> be <emu-xref aoid="CompileToCharSet" id="_ref_17403"><a href="text-processing.html#sec-compiletocharset">CompileToCharSet</a></emu-xref> of the second <emu-nt id="_ref_24743"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt> with argument <var>rer</var>.</li><li>Let <var>C</var> be <emu-xref aoid="CompileToCharSet" id="_ref_17404"><a href="text-processing.html#sec-compiletocharset">CompileToCharSet</a></emu-xref> of <emu-nt id="_ref_24744"><a href="text-processing.html#prod-ClassContents">ClassContents</a></emu-nt> with argument <var>rer</var>.</li><li>Let <var>D</var> be <emu-xref aoid="CharacterRangeOrUnion" id="_ref_17405"><a href="additional-ecmascript-features-for-web-browsers.html#sec-runtime-semantics-characterrangeorunion-abstract-operation">CharacterRangeOrUnion</a></emu-xref>(<var>rer</var>, <var>A</var>, <var>B</var>).</li><li>Return the union of <var>D</var> and <var>C</var>.</li></ol></emu-alg>
|
||
<emu-grammar><emu-production name="NonemptyClassRangesNoDash" type="lexical" collapsed="">
|
||
<emu-nt><a href="text-processing.html#prod-NonemptyClassRangesNoDash">NonemptyClassRangesNoDash</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="udwlha-v">
|
||
<emu-nt id="_ref_24745"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassAtomNoDash">ClassAtomNoDash</a></emu-nt>
|
||
<emu-t>-</emu-t>
|
||
<emu-nt id="_ref_24746"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt>
|
||
<emu-nt id="_ref_24747"><a href="text-processing.html#prod-ClassContents">ClassContents</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Let <var>A</var> be <emu-xref aoid="CompileToCharSet" id="_ref_17406"><a href="text-processing.html#sec-compiletocharset">CompileToCharSet</a></emu-xref> of <emu-nt id="_ref_24748"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassAtomNoDash">ClassAtomNoDash</a></emu-nt> with argument <var>rer</var>.</li><li>Let <var>B</var> be <emu-xref aoid="CompileToCharSet" id="_ref_17407"><a href="text-processing.html#sec-compiletocharset">CompileToCharSet</a></emu-xref> of <emu-nt id="_ref_24749"><a href="text-processing.html#prod-ClassAtom">ClassAtom</a></emu-nt> with argument <var>rer</var>.</li><li>Let <var>C</var> be <emu-xref aoid="CompileToCharSet" id="_ref_17408"><a href="text-processing.html#sec-compiletocharset">CompileToCharSet</a></emu-xref> of <emu-nt id="_ref_24750"><a href="text-processing.html#prod-ClassContents">ClassContents</a></emu-nt> with argument <var>rer</var>.</li><li>Let <var>D</var> be <emu-xref aoid="CharacterRangeOrUnion" id="_ref_17409"><a href="additional-ecmascript-features-for-web-browsers.html#sec-runtime-semantics-characterrangeorunion-abstract-operation">CharacterRangeOrUnion</a></emu-xref>(<var>rer</var>, <var>A</var>, <var>B</var>).</li><li>Return the union of <var>D</var> and <var>C</var>.</li></ol></emu-alg>
|
||
|
||
<p>In addition, the following rules are added to <emu-xref aoid="CompileToCharSet" id="_ref_17410"><a href="text-processing.html#sec-compiletocharset">CompileToCharSet</a></emu-xref>.</p>
|
||
<emu-grammar><emu-production name="ClassEscape" type="lexical" collapsed="">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassEscape">ClassEscape</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="nh-f7aun">
|
||
<emu-t>c</emu-t>
|
||
<emu-nt id="_ref_24751"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassControlLetter">ClassControlLetter</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Let <var>cv</var> be the <emu-xref aoid="CharacterValue" id="_ref_17411"><a href="text-processing.html#sec-patterns-static-semantics-character-value">CharacterValue</a></emu-xref> of this <emu-nt id="_ref_24752"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassEscape">ClassEscape</a></emu-nt>.</li><li>Let <var>c</var> be the character whose character value is <var>cv</var>.</li><li>Return the <emu-xref href="#pattern-charset" id="_ref_17412"><a href="text-processing.html#pattern-charset">CharSet</a></emu-xref> containing the single character <var>c</var>.</li></ol></emu-alg>
|
||
<emu-grammar><emu-production name="ClassAtomNoDash" type="lexical" collapsed="">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ClassAtomNoDash">ClassAtomNoDash</a></emu-nt> <emu-geq>::</emu-geq> <emu-rhs a="3hxbxljo">
|
||
<emu-t>\</emu-t>
|
||
<emu-gann>[lookahead = <emu-t>c</emu-t>]</emu-gann>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return the <emu-xref href="#pattern-charset" id="_ref_17413"><a href="text-processing.html#pattern-charset">CharSet</a></emu-xref> containing the single character <code>\</code> U+005C (REVERSE SOLIDUS).</li></ol></emu-alg>
|
||
|
||
<emu-note><span class="note">Note</span><div class="note-contents">This production can only be reached from the sequence <code>\c</code> within a character class where it is not followed by an acceptable control character.</div></emu-note>
|
||
|
||
<emu-annex id="sec-runtime-semantics-characterrangeorunion-abstract-operation" type="abstract operation" aoid="CharacterRangeOrUnion">
|
||
<h1><span class="secnum">B.1.2.8.1</span> CharacterRangeOrUnion ( <var>rer</var>, <var>A</var>, <var>B</var> )</h1>
|
||
<p>The abstract operation CharacterRangeOrUnion takes arguments <var>rer</var> (a <emu-xref href="#sec-regexp-records" id="_ref_17414"><a href="text-processing.html#sec-regexp-records">RegExp Record</a></emu-xref>), <var>A</var> (a <emu-xref href="#pattern-charset" id="_ref_17415"><a href="text-processing.html#pattern-charset">CharSet</a></emu-xref>), and <var>B</var> (a <emu-xref href="#pattern-charset" id="_ref_17416"><a href="text-processing.html#pattern-charset">CharSet</a></emu-xref>) and returns a <emu-xref href="#pattern-charset" id="_ref_17417"><a href="text-processing.html#pattern-charset">CharSet</a></emu-xref>. It performs the following steps when called:</p>
|
||
<emu-alg><ol><li>If <emu-xref aoid="HasEitherUnicodeFlag" id="_ref_17418"><a href="text-processing.html#sec-runtime-semantics-haseitherunicodeflag-abstract-operation">HasEitherUnicodeFlag</a></emu-xref>(<var>rer</var>) is <emu-val>false</emu-val>, then<ol><li>If <var>A</var> does not contain exactly one character or <var>B</var> does not contain exactly one character, then<ol><li>Let <var>C</var> be the <emu-xref href="#pattern-charset" id="_ref_17419"><a href="text-processing.html#pattern-charset">CharSet</a></emu-xref> containing the single character <code>-</code> U+002D (HYPHEN-MINUS).</li><li>Return the union of <emu-xref href="#pattern-charset" id="_ref_17420"><a href="text-processing.html#pattern-charset">CharSets</a></emu-xref> <var>A</var>, <var>B</var> and <var>C</var>.</li></ol></li></ol></li><li>Return <emu-xref aoid="CharacterRange" id="_ref_17421"><a href="text-processing.html#sec-runtime-semantics-characterrange-abstract-operation">CharacterRange</a></emu-xref>(<var>A</var>, <var>B</var>).</li></ol></emu-alg>
|
||
</emu-annex>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-parsepattern-annexb">
|
||
<h1><span class="secnum">B.1.2.9</span> Static Semantics: ParsePattern ( <var>patternText</var>, <var>u</var>, <var>v</var> )</h1>
|
||
<p>The semantics of <emu-xref href="#sec-parsepattern" id="_ref_860"><a href="text-processing.html#sec-parsepattern">22.2.3.4</a></emu-xref> is extended as follows:</p>
|
||
<p>The abstract operation <emu-xref aoid="ParsePattern" id="_ref_17422"><a href="text-processing.html#sec-parsepattern">ParsePattern</a></emu-xref> takes arguments <var>patternText</var> (a sequence of Unicode code points), <var>u</var> (a Boolean), and <var>v</var> (a Boolean). It performs the following steps when called:</p>
|
||
<emu-alg><ol><li>If <var>v</var> is <emu-val>true</emu-val> and <var>u</var> is <emu-val>true</emu-val>, then<ol><li>Let <var>parseResult</var> be a <emu-xref href="#sec-list-and-record-specification-type" id="_ref_17423"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref> containing one or more <emu-val>SyntaxError</emu-val> objects.</li></ol></li><li>Else if <var>v</var> is <emu-val>true</emu-val>, then<ol><li>Let <var>parseResult</var> be <emu-xref aoid="ParseText" id="_ref_17424"><a href="ecmascript-language-source-code.html#sec-parsetext">ParseText</a></emu-xref>(<var>patternText</var>, <emu-nt params="+UnicodeMode, +UnicodeSetsMode, +NamedCaptureGroups" id="_ref_24753"><a href="text-processing.html#prod-Pattern">Pattern</a><emu-mods><emu-params>[+UnicodeMode, +UnicodeSetsMode, +NamedCaptureGroups]</emu-params></emu-mods></emu-nt>).</li></ol></li><li>Else if <var>u</var> is <emu-val>true</emu-val>, then<ol><li>Let <var>parseResult</var> be <emu-xref aoid="ParseText" id="_ref_17425"><a href="ecmascript-language-source-code.html#sec-parsetext">ParseText</a></emu-xref>(<var>patternText</var>, <emu-nt params="+UnicodeMode, ~UnicodeSetsMode, +NamedCaptureGroups" id="_ref_24754"><a href="text-processing.html#prod-Pattern">Pattern</a><emu-mods><emu-params>[+UnicodeMode, ~UnicodeSetsMode, +NamedCaptureGroups]</emu-params></emu-mods></emu-nt>).</li></ol></li><li>Else,<ol><li>Let <var>parseResult</var> be <emu-xref aoid="ParseText" id="_ref_17426"><a href="ecmascript-language-source-code.html#sec-parsetext">ParseText</a></emu-xref>(<var>patternText</var>, <emu-nt params="~UnicodeMode, ~UnicodeSetsMode, ~NamedCaptureGroups" id="_ref_24755"><a href="text-processing.html#prod-Pattern">Pattern</a><emu-mods><emu-params>[~UnicodeMode, ~UnicodeSetsMode, ~NamedCaptureGroups]</emu-params></emu-mods></emu-nt>).</li><li>If <var>parseResult</var> is a <emu-xref href="#sec-syntactic-grammar" id="_ref_17427"><a href="notational-conventions.html#sec-syntactic-grammar">Parse Node</a></emu-xref> and <var>parseResult</var> contains a <emu-nt id="_ref_24756"><a href="text-processing.html#prod-GroupName">GroupName</a></emu-nt>, then<ol><li>Set <var>parseResult</var> to <emu-xref aoid="ParseText" id="_ref_17428"><a href="ecmascript-language-source-code.html#sec-parsetext">ParseText</a></emu-xref>(<var>patternText</var>, <emu-nt params="~UnicodeMode, ~UnicodeSetsMode, +NamedCaptureGroups" id="_ref_24757"><a href="text-processing.html#prod-Pattern">Pattern</a><emu-mods><emu-params>[~UnicodeMode, ~UnicodeSetsMode, +NamedCaptureGroups]</emu-params></emu-mods></emu-nt>).</li></ol></li></ol></li><li>Return <var>parseResult</var>.</li></ol></emu-alg>
|
||
</emu-annex>
|
||
</emu-annex>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-additional-built-in-properties">
|
||
<h1><span class="secnum">B.2</span> Additional Built-in Properties</h1>
|
||
<p>When the ECMAScript <emu-xref href="#host" id="_ref_17429"><a href="overview.html#host">host</a></emu-xref> is a web browser the following additional properties of the standard built-in objects are defined.</p>
|
||
|
||
<emu-annex id="sec-additional-properties-of-the-global-object">
|
||
<h1><span class="secnum">B.2.1</span> Additional Properties of the Global Object</h1>
|
||
<p>The entries in <emu-xref href="#table-additional-well-known-intrinsic-objects" id="_ref_861"><a href="additional-ecmascript-features-for-web-browsers.html#table-additional-well-known-intrinsic-objects">Table 97</a></emu-xref> are added to <emu-xref href="#table-well-known-intrinsic-objects" id="_ref_862"><a href="ecmascript-data-types-and-values.html#table-well-known-intrinsic-objects">Table 6</a></emu-xref>.</p>
|
||
<emu-table id="table-additional-well-known-intrinsic-objects" caption="Additional Well-known Intrinsic Objects" oldids="table-60"><figure><figcaption>Table 97: Additional Well-known Intrinsic Objects</figcaption><span id="table-60"></span>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>
|
||
Intrinsic Name
|
||
</th>
|
||
<th>
|
||
Global Name
|
||
</th>
|
||
<th>
|
||
ECMAScript Language Association
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr>
|
||
<td>
|
||
<emu-xref href="#sec-escape-string" id="_ref_17430"><a href="additional-ecmascript-features-for-web-browsers.html#sec-escape-string">%escape%</a></emu-xref>
|
||
</td>
|
||
<td>
|
||
<code>escape</code>
|
||
</td>
|
||
<td>
|
||
The <code>escape</code> function (<emu-xref href="#sec-escape-string" id="_ref_863"><a href="additional-ecmascript-features-for-web-browsers.html#sec-escape-string">B.2.1.1</a></emu-xref>)
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<emu-xref href="#sec-unescape-string" id="_ref_17431"><a href="additional-ecmascript-features-for-web-browsers.html#sec-unescape-string">%unescape%</a></emu-xref>
|
||
</td>
|
||
<td>
|
||
<code>unescape</code>
|
||
</td>
|
||
<td>
|
||
The <code>unescape</code> function (<emu-xref href="#sec-unescape-string" id="_ref_864"><a href="additional-ecmascript-features-for-web-browsers.html#sec-unescape-string">B.2.1.2</a></emu-xref>)
|
||
</td>
|
||
</tr>
|
||
</tbody></table>
|
||
</figure></emu-table>
|
||
|
||
<emu-annex id="sec-escape-string" type="built-in function">
|
||
<h1><span class="secnum">B.2.1.1</span> escape ( <var>string</var> )</h1>
|
||
<p>This function is a property of the <emu-xref href="#sec-global-object" id="_ref_17432"><a href="global-object.html#sec-global-object">global object</a></emu-xref>. It computes a new version of a String value in which certain code units have been replaced by a hexadecimal escape sequence.</p>
|
||
<p>When replacing a code unit of numeric value less than or equal to 0x00FF, a two-digit escape sequence of the form <code>%<var>xx</var></code> is used. When replacing a code unit of numeric value strictly greater than 0x00FF, a four-digit escape sequence of the form <code>%u<var>xxxx</var></code> is used.</p>
|
||
<p>It is the <dfn tabindex="-1">%escape%</dfn> intrinsic object.</p>
|
||
<p>It performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Set <var>string</var> to ? <emu-xref aoid="ToString" id="_ref_17433"><a href="abstract-operations.html#sec-tostring" class="e-user-code">ToString</a></emu-xref>(<var>string</var>).</li><li>Let <var>len</var> be the length of <var>string</var>.</li><li>Let <var>R</var> be the empty String.</li><li>Let <var>unescapedSet</var> be the <emu-xref href="#string-concatenation" id="_ref_17434"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of <emu-xref href="#ASCII-word-characters" id="_ref_17435"><a href="ecmascript-data-types-and-values.html#ASCII-word-characters">the ASCII word characters</a></emu-xref> and <emu-val>"@*+-./"</emu-val>.</li><li>Let <var>k</var> be 0.</li><li>Repeat, while <var>k</var> < <var>len</var>,<ol><li>Let <var>C</var> be the code unit at index <var>k</var> within <var>string</var>.</li><li>If <var>unescapedSet</var> contains <var>C</var>, then<ol><li>Let <var>S</var> be <var>C</var>.</li></ol></li><li>Else,<ol><li>Let <var>n</var> be the numeric value of <var>C</var>.</li><li>If <var>n</var> < 256, then<ol><li>Let <var>hex</var> be the String representation of <var>n</var>, formatted as an uppercase hexadecimal number.</li><li>Let <var>S</var> be the <emu-xref href="#string-concatenation" id="_ref_17436"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of <emu-val>"%"</emu-val> and <emu-xref aoid="StringPad" id="_ref_17437"><a href="text-processing.html#sec-stringpad">StringPad</a></emu-xref>(<var>hex</var>, 2, <emu-val>"0"</emu-val>, <emu-const>start</emu-const>).</li></ol></li><li>Else,<ol><li>Let <var>hex</var> be the String representation of <var>n</var>, formatted as an uppercase hexadecimal number.</li><li>Let <var>S</var> be the <emu-xref href="#string-concatenation" id="_ref_17438"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of <emu-val>"%u"</emu-val> and <emu-xref aoid="StringPad" id="_ref_17439"><a href="text-processing.html#sec-stringpad">StringPad</a></emu-xref>(<var>hex</var>, 4, <emu-val>"0"</emu-val>, <emu-const>start</emu-const>).</li></ol></li></ol></li><li>Set <var>R</var> to the <emu-xref href="#string-concatenation" id="_ref_17440"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of <var>R</var> and <var>S</var>.</li><li>Set <var>k</var> to <var>k</var> + 1.</li></ol></li><li>Return <var>R</var>.</li></ol></emu-alg>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>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.</p>
|
||
</div></emu-note>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-unescape-string" type="built-in function">
|
||
<h1><span class="secnum">B.2.1.2</span> unescape ( <var>string</var> )</h1>
|
||
<p>This function is a property of the <emu-xref href="#sec-global-object" id="_ref_17441"><a href="global-object.html#sec-global-object">global object</a></emu-xref>. It computes a new version of a String value in which each escape sequence of the sort that might be introduced by the <code>escape</code> function is replaced with the code unit that it represents.</p>
|
||
<p>It is the <dfn tabindex="-1">%unescape%</dfn> intrinsic object.</p>
|
||
<p>It performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Set <var>string</var> to ? <emu-xref aoid="ToString" id="_ref_17442"><a href="abstract-operations.html#sec-tostring" class="e-user-code">ToString</a></emu-xref>(<var>string</var>).</li><li>Let <var>len</var> be the length of <var>string</var>.</li><li>Let <var>R</var> be the empty String.</li><li>Let <var>k</var> be 0.</li><li>Repeat, while <var>k</var> < <var>len</var>,<ol><li>Let <var>C</var> be the code unit at index <var>k</var> within <var>string</var>.</li><li>If <var>C</var> is the code unit 0x0025 (PERCENT SIGN), then<ol><li>Let <var>hexDigits</var> be the empty String.</li><li>Let <var>optionalAdvance</var> be 0.</li><li>If <var>k</var> + 5 < <var>len</var> and the code unit at index <var>k</var> + 1 within <var>string</var> is the code unit 0x0075 (LATIN SMALL LETTER U), then<ol><li>Set <var>hexDigits</var> to the <emu-xref href="#substring" id="_ref_17443"><a href="ecmascript-data-types-and-values.html#substring">substring</a></emu-xref> of <var>string</var> from <var>k</var> + 2 to <var>k</var> + 6.</li><li>Set <var>optionalAdvance</var> to 5.</li></ol></li><li>Else if <var>k</var> + 3 ≤ <var>len</var>, then<ol><li>Set <var>hexDigits</var> to the <emu-xref href="#substring" id="_ref_17444"><a href="ecmascript-data-types-and-values.html#substring">substring</a></emu-xref> of <var>string</var> from <var>k</var> + 1 to <var>k</var> + 3.</li><li>Set <var>optionalAdvance</var> to 2.</li></ol></li><li>Let <var>parseResult</var> be <emu-xref aoid="ParseText" id="_ref_17445"><a href="ecmascript-language-source-code.html#sec-parsetext">ParseText</a></emu-xref>(<var>hexDigits</var>, <emu-nt params="~Sep" id="_ref_24758"><a href="ecmascript-language-lexical-grammar.html#prod-HexDigits">HexDigits</a><emu-mods><emu-params>[~Sep]</emu-params></emu-mods></emu-nt>).</li><li>If <var>parseResult</var> is a <emu-xref href="#sec-syntactic-grammar" id="_ref_17446"><a href="notational-conventions.html#sec-syntactic-grammar">Parse Node</a></emu-xref>, then<ol><li>Let <var>n</var> be the MV of <var>parseResult</var>.</li><li>Set <var>C</var> to the code unit whose numeric value is <var>n</var>.</li><li>Set <var>k</var> to <var>k</var> + <var>optionalAdvance</var>.</li></ol></li></ol></li><li>Set <var>R</var> to the <emu-xref href="#string-concatenation" id="_ref_17447"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of <var>R</var> and <var>C</var>.</li><li>Set <var>k</var> to <var>k</var> + 1.</li></ol></li><li>Return <var>R</var>.</li></ol></emu-alg>
|
||
</emu-annex>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-additional-properties-of-the-string.prototype-object">
|
||
<h1><span class="secnum">B.2.2</span> Additional Properties of the String.prototype Object</h1>
|
||
|
||
<emu-annex id="sec-string.prototype.substr" type="built-in function">
|
||
<h1><span class="secnum">B.2.2.1</span> String.prototype.substr ( <var>start</var>, <var>length</var> )</h1>
|
||
<p>This method returns a <emu-not-ref>substring</emu-not-ref> of the result of converting the <emu-val>this</emu-val> value to a String, starting from index <var>start</var> and running for <var>length</var> code units (or through the end of the String if <var>length</var> is <emu-val>undefined</emu-val>). If <var>start</var> is negative, it is treated as <emu-eqn class="inline"><var>sourceLength</var> + <var>start</var></emu-eqn> where <var>sourceLength</var> is the length of the String. The result <emu-xref href="#sec-ecmascript-language-types-string-type" id="_ref_17448"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types-string-type">is a String</a></emu-xref> value, not a String object.</p>
|
||
<p>It performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Let <var>O</var> be the <emu-val>this</emu-val> value.</li><li>Perform ? <emu-xref aoid="RequireObjectCoercible" id="_ref_17449"><a href="abstract-operations.html#sec-requireobjectcoercible">RequireObjectCoercible</a></emu-xref>(<var>O</var>).</li><li>Let <var>S</var> be ? <emu-xref aoid="ToString" id="_ref_17450"><a href="abstract-operations.html#sec-tostring" class="e-user-code">ToString</a></emu-xref>(<var>O</var>).</li><li>Let <var>size</var> be the length of <var>S</var>.</li><li>Let <var>intStart</var> be ? <emu-xref aoid="ToIntegerOrInfinity" id="_ref_17451"><a href="abstract-operations.html#sec-tointegerorinfinity" class="e-user-code">ToIntegerOrInfinity</a></emu-xref>(<var>start</var>).</li><li>If <var>intStart</var> = -∞, set <var>intStart</var> to 0.</li><li>Else if <var>intStart</var> < 0, set <var>intStart</var> to <emu-xref aoid="max" id="_ref_17452"><a href="notational-conventions.html#eqn-max">max</a></emu-xref>(<var>size</var> + <var>intStart</var>, 0).</li><li>Else, set <var>intStart</var> to <emu-xref aoid="min" id="_ref_17453"><a href="notational-conventions.html#eqn-min">min</a></emu-xref>(<var>intStart</var>, <var>size</var>).</li><li>If <var>length</var> is <emu-val>undefined</emu-val>, let <var>intLength</var> be <var>size</var>; else let <var>intLength</var> be ? <emu-xref aoid="ToIntegerOrInfinity" id="_ref_17454"><a href="abstract-operations.html#sec-tointegerorinfinity" class="e-user-code">ToIntegerOrInfinity</a></emu-xref>(<var>length</var>).</li><li>Set <var>intLength</var> to the result of <emu-xref href="#clamping" id="_ref_17455"><a href="notational-conventions.html#clamping">clamping</a></emu-xref> <var>intLength</var> between 0 and <var>size</var>.</li><li>Let <var>intEnd</var> be <emu-xref aoid="min" id="_ref_17456"><a href="notational-conventions.html#eqn-min">min</a></emu-xref>(<var>intStart</var> + <var>intLength</var>, <var>size</var>).</li><li>Return the <emu-xref href="#substring" id="_ref_17457"><a href="ecmascript-data-types-and-values.html#substring">substring</a></emu-xref> of <var>S</var> from <var>intStart</var> to <var>intEnd</var>.</li></ol></emu-alg>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>This method is intentionally generic; it does not require that its <emu-val>this</emu-val> value be a String object. Therefore it can be transferred to other kinds of objects for use as a method.</p>
|
||
</div></emu-note>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-string.prototype.anchor" type="built-in function">
|
||
<h1><span class="secnum">B.2.2.2</span> String.prototype.anchor ( <var>name</var> )</h1>
|
||
<p>This method performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Let <var>S</var> be the <emu-val>this</emu-val> value.</li><li>Return ? <emu-xref aoid="CreateHTML" id="_ref_17458"><a href="additional-ecmascript-features-for-web-browsers.html#sec-createhtml" class="e-user-code">CreateHTML</a></emu-xref>(<var>S</var>, <emu-val>"a"</emu-val>, <emu-val>"name"</emu-val>, <var>name</var>).</li></ol></emu-alg>
|
||
|
||
<emu-annex id="sec-createhtml" type="abstract operation" aoid="CreateHTML">
|
||
<h1><span class="secnum">B.2.2.2.1</span> CreateHTML ( <var>string</var>, <var>tag</var>, <var>attribute</var>, <var>value</var> )</h1>
|
||
<p>The abstract operation CreateHTML takes arguments <var>string</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_17459"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>), <var>tag</var> (a String), <var>attribute</var> (a String), and <var>value</var> (an <emu-xref href="#sec-ecmascript-language-types" id="_ref_17460"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type" id="_ref_17461"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">normal completion containing</a></emu-xref> a String or a <emu-xref href="#sec-completion-record-specification-type" id="_ref_17462"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">throw completion</a></emu-xref>. It performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Perform ? <emu-xref aoid="RequireObjectCoercible" id="_ref_17463"><a href="abstract-operations.html#sec-requireobjectcoercible">RequireObjectCoercible</a></emu-xref>(<var>string</var>).</li><li>Let <var>S</var> be ? <emu-xref aoid="ToString" id="_ref_17464"><a href="abstract-operations.html#sec-tostring" class="e-user-code">ToString</a></emu-xref>(<var>string</var>).</li><li>Let <var>p1</var> be the <emu-xref href="#string-concatenation" id="_ref_17465"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of <emu-val>"<"</emu-val> and <var>tag</var>.</li><li>If <var>attribute</var> is not the empty String, then<ol><li>Let <var>V</var> be ? <emu-xref aoid="ToString" id="_ref_17466"><a href="abstract-operations.html#sec-tostring" class="e-user-code">ToString</a></emu-xref>(<var>value</var>).</li><li>Let <var>escapedV</var> be the String value that is the same as <var>V</var> except that each occurrence of the code unit 0x0022 (QUOTATION MARK) in <var>V</var> has been replaced with the six code unit sequence <emu-val>"&quot;"</emu-val>.</li><li>Set <var>p1</var> to the <emu-xref href="#string-concatenation" id="_ref_17467"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of:<ul><li><var>p1</var></li><li>the code unit 0x0020 (SPACE)</li><li><var>attribute</var></li><li>the code unit 0x003D (EQUALS SIGN)</li><li>the code unit 0x0022 (QUOTATION MARK)</li><li><var>escapedV</var></li><li>the code unit 0x0022 (QUOTATION MARK)</li></ul></li></ol></li><li>Let <var>p2</var> be the <emu-xref href="#string-concatenation" id="_ref_17468"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of <var>p1</var> and <emu-val>">"</emu-val>.</li><li>Let <var>p3</var> be the <emu-xref href="#string-concatenation" id="_ref_17469"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of <var>p2</var> and <var>S</var>.</li><li>Let <var>p4</var> be the <emu-xref href="#string-concatenation" id="_ref_17470"><a href="ecmascript-data-types-and-values.html#string-concatenation">string-concatenation</a></emu-xref> of <var>p3</var>, <emu-val>"</"</emu-val>, <var>tag</var>, and <emu-val>">"</emu-val>.</li><li>Return <var>p4</var>.</li></ol></emu-alg>
|
||
</emu-annex>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-string.prototype.big" type="built-in function">
|
||
<h1><span class="secnum">B.2.2.3</span> String.prototype.big ( )</h1>
|
||
<p>This method performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Let <var>S</var> be the <emu-val>this</emu-val> value.</li><li>Return ? <emu-xref aoid="CreateHTML" id="_ref_17471"><a href="additional-ecmascript-features-for-web-browsers.html#sec-createhtml" class="e-user-code">CreateHTML</a></emu-xref>(<var>S</var>, <emu-val>"big"</emu-val>, <emu-val>""</emu-val>, <emu-val>""</emu-val>).</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-string.prototype.blink" type="built-in function">
|
||
<h1><span class="secnum">B.2.2.4</span> String.prototype.blink ( )</h1>
|
||
<p>This method performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Let <var>S</var> be the <emu-val>this</emu-val> value.</li><li>Return ? <emu-xref aoid="CreateHTML" id="_ref_17472"><a href="additional-ecmascript-features-for-web-browsers.html#sec-createhtml" class="e-user-code">CreateHTML</a></emu-xref>(<var>S</var>, <emu-val>"blink"</emu-val>, <emu-val>""</emu-val>, <emu-val>""</emu-val>).</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-string.prototype.bold" type="built-in function">
|
||
<h1><span class="secnum">B.2.2.5</span> String.prototype.bold ( )</h1>
|
||
<p>This method performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Let <var>S</var> be the <emu-val>this</emu-val> value.</li><li>Return ? <emu-xref aoid="CreateHTML" id="_ref_17473"><a href="additional-ecmascript-features-for-web-browsers.html#sec-createhtml" class="e-user-code">CreateHTML</a></emu-xref>(<var>S</var>, <emu-val>"b"</emu-val>, <emu-val>""</emu-val>, <emu-val>""</emu-val>).</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-string.prototype.fixed" type="built-in function">
|
||
<h1><span class="secnum">B.2.2.6</span> String.prototype.fixed ( )</h1>
|
||
<p>This method performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Let <var>S</var> be the <emu-val>this</emu-val> value.</li><li>Return ? <emu-xref aoid="CreateHTML" id="_ref_17474"><a href="additional-ecmascript-features-for-web-browsers.html#sec-createhtml" class="e-user-code">CreateHTML</a></emu-xref>(<var>S</var>, <emu-val>"tt"</emu-val>, <emu-val>""</emu-val>, <emu-val>""</emu-val>).</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-string.prototype.fontcolor" type="built-in function">
|
||
<h1><span class="secnum">B.2.2.7</span> String.prototype.fontcolor ( <var>colour</var> )</h1>
|
||
<p>This method performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Let <var>S</var> be the <emu-val>this</emu-val> value.</li><li>Return ? <emu-xref aoid="CreateHTML" id="_ref_17475"><a href="additional-ecmascript-features-for-web-browsers.html#sec-createhtml" class="e-user-code">CreateHTML</a></emu-xref>(<var>S</var>, <emu-val>"font"</emu-val>, <emu-val>"color"</emu-val>, <var>colour</var>).</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-string.prototype.fontsize" type="built-in function">
|
||
<h1><span class="secnum">B.2.2.8</span> String.prototype.fontsize ( <var>size</var> )</h1>
|
||
<p>This method performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Let <var>S</var> be the <emu-val>this</emu-val> value.</li><li>Return ? <emu-xref aoid="CreateHTML" id="_ref_17476"><a href="additional-ecmascript-features-for-web-browsers.html#sec-createhtml" class="e-user-code">CreateHTML</a></emu-xref>(<var>S</var>, <emu-val>"font"</emu-val>, <emu-val>"size"</emu-val>, <var>size</var>).</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-string.prototype.italics" type="built-in function">
|
||
<h1><span class="secnum">B.2.2.9</span> String.prototype.italics ( )</h1>
|
||
<p>This method performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Let <var>S</var> be the <emu-val>this</emu-val> value.</li><li>Return ? <emu-xref aoid="CreateHTML" id="_ref_17477"><a href="additional-ecmascript-features-for-web-browsers.html#sec-createhtml" class="e-user-code">CreateHTML</a></emu-xref>(<var>S</var>, <emu-val>"i"</emu-val>, <emu-val>""</emu-val>, <emu-val>""</emu-val>).</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-string.prototype.link" type="built-in function">
|
||
<h1><span class="secnum">B.2.2.10</span> String.prototype.link ( <var>url</var> )</h1>
|
||
<p>This method performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Let <var>S</var> be the <emu-val>this</emu-val> value.</li><li>Return ? <emu-xref aoid="CreateHTML" id="_ref_17478"><a href="additional-ecmascript-features-for-web-browsers.html#sec-createhtml" class="e-user-code">CreateHTML</a></emu-xref>(<var>S</var>, <emu-val>"a"</emu-val>, <emu-val>"href"</emu-val>, <var>url</var>).</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-string.prototype.small" type="built-in function">
|
||
<h1><span class="secnum">B.2.2.11</span> String.prototype.small ( )</h1>
|
||
<p>This method performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Let <var>S</var> be the <emu-val>this</emu-val> value.</li><li>Return ? <emu-xref aoid="CreateHTML" id="_ref_17479"><a href="additional-ecmascript-features-for-web-browsers.html#sec-createhtml" class="e-user-code">CreateHTML</a></emu-xref>(<var>S</var>, <emu-val>"small"</emu-val>, <emu-val>""</emu-val>, <emu-val>""</emu-val>).</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-string.prototype.strike" type="built-in function">
|
||
<h1><span class="secnum">B.2.2.12</span> String.prototype.strike ( )</h1>
|
||
<p>This method performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Let <var>S</var> be the <emu-val>this</emu-val> value.</li><li>Return ? <emu-xref aoid="CreateHTML" id="_ref_17480"><a href="additional-ecmascript-features-for-web-browsers.html#sec-createhtml" class="e-user-code">CreateHTML</a></emu-xref>(<var>S</var>, <emu-val>"strike"</emu-val>, <emu-val>""</emu-val>, <emu-val>""</emu-val>).</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-string.prototype.sub" type="built-in function">
|
||
<h1><span class="secnum">B.2.2.13</span> String.prototype.sub ( )</h1>
|
||
<p>This method performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Let <var>S</var> be the <emu-val>this</emu-val> value.</li><li>Return ? <emu-xref aoid="CreateHTML" id="_ref_17481"><a href="additional-ecmascript-features-for-web-browsers.html#sec-createhtml" class="e-user-code">CreateHTML</a></emu-xref>(<var>S</var>, <emu-val>"sub"</emu-val>, <emu-val>""</emu-val>, <emu-val>""</emu-val>).</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-string.prototype.sup" type="built-in function">
|
||
<h1><span class="secnum">B.2.2.14</span> String.prototype.sup ( )</h1>
|
||
<p>This method performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Let <var>S</var> be the <emu-val>this</emu-val> value.</li><li>Return ? <emu-xref aoid="CreateHTML" id="_ref_17482"><a href="additional-ecmascript-features-for-web-browsers.html#sec-createhtml" class="e-user-code">CreateHTML</a></emu-xref>(<var>S</var>, <emu-val>"sup"</emu-val>, <emu-val>""</emu-val>, <emu-val>""</emu-val>).</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="String.prototype.trimleft" type="built-in function">
|
||
<h1><span class="secnum">B.2.2.15</span> String.prototype.trimLeft ( )</h1>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>The property <emu-val>"trimStart"</emu-val> is preferred. The <emu-val>"trimLeft"</emu-val> property is provided principally for compatibility with old code. It is recommended that the <emu-val>"trimStart"</emu-val> property be used in new ECMAScript code.</p>
|
||
</div></emu-note>
|
||
<p>The initial value of the <emu-val>"trimLeft"</emu-val> property is %String.prototype.trimStart%, defined in <emu-xref href="#sec-string.prototype.trimstart" id="_ref_865"><a href="text-processing.html#sec-string.prototype.trimstart">22.1.3.34</a></emu-xref>.</p>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="String.prototype.trimright" type="built-in function">
|
||
<h1><span class="secnum">B.2.2.16</span> String.prototype.trimRight ( )</h1>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>The property <emu-val>"trimEnd"</emu-val> is preferred. The <emu-val>"trimRight"</emu-val> property is provided principally for compatibility with old code. It is recommended that the <emu-val>"trimEnd"</emu-val> property be used in new ECMAScript code.</p>
|
||
</div></emu-note>
|
||
<p>The initial value of the <emu-val>"trimRight"</emu-val> property is %String.prototype.trimEnd%, defined in <emu-xref href="#sec-string.prototype.trimend" id="_ref_866"><a href="text-processing.html#sec-string.prototype.trimend">22.1.3.33</a></emu-xref>.</p>
|
||
</emu-annex>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-additional-properties-of-the-date.prototype-object">
|
||
<h1><span class="secnum">B.2.3</span> Additional Properties of the Date.prototype Object</h1>
|
||
|
||
<emu-annex id="sec-date.prototype.getyear" type="built-in function">
|
||
<h1><span class="secnum">B.2.3.1</span> Date.prototype.getYear ( )</h1>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>The <code>getFullYear</code> method is preferred for nearly all purposes, because it avoids the “year 2000 problem.”</p>
|
||
</div></emu-note>
|
||
<p>This method performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Let <var>dateObject</var> be the <emu-val>this</emu-val> value.</li><li>Perform ? <emu-xref aoid="RequireInternalSlot" id="_ref_17483"><a href="ordinary-and-exotic-objects-behaviours.html#sec-requireinternalslot">RequireInternalSlot</a></emu-xref>(<var>dateObject</var>, <var class="field">[[DateValue]]</var>).</li><li>Let <var>t</var> be <var>dateObject</var>.<var class="field">[[DateValue]]</var>.</li><li>If <var>t</var> is <emu-val>NaN</emu-val>, return <emu-val>NaN</emu-val>.</li><li>Return <emu-xref aoid="YearFromTime" id="_ref_17484"><a href="numbers-and-dates.html#sec-yearfromtime">YearFromTime</a></emu-xref>(<emu-xref aoid="LocalTime" id="_ref_17485"><a href="numbers-and-dates.html#sec-localtime">LocalTime</a></emu-xref>(<var>t</var>)) - <emu-val>1900</emu-val><sub>𝔽</sub>.</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-date.prototype.setyear" type="built-in function">
|
||
<h1><span class="secnum">B.2.3.2</span> Date.prototype.setYear ( <var>year</var> )</h1>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>The <code>setFullYear</code> method is preferred for nearly all purposes, because it avoids the “year 2000 problem.”</p>
|
||
</div></emu-note>
|
||
<p>This method performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Let <var>dateObject</var> be the <emu-val>this</emu-val> value.</li><li>Perform ? <emu-xref aoid="RequireInternalSlot" id="_ref_17486"><a href="ordinary-and-exotic-objects-behaviours.html#sec-requireinternalslot">RequireInternalSlot</a></emu-xref>(<var>dateObject</var>, <var class="field">[[DateValue]]</var>).</li><li>Let <var>t</var> be <var>dateObject</var>.<var class="field">[[DateValue]]</var>.</li><li>Let <var>y</var> be ? <emu-xref aoid="ToNumber" id="_ref_17487"><a href="abstract-operations.html#sec-tonumber" class="e-user-code">ToNumber</a></emu-xref>(<var>year</var>).</li><li>If <var>t</var> is <emu-val>NaN</emu-val>, set <var>t</var> to <emu-val>+0</emu-val><sub>𝔽</sub>; else set <var>t</var> to <emu-xref aoid="LocalTime" id="_ref_17488"><a href="numbers-and-dates.html#sec-localtime">LocalTime</a></emu-xref>(<var>t</var>).</li><li>Let <var>yyyy</var> be <emu-xref aoid="MakeFullYear" id="_ref_17489"><a href="numbers-and-dates.html#sec-makefullyear">MakeFullYear</a></emu-xref>(<var>y</var>).</li><li>Let <var>d</var> be <emu-xref aoid="MakeDay" id="_ref_17490"><a href="numbers-and-dates.html#sec-makeday">MakeDay</a></emu-xref>(<var>yyyy</var>, <emu-xref aoid="MonthFromTime" id="_ref_17491"><a href="numbers-and-dates.html#sec-monthfromtime">MonthFromTime</a></emu-xref>(<var>t</var>), <emu-xref aoid="DateFromTime" id="_ref_17492"><a href="numbers-and-dates.html#sec-datefromtime">DateFromTime</a></emu-xref>(<var>t</var>)).</li><li>Let <var>date</var> be <emu-xref aoid="MakeDate" id="_ref_17493"><a href="numbers-and-dates.html#sec-makedate">MakeDate</a></emu-xref>(<var>d</var>, <emu-xref aoid="TimeWithinDay" id="_ref_17494"><a href="numbers-and-dates.html#sec-timewithinday">TimeWithinDay</a></emu-xref>(<var>t</var>)).</li><li>Let <var>u</var> be <emu-xref aoid="TimeClip" id="_ref_17495"><a href="numbers-and-dates.html#sec-timeclip">TimeClip</a></emu-xref>(<emu-xref aoid="UTC" id="_ref_17496"><a href="numbers-and-dates.html#sec-utc-t">UTC</a></emu-xref>(<var>date</var>)).</li><li>Set <var>dateObject</var>.<var class="field">[[DateValue]]</var> to <var>u</var>.</li><li>Return <var>u</var>.</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-date.prototype.togmtstring" type="built-in function">
|
||
<h1><span class="secnum">B.2.3.3</span> Date.prototype.toGMTString ( )</h1>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>The <code>toUTCString</code> method is preferred. This method is provided principally for compatibility with old code.</p>
|
||
</div></emu-note>
|
||
<p>The initial value of the <emu-val>"toGMTString"</emu-val> property is %Date.prototype.toUTCString%, defined in <emu-xref href="#sec-date.prototype.toutcstring" id="_ref_867"><a href="numbers-and-dates.html#sec-date.prototype.toutcstring">21.4.4.43</a></emu-xref>.</p>
|
||
</emu-annex>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-additional-properties-of-the-regexp.prototype-object">
|
||
<h1><span class="secnum">B.2.4</span> Additional Properties of the RegExp.prototype Object</h1>
|
||
|
||
<emu-annex id="sec-regexp.prototype.compile" type="built-in function">
|
||
<h1><span class="secnum">B.2.4.1</span> RegExp.prototype.compile ( <var>pattern</var>, <var>flags</var> )</h1>
|
||
<p>This method performs the following steps when called:</p>
|
||
<emu-alg><ol><li>Let <var>O</var> be the <emu-val>this</emu-val> value.</li><li>Perform ? <emu-xref aoid="RequireInternalSlot" id="_ref_17497"><a href="ordinary-and-exotic-objects-behaviours.html#sec-requireinternalslot">RequireInternalSlot</a></emu-xref>(<var>O</var>, <var class="field">[[RegExpMatcher]]</var>).</li><li>If <var>pattern</var> <emu-xref href="#sec-object-type" id="_ref_17498"><a href="ecmascript-data-types-and-values.html#sec-object-type">is an Object</a></emu-xref> and <var>pattern</var> has a <var class="field">[[RegExpMatcher]]</var> internal slot, then<ol><li>If <var>flags</var> is not <emu-val>undefined</emu-val>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Let <var>P</var> be <var>pattern</var>.<var class="field">[[OriginalSource]]</var>.</li><li>Let <var>F</var> be <var>pattern</var>.<var class="field">[[OriginalFlags]]</var>.</li></ol></li><li>Else,<ol><li>Let <var>P</var> be <var>pattern</var>.</li><li>Let <var>F</var> be <var>flags</var>.</li></ol></li><li>Return ? <emu-xref aoid="RegExpInitialize" id="_ref_17499"><a href="text-processing.html#sec-regexpinitialize" class="e-user-code">RegExpInitialize</a></emu-xref>(<var>O</var>, <var>P</var>, <var>F</var>).</li></ol></emu-alg>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>This method completely reinitializes the <emu-val>this</emu-val> value RegExp with a new pattern and flags. An implementation may interpret use of this method as an assertion that the resulting RegExp object will be used multiple times and hence is a candidate for extra optimization.</p>
|
||
</div></emu-note>
|
||
</emu-annex>
|
||
</emu-annex>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-other-additional-features">
|
||
<h1><span class="secnum">B.3</span> Other Additional Features</h1>
|
||
|
||
<emu-annex id="sec-labelled-function-declarations">
|
||
<h1><span class="secnum">B.3.1</span> Labelled Function Declarations</h1>
|
||
<p>Prior to ECMAScript 2015, the specification of <emu-nt id="_ref_24759"><a href="ecmascript-language-statements-and-declarations.html#prod-LabelledStatement">LabelledStatement</a></emu-nt> did not allow for the association of a statement label with a <emu-nt id="_ref_24760"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt>. However, a labelled <emu-nt id="_ref_24761"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt> was an allowable extension for <emu-xref href="#non-strict-code" id="_ref_17500"><a href="ecmascript-language-source-code.html#non-strict-code">non-strict code</a></emu-xref> and most browser-hosted ECMAScript implementations supported that extension. In ECMAScript 2015 and later, the grammar production for <emu-nt id="_ref_24762"><a href="ecmascript-language-statements-and-declarations.html#prod-LabelledStatement">LabelledStatement</a></emu-nt> permits use of <emu-nt id="_ref_24763"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt> as a <emu-nt id="_ref_24764"><a href="ecmascript-language-statements-and-declarations.html#prod-LabelledItem">LabelledItem</a></emu-nt> but <emu-xref href="#sec-labelled-statements-static-semantics-early-errors" id="_ref_868"><a href="ecmascript-language-statements-and-declarations.html#sec-labelled-statements-static-semantics-early-errors">14.13.1</a></emu-xref> includes an Early Error rule that produces a Syntax Error if that occurs. That rule is then modified to suppress the Syntax Error in <emu-xref href="#non-strict-code" id="_ref_17501"><a href="ecmascript-language-source-code.html#non-strict-code">non-strict code</a></emu-xref> if <emu-xref href="#sec-additional-ecmascript-features-for-web-browsers" id="_ref_17502"><a href="additional-ecmascript-features-for-web-browsers.html#sec-additional-ecmascript-features-for-web-browsers">the host supports</a></emu-xref> this feature.</p>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>The <emu-xref href="#early-error" id="_ref_17503"><a href="error-handling-and-language-extensions.html#early-error">early error</a></emu-xref> rules for <emu-nt id="_ref_24765"><a href="ecmascript-language-statements-and-declarations.html#prod-WithStatement">WithStatement</a></emu-nt>, <emu-nt id="_ref_24766"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-IfStatement">IfStatement</a></emu-nt>, and <emu-nt id="_ref_24767"><a href="ecmascript-language-statements-and-declarations.html#prod-IterationStatement">IterationStatement</a></emu-nt> prevent these statements from containing a labelled <emu-nt id="_ref_24768"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt> in <emu-xref href="#non-strict-code" id="_ref_17504"><a href="ecmascript-language-source-code.html#non-strict-code">non-strict code</a></emu-xref>.</p>
|
||
</div></emu-note>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-block-level-function-declarations-web-legacy-compatibility-semantics">
|
||
<h1><span class="secnum">B.3.2</span> Block-Level Function Declarations Web Legacy Compatibility Semantics</h1>
|
||
<p>Prior to ECMAScript 2015, the ECMAScript specification did not define the occurrence of a <emu-nt id="_ref_24769"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt> as an element of a <emu-nt id="_ref_24770"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt> statement's <emu-nt id="_ref_24771"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementList">StatementList</a></emu-nt>. However, support for that form of <emu-nt id="_ref_24772"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt> was an allowable extension and most browser-hosted ECMAScript implementations permitted them. Unfortunately, the semantics of such declarations differ among those implementations. Because of these semantic differences, existing web <emu-xref href="#sec-source-text" id="_ref_17505"><a href="ecmascript-language-source-code.html#sec-source-text">ECMAScript source text</a></emu-xref> that uses <emu-nt id="_ref_24773"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt> level function declarations is only portable among browser implementations if the usage only depends upon the semantic intersection of all of the browser implementations for such declarations. The following are the use cases that fall within that intersection semantics:</p>
|
||
<ol>
|
||
<li>
|
||
<p>A function is declared and only referenced within a single block.</p>
|
||
<ul>
|
||
<li>
|
||
One or more <emu-nt id="_ref_24774"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt>s whose <emu-nt id="_ref_24775"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> is the name <var>f</var> occur within the function code of an enclosing function <var>g</var> and that declaration is nested within a <emu-nt id="_ref_24776"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
No other declaration of <var>f</var> that is not a <code>var</code> declaration occurs within the function code of <var>g</var>.
|
||
</li>
|
||
<li>
|
||
All occurrences of <var>f</var> as an <emu-nt id="_ref_24777"><a href="ecmascript-language-expressions.html#prod-IdentifierReference">IdentifierReference</a></emu-nt> are within the <emu-nt id="_ref_24778"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementList">StatementList</a></emu-nt> of the <emu-nt id="_ref_24779"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt> containing the declaration of <var>f</var>.
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<p>A function is declared and possibly used within a single <emu-nt id="_ref_24780"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt> but also referenced by an inner function definition that is not contained within that same <emu-nt id="_ref_24781"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt>.</p>
|
||
<ul>
|
||
<li>
|
||
One or more <emu-nt id="_ref_24782"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt>s whose <emu-nt id="_ref_24783"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> is the name <var>f</var> occur within the function code of an enclosing function <var>g</var> and that declaration is nested within a <emu-nt id="_ref_24784"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
No other declaration of <var>f</var> that is not a <code>var</code> declaration occurs within the function code of <var>g</var>.
|
||
</li>
|
||
<li>
|
||
There may be occurrences of <var>f</var> as an <emu-nt id="_ref_24785"><a href="ecmascript-language-expressions.html#prod-IdentifierReference">IdentifierReference</a></emu-nt> within the <emu-nt id="_ref_24786"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementList">StatementList</a></emu-nt> of the <emu-nt id="_ref_24787"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt> containing the declaration of <var>f</var>.
|
||
</li>
|
||
<li>
|
||
There is at least one occurrence of <var>f</var> as an <emu-nt id="_ref_24788"><a href="ecmascript-language-expressions.html#prod-IdentifierReference">IdentifierReference</a></emu-nt> within another function <var>h</var> that is nested within <var>g</var> and no other declaration of <var>f</var> shadows the references to <var>f</var> from within <var>h</var>.
|
||
</li>
|
||
<li>
|
||
All invocations of <var>h</var> occur after the declaration of <var>f</var> has been evaluated.
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<p>A function is declared and possibly used within a single block but also referenced within subsequent blocks.</p>
|
||
<ul>
|
||
<li>
|
||
One or more <emu-nt id="_ref_24789"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt> whose <emu-nt id="_ref_24790"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> is the name <var>f</var> occur within the function code of an enclosing function <var>g</var> and that declaration is nested within a <emu-nt id="_ref_24791"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt>.
|
||
</li>
|
||
<li>
|
||
No other declaration of <var>f</var> that is not a <code>var</code> declaration occurs within the function code of <var>g</var>.
|
||
</li>
|
||
<li>
|
||
There may be occurrences of <var>f</var> as an <emu-nt id="_ref_24792"><a href="ecmascript-language-expressions.html#prod-IdentifierReference">IdentifierReference</a></emu-nt> within the <emu-nt id="_ref_24793"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementList">StatementList</a></emu-nt> of the <emu-nt id="_ref_24794"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt> containing the declaration of <var>f</var>.
|
||
</li>
|
||
<li>
|
||
There is at least one occurrence of <var>f</var> as an <emu-nt id="_ref_24795"><a href="ecmascript-language-expressions.html#prod-IdentifierReference">IdentifierReference</a></emu-nt> within the function code of <var>g</var> that lexically follows the <emu-nt id="_ref_24796"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt> containing the declaration of <var>f</var>.
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ol>
|
||
<p>The first use case is interoperable with the semantics of <emu-nt id="_ref_24797"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt> level function declarations provided by ECMAScript 2015. Any pre-existing <emu-xref href="#sec-source-text" id="_ref_17506"><a href="ecmascript-language-source-code.html#sec-source-text">ECMAScript source text</a></emu-xref> that employs that use case will operate using the Block level function declarations semantics defined by clauses <emu-xref href="#sec-ordinary-and-exotic-objects-behaviours" id="_ref_869"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinary-and-exotic-objects-behaviours">10</a></emu-xref>, <emu-xref href="#sec-ecmascript-language-statements-and-declarations" id="_ref_870"><a href="ecmascript-language-statements-and-declarations.html#sec-ecmascript-language-statements-and-declarations">14</a></emu-xref>, and <emu-xref href="#sec-ecmascript-language-functions-and-classes" id="_ref_871"><a href="ecmascript-language-functions-and-classes.html#sec-ecmascript-language-functions-and-classes">15</a></emu-xref>.</p>
|
||
<p>ECMAScript 2015 interoperability for the second and third use cases requires the following extensions to the clause <emu-xref href="#sec-ordinary-and-exotic-objects-behaviours" id="_ref_872"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinary-and-exotic-objects-behaviours">10</a></emu-xref>, clause <emu-xref href="#sec-ecmascript-language-functions-and-classes" id="_ref_873"><a href="ecmascript-language-functions-and-classes.html#sec-ecmascript-language-functions-and-classes">15</a></emu-xref>, clause <emu-xref href="#sec-eval-x" id="_ref_874"><a href="global-object.html#sec-eval-x">19.2.1</a></emu-xref> and clause <emu-xref href="#sec-globaldeclarationinstantiation" id="_ref_875"><a href="ecmascript-language-scripts-and-modules.html#sec-globaldeclarationinstantiation">16.1.7</a></emu-xref> semantics.</p>
|
||
<p>If an ECMAScript implementation has a mechanism for reporting diagnostic warning messages, a warning should be produced when code contains a <emu-nt id="_ref_24798"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt> for which these compatibility semantics are applied and introduce observable differences from non-compatibility semantics. For example, if a var binding is not introduced because its introduction would create an <emu-xref href="#early-error" id="_ref_17507"><a href="error-handling-and-language-extensions.html#early-error">early error</a></emu-xref>, a warning message should not be produced.</p>
|
||
<p>This feature involves special semantics at the following points:</p>
|
||
<ul>
|
||
<li>one of the <emu-xref href="#early-error" id="_ref_17508"><a href="error-handling-and-language-extensions.html#early-error">early error</a></emu-xref> rules for <emu-grammar><emu-production name="Block" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="z4ljp0ar">
|
||
<emu-t>{</emu-t>
|
||
<emu-nt id="_ref_24799"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementList">StatementList</a></emu-nt>
|
||
<emu-t>}</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> in <emu-xref href="#sec-block-static-semantics-early-errors" id="_ref_876"><a href="ecmascript-language-statements-and-declarations.html#sec-block-static-semantics-early-errors">14.2.1</a></emu-xref></li>
|
||
<li>one of the <emu-xref href="#early-error" id="_ref_17509"><a href="error-handling-and-language-extensions.html#early-error">early error</a></emu-xref> rules for <emu-grammar><emu-production name="SwitchStatement" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-SwitchStatement">SwitchStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uvrp_hkw">
|
||
<emu-t>switch</emu-t>
|
||
<emu-t>(</emu-t>
|
||
<emu-nt id="_ref_24800"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-nt id="_ref_24801"><a href="ecmascript-language-statements-and-declarations.html#prod-CaseBlock">CaseBlock</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> in <emu-xref href="#sec-switch-statement-static-semantics-early-errors" id="_ref_877"><a href="ecmascript-language-statements-and-declarations.html#sec-switch-statement-static-semantics-early-errors">14.12.1</a></emu-xref></li>
|
||
<li>step <emu-xref href="#step-functiondeclarationinstantiation-web-compat-insertion-point" id="_ref_878"><a href="ordinary-and-exotic-objects-behaviours.html#step-functiondeclarationinstantiation-web-compat-insertion-point">32.a</a></emu-xref> in <emu-xref aoid="FunctionDeclarationInstantiation" id="_ref_17510"><a href="ordinary-and-exotic-objects-behaviours.html#sec-functiondeclarationinstantiation">FunctionDeclarationInstantiation</a></emu-xref></li>
|
||
<li>step <emu-xref href="#step-blockdeclarationinstantiation-createmutablebinding" id="_ref_879"><a href="ecmascript-language-statements-and-declarations.html#step-blockdeclarationinstantiation-createmutablebinding">3.a.ii.1</a></emu-xref> in <emu-xref aoid="BlockDeclarationInstantiation" id="_ref_17511"><a href="ecmascript-language-statements-and-declarations.html#sec-blockdeclarationinstantiation">BlockDeclarationInstantiation</a></emu-xref></li>
|
||
<li>step <emu-xref href="#step-blockdeclarationinstantiation-initializebinding" id="_ref_880"><a href="ecmascript-language-statements-and-declarations.html#step-blockdeclarationinstantiation-initializebinding">3.b.iii</a></emu-xref> in <emu-xref aoid="BlockDeclarationInstantiation" id="_ref_17512"><a href="ecmascript-language-statements-and-declarations.html#sec-blockdeclarationinstantiation">BlockDeclarationInstantiation</a></emu-xref></li>
|
||
<li>step <emu-xref href="#step-globaldeclarationinstantiation-web-compat-insertion-point" id="_ref_881"><a href="ecmascript-language-scripts-and-modules.html#step-globaldeclarationinstantiation-web-compat-insertion-point">12</a></emu-xref> in <emu-xref aoid="GlobalDeclarationInstantiation" id="_ref_17513"><a href="ecmascript-language-scripts-and-modules.html#sec-globaldeclarationinstantiation">GlobalDeclarationInstantiation</a></emu-xref></li>
|
||
<li>step <emu-xref href="#step-evaldeclarationinstantiation-web-compat-insertion-point" id="_ref_882"><a href="global-object.html#step-evaldeclarationinstantiation-web-compat-insertion-point">13</a></emu-xref> in <emu-xref aoid="EvalDeclarationInstantiation" id="_ref_17514"><a href="global-object.html#sec-evaldeclarationinstantiation">EvalDeclarationInstantiation</a></emu-xref></li>
|
||
</ul>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-functiondeclarations-in-ifstatement-statement-clauses">
|
||
<h1><span class="secnum">B.3.3</span> FunctionDeclarations in IfStatement Statement Clauses</h1>
|
||
<p>The following augments the <emu-nt id="_ref_24802"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-IfStatement">IfStatement</a></emu-nt> production in <emu-xref href="#sec-if-statement" id="_ref_883"><a href="ecmascript-language-statements-and-declarations.html#sec-if-statement">14.6</a></emu-xref>:</p>
|
||
<emu-grammar type="definition"><emu-production name="IfStatement" params="Yield, Await, Return" id="prod-annexB-IfStatement">
|
||
<emu-nt params="Yield, Await, Return"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-IfStatement">IfStatement</a><emu-mods><emu-params>[Yield, Await, Return]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="3oae1kl0">
|
||
<emu-t>if</emu-t>
|
||
<emu-t>(</emu-t>
|
||
<emu-nt params="+In, ?Yield, ?Await" id="_ref_24803"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-nt params="?Yield, ?Await, ~Default" id="_ref_24804"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a><emu-mods><emu-params>[?Yield, ?Await, ~Default]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>else</emu-t>
|
||
<emu-nt params="?Yield, ?Await, ?Return" id="_ref_24805"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a><emu-mods><emu-params>[?Yield, ?Await, ?Return]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="_rfywn3t">
|
||
<emu-t>if</emu-t>
|
||
<emu-t>(</emu-t>
|
||
<emu-nt params="+In, ?Yield, ?Await" id="_ref_24806"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-nt params="?Yield, ?Await, ?Return" id="_ref_24807"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a><emu-mods><emu-params>[?Yield, ?Await, ?Return]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>else</emu-t>
|
||
<emu-nt params="?Yield, ?Await, ~Default" id="_ref_24808"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a><emu-mods><emu-params>[?Yield, ?Await, ~Default]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="ndmrr5v_">
|
||
<emu-t>if</emu-t>
|
||
<emu-t>(</emu-t>
|
||
<emu-nt params="+In, ?Yield, ?Await" id="_ref_24809"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-nt params="?Yield, ?Await, ~Default" id="_ref_24810"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a><emu-mods><emu-params>[?Yield, ?Await, ~Default]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>else</emu-t>
|
||
<emu-nt params="?Yield, ?Await, ~Default" id="_ref_24811"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a><emu-mods><emu-params>[?Yield, ?Await, ~Default]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="qlu6dc6n">
|
||
<emu-t>if</emu-t>
|
||
<emu-t>(</emu-t>
|
||
<emu-nt params="+In, ?Yield, ?Await" id="_ref_24812"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-nt params="?Yield, ?Await, ~Default" id="_ref_24813"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a><emu-mods><emu-params>[?Yield, ?Await, ~Default]</emu-params></emu-mods></emu-nt>
|
||
<emu-gann>[lookahead ≠ <emu-t>else</emu-t>]</emu-gann>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<p>This production only applies when parsing <emu-xref href="#non-strict-code" id="_ref_17515"><a href="ecmascript-language-source-code.html#non-strict-code">non-strict code</a></emu-xref>. <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_17516"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">Source text matched by</a></emu-xref> this production is processed as if each matching occurrence of <emu-nt params="?Yield, ?Await, ~Default" id="_ref_24814"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a><emu-mods><emu-params>[?Yield, ?Await, ~Default]</emu-params></emu-mods></emu-nt> was the sole <emu-nt id="_ref_24815"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementListItem">StatementListItem</a></emu-nt> of a <emu-nt id="_ref_24816"><a href="ecmascript-language-statements-and-declarations.html#prod-BlockStatement">BlockStatement</a></emu-nt> occupying that position in the source text. The semantics of such a synthetic <emu-nt id="_ref_24817"><a href="ecmascript-language-statements-and-declarations.html#prod-BlockStatement">BlockStatement</a></emu-nt> includes the web legacy compatibility semantics specified in <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" id="_ref_884"><a href="additional-ecmascript-features-for-web-browsers.html#sec-block-level-function-declarations-web-legacy-compatibility-semantics">B.3.2</a></emu-xref>.</p>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-variablestatements-in-catch-blocks">
|
||
<h1><span class="secnum">B.3.4</span> VariableStatements in Catch Blocks</h1>
|
||
<p>In this feature, the <emu-nt id="_ref_24818"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt> of a <emu-nt id="_ref_24819"><a href="ecmascript-language-statements-and-declarations.html#prod-Catch">Catch</a></emu-nt> clause may contain <code>var</code> declarations that bind a name that is also bound by the <emu-nt id="_ref_24820"><a href="ecmascript-language-statements-and-declarations.html#prod-CatchParameter">CatchParameter</a></emu-nt>. This is accomplished by modifying an <emu-xref href="#early-error" id="_ref_17517"><a href="error-handling-and-language-extensions.html#early-error">early error</a></emu-xref> rule for <emu-grammar><emu-production name="Catch" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-Catch">Catch</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="3ce8nhiw">
|
||
<emu-t>catch</emu-t>
|
||
<emu-t>(</emu-t>
|
||
<emu-nt id="_ref_24821"><a href="ecmascript-language-statements-and-declarations.html#prod-CatchParameter">CatchParameter</a></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-nt id="_ref_24822"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> in <emu-xref href="#sec-try-statement-static-semantics-early-errors" id="_ref_885"><a href="ecmascript-language-statements-and-declarations.html#sec-try-statement-static-semantics-early-errors">14.15.1</a></emu-xref>.</p>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>At runtime, such bindings are instantiated in the VariableDeclarationEnvironment. They do not shadow the same-named bindings introduced by the <emu-nt id="_ref_24823"><a href="ecmascript-language-statements-and-declarations.html#prod-CatchParameter">CatchParameter</a></emu-nt> and hence the <emu-nt id="_ref_24824"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt> for such <code>var</code> declarations will assign to the corresponding catch parameter rather than the <code>var</code> binding.</p>
|
||
</div></emu-note>
|
||
<p>This modified behaviour also applies to <code>var</code> and <code>function</code> declarations introduced by <emu-xref href="#sec-function-calls-runtime-semantics-evaluation" id="_ref_17518"><a href="ecmascript-language-expressions.html#sec-function-calls-runtime-semantics-evaluation">direct eval</a></emu-xref> calls contained within the <emu-nt id="_ref_24825"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt> of a <emu-nt id="_ref_24826"><a href="ecmascript-language-statements-and-declarations.html#prod-Catch">Catch</a></emu-nt> clause. This change is accomplished by modifying steps <emu-xref href="#step-evaldeclarationinstantiation-throw-duplicate-binding" id="_ref_886"><a href="global-object.html#step-evaldeclarationinstantiation-throw-duplicate-binding">3.d.i.2.a.i</a></emu-xref> and <emu-xref href="#step-evaldeclarationinstantiation-web-compat-bindingexists" id="_ref_887"><a href="global-object.html#step-evaldeclarationinstantiation-web-compat-bindingexists">13.b.ii.4.a.i.i</a></emu-xref> in <emu-xref aoid="EvalDeclarationInstantiation" id="_ref_17519"><a href="global-object.html#sec-evaldeclarationinstantiation">EvalDeclarationInstantiation</a></emu-xref>.</p>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-initializers-in-forin-statement-heads">
|
||
<h1><span class="secnum">B.3.5</span> Initializers in ForIn Statement Heads</h1>
|
||
<p>The following augments the <emu-nt id="_ref_24827"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ForInOfStatement">ForInOfStatement</a></emu-nt> production in <emu-xref href="#sec-for-in-and-for-of-statements" id="_ref_888"><a href="ecmascript-language-statements-and-declarations.html#sec-for-in-and-for-of-statements">14.7.5</a></emu-xref>:</p>
|
||
<emu-grammar type="definition"><emu-production name="ForInOfStatement" params="Yield, Await, Return" id="prod-annexB-ForInOfStatement">
|
||
<emu-nt params="Yield, Await, Return"><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ForInOfStatement">ForInOfStatement</a><emu-mods><emu-params>[Yield, Await, Return]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ouav8kzt">
|
||
<emu-t>for</emu-t>
|
||
<emu-t>(</emu-t>
|
||
<emu-t>var</emu-t>
|
||
<emu-nt params="?Yield, ?Await" id="_ref_24828"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-nt params="~In, ?Yield, ?Await" id="_ref_24829"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a><emu-mods><emu-params>[~In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>in</emu-t>
|
||
<emu-nt params="+In, ?Yield, ?Await" id="_ref_24830"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params></emu-mods></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-nt params="?Yield, ?Await, ?Return" id="_ref_24831"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a><emu-mods><emu-params>[?Yield, ?Await, ?Return]</emu-params></emu-mods></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<p>This production only applies when parsing <emu-xref href="#non-strict-code" id="_ref_17520"><a href="ecmascript-language-source-code.html#non-strict-code">non-strict code</a></emu-xref>.</p>
|
||
<p>The <emu-xref href="#sec-static-semantic-rules" id="_ref_17521"><a href="notational-conventions.html#sec-static-semantic-rules">static semantics</a></emu-xref> of <emu-xref aoid="ContainsDuplicateLabels" id="_ref_17522"><a href="syntax-directed-operations.html#sec-static-semantics-containsduplicatelabels">ContainsDuplicateLabels</a></emu-xref> in <emu-xref href="#sec-static-semantics-containsduplicatelabels" id="_ref_889"><a href="syntax-directed-operations.html#sec-static-semantics-containsduplicatelabels">8.3.1</a></emu-xref> are augmented with the following:</p>
|
||
<emu-grammar><emu-production name="ForInOfStatement" collapsed="">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ForInOfStatement">ForInOfStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ux2wyuaj">
|
||
<emu-t>for</emu-t>
|
||
<emu-t>(</emu-t>
|
||
<emu-t>var</emu-t>
|
||
<emu-nt id="_ref_24832"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
|
||
<emu-nt id="_ref_24833"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt>
|
||
<emu-t>in</emu-t>
|
||
<emu-nt id="_ref_24834"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-nt id="_ref_24835"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return <emu-xref aoid="ContainsDuplicateLabels" id="_ref_17523"><a href="syntax-directed-operations.html#sec-static-semantics-containsduplicatelabels">ContainsDuplicateLabels</a></emu-xref> of <emu-nt id="_ref_24836"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt> with argument <var>labelSet</var>.</li></ol></emu-alg>
|
||
<p>The <emu-xref href="#sec-static-semantic-rules" id="_ref_17524"><a href="notational-conventions.html#sec-static-semantic-rules">static semantics</a></emu-xref> of <emu-xref aoid="ContainsUndefinedBreakTarget" id="_ref_17525"><a href="syntax-directed-operations.html#sec-static-semantics-containsundefinedbreaktarget">ContainsUndefinedBreakTarget</a></emu-xref> in <emu-xref href="#sec-static-semantics-containsundefinedbreaktarget" id="_ref_890"><a href="syntax-directed-operations.html#sec-static-semantics-containsundefinedbreaktarget">8.3.2</a></emu-xref> are augmented with the following:</p>
|
||
<emu-grammar><emu-production name="ForInOfStatement" collapsed="">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ForInOfStatement">ForInOfStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ux2wyuaj">
|
||
<emu-t>for</emu-t>
|
||
<emu-t>(</emu-t>
|
||
<emu-t>var</emu-t>
|
||
<emu-nt id="_ref_24837"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
|
||
<emu-nt id="_ref_24838"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt>
|
||
<emu-t>in</emu-t>
|
||
<emu-nt id="_ref_24839"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-nt id="_ref_24840"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return <emu-xref aoid="ContainsUndefinedBreakTarget" id="_ref_17526"><a href="syntax-directed-operations.html#sec-static-semantics-containsundefinedbreaktarget">ContainsUndefinedBreakTarget</a></emu-xref> of <emu-nt id="_ref_24841"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt> with argument <var>labelSet</var>.</li></ol></emu-alg>
|
||
<p>The <emu-xref href="#sec-static-semantic-rules" id="_ref_17527"><a href="notational-conventions.html#sec-static-semantic-rules">static semantics</a></emu-xref> of <emu-xref aoid="ContainsUndefinedContinueTarget" id="_ref_17528"><a href="syntax-directed-operations.html#sec-static-semantics-containsundefinedcontinuetarget">ContainsUndefinedContinueTarget</a></emu-xref> in <emu-xref href="#sec-static-semantics-containsundefinedcontinuetarget" id="_ref_891"><a href="syntax-directed-operations.html#sec-static-semantics-containsundefinedcontinuetarget">8.3.3</a></emu-xref> are augmented with the following:</p>
|
||
<emu-grammar><emu-production name="ForInOfStatement" collapsed="">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ForInOfStatement">ForInOfStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ux2wyuaj">
|
||
<emu-t>for</emu-t>
|
||
<emu-t>(</emu-t>
|
||
<emu-t>var</emu-t>
|
||
<emu-nt id="_ref_24842"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
|
||
<emu-nt id="_ref_24843"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt>
|
||
<emu-t>in</emu-t>
|
||
<emu-nt id="_ref_24844"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-nt id="_ref_24845"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return <emu-xref aoid="ContainsUndefinedContinueTarget" id="_ref_17529"><a href="syntax-directed-operations.html#sec-static-semantics-containsundefinedcontinuetarget">ContainsUndefinedContinueTarget</a></emu-xref> of <emu-nt id="_ref_24846"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt> with arguments <var>iterationSet</var> and « ».</li></ol></emu-alg>
|
||
<p>The <emu-xref href="#sec-static-semantic-rules" id="_ref_17530"><a href="notational-conventions.html#sec-static-semantic-rules">static semantics</a></emu-xref> of <emu-xref aoid="IsDestructuring" id="_ref_17531"><a href="ecmascript-language-statements-and-declarations.html#sec-static-semantics-isdestructuring">IsDestructuring</a></emu-xref> in <emu-xref href="#sec-static-semantics-isdestructuring" id="_ref_892"><a href="ecmascript-language-statements-and-declarations.html#sec-static-semantics-isdestructuring">14.7.5.2</a></emu-xref> are augmented with the following:</p>
|
||
<emu-grammar><emu-production name="BindingIdentifier">
|
||
<emu-nt><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="bras6mo_">
|
||
<emu-nt id="_ref_24847"><a href="ecmascript-language-expressions.html#prod-Identifier">Identifier</a></emu-nt>
|
||
</emu-rhs>
|
||
<emu-rhs a="0d8zyjn8">
|
||
<emu-t>yield</emu-t>
|
||
</emu-rhs>
|
||
<emu-rhs a="hx1dvlrw">
|
||
<emu-t>await</emu-t>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
|
||
<p>The <emu-xref href="#sec-static-semantic-rules" id="_ref_17532"><a href="notational-conventions.html#sec-static-semantic-rules">static semantics</a></emu-xref> of <emu-xref aoid="VarDeclaredNames" id="_ref_17533"><a href="syntax-directed-operations.html#sec-static-semantics-vardeclarednames">VarDeclaredNames</a></emu-xref> in <emu-xref href="#sec-static-semantics-vardeclarednames" id="_ref_893"><a href="syntax-directed-operations.html#sec-static-semantics-vardeclarednames">8.2.6</a></emu-xref> are augmented with the following:</p>
|
||
<emu-grammar><emu-production name="ForInOfStatement" collapsed="">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ForInOfStatement">ForInOfStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ux2wyuaj">
|
||
<emu-t>for</emu-t>
|
||
<emu-t>(</emu-t>
|
||
<emu-t>var</emu-t>
|
||
<emu-nt id="_ref_24848"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
|
||
<emu-nt id="_ref_24849"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt>
|
||
<emu-t>in</emu-t>
|
||
<emu-nt id="_ref_24850"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-nt id="_ref_24851"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Let <var>names1</var> be the <emu-xref aoid="BoundNames" id="_ref_17534"><a href="syntax-directed-operations.html#sec-static-semantics-boundnames">BoundNames</a></emu-xref> of <emu-nt id="_ref_24852"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>.</li><li>Let <var>names2</var> be the <emu-xref aoid="VarDeclaredNames" id="_ref_17535"><a href="syntax-directed-operations.html#sec-static-semantics-vardeclarednames">VarDeclaredNames</a></emu-xref> of <emu-nt id="_ref_24853"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>.</li><li>Return the <emu-xref href="#list-concatenation" id="_ref_17536"><a href="ecmascript-data-types-and-values.html#list-concatenation">list-concatenation</a></emu-xref> of <var>names1</var> and <var>names2</var>.</li></ol></emu-alg>
|
||
<p>The <emu-xref href="#sec-static-semantic-rules" id="_ref_17537"><a href="notational-conventions.html#sec-static-semantic-rules">static semantics</a></emu-xref> of <emu-xref aoid="VarScopedDeclarations" id="_ref_17538"><a href="syntax-directed-operations.html#sec-static-semantics-varscopeddeclarations">VarScopedDeclarations</a></emu-xref> in <emu-xref href="#sec-static-semantics-varscopeddeclarations" id="_ref_894"><a href="syntax-directed-operations.html#sec-static-semantics-varscopeddeclarations">8.2.7</a></emu-xref> are augmented with the following:</p>
|
||
<emu-grammar><emu-production name="ForInOfStatement" collapsed="">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ForInOfStatement">ForInOfStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ux2wyuaj">
|
||
<emu-t>for</emu-t>
|
||
<emu-t>(</emu-t>
|
||
<emu-t>var</emu-t>
|
||
<emu-nt id="_ref_24854"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
|
||
<emu-nt id="_ref_24855"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt>
|
||
<emu-t>in</emu-t>
|
||
<emu-nt id="_ref_24856"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-nt id="_ref_24857"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Let <var>declarations1</var> be « <emu-nt id="_ref_24858"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> ».</li><li>Let <var>declarations2</var> be the <emu-xref aoid="VarScopedDeclarations" id="_ref_17539"><a href="syntax-directed-operations.html#sec-static-semantics-varscopeddeclarations">VarScopedDeclarations</a></emu-xref> of <emu-nt id="_ref_24859"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>.</li><li>Return the <emu-xref href="#list-concatenation" id="_ref_17540"><a href="ecmascript-data-types-and-values.html#list-concatenation">list-concatenation</a></emu-xref> of <var>declarations1</var> and <var>declarations2</var>.</li></ol></emu-alg>
|
||
<p>The <emu-xref href="#sec-runtime-semantics" id="_ref_17541"><a href="notational-conventions.html#sec-runtime-semantics">runtime semantics</a></emu-xref> of <emu-xref aoid="ForInOfLoopEvaluation" id="_ref_17542"><a href="ecmascript-language-statements-and-declarations.html#sec-runtime-semantics-forinofloopevaluation">ForInOfLoopEvaluation</a></emu-xref> in <emu-xref href="#sec-runtime-semantics-forinofloopevaluation" id="_ref_895"><a href="ecmascript-language-statements-and-declarations.html#sec-runtime-semantics-forinofloopevaluation">14.7.5.5</a></emu-xref> are augmented with the following:</p>
|
||
<emu-grammar><emu-production name="ForInOfStatement" collapsed="">
|
||
<emu-nt><a href="additional-ecmascript-features-for-web-browsers.html#prod-annexB-ForInOfStatement">ForInOfStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ux2wyuaj">
|
||
<emu-t>for</emu-t>
|
||
<emu-t>(</emu-t>
|
||
<emu-t>var</emu-t>
|
||
<emu-nt id="_ref_24860"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
|
||
<emu-nt id="_ref_24861"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt>
|
||
<emu-t>in</emu-t>
|
||
<emu-nt id="_ref_24862"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
|
||
<emu-t>)</emu-t>
|
||
<emu-nt id="_ref_24863"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>
|
||
<emu-alg><ol><li>Let <var>bindingId</var> be the <emu-xref aoid="StringValue" id="_ref_17543"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_24864"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>.</li><li>Let <var>lhs</var> be ? <emu-xref aoid="ResolveBinding" id="_ref_17544"><a href="executable-code-and-execution-contexts.html#sec-resolvebinding" class="e-user-code">ResolveBinding</a></emu-xref>(<var>bindingId</var>).</li><li>If <emu-xref aoid="IsAnonymousFunctionDefinition" id="_ref_17545"><a href="syntax-directed-operations.html#sec-isanonymousfunctiondefinition">IsAnonymousFunctionDefinition</a></emu-xref>(<emu-nt id="_ref_24865"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt>) is <emu-val>true</emu-val>, then<ol><li>Let <var>value</var> be ? <emu-xref aoid="NamedEvaluation" id="_ref_17546"><a href="syntax-directed-operations.html#sec-runtime-semantics-namedevaluation" class="e-user-code">NamedEvaluation</a></emu-xref> of <emu-nt id="_ref_24866"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt> with argument <var>bindingId</var>.</li></ol></li><li>Else,<ol><li>Let <var>rhs</var> be ? <emu-xref aoid="Evaluation" id="_ref_17547"><a href="syntax-directed-operations.html#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt id="_ref_24867"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt>.</li><li>Let <var>value</var> be ? <emu-xref aoid="GetValue" id="_ref_17548"><a href="ecmascript-data-types-and-values.html#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>rhs</var>).</li></ol></li><li>Perform ? <emu-xref aoid="PutValue" id="_ref_17549"><a href="ecmascript-data-types-and-values.html#sec-putvalue" class="e-user-code">PutValue</a></emu-xref>(<var>lhs</var>, <var>value</var>).</li><li>Let <var>keyResult</var> be ? <emu-xref aoid="ForIn/OfHeadEvaluation" id="_ref_17550"><a href="ecmascript-language-statements-and-declarations.html#sec-runtime-semantics-forinofheadevaluation" class="e-user-code">ForIn/OfHeadEvaluation</a></emu-xref>(« », <emu-nt id="_ref_24868"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>, <emu-const>enumerate</emu-const>).</li><li>Return ? <emu-xref aoid="ForIn/OfBodyEvaluation" id="_ref_17551"><a href="ecmascript-language-statements-and-declarations.html#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset" class="e-user-code">ForIn/OfBodyEvaluation</a></emu-xref>(<emu-nt id="_ref_24869"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>, <emu-nt id="_ref_24870"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>, <var>keyResult</var>, <emu-const>enumerate</emu-const>, <emu-const>var-binding</emu-const>, <var>labelSet</var>).</li></ol></emu-alg>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-IsHTMLDDA-internal-slot">
|
||
<h1><span class="secnum">B.3.6</span> The <var class="field">[[IsHTMLDDA]]</var> Internal Slot</h1>
|
||
<p>An <dfn tabindex="-1"><var class="field">[[IsHTMLDDA]]</var> internal slot</dfn> may exist on <emu-xref href="#host-defined" id="_ref_17552"><a href="overview.html#host-defined">host-defined</a></emu-xref> objects. Objects with an <var class="field">[[IsHTMLDDA]]</var> internal slot behave like <emu-val>undefined</emu-val> in the <emu-xref href="#sec-toboolean" id="_ref_896"><a href="abstract-operations.html#sec-toboolean">ToBoolean</a></emu-xref> and <emu-xref aoid="IsLooselyEqual" id="_ref_17553"><a href="abstract-operations.html#sec-islooselyequal">IsLooselyEqual</a></emu-xref> <emu-xref href="#sec-algorithm-conventions-abstract-operations" id="_ref_17554"><a href="notational-conventions.html#sec-algorithm-conventions-abstract-operations">abstract operations</a></emu-xref> and when used as an operand for the <emu-xref href="#sec-typeof-operator" id="_ref_897"><a href="ecmascript-language-expressions.html#sec-typeof-operator"><code>typeof</code> operator</a></emu-xref>.</p>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>Objects with an <var class="field">[[IsHTMLDDA]]</var> internal slot are never created by this specification. However, the <a href="https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-all"><code>document.all</code> object</a> in web browsers is a <emu-xref href="#host-defined" id="_ref_17555"><a href="overview.html#host-defined">host-defined</a></emu-xref> <emu-xref href="#exotic-object" id="_ref_17556"><a href="ecmascript-data-types-and-values.html#exotic-object">exotic object</a></emu-xref> with this slot that exists for web compatibility purposes. There are no other known examples of this type of object and implementations should not create any with the exception of <code>document.all</code>.</p>
|
||
</div></emu-note>
|
||
<p>This feature involves special semantics at the following points:</p>
|
||
<ul>
|
||
<li>step <emu-xref href="#step-to-boolean-web-compat-insertion-point" id="_ref_898"><a href="abstract-operations.html#step-to-boolean-web-compat-insertion-point">3</a></emu-xref> in <emu-xref aoid="ToBoolean" id="_ref_17557"><a href="abstract-operations.html#sec-toboolean">ToBoolean</a></emu-xref></li>
|
||
<li>step <emu-xref href="#step-abstract-equality-comparison-web-compat-insertion-point" id="_ref_899"><a href="abstract-operations.html#step-abstract-equality-comparison-web-compat-insertion-point">4</a></emu-xref> in <emu-xref aoid="IsLooselyEqual" id="_ref_17558"><a href="abstract-operations.html#sec-islooselyequal">IsLooselyEqual</a></emu-xref></li>
|
||
<li>step <emu-xref href="#step-typeof-web-compat-insertion-point" id="_ref_900"><a href="ecmascript-language-expressions.html#step-typeof-web-compat-insertion-point">12</a></emu-xref> in the evaluation semantics for <code>typeof</code></li>
|
||
</ul>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-web-compat-host-make-job-callback">
|
||
<h1><span class="secnum">B.3.7</span> Non-default behaviour in HostMakeJobCallback</h1>
|
||
<p>The <emu-xref aoid="HostMakeJobCallback" id="_ref_17559"><a href="executable-code-and-execution-contexts.html#sec-hostmakejobcallback">HostMakeJobCallback</a></emu-xref> abstract operation allows <emu-xref href="#host" id="_ref_17560"><a href="overview.html#host">hosts</a></emu-xref> which are web browsers to specify non-default behaviour.</p>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-web-compat-host-ensure-can-add-private-field">
|
||
<h1><span class="secnum">B.3.8</span> Non-default behaviour in HostEnsureCanAddPrivateElement</h1>
|
||
<p>The <emu-xref aoid="HostEnsureCanAddPrivateElement" id="_ref_17561"><a href="abstract-operations.html#sec-hostensurecanaddprivateelement">HostEnsureCanAddPrivateElement</a></emu-xref> abstract operation allows <emu-xref href="#host" id="_ref_17562"><a href="overview.html#host">hosts</a></emu-xref> which are web browsers to specify non-default behaviour.</p>
|
||
</emu-annex>
|
||
|
||
<emu-annex id="sec-runtime-errors-for-function-call-assignment-targets">
|
||
<h1><span class="secnum">B.3.9</span> Runtime Errors for Function Call Assignment Targets</h1>
|
||
<p>When a function call (<emu-xref href="#sec-function-calls" id="_ref_901"><a href="ecmascript-language-expressions.html#sec-function-calls">13.3.6</a></emu-xref>) is used as an assignment target in <emu-xref href="#non-strict-code" id="_ref_17563"><a href="ecmascript-language-source-code.html#non-strict-code">non-strict code</a></emu-xref>, instead of producing an <emu-xref href="#early-error" id="_ref_17564"><a href="error-handling-and-language-extensions.html#early-error">early error</a></emu-xref>, a <emu-val>ReferenceError</emu-val> exception is thrown during evaluation of the assignment.</p>
|
||
<emu-note><span class="note">Note</span><div class="note-contents">
|
||
<p>When the assignment target is the <emu-nt id="_ref_24871"><a href="ecmascript-language-expressions.html#prod-LeftHandSideExpression">LeftHandSideExpression</a></emu-nt> of an <emu-nt id="_ref_24872"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>, the assignment operator must be <code>=</code> or an <emu-nt id="_ref_24873"><a href="ecmascript-language-expressions.html#prod-AssignmentOperator">AssignmentOperator</a></emu-nt>; in particular, the allowance here does not apply to the logical assignment operators (<code>??=</code>, <code>&&=</code>, <code>||=</code>).</p>
|
||
</div></emu-note>
|
||
<p>See step <emu-xref href="#step-assignmenttargettype-web-compat" id="_ref_902"><a href="syntax-directed-operations.html#step-assignmenttargettype-web-compat">1</a></emu-xref> of <emu-xref aoid="AssignmentTargetType" id="_ref_17565"><a href="syntax-directed-operations.html#sec-static-semantics-assignmenttargettype">AssignmentTargetType</a></emu-xref> for <emu-grammar><emu-production name="CallExpression" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="7jj-96li"><emu-nt id="_ref_24874"><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt></emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar> and <emu-grammar><emu-production name="CallExpression" collapsed="" class=" inline">
|
||
<emu-nt><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="qugahahu">
|
||
<emu-nt id="_ref_24875"><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt>
|
||
<emu-nt id="_ref_24876"><a href="ecmascript-language-expressions.html#prod-Arguments">Arguments</a></emu-nt>
|
||
</emu-rhs>
|
||
</emu-production>
|
||
</emu-grammar>.</p>
|
||
</emu-annex>
|
||
</emu-annex>
|
||
</emu-annex></div></body></html> |