Files
ask262/spec-built/multipage/ecmascript-language-functions-and-classes.html

4043 lines
552 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&nbsp;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&nbsp;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-ecmascript-language-functions-and-classes"></head>
<body><div id="spec-container"><emu-clause id="sec-ecmascript-language-functions-and-classes">
<h1><span class="secnum">15</span> ECMAScript Language: Functions and Classes</h1>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>Various ECMAScript language elements cause the creation of ECMAScript <emu-xref href="#function-object" id="_ref_7526"><a href="ecmascript-data-types-and-values.html#function-object">function objects</a></emu-xref> (<emu-xref href="#sec-ecmascript-function-objects" id="_ref_461"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ecmascript-function-objects">10.2</a></emu-xref>). <emu-xref aoid="Evaluation" id="_ref_7527"><a href="syntax-directed-operations.html#sec-evaluation">Evaluation</a></emu-xref> of such functions starts with the execution of their <var class="field">[[Call]]</var> internal method (<emu-xref href="#sec-ecmascript-function-objects-call-thisargument-argumentslist" id="_ref_462"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ecmascript-function-objects-call-thisargument-argumentslist">10.2.1</a></emu-xref>).</p>
</div></emu-note>
<emu-clause id="sec-parameter-lists">
<h1><span class="secnum">15.1</span> Parameter Lists</h1>
<h2>Syntax</h2>
<emu-grammar type="definition"><emu-production name="UniqueFormalParameters" params="Yield, Await" id="prod-UniqueFormalParameters">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="kat5sugn">
<emu-nt params="?Yield, ?Await" id="_ref_22107"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="FormalParameters" params="Yield, Await" id="prod-FormalParameters">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="n7nathbb" id="prod-L6HGhDG8">
<emu-gann>[empty]</emu-gann>
</emu-rhs>
<emu-rhs a="xs94btl2" id="prod-gUzIea_C">
<emu-nt params="?Yield, ?Await" id="_ref_22108"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionRestParameter">FunctionRestParameter</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
<emu-rhs a="5f3rxyqw">
<emu-nt params="?Yield, ?Await" id="_ref_22109"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
<emu-rhs a="wdsulm_w">
<emu-nt params="?Yield, ?Await" id="_ref_22110"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-t>,</emu-t>
</emu-rhs>
<emu-rhs a="yh9ahvuw" id="prod-aTWifksv">
<emu-nt params="?Yield, ?Await" id="_ref_22111"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-t>,</emu-t>
<emu-nt params="?Yield, ?Await" id="_ref_22112"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionRestParameter">FunctionRestParameter</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="FormalParameterList" params="Yield, Await" id="prod-FormalParameterList">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="3qhu-4tu" id="prod-NNXqGrU3">
<emu-nt params="?Yield, ?Await" id="_ref_22113"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
<emu-rhs a="mlncfkxh" id="prod-7NFUmaIc">
<emu-nt params="?Yield, ?Await" id="_ref_22114"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-t>,</emu-t>
<emu-nt params="?Yield, ?Await" id="_ref_22115"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="FunctionRestParameter" params="Yield, Await" id="prod-FunctionRestParameter">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionRestParameter">FunctionRestParameter</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="iw2hthb9">
<emu-nt params="?Yield, ?Await" id="_ref_22116"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingRestElement">BindingRestElement</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="FormalParameter" params="Yield, Await" id="prod-FormalParameter">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="xpmoewcq" id="prod-H68ZoagN">
<emu-nt params="?Yield, ?Await" id="_ref_22117"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElement">BindingElement</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-clause id="sec-parameter-lists-static-semantics-early-errors">
<h1><span class="secnum">15.1.1</span> Static Semantics: Early Errors</h1>
<emu-grammar><emu-production name="UniqueFormalParameters" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ahjg9bb6"><emu-nt id="_ref_22118"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>
It is a Syntax Error if the <emu-xref aoid="BoundNames" id="_ref_7528"><a href="syntax-directed-operations.html#sec-static-semantics-boundnames">BoundNames</a></emu-xref> of <emu-nt id="_ref_22119"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> contains any duplicate elements.
</li>
</ul>
<emu-grammar><emu-production name="FormalParameters" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="mupdqnts"><emu-nt id="_ref_22120"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>
It is a Syntax Error if <emu-xref aoid="IsSimpleParameterList" id="_ref_7529"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-issimpleparameterlist">IsSimpleParameterList</a></emu-xref> of <emu-nt id="_ref_22121"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt> is <emu-val>false</emu-val> and the <emu-xref aoid="BoundNames" id="_ref_7530"><a href="syntax-directed-operations.html#sec-static-semantics-boundnames">BoundNames</a></emu-xref> of <emu-nt id="_ref_22122"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt> contains any duplicate elements.
</li>
</ul>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>Multiple occurrences of the same <emu-nt id="_ref_22123"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> in a <emu-nt id="_ref_22124"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt> is only allowed for functions which have simple parameter lists and which are not defined in <emu-xref href="#sec-strict-mode-code" id="_ref_7531"><a href="ecmascript-language-source-code.html#sec-strict-mode-code">strict mode code</a></emu-xref>.</p>
</div></emu-note>
</emu-clause>
<emu-clause id="sec-static-semantics-containsexpression" oldids="sec-destructuring-binding-patterns-static-semantics-containsexpression,sec-function-definitions-static-semantics-containsexpression,sec-arrow-function-definitions-static-semantics-containsexpression,sec-async-arrow-function-definitions-static-semantics-ContainsExpression" type="sdo" aoid="ContainsExpression"><span id="sec-async-arrow-function-definitions-static-semantics-ContainsExpression"></span><span id="sec-arrow-function-definitions-static-semantics-containsexpression"></span><span id="sec-function-definitions-static-semantics-containsexpression"></span><span id="sec-destructuring-binding-patterns-static-semantics-containsexpression"></span>
<h1><span class="secnum">15.1.2</span> Static Semantics: ContainsExpression</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7532"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> ContainsExpression takes no arguments and returns a Boolean. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="ObjectBindingPattern">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-ObjectBindingPattern">ObjectBindingPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="gbpaspne" id="prod-zkT2lhLy">
<emu-t>{</emu-t>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="etffxusy" id="prod-6b4rrD_8">
<emu-t>{</emu-t>
<emu-nt id="_ref_22125"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingRestProperty">BindingRestProperty</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ObjectBindingPattern" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-ObjectBindingPattern">ObjectBindingPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ullzxsua" id="prod-wtzT9EiN">
<emu-t>{</emu-t>
<emu-nt id="_ref_22126"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingPropertyList">BindingPropertyList</a></emu-nt>
<emu-t>,</emu-t>
<emu-nt id="_ref_22127"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingRestProperty">BindingRestProperty</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="ContainsExpression" id="_ref_7533"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsexpression">ContainsExpression</a></emu-xref> of <emu-nt id="_ref_22128"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingPropertyList">BindingPropertyList</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ArrayBindingPattern" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-ArrayBindingPattern">ArrayBindingPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="kg5ha7xc" id="prod-h16qYz6B">
<emu-t>[</emu-t>
<emu-nt optional="" id="_ref_22129"><a href="ecmascript-language-expressions.html#prod-Elision">Elision</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>]</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ArrayBindingPattern" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-ArrayBindingPattern">ArrayBindingPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="dev8fspa" id="prod-1FzGu7Lp">
<emu-t>[</emu-t>
<emu-nt optional="" id="_ref_22130"><a href="ecmascript-language-expressions.html#prod-Elision">Elision</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-nt id="_ref_22131"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingRestElement">BindingRestElement</a></emu-nt>
<emu-t>]</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="ContainsExpression" id="_ref_7534"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsexpression">ContainsExpression</a></emu-xref> of <emu-nt id="_ref_22132"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingRestElement">BindingRestElement</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ArrayBindingPattern" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-ArrayBindingPattern">ArrayBindingPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="jxqgfqnk" id="prod-rkwjGbA6">
<emu-t>[</emu-t>
<emu-nt id="_ref_22133"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElementList">BindingElementList</a></emu-nt>
<emu-t>,</emu-t>
<emu-nt optional="" id="_ref_22134"><a href="ecmascript-language-expressions.html#prod-Elision">Elision</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>]</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="ContainsExpression" id="_ref_7535"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsexpression">ContainsExpression</a></emu-xref> of <emu-nt id="_ref_22135"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElementList">BindingElementList</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ArrayBindingPattern" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-ArrayBindingPattern">ArrayBindingPattern</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="7lkdseap" id="prod-J6x8FZJI">
<emu-t>[</emu-t>
<emu-nt id="_ref_22136"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElementList">BindingElementList</a></emu-nt>
<emu-t>,</emu-t>
<emu-nt optional="" id="_ref_22137"><a href="ecmascript-language-expressions.html#prod-Elision">Elision</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-nt id="_ref_22138"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingRestElement">BindingRestElement</a></emu-nt>
<emu-t>]</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>has</var> be <emu-xref aoid="ContainsExpression" id="_ref_7536"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsexpression">ContainsExpression</a></emu-xref> of <emu-nt id="_ref_22139"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElementList">BindingElementList</a></emu-nt>.</li><li>If <var>has</var> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-xref aoid="ContainsExpression" id="_ref_7537"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsexpression">ContainsExpression</a></emu-xref> of <emu-nt id="_ref_22140"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingRestElement">BindingRestElement</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="BindingPropertyList" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-BindingPropertyList">BindingPropertyList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="bzdeo9zt" id="prod-OZ7bBYfO">
<emu-nt id="_ref_22141"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingPropertyList">BindingPropertyList</a></emu-nt>
<emu-t>,</emu-t>
<emu-nt id="_ref_22142"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingProperty">BindingProperty</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>has</var> be <emu-xref aoid="ContainsExpression" id="_ref_7538"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsexpression">ContainsExpression</a></emu-xref> of <emu-nt id="_ref_22143"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingPropertyList">BindingPropertyList</a></emu-nt>.</li><li>If <var>has</var> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-xref aoid="ContainsExpression" id="_ref_7539"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsexpression">ContainsExpression</a></emu-xref> of <emu-nt id="_ref_22144"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingProperty">BindingProperty</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="BindingElementList" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElementList">BindingElementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="hiwampap" id="prod-Pbu7NeJV">
<emu-nt id="_ref_22145"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElementList">BindingElementList</a></emu-nt>
<emu-t>,</emu-t>
<emu-nt id="_ref_22146"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElisionElement">BindingElisionElement</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>has</var> be <emu-xref aoid="ContainsExpression" id="_ref_7540"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsexpression">ContainsExpression</a></emu-xref> of <emu-nt id="_ref_22147"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElementList">BindingElementList</a></emu-nt>.</li><li>If <var>has</var> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-xref aoid="ContainsExpression" id="_ref_7541"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsexpression">ContainsExpression</a></emu-xref> of <emu-nt id="_ref_22148"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElisionElement">BindingElisionElement</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="BindingElisionElement" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElisionElement">BindingElisionElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="wo9nasvo" id="prod-l7kFOPKe">
<emu-nt optional="" id="_ref_22149"><a href="ecmascript-language-expressions.html#prod-Elision">Elision</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-nt id="_ref_22150"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElement">BindingElement</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="ContainsExpression" id="_ref_7542"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsexpression">ContainsExpression</a></emu-xref> of <emu-nt id="_ref_22151"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElement">BindingElement</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="BindingProperty" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-BindingProperty">BindingProperty</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="mhvrwluk" id="prod-eeXd9umu">
<emu-nt id="_ref_22152"><a href="ecmascript-language-expressions.html#prod-PropertyName">PropertyName</a></emu-nt>
<emu-t>:</emu-t>
<emu-nt id="_ref_22153"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElement">BindingElement</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>has</var> be <emu-xref aoid="IsComputedPropertyKey" id="_ref_7543"><a href="ecmascript-language-expressions.html#sec-static-semantics-iscomputedpropertykey">IsComputedPropertyKey</a></emu-xref> of <emu-nt id="_ref_22154"><a href="ecmascript-language-expressions.html#prod-PropertyName">PropertyName</a></emu-nt>.</li><li>If <var>has</var> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-xref aoid="ContainsExpression" id="_ref_7544"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsexpression">ContainsExpression</a></emu-xref> of <emu-nt id="_ref_22155"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElement">BindingElement</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="BindingElement" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElement">BindingElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="dd1t5ekf" id="prod-1LlZEk6k">
<emu-nt id="_ref_22156"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingPattern">BindingPattern</a></emu-nt>
<emu-nt id="_ref_22157"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="SingleNameBinding" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-SingleNameBinding">SingleNameBinding</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uolyom43" id="prod-4G21hRBK"><emu-nt id="_ref_22158"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="SingleNameBinding" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-SingleNameBinding">SingleNameBinding</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ib7lg1vi" id="prod-8U9yuoPy">
<emu-nt id="_ref_22159"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-nt id="_ref_22160"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="BindingRestElement" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-BindingRestElement">BindingRestElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ffhe3nqa" id="prod-NXTQAWlJ">
<emu-t>...</emu-t>
<emu-nt id="_ref_22161"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="BindingRestElement" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-BindingRestElement">BindingRestElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="hmjzlo6g" id="prod-TzoSXJM8">
<emu-t>...</emu-t>
<emu-nt id="_ref_22162"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingPattern">BindingPattern</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="ContainsExpression" id="_ref_7545"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsexpression">ContainsExpression</a></emu-xref> of <emu-nt id="_ref_22163"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingPattern">BindingPattern</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="FormalParameters" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="n7nathbb" id="prod-i4esWmfn"><emu-gann>[empty]</emu-gann></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="FormalParameters" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uqeba6gz" id="prod-ffwfOKFy">
<emu-nt id="_ref_22164"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt>
<emu-t>,</emu-t>
<emu-nt id="_ref_22165"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionRestParameter">FunctionRestParameter</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <emu-xref aoid="ContainsExpression" id="_ref_7546"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsexpression">ContainsExpression</a></emu-xref> of <emu-nt id="_ref_22166"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-xref aoid="ContainsExpression" id="_ref_7547"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsexpression">ContainsExpression</a></emu-xref> of <emu-nt id="_ref_22167"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionRestParameter">FunctionRestParameter</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="FormalParameterList" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ijrjejbs" id="prod-Z488vACK">
<emu-nt id="_ref_22168"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt>
<emu-t>,</emu-t>
<emu-nt id="_ref_22169"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <emu-xref aoid="ContainsExpression" id="_ref_7548"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsexpression">ContainsExpression</a></emu-xref> of <emu-nt id="_ref_22170"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-xref aoid="ContainsExpression" id="_ref_7549"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsexpression">ContainsExpression</a></emu-xref> of <emu-nt id="_ref_22171"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ArrowParameters" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uolyom43" id="prod-4Zv7nEzD"><emu-nt id="_ref_22172"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ArrowParameters" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="yrb110hm" id="prod-l6d_kFqp"><emu-nt id="_ref_22173"><a href="ecmascript-language-expressions.html#prod-CoverParenthesizedExpressionAndArrowParameterList">CoverParenthesizedExpressionAndArrowParameterList</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>formals</var> be the <emu-nt id="_ref_22174"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFormalParameters">ArrowFormalParameters</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar" id="_ref_7550"><a href="notational-conventions.html#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_22175"><a href="ecmascript-language-expressions.html#prod-CoverParenthesizedExpressionAndArrowParameterList">CoverParenthesizedExpressionAndArrowParameterList</a></emu-nt>.</li><li>Return <emu-xref aoid="ContainsExpression" id="_ref_7551"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsexpression">ContainsExpression</a></emu-xref> of <var>formals</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="AsyncArrowBindingIdentifier" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowBindingIdentifier">AsyncArrowBindingIdentifier</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uolyom43" id="prod-gFcfnGJu"><emu-nt id="_ref_22176"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-static-semantics-issimpleparameterlist" oldids="sec-destructuring-binding-patterns-static-semantics-issimpleparameterlist,sec-function-definitions-static-semantics-issimpleparameterlist,sec-arrow-function-definitions-static-semantics-issimpleparameterlist,sec-async-arrow-function-definitions-static-semantics-IsSimpleParameterList" type="sdo" aoid="IsSimpleParameterList"><span id="sec-async-arrow-function-definitions-static-semantics-IsSimpleParameterList"></span><span id="sec-arrow-function-definitions-static-semantics-issimpleparameterlist"></span><span id="sec-function-definitions-static-semantics-issimpleparameterlist"></span><span id="sec-destructuring-binding-patterns-static-semantics-issimpleparameterlist"></span>
<h1><span class="secnum">15.1.3</span> Static Semantics: IsSimpleParameterList</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7552"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> IsSimpleParameterList takes no arguments and returns a Boolean. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="BindingElement" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElement">BindingElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="mdrfyhm6" id="prod-iu5DldfN"><emu-nt id="_ref_22177"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingPattern">BindingPattern</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="BindingElement" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElement">BindingElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="dd1t5ekf" id="prod-qrNno2ET">
<emu-nt id="_ref_22178"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingPattern">BindingPattern</a></emu-nt>
<emu-nt id="_ref_22179"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="SingleNameBinding" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-SingleNameBinding">SingleNameBinding</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uolyom43" id="prod-0qUANoiw"><emu-nt id="_ref_22180"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="SingleNameBinding" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-SingleNameBinding">SingleNameBinding</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ib7lg1vi" id="prod-b6-qn4pg">
<emu-nt id="_ref_22181"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-nt id="_ref_22182"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="FormalParameters" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="n7nathbb" id="prod-tfjykC09"><emu-gann>[empty]</emu-gann></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="FormalParameters" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="dnjnbote" id="prod-3o8iyoDi"><emu-nt id="_ref_22183"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionRestParameter">FunctionRestParameter</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="FormalParameters" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uqeba6gz" id="prod-90MekD57">
<emu-nt id="_ref_22184"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt>
<emu-t>,</emu-t>
<emu-nt id="_ref_22185"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionRestParameter">FunctionRestParameter</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="FormalParameterList" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ijrjejbs" id="prod-CdQEr4_m">
<emu-nt id="_ref_22186"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt>
<emu-t>,</emu-t>
<emu-nt id="_ref_22187"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <emu-xref aoid="IsSimpleParameterList" id="_ref_7553"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-issimpleparameterlist">IsSimpleParameterList</a></emu-xref> of <emu-nt id="_ref_22188"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt> is <emu-val>false</emu-val>, return <emu-val>false</emu-val>.</li><li>Return <emu-xref aoid="IsSimpleParameterList" id="_ref_7554"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-issimpleparameterlist">IsSimpleParameterList</a></emu-xref> of <emu-nt id="_ref_22189"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="FormalParameter" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="azzrmst0" id="prod-uFFTeOPE"><emu-nt id="_ref_22190"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElement">BindingElement</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="IsSimpleParameterList" id="_ref_7555"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-issimpleparameterlist">IsSimpleParameterList</a></emu-xref> of <emu-nt id="_ref_22191"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElement">BindingElement</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ArrowParameters" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uolyom43" id="prod-suhNtUzj"><emu-nt id="_ref_22192"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ArrowParameters" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="yrb110hm" id="prod-46y1StQq"><emu-nt id="_ref_22193"><a href="ecmascript-language-expressions.html#prod-CoverParenthesizedExpressionAndArrowParameterList">CoverParenthesizedExpressionAndArrowParameterList</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>formals</var> be the <emu-nt id="_ref_22194"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFormalParameters">ArrowFormalParameters</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar" id="_ref_7556"><a href="notational-conventions.html#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_22195"><a href="ecmascript-language-expressions.html#prod-CoverParenthesizedExpressionAndArrowParameterList">CoverParenthesizedExpressionAndArrowParameterList</a></emu-nt>.</li><li>Return <emu-xref aoid="IsSimpleParameterList" id="_ref_7557"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-issimpleparameterlist">IsSimpleParameterList</a></emu-xref> of <var>formals</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="AsyncArrowBindingIdentifier" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowBindingIdentifier">AsyncArrowBindingIdentifier</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uolyom43" id="prod-qGPu4-Bq"><emu-nt id="_ref_22196"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="CoverCallExpressionAndAsyncArrowHead" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="vks-z6n3" id="prod-bCpQszCG">
<emu-nt id="_ref_22197"><a href="ecmascript-language-expressions.html#prod-MemberExpression">MemberExpression</a></emu-nt>
<emu-nt id="_ref_22198"><a href="ecmascript-language-expressions.html#prod-Arguments">Arguments</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>head</var> be the <emu-nt id="_ref_22199"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowHead">AsyncArrowHead</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar" id="_ref_7558"><a href="notational-conventions.html#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_22200"><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt>.</li><li>Return <emu-xref aoid="IsSimpleParameterList" id="_ref_7559"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-issimpleparameterlist">IsSimpleParameterList</a></emu-xref> of <var>head</var>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-static-semantics-hasinitializer" oldids="sec-destructuring-binding-patterns-static-semantics-hasinitializer,sec-function-definitions-static-semantics-hasinitializer" type="sdo" aoid="HasInitializer"><span id="sec-function-definitions-static-semantics-hasinitializer"></span><span id="sec-destructuring-binding-patterns-static-semantics-hasinitializer"></span>
<h1><span class="secnum">15.1.4</span> Static Semantics: HasInitializer</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7560"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> HasInitializer takes no arguments and returns a Boolean. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="BindingElement" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElement">BindingElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="mdrfyhm6" id="prod-HBo05lrR"><emu-nt id="_ref_22201"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingPattern">BindingPattern</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="BindingElement" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-BindingElement">BindingElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="dd1t5ekf" id="prod-3n6oU9Uv">
<emu-nt id="_ref_22202"><a href="ecmascript-language-statements-and-declarations.html#prod-BindingPattern">BindingPattern</a></emu-nt>
<emu-nt id="_ref_22203"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="SingleNameBinding" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-SingleNameBinding">SingleNameBinding</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uolyom43" id="prod-Qjr24iGe"><emu-nt id="_ref_22204"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="SingleNameBinding" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-SingleNameBinding">SingleNameBinding</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ib7lg1vi" id="prod-6kCXjXJH">
<emu-nt id="_ref_22205"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-nt id="_ref_22206"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="FormalParameterList" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ijrjejbs" id="prod-YlncCUel">
<emu-nt id="_ref_22207"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt>
<emu-t>,</emu-t>
<emu-nt id="_ref_22208"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <emu-xref aoid="HasInitializer" id="_ref_7561"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hasinitializer">HasInitializer</a></emu-xref> of <emu-nt id="_ref_22209"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-xref aoid="HasInitializer" id="_ref_7562"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hasinitializer">HasInitializer</a></emu-xref> of <emu-nt id="_ref_22210"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a></emu-nt>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-static-semantics-expectedargumentcount" oldids="sec-function-definitions-static-semantics-expectedargumentcount,sec-arrow-function-definitions-static-semantics-expectedargumentcount,sec-method-definitions-static-semantics-expectedargumentcount,sec-async-arrow-function-definitions-static-semantics-ExpectedArgumentCount" type="sdo" aoid="ExpectedArgumentCount"><span id="sec-async-arrow-function-definitions-static-semantics-ExpectedArgumentCount"></span><span id="sec-method-definitions-static-semantics-expectedargumentcount"></span><span id="sec-arrow-function-definitions-static-semantics-expectedargumentcount"></span><span id="sec-function-definitions-static-semantics-expectedargumentcount"></span>
<h1><span class="secnum">15.1.5</span> Static Semantics: ExpectedArgumentCount</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7563"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> ExpectedArgumentCount takes no arguments and returns a non-negative <emu-xref href="#integer" id="_ref_7564"><a href="notational-conventions.html#integer">integer</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="FormalParameters">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="n7nathbb" id="prod-eE6gHDad">
<emu-gann>[empty]</emu-gann>
</emu-rhs>
<emu-rhs a="dnjnbote" id="prod-wqRyU6iR">
<emu-nt id="_ref_22211"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionRestParameter">FunctionRestParameter</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return 0.</li></ol></emu-alg>
<emu-grammar><emu-production name="FormalParameters" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uqeba6gz" id="prod--tdGBtde">
<emu-nt id="_ref_22212"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt>
<emu-t>,</emu-t>
<emu-nt id="_ref_22213"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionRestParameter">FunctionRestParameter</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return the <emu-xref aoid="ExpectedArgumentCount" id="_ref_7565"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-expectedargumentcount">ExpectedArgumentCount</a></emu-xref> of <emu-nt id="_ref_22214"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt>.</li></ol></emu-alg>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>The ExpectedArgumentCount of a <emu-nt id="_ref_22215"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt> is the number of <emu-nt id="_ref_22216"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> to the left of either the rest parameter or the first <emu-nt id="_ref_22217"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a></emu-nt> with an Initializer. A <emu-nt id="_ref_22218"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a></emu-nt> without an initializer is allowed after the first parameter with an initializer but such parameters are considered to be optional with <emu-val>undefined</emu-val> as their default value.</p>
</div></emu-note>
<emu-grammar><emu-production name="FormalParameterList" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="sxlu9ab0" id="prod-WmFS8bja"><emu-nt id="_ref_22219"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <emu-xref aoid="HasInitializer" id="_ref_7566"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hasinitializer">HasInitializer</a></emu-xref> of <emu-nt id="_ref_22220"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a></emu-nt> is <emu-val>true</emu-val>, return 0.</li><li>Return 1.</li></ol></emu-alg>
<emu-grammar><emu-production name="FormalParameterList" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ijrjejbs" id="prod-2HGoRaSl">
<emu-nt id="_ref_22221"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt>
<emu-t>,</emu-t>
<emu-nt id="_ref_22222"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>count</var> be the <emu-xref aoid="ExpectedArgumentCount" id="_ref_7567"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-expectedargumentcount">ExpectedArgumentCount</a></emu-xref> of <emu-nt id="_ref_22223"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt>.</li><li>If <emu-xref aoid="HasInitializer" id="_ref_7568"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hasinitializer">HasInitializer</a></emu-xref> of <emu-nt id="_ref_22224"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameterList">FormalParameterList</a></emu-nt> is <emu-val>true</emu-val> or <emu-xref aoid="HasInitializer" id="_ref_7569"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hasinitializer">HasInitializer</a></emu-xref> of <emu-nt id="_ref_22225"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a></emu-nt> is <emu-val>true</emu-val>, return <var>count</var>.</li><li>Return <var>count</var> + 1.</li></ol></emu-alg>
<emu-grammar><emu-production name="ArrowParameters" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uolyom43" id="prod-u-Q5LrzT"><emu-nt id="_ref_22226"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return 1.</li></ol></emu-alg>
<emu-grammar><emu-production name="ArrowParameters" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="yrb110hm" id="prod-2fYMCaig"><emu-nt id="_ref_22227"><a href="ecmascript-language-expressions.html#prod-CoverParenthesizedExpressionAndArrowParameterList">CoverParenthesizedExpressionAndArrowParameterList</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>formals</var> be the <emu-nt id="_ref_22228"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFormalParameters">ArrowFormalParameters</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar" id="_ref_7570"><a href="notational-conventions.html#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_22229"><a href="ecmascript-language-expressions.html#prod-CoverParenthesizedExpressionAndArrowParameterList">CoverParenthesizedExpressionAndArrowParameterList</a></emu-nt>.</li><li>Return the <emu-xref aoid="ExpectedArgumentCount" id="_ref_7571"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-expectedargumentcount">ExpectedArgumentCount</a></emu-xref> of <var>formals</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="PropertySetParameterList" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-PropertySetParameterList">PropertySetParameterList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="sxlu9ab0" id="prod-01YV1lrL"><emu-nt id="_ref_22230"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <emu-xref aoid="HasInitializer" id="_ref_7572"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hasinitializer">HasInitializer</a></emu-xref> of <emu-nt id="_ref_22231"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a></emu-nt> is <emu-val>true</emu-val>, return 0.</li><li>Return 1.</li></ol></emu-alg>
<emu-grammar><emu-production name="AsyncArrowBindingIdentifier" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowBindingIdentifier">AsyncArrowBindingIdentifier</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uolyom43" id="prod-df9_W4vY"><emu-nt id="_ref_22232"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return 1.</li></ol></emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-function-definitions">
<h1><span class="secnum">15.2</span> Function Definitions</h1>
<h2>Syntax</h2>
<emu-grammar type="definition"><emu-production name="FunctionDeclaration" params="Yield, Await, Default" id="prod-FunctionDeclaration">
<emu-nt params="Yield, Await, Default"><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-geq>:</emu-geq> <emu-rhs a="fal2s0ab" id="prod-lEQdX6hk">
<emu-t>function</emu-t>
<emu-nt params="?Yield, ?Await" id="_ref_22233"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt params="~Yield, ~Await" id="_ref_22234"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[~Yield, ~Await]</emu-params></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt params="~Yield, ~Await" id="_ref_22235"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a><emu-mods><emu-params>[~Yield, ~Await]</emu-params></emu-mods></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="_ww4ynxp" constraints="+Default" id="prod-eqpHaG0r"><emu-constraints>[+Default]</emu-constraints>
<emu-t>function</emu-t>
<emu-t>(</emu-t>
<emu-nt params="~Yield, ~Await" id="_ref_22236"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[~Yield, ~Await]</emu-params></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt params="~Yield, ~Await" id="_ref_22237"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a><emu-mods><emu-params>[~Yield, ~Await]</emu-params></emu-mods></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="FunctionExpression" id="prod-FunctionExpression">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="h6r9zk3c" id="prod--zvLR38c">
<emu-t>function</emu-t>
<emu-nt params="~Yield, ~Await" optional="" id="_ref_22238"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[~Yield, ~Await]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt params="~Yield, ~Await" id="_ref_22239"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[~Yield, ~Await]</emu-params></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt params="~Yield, ~Await" id="_ref_22240"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a><emu-mods><emu-params>[~Yield, ~Await]</emu-params></emu-mods></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="FunctionBody" params="Yield, Await" id="prod-FunctionBody">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="gljyayfs" id="prod-CKMymB_i">
<emu-nt params="?Yield, ?Await" id="_ref_22241"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionStatementList">FunctionStatementList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="FunctionStatementList" params="Yield, Await" id="prod-FunctionStatementList">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionStatementList">FunctionStatementList</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ime6-pzo" id="prod-WeOYFNsx">
<emu-nt params="?Yield, ?Await, +Return" optional="" id="_ref_22242"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementList">StatementList</a><emu-mods><emu-params>[?Yield, ?Await, +Return]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-clause id="sec-function-definitions-static-semantics-early-errors">
<h1><span class="secnum">15.2.1</span> Static Semantics: Early Errors</h1>
<emu-grammar><emu-production name="FunctionDeclaration">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="gxoavzvy">
<emu-t>function</emu-t>
<emu-nt id="_ref_22243"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22244"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22245"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="smus6qca">
<emu-t>function</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_22246"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22247"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="FunctionExpression">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="g3mtfiqq">
<emu-t>function</emu-t>
<emu-nt optional="" id="_ref_22248"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22249"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22250"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>
If <emu-xref aoid="IsStrict" id="_ref_7573"><a href="ecmascript-language-source-code.html#sec-isstrict">IsStrict</a></emu-xref>(<emu-nt id="_ref_22251"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>) is <emu-val>true</emu-val>, the Early Error rules for <emu-grammar><emu-production name="UniqueFormalParameters" collapsed="" class=" inline">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ahjg9bb6"><emu-nt id="_ref_22252"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar> are applied.
</li>
<li>
If <emu-nt id="_ref_22253"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> is present and <emu-xref aoid="IsStrict" id="_ref_7574"><a href="ecmascript-language-source-code.html#sec-isstrict">IsStrict</a></emu-xref>(<emu-nt id="_ref_22254"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>) is <emu-val>true</emu-val>, it is a Syntax Error if the <emu-xref aoid="StringValue" id="_ref_7575"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22255"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> is either <emu-val>"eval"</emu-val> or <emu-val>"arguments"</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-xref aoid="FunctionBodyContainsUseStrict" id="_ref_7576"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-functionbodycontainsusestrict">FunctionBodyContainsUseStrict</a></emu-xref> of <emu-nt id="_ref_22256"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> is <emu-val>true</emu-val> and <emu-xref aoid="IsSimpleParameterList" id="_ref_7577"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-issimpleparameterlist">IsSimpleParameterList</a></emu-xref> of <emu-nt id="_ref_22257"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> is <emu-val>false</emu-val>.
</li>
<li>
It is a Syntax Error if any element of the <emu-xref aoid="BoundNames" id="_ref_7578"><a href="syntax-directed-operations.html#sec-static-semantics-boundnames">BoundNames</a></emu-xref> of <emu-nt id="_ref_22258"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> also occurs in the <emu-xref aoid="LexicallyDeclaredNames" id="_ref_7579"><a href="syntax-directed-operations.html#sec-static-semantics-lexicallydeclarednames">LexicallyDeclaredNames</a></emu-xref> of <emu-nt id="_ref_22259"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>.
</li>
<li>
It is a Syntax Error if <emu-nt id="_ref_22260"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7580"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22261"><a href="ecmascript-language-expressions.html#prod-SuperProperty">SuperProperty</a></emu-nt> is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-nt id="_ref_22262"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7581"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22263"><a href="ecmascript-language-expressions.html#prod-SuperProperty">SuperProperty</a></emu-nt> is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-nt id="_ref_22264"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7582"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22265"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt> is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-nt id="_ref_22266"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7583"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22267"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt> is <emu-val>true</emu-val>.
</li>
</ul>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>The <emu-xref aoid="LexicallyDeclaredNames" id="_ref_7584"><a href="syntax-directed-operations.html#sec-static-semantics-lexicallydeclarednames">LexicallyDeclaredNames</a></emu-xref> of a <emu-nt id="_ref_22268"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> does not include identifiers bound using var or function declarations.</p>
</div></emu-note>
<emu-grammar><emu-production name="FunctionBody" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="xn8an8nx"><emu-nt id="_ref_22269"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionStatementList">FunctionStatementList</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>
It is a Syntax Error if the <emu-xref aoid="LexicallyDeclaredNames" id="_ref_7585"><a href="syntax-directed-operations.html#sec-static-semantics-lexicallydeclarednames">LexicallyDeclaredNames</a></emu-xref> of <emu-nt id="_ref_22270"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionStatementList">FunctionStatementList</a></emu-nt> contains any duplicate entries.
</li>
<li>
It is a Syntax Error if any element of the <emu-xref aoid="LexicallyDeclaredNames" id="_ref_7586"><a href="syntax-directed-operations.html#sec-static-semantics-lexicallydeclarednames">LexicallyDeclaredNames</a></emu-xref> of <emu-nt id="_ref_22271"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionStatementList">FunctionStatementList</a></emu-nt> also occurs in the <emu-xref aoid="VarDeclaredNames" id="_ref_7587"><a href="syntax-directed-operations.html#sec-static-semantics-vardeclarednames">VarDeclaredNames</a></emu-xref> of <emu-nt id="_ref_22272"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionStatementList">FunctionStatementList</a></emu-nt>.
</li>
<li>
It is a Syntax Error if <emu-xref aoid="ContainsDuplicateLabels" id="_ref_7588"><a href="syntax-directed-operations.html#sec-static-semantics-containsduplicatelabels">ContainsDuplicateLabels</a></emu-xref> of <emu-nt id="_ref_22273"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionStatementList">FunctionStatementList</a></emu-nt> with argument « » is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-xref aoid="ContainsUndefinedBreakTarget" id="_ref_7589"><a href="syntax-directed-operations.html#sec-static-semantics-containsundefinedbreaktarget">ContainsUndefinedBreakTarget</a></emu-xref> of <emu-nt id="_ref_22274"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionStatementList">FunctionStatementList</a></emu-nt> with argument « » is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-xref aoid="ContainsUndefinedContinueTarget" id="_ref_7590"><a href="syntax-directed-operations.html#sec-static-semantics-containsundefinedcontinuetarget">ContainsUndefinedContinueTarget</a></emu-xref> of <emu-nt id="_ref_22275"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionStatementList">FunctionStatementList</a></emu-nt> with arguments « » and « » is <emu-val>true</emu-val>.
</li>
</ul>
</emu-clause>
<emu-clause id="sec-static-semantics-functionbodycontainsusestrict" oldids="sec-function-definitions-static-semantics-containsusestrict" type="sdo" aoid="FunctionBodyContainsUseStrict"><span id="sec-function-definitions-static-semantics-containsusestrict"></span>
<h1><span class="secnum">15.2.2</span> Static Semantics: FunctionBodyContainsUseStrict</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7591"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> FunctionBodyContainsUseStrict takes no arguments and returns a Boolean. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="FunctionBody" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="xn8an8nx" id="prod-SI3y-Fh-"><emu-nt id="_ref_22276"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionStatementList">FunctionStatementList</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If the <emu-xref href="#directive-prologue" id="_ref_7592"><a href="ecmascript-language-source-code.html#directive-prologue">Directive Prologue</a></emu-xref> of <emu-nt id="_ref_22277"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> contains a <emu-xref href="#use-strict-directive" id="_ref_7593"><a href="ecmascript-language-source-code.html#use-strict-directive">Use Strict Directive</a></emu-xref>, return <emu-val>true</emu-val>.</li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-runtime-semantics-evaluatefunctionbody" oldids="sec-function-definitions-runtime-semantics-evaluatebody" type="sdo" aoid="EvaluateFunctionBody"><span id="sec-function-definitions-runtime-semantics-evaluatebody"></span>
<h1><span class="secnum">15.2.3</span> Runtime Semantics: EvaluateFunctionBody</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7594"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> EvaluateFunctionBody takes arguments <var>functionObject</var> (an ECMAScript <emu-xref href="#function-object" id="_ref_7595"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>) and <var>argumentsList</var> (a <emu-xref href="#sec-list-and-record-specification-type" id="_ref_7596"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-xref href="#sec-ecmascript-language-types" id="_ref_7597"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types">ECMAScript language values</a></emu-xref>) and returns a <emu-xref href="#sec-completion-record-specification-type" id="_ref_7598"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">return completion</a></emu-xref> or a <emu-xref href="#sec-completion-record-specification-type" id="_ref_7599"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">throw completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="FunctionBody" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="xn8an8nx" id="prod-BiHevouZ"><emu-nt id="_ref_22278"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionStatementList">FunctionStatementList</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="FunctionDeclarationInstantiation" id="_ref_7600"><a href="ordinary-and-exotic-objects-behaviours.html#sec-functiondeclarationinstantiation" class="e-user-code">FunctionDeclarationInstantiation</a></emu-xref>(<var>functionObject</var>, <var>argumentsList</var>).</li><li>Perform ?&nbsp;<emu-xref aoid="Evaluation" id="_ref_7601"><a href="syntax-directed-operations.html#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt id="_ref_22279"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionStatementList">FunctionStatementList</a></emu-nt>.</li><li>NOTE: If the previous step resulted in a <emu-xref href="#sec-completion-record-specification-type" id="_ref_7602"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">normal completion</a></emu-xref>, then evaluation finished by proceeding past the end of the <emu-nt id="_ref_22280"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionStatementList">FunctionStatementList</a></emu-nt>.</li><li>Return <emu-xref aoid="ReturnCompletion" id="_ref_7603"><a href="ecmascript-data-types-and-values.html#sec-returncompletion">ReturnCompletion</a></emu-xref>(<emu-val>undefined</emu-val>).</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-runtime-semantics-instantiateordinaryfunctionobject" oldids="sec-function-definitions-runtime-semantics-instantiatefunctionobject" type="sdo" aoid="InstantiateOrdinaryFunctionObject"><span id="sec-function-definitions-runtime-semantics-instantiatefunctionobject"></span>
<h1><span class="secnum">15.2.4</span> Runtime Semantics: InstantiateOrdinaryFunctionObject</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7604"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> InstantiateOrdinaryFunctionObject takes arguments <var>env</var> (an <emu-xref href="#sec-environment-records" id="_ref_7605"><a href="executable-code-and-execution-contexts.html#sec-environment-records">Environment Record</a></emu-xref>) and <var>privateEnv</var> (a <emu-xref href="#privateenvironment-record" id="_ref_7606"><a href="executable-code-and-execution-contexts.html#privateenvironment-record">PrivateEnvironment Record</a></emu-xref> or <emu-val>null</emu-val>) and returns an ECMAScript <emu-xref href="#function-object" id="_ref_7607"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="FunctionDeclaration" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="gxoavzvy" id="prod-oT86BVb2">
<emu-t>function</emu-t>
<emu-nt id="_ref_22281"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22282"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22283"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>name</var> be the <emu-xref aoid="StringValue" id="_ref_7608"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22284"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7609"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22285"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt>.</li><li>Let <var>F</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7610"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-function-prototype-object" id="_ref_7611"><a href="fundamental-objects.html#sec-properties-of-the-function-prototype-object">%Function.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_22286"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>, <emu-nt id="_ref_22287"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7612"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>F</var>, <var>name</var>).</li><li>Perform <emu-xref aoid="MakeConstructor" id="_ref_7613"><a href="ordinary-and-exotic-objects-behaviours.html#sec-makeconstructor">MakeConstructor</a></emu-xref>(<var>F</var>).</li><li>Return <var>F</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="FunctionDeclaration" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="smus6qca" id="prod-TjR6TGOd">
<emu-t>function</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_22288"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22289"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7614"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22290"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt>.</li><li>Let <var>F</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7615"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-function-prototype-object" id="_ref_7616"><a href="fundamental-objects.html#sec-properties-of-the-function-prototype-object">%Function.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_22291"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>, <emu-nt id="_ref_22292"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7617"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>F</var>, <emu-val>"default"</emu-val>).</li><li>Perform <emu-xref aoid="MakeConstructor" id="_ref_7618"><a href="ordinary-and-exotic-objects-behaviours.html#sec-makeconstructor">MakeConstructor</a></emu-xref>(<var>F</var>).</li><li>Return <var>F</var>.</li></ol></emu-alg>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>An anonymous <emu-nt id="_ref_22293"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt> can only occur as part of an <code>export default</code> declaration, and its function code is therefore always <emu-xref href="#sec-strict-mode-code" id="_ref_7619"><a href="ecmascript-language-source-code.html#sec-strict-mode-code">strict mode code</a></emu-xref>.</p>
</div></emu-note>
</emu-clause>
<emu-clause id="sec-runtime-semantics-instantiateordinaryfunctionexpression" type="sdo" aoid="InstantiateOrdinaryFunctionExpression">
<h1><span class="secnum">15.2.5</span> Runtime Semantics: InstantiateOrdinaryFunctionExpression</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7620"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> InstantiateOrdinaryFunctionExpression takes optional argument <var>name</var> (a <emu-xref href="#property-key" id="_ref_7621"><a href="ecmascript-data-types-and-values.html#property-key">property key</a></emu-xref> or a <emu-xref href="#sec-private-names" id="_ref_7622"><a href="ecmascript-data-types-and-values.html#sec-private-names">Private Name</a></emu-xref>) and returns an ECMAScript <emu-xref href="#function-object" id="_ref_7623"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="FunctionExpression" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="smus6qca" id="prod-M2Odxhb_">
<emu-t>function</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_22294"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22295"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <var>name</var> is not present, set <var>name</var> to <emu-val>""</emu-val>.</li><li>Let <var>env</var> be the LexicalEnvironment of the <emu-xref href="#running-execution-context" id="_ref_7624"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>.</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_7625"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7626"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22296"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt>.</li><li>Let <var>closure</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7627"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-function-prototype-object" id="_ref_7628"><a href="fundamental-objects.html#sec-properties-of-the-function-prototype-object">%Function.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_22297"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>, <emu-nt id="_ref_22298"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7629"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>closure</var>, <var>name</var>).</li><li>Perform <emu-xref aoid="MakeConstructor" id="_ref_7630"><a href="ordinary-and-exotic-objects-behaviours.html#sec-makeconstructor">MakeConstructor</a></emu-xref>(<var>closure</var>).</li><li>Return <var>closure</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="FunctionExpression" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="gxoavzvy" id="prod-ZT_oXgSx">
<emu-t>function</emu-t>
<emu-nt id="_ref_22299"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22300"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22301"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li><emu-xref href="#assert" id="_ref_7631"><a href="notational-conventions.html#assert">Assert</a></emu-xref>: <var>name</var> is not present.</li><li>Set <var>name</var> to the <emu-xref aoid="StringValue" id="_ref_7632"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22302"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>.</li><li>Let <var>outerEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_7633"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s LexicalEnvironment.</li><li>Let <var>funcEnv</var> be <emu-xref aoid="NewDeclarativeEnvironment" id="_ref_7634"><a href="executable-code-and-execution-contexts.html#sec-newdeclarativeenvironment">NewDeclarativeEnvironment</a></emu-xref>(<var>outerEnv</var>).</li><li>Perform !&nbsp;<var>funcEnv</var>.<emu-xref aoid="CreateImmutableBinding" id="_ref_7635"><a href="executable-code-and-execution-contexts.html#abstract-createimmutablebinding">CreateImmutableBinding</a></emu-xref>(<var>name</var>, <emu-val>false</emu-val>).</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_7636"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7637"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22303"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt>.</li><li>Let <var>closure</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7638"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-function-prototype-object" id="_ref_7639"><a href="fundamental-objects.html#sec-properties-of-the-function-prototype-object">%Function.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_22304"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>, <emu-nt id="_ref_22305"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>funcEnv</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7640"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>closure</var>, <var>name</var>).</li><li>Perform <emu-xref aoid="MakeConstructor" id="_ref_7641"><a href="ordinary-and-exotic-objects-behaviours.html#sec-makeconstructor">MakeConstructor</a></emu-xref>(<var>closure</var>).</li><li>Perform !&nbsp;<var>funcEnv</var>.<emu-xref aoid="InitializeBinding" id="_ref_7642"><a href="executable-code-and-execution-contexts.html#abstract-initializebinding">InitializeBinding</a></emu-xref>(<var>name</var>, <var>closure</var>).</li><li>Return <var>closure</var>.</li></ol></emu-alg>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>The <emu-nt id="_ref_22306"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> in a <emu-nt id="_ref_22307"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt> can be referenced from inside the <emu-nt id="_ref_22308"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt>'s <emu-nt id="_ref_22309"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> to allow the function to call itself recursively. However, unlike in a <emu-nt id="_ref_22310"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt>, the <emu-nt id="_ref_22311"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> in a <emu-nt id="_ref_22312"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt> cannot be referenced from and does not affect the scope enclosing the <emu-nt id="_ref_22313"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt>.</p>
</div></emu-note>
</emu-clause>
<emu-clause id="sec-function-definitions-runtime-semantics-evaluation" type="sdo">
<h1><span class="secnum">15.2.6</span> Runtime Semantics: Evaluation</h1>
<emu-grammar><emu-production name="FunctionDeclaration" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="gxoavzvy" id="prod-JkNCEml2">
<emu-t>function</emu-t>
<emu-nt id="_ref_22314"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22315"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22316"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-const>empty</emu-const>.</li></ol></emu-alg>
<emu-note><span class="note">Note 1</span><div class="note-contents">
<p>An alternative semantics is provided by <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title="" id="_ref_463"><a href="additional-ecmascript-features-for-web-browsers.html#sec-block-level-function-declarations-web-legacy-compatibility-semantics">Block-Level Function Declarations Web Legacy Compatibility Semantics</a></emu-xref> at step <emu-xref href="#step-functiondeclarationinstantiation-alt-funcdecl-eval" id="_ref_464"><a href="ordinary-and-exotic-objects-behaviours.html#step-functiondeclarationinstantiation-alt-funcdecl-eval">32.a.i.2.c</a></emu-xref> of <emu-xref aoid="FunctionDeclarationInstantiation" id="_ref_7643"><a href="ordinary-and-exotic-objects-behaviours.html#sec-functiondeclarationinstantiation">FunctionDeclarationInstantiation</a></emu-xref>, step <emu-xref href="#step-globaldeclarationinstantiation-alt-funcdecl-eval" id="_ref_465"><a href="ecmascript-language-scripts-and-modules.html#step-globaldeclarationinstantiation-alt-funcdecl-eval">12.b.ii.2.a.ii.iii</a></emu-xref> of <emu-xref aoid="GlobalDeclarationInstantiation" id="_ref_7644"><a href="ecmascript-language-scripts-and-modules.html#sec-globaldeclarationinstantiation">GlobalDeclarationInstantiation</a></emu-xref>, and step <emu-xref href="#step-evaldeclarationinstantiation-alt-funcdecl-eval" id="_ref_466"><a href="global-object.html#step-evaldeclarationinstantiation-alt-funcdecl-eval">13.b.ii.7.b</a></emu-xref> of <emu-xref aoid="EvalDeclarationInstantiation" id="_ref_7645"><a href="global-object.html#sec-evaldeclarationinstantiation">EvalDeclarationInstantiation</a></emu-xref>.</p>
</div></emu-note>
<emu-grammar><emu-production name="FunctionDeclaration" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="smus6qca" id="prod-JB2pB6KU">
<emu-t>function</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_22317"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22318"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-const>empty</emu-const>.</li></ol></emu-alg>
<emu-grammar><emu-production name="FunctionExpression" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="g3mtfiqq" id="prod-gx42gzY4">
<emu-t>function</emu-t>
<emu-nt optional="" id="_ref_22319"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22320"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22321"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="InstantiateOrdinaryFunctionExpression" id="_ref_7646"><a href="ecmascript-language-functions-and-classes.html#sec-runtime-semantics-instantiateordinaryfunctionexpression">InstantiateOrdinaryFunctionExpression</a></emu-xref> of <emu-nt id="_ref_22322"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt>.</li></ol></emu-alg>
<emu-note><span class="note">Note 2</span><div class="note-contents">
<p>A <emu-val>"prototype"</emu-val> property is automatically created for every function defined using a <emu-nt id="_ref_22323"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt> or <emu-nt id="_ref_22324"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt>, to allow for the possibility that the function will be used as a <emu-xref href="#constructor" id="_ref_7647"><a href="ecmascript-data-types-and-values.html#constructor">constructor</a></emu-xref>.</p>
</div></emu-note>
<emu-grammar><emu-production name="FunctionStatementList" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FunctionStatementList">FunctionStatementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="n7nathbb" id="prod-TAJ7Z-Ln"><emu-gann>[empty]</emu-gann></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>undefined</emu-val>.</li></ol></emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-arrow-function-definitions">
<h1><span class="secnum">15.3</span> Arrow Function Definitions</h1>
<h2>Syntax</h2>
<emu-grammar type="definition"><emu-production name="ArrowFunction" params="In, Yield, Await" id="prod-ArrowFunction">
<emu-nt params="In, Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a><emu-mods><emu-params>[In, Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="c-igjs-g" id="prod-AtXUMYu3">
<emu-nt params="?Yield, ?Await" id="_ref_22325"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-gann>[no <emu-nt id="_ref_22326"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
<emu-t>=&gt;</emu-t>
<emu-nt params="?In" id="_ref_22327"><a href="ecmascript-language-functions-and-classes.html#prod-ConciseBody">ConciseBody</a><emu-mods><emu-params>[?In]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="ArrowParameters" params="Yield, Await" id="prod-ArrowParameters">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ir-rfjfi" id="prod-7Fo_GcBM">
<emu-nt params="?Yield, ?Await" id="_ref_22328"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
<emu-rhs a="parencover" id="prod-W9higncN">
<emu-nt params="?Yield, ?Await" id="_ref_22329"><a href="ecmascript-language-expressions.html#prod-CoverParenthesizedExpressionAndArrowParameterList">CoverParenthesizedExpressionAndArrowParameterList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="ConciseBody" params="In" id="prod-ConciseBody">
<emu-nt params="In"><a href="ecmascript-language-functions-and-classes.html#prod-ConciseBody">ConciseBody</a><emu-mods><emu-params>[In]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="eofx7fcb" id="prod-UOsd7muB">
<emu-gann>[lookahead ≠ <emu-t>{</emu-t>]</emu-gann>
<emu-nt params="?In, ~Await" id="_ref_22330"><a href="ecmascript-language-functions-and-classes.html#prod-ExpressionBody">ExpressionBody</a><emu-mods><emu-params>[?In, ~Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
<emu-rhs a="b3uvs-pa" id="prod-c6cxJePv">
<emu-t>{</emu-t>
<emu-nt params="~Yield, ~Await" id="_ref_22331"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a><emu-mods><emu-params>[~Yield, ~Await]</emu-params></emu-mods></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="ExpressionBody" params="In, Await" id="prod-ExpressionBody">
<emu-nt params="In, Await"><a href="ecmascript-language-functions-and-classes.html#prod-ExpressionBody">ExpressionBody</a><emu-mods><emu-params>[In, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ickgdpbs" id="prod-Eaqym5cf">
<emu-nt params="?In, ~Yield, ?Await" id="_ref_22332"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a><emu-mods><emu-params>[?In, ~Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<h2>Supplemental Syntax</h2>
<p>
When processing an instance of the production<br>
<emu-grammar><emu-production name="ArrowParameters" params="Yield, Await" collapsed="" class=" inline">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="kcra71qq"><emu-nt params="?Yield, ?Await" id="_ref_22333"><a href="ecmascript-language-expressions.html#prod-CoverParenthesizedExpressionAndArrowParameterList">CoverParenthesizedExpressionAndArrowParameterList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt></emu-rhs>
</emu-production>
</emu-grammar><br>
the interpretation of <emu-nt id="_ref_22334"><a href="ecmascript-language-expressions.html#prod-CoverParenthesizedExpressionAndArrowParameterList">CoverParenthesizedExpressionAndArrowParameterList</a></emu-nt> is refined using the following grammar:
</p>
<emu-grammar type="definition"><emu-production name="ArrowFormalParameters" params="Yield, Await" id="prod-ArrowFormalParameters">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFormalParameters">ArrowFormalParameters</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="t1yas6ob">
<emu-t>(</emu-t>
<emu-nt params="?Yield, ?Await" id="_ref_22335"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-t>)</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-clause id="sec-arrow-function-definitions-static-semantics-early-errors">
<h1><span class="secnum">15.3.1</span> Static Semantics: Early Errors</h1>
<emu-grammar><emu-production name="ArrowFunction" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ieeod2mi">
<emu-nt id="_ref_22336"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a></emu-nt>
<emu-t>=&gt;</emu-t>
<emu-nt id="_ref_22337"><a href="ecmascript-language-functions-and-classes.html#prod-ConciseBody">ConciseBody</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>
It is a Syntax Error if <emu-nt id="_ref_22338"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7648"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22339"><a href="ecmascript-language-functions-and-classes.html#prod-YieldExpression">YieldExpression</a></emu-nt> is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-nt id="_ref_22340"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7649"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22341"><a href="ecmascript-language-functions-and-classes.html#prod-AwaitExpression">AwaitExpression</a></emu-nt> is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-xref aoid="ConciseBodyContainsUseStrict" id="_ref_7650"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-concisebodycontainsusestrict">ConciseBodyContainsUseStrict</a></emu-xref> of <emu-nt id="_ref_22342"><a href="ecmascript-language-functions-and-classes.html#prod-ConciseBody">ConciseBody</a></emu-nt> is <emu-val>true</emu-val> and <emu-xref aoid="IsSimpleParameterList" id="_ref_7651"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-issimpleparameterlist">IsSimpleParameterList</a></emu-xref> of <emu-nt id="_ref_22343"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a></emu-nt> is <emu-val>false</emu-val>.
</li>
<li>
It is a Syntax Error if any element of the <emu-xref aoid="BoundNames" id="_ref_7652"><a href="syntax-directed-operations.html#sec-static-semantics-boundnames">BoundNames</a></emu-xref> of <emu-nt id="_ref_22344"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a></emu-nt> also occurs in the <emu-xref aoid="LexicallyDeclaredNames" id="_ref_7653"><a href="syntax-directed-operations.html#sec-static-semantics-lexicallydeclarednames">LexicallyDeclaredNames</a></emu-xref> of <emu-nt id="_ref_22345"><a href="ecmascript-language-functions-and-classes.html#prod-ConciseBody">ConciseBody</a></emu-nt>.
</li>
</ul>
<emu-grammar><emu-production name="ArrowParameters" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="yrb110hm"><emu-nt id="_ref_22346"><a href="ecmascript-language-expressions.html#prod-CoverParenthesizedExpressionAndArrowParameterList">CoverParenthesizedExpressionAndArrowParameterList</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>
<emu-nt id="_ref_22347"><a href="ecmascript-language-expressions.html#prod-CoverParenthesizedExpressionAndArrowParameterList">CoverParenthesizedExpressionAndArrowParameterList</a></emu-nt> <emu-xref href="#must-cover" id="_ref_7654"><a href="notational-conventions.html#must-cover">must cover</a></emu-xref> an <emu-nt id="_ref_22348"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFormalParameters">ArrowFormalParameters</a></emu-nt>.
</li>
</ul>
</emu-clause>
<emu-clause id="sec-static-semantics-concisebodycontainsusestrict" oldids="sec-arrow-function-definitions-static-semantics-containsusestrict" type="sdo" aoid="ConciseBodyContainsUseStrict"><span id="sec-arrow-function-definitions-static-semantics-containsusestrict"></span>
<h1><span class="secnum">15.3.2</span> Static Semantics: ConciseBodyContainsUseStrict</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7655"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> ConciseBodyContainsUseStrict takes no arguments and returns a Boolean. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="ConciseBody" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ConciseBody">ConciseBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="39f4t7jo" id="prod-paSxtgKv"><emu-nt id="_ref_22349"><a href="ecmascript-language-functions-and-classes.html#prod-ExpressionBody">ExpressionBody</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ConciseBody" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ConciseBody">ConciseBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="aerabkqd" id="prod-72drK4Uu">
<emu-t>{</emu-t>
<emu-nt id="_ref_22350"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="FunctionBodyContainsUseStrict" id="_ref_7656"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-functionbodycontainsusestrict">FunctionBodyContainsUseStrict</a></emu-xref> of <emu-nt id="_ref_22351"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-runtime-semantics-evaluateconcisebody" oldids="sec-arrow-function-definitions-runtime-semantics-evaluatebody" type="sdo" aoid="EvaluateConciseBody"><span id="sec-arrow-function-definitions-runtime-semantics-evaluatebody"></span>
<h1><span class="secnum">15.3.3</span> Runtime Semantics: EvaluateConciseBody</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7657"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> EvaluateConciseBody takes arguments <var>functionObject</var> (an ECMAScript <emu-xref href="#function-object" id="_ref_7658"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>) and <var>argumentsList</var> (a <emu-xref href="#sec-list-and-record-specification-type" id="_ref_7659"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-xref href="#sec-ecmascript-language-types" id="_ref_7660"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types">ECMAScript language values</a></emu-xref>) and returns a <emu-xref href="#sec-completion-record-specification-type" id="_ref_7661"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">return completion</a></emu-xref> or a <emu-xref href="#sec-completion-record-specification-type" id="_ref_7662"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">throw completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="ConciseBody" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ConciseBody">ConciseBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="39f4t7jo" id="prod-WWzcef1e"><emu-nt id="_ref_22352"><a href="ecmascript-language-functions-and-classes.html#prod-ExpressionBody">ExpressionBody</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="FunctionDeclarationInstantiation" id="_ref_7663"><a href="ordinary-and-exotic-objects-behaviours.html#sec-functiondeclarationinstantiation" class="e-user-code">FunctionDeclarationInstantiation</a></emu-xref>(<var>functionObject</var>, <var>argumentsList</var>).</li><li>Return ?&nbsp;<emu-xref aoid="Evaluation" id="_ref_7664"><a href="syntax-directed-operations.html#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt id="_ref_22353"><a href="ecmascript-language-functions-and-classes.html#prod-ExpressionBody">ExpressionBody</a></emu-nt>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-runtime-semantics-instantiatearrowfunctionexpression" type="sdo" aoid="InstantiateArrowFunctionExpression">
<h1><span class="secnum">15.3.4</span> Runtime Semantics: InstantiateArrowFunctionExpression</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7665"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> InstantiateArrowFunctionExpression takes optional argument <var>name</var> (a <emu-xref href="#property-key" id="_ref_7666"><a href="ecmascript-data-types-and-values.html#property-key">property key</a></emu-xref> or a <emu-xref href="#sec-private-names" id="_ref_7667"><a href="ecmascript-data-types-and-values.html#sec-private-names">Private Name</a></emu-xref>) and returns an ECMAScript <emu-xref href="#function-object" id="_ref_7668"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="ArrowFunction" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ieeod2mi" id="prod-C8uAwDLj">
<emu-nt id="_ref_22354"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a></emu-nt>
<emu-t>=&gt;</emu-t>
<emu-nt id="_ref_22355"><a href="ecmascript-language-functions-and-classes.html#prod-ConciseBody">ConciseBody</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <var>name</var> is not present, set <var>name</var> to <emu-val>""</emu-val>.</li><li>Let <var>env</var> be the LexicalEnvironment of the <emu-xref href="#running-execution-context" id="_ref_7669"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>.</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_7670"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7671"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22356"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a></emu-nt>.</li><li id="step-arrowfunction-evaluation-functioncreate">Let <var>closure</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7672"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-function-prototype-object" id="_ref_7673"><a href="fundamental-objects.html#sec-properties-of-the-function-prototype-object">%Function.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_22357"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a></emu-nt>, <emu-nt id="_ref_22358"><a href="ecmascript-language-functions-and-classes.html#prod-ConciseBody">ConciseBody</a></emu-nt>, <emu-const>lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7674"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>closure</var>, <var>name</var>).</li><li>Return <var>closure</var>.</li></ol></emu-alg>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>An <emu-nt id="_ref_22359"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a></emu-nt> does not define local bindings for <code>arguments</code>, <code>super</code>, <code>this</code>, or <code>new.target</code>. Any reference to <code>arguments</code>, <code>super</code>, <code>this</code>, or <code>new.target</code> within an <emu-nt id="_ref_22360"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a></emu-nt> must resolve to a binding in a lexically enclosing environment. Typically this will be the Function Environment of an immediately enclosing function. Even though an <emu-nt id="_ref_22361"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a></emu-nt> may contain references to <code>super</code>, the <emu-xref href="#function-object" id="_ref_7675"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref> created in step <emu-xref href="#step-arrowfunction-evaluation-functioncreate" id="_ref_467"><a href="ecmascript-language-functions-and-classes.html#step-arrowfunction-evaluation-functioncreate">5</a></emu-xref> is not made into a method by performing <emu-xref aoid="MakeMethod" id="_ref_7676"><a href="ordinary-and-exotic-objects-behaviours.html#sec-makemethod">MakeMethod</a></emu-xref>. An <emu-nt id="_ref_22362"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a></emu-nt> that references <code>super</code> is always contained within a non-<emu-nt id="_ref_22363"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a></emu-nt> and the necessary state to implement <code>super</code> is accessible via the <var>env</var> that is captured by the <emu-xref href="#function-object" id="_ref_7677"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref> of the <emu-nt id="_ref_22364"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a></emu-nt>.</p>
</div></emu-note>
</emu-clause>
<emu-clause id="sec-arrow-function-definitions-runtime-semantics-evaluation" type="sdo">
<h1><span class="secnum">15.3.5</span> Runtime Semantics: Evaluation</h1>
<emu-grammar><emu-production name="ArrowFunction" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ieeod2mi" id="prod-_r8vevEJ">
<emu-nt id="_ref_22365"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowParameters">ArrowParameters</a></emu-nt>
<emu-t>=&gt;</emu-t>
<emu-nt id="_ref_22366"><a href="ecmascript-language-functions-and-classes.html#prod-ConciseBody">ConciseBody</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="InstantiateArrowFunctionExpression" id="_ref_7678"><a href="ecmascript-language-functions-and-classes.html#sec-runtime-semantics-instantiatearrowfunctionexpression">InstantiateArrowFunctionExpression</a></emu-xref> of <emu-nt id="_ref_22367"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ExpressionBody" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ExpressionBody">ExpressionBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="1px9pijq" id="prod-K1YpROJJ"><emu-nt id="_ref_22368"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>exprRef</var> be ?&nbsp;<emu-xref aoid="Evaluation" id="_ref_7679"><a href="syntax-directed-operations.html#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt id="_ref_22369"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>.</li><li>Let <var>exprValue</var> be ?&nbsp;<emu-xref aoid="GetValue" id="_ref_7680"><a href="ecmascript-data-types-and-values.html#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>exprRef</var>).</li><li>Return <emu-xref aoid="ReturnCompletion" id="_ref_7681"><a href="ecmascript-data-types-and-values.html#sec-returncompletion">ReturnCompletion</a></emu-xref>(<var>exprValue</var>).</li></ol></emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-method-definitions">
<h1><span class="secnum">15.4</span> Method Definitions</h1>
<h2>Syntax</h2>
<emu-grammar type="definition"><emu-production name="MethodDefinition" params="Yield, Await" id="prod-MethodDefinition">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="zqbkmnaz" id="prod-BMcTBp4V">
<emu-nt params="?Yield, ?Await" id="_ref_22370"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt params="~Yield, ~Await" id="_ref_22371"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a><emu-mods><emu-params>[~Yield, ~Await]</emu-params></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt params="~Yield, ~Await" id="_ref_22372"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a><emu-mods><emu-params>[~Yield, ~Await]</emu-params></emu-mods></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="uivm4t30" id="prod-p-hcBiIQ">
<emu-nt params="?Yield, ?Await" id="_ref_22373"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorMethod">GeneratorMethod</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
<emu-rhs a="l4rbqexd" id="prod-SD1i1opG">
<emu-nt params="?Yield, ?Await" id="_ref_22374"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncMethod">AsyncMethod</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
<emu-rhs a="2nx0uygb" id="prod-y0j2wcW4">
<emu-nt params="?Yield, ?Await" id="_ref_22375"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorMethod">AsyncGeneratorMethod</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
<emu-rhs a="jjr3zjnj" id="prod-SnKN_cew">
<emu-t>get</emu-t>
<emu-nt params="?Yield, ?Await" id="_ref_22376"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt params="~Yield, ~Await" id="_ref_22377"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a><emu-mods><emu-params>[~Yield, ~Await]</emu-params></emu-mods></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="lrypae2k" id="prod-nWs7csn9">
<emu-t>set</emu-t>
<emu-nt params="?Yield, ?Await" id="_ref_22378"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22379"><a href="ecmascript-language-functions-and-classes.html#prod-PropertySetParameterList">PropertySetParameterList</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt params="~Yield, ~Await" id="_ref_22380"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a><emu-mods><emu-params>[~Yield, ~Await]</emu-params></emu-mods></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="PropertySetParameterList" id="prod-PropertySetParameterList">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-PropertySetParameterList">PropertySetParameterList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="p0ls10ix" id="prod-KB8f5_em">
<emu-nt params="~Yield, ~Await" id="_ref_22381"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameter">FormalParameter</a><emu-mods><emu-params>[~Yield, ~Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-clause id="sec-method-definitions-static-semantics-early-errors">
<h1><span class="secnum">15.4.1</span> Static Semantics: Early Errors</h1>
<emu-grammar><emu-production name="MethodDefinition" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="f2ayx1_q">
<emu-nt id="_ref_22382"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22383"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22384"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>
It is a Syntax Error if <emu-xref aoid="FunctionBodyContainsUseStrict" id="_ref_7682"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-functionbodycontainsusestrict">FunctionBodyContainsUseStrict</a></emu-xref> of <emu-nt id="_ref_22385"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> is <emu-val>true</emu-val> and <emu-xref aoid="IsSimpleParameterList" id="_ref_7683"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-issimpleparameterlist">IsSimpleParameterList</a></emu-xref> of <emu-nt id="_ref_22386"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> is <emu-val>false</emu-val>.
</li>
<li>
It is a Syntax Error if any element of the <emu-xref aoid="BoundNames" id="_ref_7684"><a href="syntax-directed-operations.html#sec-static-semantics-boundnames">BoundNames</a></emu-xref> of <emu-nt id="_ref_22387"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> also occurs in the <emu-xref aoid="LexicallyDeclaredNames" id="_ref_7685"><a href="syntax-directed-operations.html#sec-static-semantics-lexicallydeclarednames">LexicallyDeclaredNames</a></emu-xref> of <emu-nt id="_ref_22388"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>.
</li>
</ul>
<emu-grammar><emu-production name="MethodDefinition" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="lbu40xzc">
<emu-t>set</emu-t>
<emu-nt id="_ref_22389"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22390"><a href="ecmascript-language-functions-and-classes.html#prod-PropertySetParameterList">PropertySetParameterList</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22391"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>
It is a Syntax Error if the <emu-xref aoid="BoundNames" id="_ref_7686"><a href="syntax-directed-operations.html#sec-static-semantics-boundnames">BoundNames</a></emu-xref> of <emu-nt id="_ref_22392"><a href="ecmascript-language-functions-and-classes.html#prod-PropertySetParameterList">PropertySetParameterList</a></emu-nt> contains any duplicate elements.
</li>
<li>
It is a Syntax Error if <emu-xref aoid="FunctionBodyContainsUseStrict" id="_ref_7687"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-functionbodycontainsusestrict">FunctionBodyContainsUseStrict</a></emu-xref> of <emu-nt id="_ref_22393"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> is <emu-val>true</emu-val> and <emu-xref aoid="IsSimpleParameterList" id="_ref_7688"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-issimpleparameterlist">IsSimpleParameterList</a></emu-xref> of <emu-nt id="_ref_22394"><a href="ecmascript-language-functions-and-classes.html#prod-PropertySetParameterList">PropertySetParameterList</a></emu-nt> is <emu-val>false</emu-val>.
</li>
<li>
It is a Syntax Error if any element of the <emu-xref aoid="BoundNames" id="_ref_7689"><a href="syntax-directed-operations.html#sec-static-semantics-boundnames">BoundNames</a></emu-xref> of <emu-nt id="_ref_22395"><a href="ecmascript-language-functions-and-classes.html#prod-PropertySetParameterList">PropertySetParameterList</a></emu-nt> also occurs in the <emu-xref aoid="LexicallyDeclaredNames" id="_ref_7690"><a href="syntax-directed-operations.html#sec-static-semantics-lexicallydeclarednames">LexicallyDeclaredNames</a></emu-xref> of <emu-nt id="_ref_22396"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>.
</li>
</ul>
</emu-clause>
<emu-clause id="sec-static-semantics-hasdirectsuper" oldids="sec-method-definitions-static-semantics-hasdirectsuper,sec-generator-function-definitions-static-semantics-hasdirectsuper,sec-async-generator-function-definitions-static-semantics-hasdirectsuper,sec-async-function-definitions-static-semantics-HasDirectSuper" type="sdo" aoid="HasDirectSuper"><span id="sec-async-function-definitions-static-semantics-HasDirectSuper"></span><span id="sec-async-generator-function-definitions-static-semantics-hasdirectsuper"></span><span id="sec-generator-function-definitions-static-semantics-hasdirectsuper"></span><span id="sec-method-definitions-static-semantics-hasdirectsuper"></span>
<h1><span class="secnum">15.4.2</span> Static Semantics: HasDirectSuper</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7691"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> HasDirectSuper takes no arguments and returns a Boolean. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="MethodDefinition" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="f2ayx1_q" id="prod-IjiMaa22">
<emu-nt id="_ref_22397"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22398"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22399"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <emu-nt id="_ref_22400"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7692"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22401"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-nt id="_ref_22402"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7693"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22403"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="MethodDefinition" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="s7vk7pda" id="prod-DQeOw0IT">
<emu-t>get</emu-t>
<emu-nt id="_ref_22404"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22405"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-nt id="_ref_22406"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7694"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22407"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="MethodDefinition" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="lbu40xzc" id="prod-H05PoHaH">
<emu-t>set</emu-t>
<emu-nt id="_ref_22408"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22409"><a href="ecmascript-language-functions-and-classes.html#prod-PropertySetParameterList">PropertySetParameterList</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22410"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <emu-nt id="_ref_22411"><a href="ecmascript-language-functions-and-classes.html#prod-PropertySetParameterList">PropertySetParameterList</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7695"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22412"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-nt id="_ref_22413"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7696"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22414"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="GeneratorMethod" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorMethod">GeneratorMethod</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="e6yupcp1" id="prod-u4Tk9i08">
<emu-t>*</emu-t>
<emu-nt id="_ref_22415"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22416"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22417"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <emu-nt id="_ref_22418"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7697"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22419"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-nt id="_ref_22420"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7698"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22421"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="AsyncGeneratorMethod" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorMethod">AsyncGeneratorMethod</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="2edb8sar" id="prod-OGEtsTHJ">
<emu-t>async</emu-t>
<emu-t>*</emu-t>
<emu-nt id="_ref_22422"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22423"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22424"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <emu-nt id="_ref_22425"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7699"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22426"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-nt id="_ref_22427"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7700"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22428"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="AsyncMethod" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncMethod">AsyncMethod</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="cfy3_9l8" id="prod-p8Pkhz62">
<emu-t>async</emu-t>
<emu-nt id="_ref_22429"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22430"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22431"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <emu-nt id="_ref_22432"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7701"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22433"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-nt id="_ref_22434"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7702"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22435"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-static-semantics-specialmethod" type="sdo" aoid="SpecialMethod">
<h1><span class="secnum">15.4.3</span> Static Semantics: SpecialMethod</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7703"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> SpecialMethod takes no arguments and returns a Boolean. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="MethodDefinition" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="f2ayx1_q" id="prod-pvkrotoO">
<emu-nt id="_ref_22436"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22437"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22438"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="MethodDefinition">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uv5zsffy" id="prod-rP4adc9Q">
<emu-nt id="_ref_22439"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorMethod">GeneratorMethod</a></emu-nt>
</emu-rhs>
<emu-rhs a="pbphxm47" id="prod-YxKa5Jjx">
<emu-nt id="_ref_22440"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncMethod">AsyncMethod</a></emu-nt>
</emu-rhs>
<emu-rhs a="gbmuvro8" id="prod-0jHLXbe4">
<emu-nt id="_ref_22441"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorMethod">AsyncGeneratorMethod</a></emu-nt>
</emu-rhs>
<emu-rhs a="s7vk7pda" id="prod-wnqbOfrS">
<emu-t>get</emu-t>
<emu-nt id="_ref_22442"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22443"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="lbu40xzc" id="prod-9m8VG-FD">
<emu-t>set</emu-t>
<emu-nt id="_ref_22444"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22445"><a href="ecmascript-language-functions-and-classes.html#prod-PropertySetParameterList">PropertySetParameterList</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22446"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-runtime-semantics-definemethod" type="sdo" aoid="DefineMethod">
<h1><span class="secnum">15.4.4</span> Runtime Semantics: DefineMethod</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7704"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> DefineMethod takes argument <var>object</var> (an Object) and optional argument <var>functionPrototype</var> (an Object) and returns either a <emu-xref href="#sec-completion-record-specification-type" id="_ref_7705"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">normal completion containing</a></emu-xref> a <emu-xref href="#sec-list-and-record-specification-type" id="_ref_7706"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">Record</a></emu-xref> with fields <var class="field">[[Key]]</var> (a <emu-xref href="#property-key" id="_ref_7707"><a href="ecmascript-data-types-and-values.html#property-key">property key</a></emu-xref>) and <var class="field">[[Closure]]</var> (an ECMAScript <emu-xref href="#function-object" id="_ref_7708"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>) or an <emu-xref href="#sec-completion-record-specification-type" id="_ref_7709"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="MethodDefinition" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="f2ayx1_q" id="prod-VntM4j0E">
<emu-nt id="_ref_22447"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22448"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22449"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>propKey</var> be ?&nbsp;<emu-xref aoid="Evaluation" id="_ref_7710"><a href="syntax-directed-operations.html#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt id="_ref_22450"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>.</li><li>Let <var>env</var> be the <emu-xref href="#running-execution-context" id="_ref_7711"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s LexicalEnvironment.</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_7712"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>If <var>functionPrototype</var> is present, then<ol><li>Let <var>prototype</var> be <var>functionPrototype</var>.</li></ol></li><li>Else,<ol><li>Let <var>prototype</var> be <emu-xref href="#sec-properties-of-the-function-prototype-object" id="_ref_7713"><a href="fundamental-objects.html#sec-properties-of-the-function-prototype-object">%Function.prototype%</a></emu-xref>.</li></ol></li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7714"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22451"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt>.</li><li>Let <var>closure</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7715"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<var>prototype</var>, <var>sourceText</var>, <emu-nt id="_ref_22452"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>, <emu-nt id="_ref_22453"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="MakeMethod" id="_ref_7716"><a href="ordinary-and-exotic-objects-behaviours.html#sec-makemethod">MakeMethod</a></emu-xref>(<var>closure</var>, <var>object</var>).</li><li>Return the <emu-xref href="#sec-list-and-record-specification-type" id="_ref_7717"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">Record</a></emu-xref> { <var class="field">[[Key]]</var>: <var>propKey</var>, <var class="field">[[Closure]]</var>: <var>closure</var>&nbsp;}.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-runtime-semantics-methoddefinitionevaluation" oldids="sec-method-definitions-runtime-semantics-propertydefinitionevaluation,sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation,sec-asyncgenerator-definitions-propertydefinitionevaluation,sec-async-function-definitions-PropertyDefinitionEvaluation" type="sdo" aoid="MethodDefinitionEvaluation"><span id="sec-async-function-definitions-PropertyDefinitionEvaluation"></span><span id="sec-asyncgenerator-definitions-propertydefinitionevaluation"></span><span id="sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation"></span><span id="sec-method-definitions-runtime-semantics-propertydefinitionevaluation"></span>
<h1><span class="secnum">15.4.5</span> Runtime Semantics: MethodDefinitionEvaluation</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7718"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> MethodDefinitionEvaluation takes arguments <var>object</var> (an Object) and <var>enumerable</var> (a Boolean) and returns either a <emu-xref href="#sec-completion-record-specification-type" id="_ref_7719"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">normal completion containing</a></emu-xref> either a <emu-xref href="#sec-privateelement-specification-type" id="_ref_7720"><a href="ecmascript-data-types-and-values.html#sec-privateelement-specification-type">PrivateElement</a></emu-xref> or <emu-const>unused</emu-const>, or an <emu-xref href="#sec-completion-record-specification-type" id="_ref_7721"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="MethodDefinition" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="f2ayx1_q" id="prod-w_uDCOXP">
<emu-nt id="_ref_22454"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22455"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22456"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>methodDef</var> be ?&nbsp;<emu-xref aoid="DefineMethod" id="_ref_7722"><a href="ecmascript-language-functions-and-classes.html#sec-runtime-semantics-definemethod" class="e-user-code">DefineMethod</a></emu-xref> of <emu-nt id="_ref_22457"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> with argument <var>object</var>.</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7723"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>methodDef</var>.<var class="field">[[Closure]]</var>, <var>methodDef</var>.<var class="field">[[Key]]</var>).</li><li>Return ?&nbsp;<emu-xref aoid="DefineMethodProperty" id="_ref_7724"><a href="ordinary-and-exotic-objects-behaviours.html#sec-definemethodproperty" class="e-user-code">DefineMethodProperty</a></emu-xref>(<var>object</var>, <var>methodDef</var>.<var class="field">[[Key]]</var>, <var>methodDef</var>.<var class="field">[[Closure]]</var>, <var>enumerable</var>).</li></ol></emu-alg>
<emu-grammar><emu-production name="MethodDefinition" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="s7vk7pda" id="prod-JtMhObe9">
<emu-t>get</emu-t>
<emu-nt id="_ref_22458"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22459"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>propKey</var> be ?&nbsp;<emu-xref aoid="Evaluation" id="_ref_7725"><a href="syntax-directed-operations.html#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt id="_ref_22460"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>.</li><li>Let <var>env</var> be the <emu-xref href="#running-execution-context" id="_ref_7726"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s LexicalEnvironment.</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_7727"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7728"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22461"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt>.</li><li>Let <var>formalParameterList</var> be an instance of the production <emu-grammar><emu-production name="FormalParameters" collapsed="" class=" inline">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="n7nathbb"><emu-gann>[empty]</emu-gann></emu-rhs>
</emu-production>
</emu-grammar>.</li><li>Let <var>closure</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7729"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-function-prototype-object" id="_ref_7730"><a href="fundamental-objects.html#sec-properties-of-the-function-prototype-object">%Function.prototype%</a></emu-xref>, <var>sourceText</var>, <var>formalParameterList</var>, <emu-nt id="_ref_22462"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="MakeMethod" id="_ref_7731"><a href="ordinary-and-exotic-objects-behaviours.html#sec-makemethod">MakeMethod</a></emu-xref>(<var>closure</var>, <var>object</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7732"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>closure</var>, <var>propKey</var>, <emu-val>"get"</emu-val>).</li><li>If <var>propKey</var> is a <emu-xref href="#sec-private-names" id="_ref_7733"><a href="ecmascript-data-types-and-values.html#sec-private-names">Private Name</a></emu-xref>, then<ol><li>Return <emu-xref href="#sec-privateelement-specification-type" id="_ref_7734"><a href="ecmascript-data-types-and-values.html#sec-privateelement-specification-type">PrivateElement</a></emu-xref> { <var class="field">[[Key]]</var>: <var>propKey</var>, <var class="field">[[Kind]]</var>: <emu-const>accessor</emu-const>, <var class="field">[[Get]]</var>: <var>closure</var>, <var class="field">[[Set]]</var>: <emu-val>undefined</emu-val>&nbsp;}.</li></ol></li><li>Let <var>desc</var> be the PropertyDescriptor { <var class="field">[[Get]]</var>: <var>closure</var>, <var class="field">[[Enumerable]]</var>: <var>enumerable</var>, <var class="field">[[Configurable]]</var>: <emu-val>true</emu-val>&nbsp;}.</li><li>Perform ?&nbsp;<emu-xref aoid="DefinePropertyOrThrow" id="_ref_7735"><a href="abstract-operations.html#sec-definepropertyorthrow" class="e-user-code">DefinePropertyOrThrow</a></emu-xref>(<var>object</var>, <var>propKey</var>, <var>desc</var>).</li><li>Return <emu-const>unused</emu-const>.</li></ol></emu-alg>
<emu-grammar><emu-production name="MethodDefinition" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="lbu40xzc" id="prod-tr90svxc">
<emu-t>set</emu-t>
<emu-nt id="_ref_22463"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22464"><a href="ecmascript-language-functions-and-classes.html#prod-PropertySetParameterList">PropertySetParameterList</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22465"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>propKey</var> be ?&nbsp;<emu-xref aoid="Evaluation" id="_ref_7736"><a href="syntax-directed-operations.html#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt id="_ref_22466"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>.</li><li>Let <var>env</var> be the <emu-xref href="#running-execution-context" id="_ref_7737"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s LexicalEnvironment.</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_7738"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7739"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22467"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt>.</li><li>Let <var>closure</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7740"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-function-prototype-object" id="_ref_7741"><a href="fundamental-objects.html#sec-properties-of-the-function-prototype-object">%Function.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_22468"><a href="ecmascript-language-functions-and-classes.html#prod-PropertySetParameterList">PropertySetParameterList</a></emu-nt>, <emu-nt id="_ref_22469"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="MakeMethod" id="_ref_7742"><a href="ordinary-and-exotic-objects-behaviours.html#sec-makemethod">MakeMethod</a></emu-xref>(<var>closure</var>, <var>object</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7743"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>closure</var>, <var>propKey</var>, <emu-val>"set"</emu-val>).</li><li>If <var>propKey</var> is a <emu-xref href="#sec-private-names" id="_ref_7744"><a href="ecmascript-data-types-and-values.html#sec-private-names">Private Name</a></emu-xref>, then<ol><li>Return <emu-xref href="#sec-privateelement-specification-type" id="_ref_7745"><a href="ecmascript-data-types-and-values.html#sec-privateelement-specification-type">PrivateElement</a></emu-xref> { <var class="field">[[Key]]</var>: <var>propKey</var>, <var class="field">[[Kind]]</var>: <emu-const>accessor</emu-const>, <var class="field">[[Get]]</var>: <emu-val>undefined</emu-val>, <var class="field">[[Set]]</var>: <var>closure</var>&nbsp;}.</li></ol></li><li>Let <var>desc</var> be the PropertyDescriptor { <var class="field">[[Set]]</var>: <var>closure</var>, <var class="field">[[Enumerable]]</var>: <var>enumerable</var>, <var class="field">[[Configurable]]</var>: <emu-val>true</emu-val>&nbsp;}.</li><li>Perform ?&nbsp;<emu-xref aoid="DefinePropertyOrThrow" id="_ref_7746"><a href="abstract-operations.html#sec-definepropertyorthrow" class="e-user-code">DefinePropertyOrThrow</a></emu-xref>(<var>object</var>, <var>propKey</var>, <var>desc</var>).</li><li>Return <emu-const>unused</emu-const>.</li></ol></emu-alg>
<emu-grammar><emu-production name="GeneratorMethod" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorMethod">GeneratorMethod</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="e6yupcp1" id="prod-qDk-XFAF">
<emu-t>*</emu-t>
<emu-nt id="_ref_22470"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22471"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22472"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>propKey</var> be ?&nbsp;<emu-xref aoid="Evaluation" id="_ref_7747"><a href="syntax-directed-operations.html#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt id="_ref_22473"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>.</li><li>Let <var>env</var> be the <emu-xref href="#running-execution-context" id="_ref_7748"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s LexicalEnvironment.</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_7749"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7750"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22474"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorMethod">GeneratorMethod</a></emu-nt>.</li><li>Let <var>closure</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7751"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-generatorfunction-prototype-object" id="_ref_7752"><a href="control-abstraction-objects.html#sec-properties-of-the-generatorfunction-prototype-object">%GeneratorFunction.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_22475"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>, <emu-nt id="_ref_22476"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="MakeMethod" id="_ref_7753"><a href="ordinary-and-exotic-objects-behaviours.html#sec-makemethod">MakeMethod</a></emu-xref>(<var>closure</var>, <var>object</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7754"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>closure</var>, <var>propKey</var>).</li><li>Let <var>prototype</var> be <emu-xref aoid="OrdinaryObjectCreate" id="_ref_7755"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryobjectcreate">OrdinaryObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-generator-prototype" id="_ref_7756"><a href="control-abstraction-objects.html#sec-properties-of-generator-prototype">%GeneratorPrototype%</a></emu-xref>).</li><li>Perform !&nbsp;<emu-xref aoid="DefinePropertyOrThrow" id="_ref_7757"><a href="abstract-operations.html#sec-definepropertyorthrow">DefinePropertyOrThrow</a></emu-xref>(<var>closure</var>, <emu-val>"prototype"</emu-val>, PropertyDescriptor { <var class="field">[[Value]]</var>: <var>prototype</var>, <var class="field">[[Writable]]</var>: <emu-val>true</emu-val>, <var class="field">[[Enumerable]]</var>: <emu-val>false</emu-val>, <var class="field">[[Configurable]]</var>: <emu-val>false</emu-val>&nbsp;}).</li><li>Return ?&nbsp;<emu-xref aoid="DefineMethodProperty" id="_ref_7758"><a href="ordinary-and-exotic-objects-behaviours.html#sec-definemethodproperty" class="e-user-code">DefineMethodProperty</a></emu-xref>(<var>object</var>, <var>propKey</var>, <var>closure</var>, <var>enumerable</var>).</li></ol></emu-alg>
<emu-grammar><emu-production name="AsyncGeneratorMethod" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorMethod">AsyncGeneratorMethod</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="2edb8sar" id="prod-lPECR135">
<emu-t>async</emu-t>
<emu-t>*</emu-t>
<emu-nt id="_ref_22477"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22478"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22479"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>propKey</var> be ?&nbsp;<emu-xref aoid="Evaluation" id="_ref_7759"><a href="syntax-directed-operations.html#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt id="_ref_22480"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>.</li><li>Let <var>env</var> be the <emu-xref href="#running-execution-context" id="_ref_7760"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s LexicalEnvironment.</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_7761"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7762"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22481"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorMethod">AsyncGeneratorMethod</a></emu-nt>.</li><li>Let <var>closure</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7763"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-asyncgeneratorfunction-prototype" id="_ref_7764"><a href="control-abstraction-objects.html#sec-properties-of-asyncgeneratorfunction-prototype">%AsyncGeneratorFunction.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_22482"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>, <emu-nt id="_ref_22483"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="MakeMethod" id="_ref_7765"><a href="ordinary-and-exotic-objects-behaviours.html#sec-makemethod">MakeMethod</a></emu-xref>(<var>closure</var>, <var>object</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7766"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>closure</var>, <var>propKey</var>).</li><li>Let <var>prototype</var> be <emu-xref aoid="OrdinaryObjectCreate" id="_ref_7767"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryobjectcreate">OrdinaryObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-asyncgenerator-prototype" id="_ref_7768"><a href="control-abstraction-objects.html#sec-properties-of-asyncgenerator-prototype">%AsyncGeneratorPrototype%</a></emu-xref>).</li><li>Perform !&nbsp;<emu-xref aoid="DefinePropertyOrThrow" id="_ref_7769"><a href="abstract-operations.html#sec-definepropertyorthrow">DefinePropertyOrThrow</a></emu-xref>(<var>closure</var>, <emu-val>"prototype"</emu-val>, PropertyDescriptor { <var class="field">[[Value]]</var>: <var>prototype</var>, <var class="field">[[Writable]]</var>: <emu-val>true</emu-val>, <var class="field">[[Enumerable]]</var>: <emu-val>false</emu-val>, <var class="field">[[Configurable]]</var>: <emu-val>false</emu-val>&nbsp;}).</li><li>Return ?&nbsp;<emu-xref aoid="DefineMethodProperty" id="_ref_7770"><a href="ordinary-and-exotic-objects-behaviours.html#sec-definemethodproperty" class="e-user-code">DefineMethodProperty</a></emu-xref>(<var>object</var>, <var>propKey</var>, <var>closure</var>, <var>enumerable</var>).</li></ol></emu-alg>
<emu-grammar><emu-production name="AsyncMethod" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncMethod">AsyncMethod</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="cfy3_9l8" id="prod-a75_jVUN">
<emu-t>async</emu-t>
<emu-nt id="_ref_22484"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22485"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22486"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>propKey</var> be ?&nbsp;<emu-xref aoid="Evaluation" id="_ref_7771"><a href="syntax-directed-operations.html#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt id="_ref_22487"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>.</li><li>Let <var>env</var> be the LexicalEnvironment of the <emu-xref href="#running-execution-context" id="_ref_7772"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>.</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_7773"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7774"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22488"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncMethod">AsyncMethod</a></emu-nt>.</li><li>Let <var>closure</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7775"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-async-function-prototype-properties" id="_ref_7776"><a href="control-abstraction-objects.html#sec-async-function-prototype-properties">%AsyncFunction.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_22489"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>, <emu-nt id="_ref_22490"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="MakeMethod" id="_ref_7777"><a href="ordinary-and-exotic-objects-behaviours.html#sec-makemethod">MakeMethod</a></emu-xref>(<var>closure</var>, <var>object</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7778"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>closure</var>, <var>propKey</var>).</li><li>Return ?&nbsp;<emu-xref aoid="DefineMethodProperty" id="_ref_7779"><a href="ordinary-and-exotic-objects-behaviours.html#sec-definemethodproperty" class="e-user-code">DefineMethodProperty</a></emu-xref>(<var>object</var>, <var>propKey</var>, <var>closure</var>, <var>enumerable</var>).</li></ol></emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-generator-function-definitions">
<h1><span class="secnum">15.5</span> Generator Function Definitions</h1>
<h2>Syntax</h2>
<emu-grammar type="definition"><emu-production name="GeneratorDeclaration" params="Yield, Await, Default" id="prod-GeneratorDeclaration">
<emu-nt params="Yield, Await, Default"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorDeclaration">GeneratorDeclaration</a><emu-mods><emu-params>[Yield, Await, Default]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="56abocni" id="prod-oJNsRhfl">
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt params="?Yield, ?Await" id="_ref_22491"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt params="+Yield, ~Await" id="_ref_22492"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[+Yield, ~Await]</emu-params></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22493"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="gcxlonl8" constraints="+Default" id="prod-bWfHg6Xe"><emu-constraints>[+Default]</emu-constraints>
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-t>(</emu-t>
<emu-nt params="+Yield, ~Await" id="_ref_22494"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[+Yield, ~Await]</emu-params></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22495"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="GeneratorExpression" id="prod-GeneratorExpression">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="zsu4etlj" id="prod-haubt72j">
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt params="+Yield, ~Await" optional="" id="_ref_22496"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[+Yield, ~Await]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt params="+Yield, ~Await" id="_ref_22497"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[+Yield, ~Await]</emu-params></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22498"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="GeneratorMethod" params="Yield, Await" id="prod-GeneratorMethod">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorMethod">GeneratorMethod</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="s6ntmoac" id="prod-8GV2khgE">
<emu-t>*</emu-t>
<emu-nt params="?Yield, ?Await" id="_ref_22499"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt params="+Yield, ~Await" id="_ref_22500"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a><emu-mods><emu-params>[+Yield, ~Await]</emu-params></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22501"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="GeneratorBody" id="prod-GeneratorBody">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="quvqn30c" id="prod-PKmJj3Nf">
<emu-nt params="+Yield, ~Await" id="_ref_22502"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a><emu-mods><emu-params>[+Yield, ~Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="YieldExpression" params="In, Await" id="prod-YieldExpression">
<emu-nt params="In, Await"><a href="ecmascript-language-functions-and-classes.html#prod-YieldExpression">YieldExpression</a><emu-mods><emu-params>[In, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="0d8zyjn8" id="prod-Ldhpu6QZ">
<emu-t>yield</emu-t>
</emu-rhs>
<emu-rhs a="alznzlpx" id="prod-eT7GKT7i">
<emu-t>yield</emu-t>
<emu-gann>[no <emu-nt id="_ref_22503"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
<emu-nt params="?In, +Yield, ?Await" id="_ref_22504"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a><emu-mods><emu-params>[?In, +Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
<emu-rhs a="mrbi6v84" id="prod-iAdFfqlf">
<emu-t>yield</emu-t>
<emu-gann>[no <emu-nt id="_ref_22505"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
<emu-t>*</emu-t>
<emu-nt params="?In, +Yield, ?Await" id="_ref_22506"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a><emu-mods><emu-params>[?In, +Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-note><span class="note">Note 1</span><div class="note-contents">
<p>The syntactic context immediately following <code>yield</code> requires use of the <emu-nt id="_ref_22507"><a href="ecmascript-language-lexical-grammar.html#prod-InputElementRegExpOrTemplateTail">InputElementRegExpOrTemplateTail</a></emu-nt> lexical goal.</p>
</div></emu-note>
<emu-note><span class="note">Note 2</span><div class="note-contents">
<p><emu-nt id="_ref_22508"><a href="ecmascript-language-functions-and-classes.html#prod-YieldExpression">YieldExpression</a></emu-nt> cannot be used within the <emu-nt id="_ref_22509"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> of a generator function because any expressions that are part of <emu-nt id="_ref_22510"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> are evaluated before the resulting Generator is in a resumable state.</p>
</div></emu-note>
<emu-note><span class="note">Note 3</span><div class="note-contents">
<p><emu-xref href="#sec-algorithm-conventions-abstract-operations" id="_ref_7780"><a href="notational-conventions.html#sec-algorithm-conventions-abstract-operations">Abstract operations</a></emu-xref> relating to Generators are defined in <emu-xref href="#sec-generator-abstract-operations" id="_ref_468"><a href="control-abstraction-objects.html#sec-generator-abstract-operations">27.5.3</a></emu-xref>.</p>
</div></emu-note>
<emu-clause id="sec-generator-function-definitions-static-semantics-early-errors">
<h1><span class="secnum">15.5.1</span> Static Semantics: Early Errors</h1>
<emu-grammar><emu-production name="GeneratorMethod" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorMethod">GeneratorMethod</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="e6yupcp1">
<emu-t>*</emu-t>
<emu-nt id="_ref_22511"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22512"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22513"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>
It is a Syntax Error if <emu-xref aoid="HasDirectSuper" id="_ref_7781"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hasdirectsuper">HasDirectSuper</a></emu-xref> of <emu-nt id="_ref_22514"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorMethod">GeneratorMethod</a></emu-nt> is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-nt id="_ref_22515"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7782"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22516"><a href="ecmascript-language-functions-and-classes.html#prod-YieldExpression">YieldExpression</a></emu-nt> is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-xref aoid="FunctionBodyContainsUseStrict" id="_ref_7783"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-functionbodycontainsusestrict">FunctionBodyContainsUseStrict</a></emu-xref> of <emu-nt id="_ref_22517"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt> is <emu-val>true</emu-val> and <emu-xref aoid="IsSimpleParameterList" id="_ref_7784"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-issimpleparameterlist">IsSimpleParameterList</a></emu-xref> of <emu-nt id="_ref_22518"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> is <emu-val>false</emu-val>.
</li>
<li>
It is a Syntax Error if any element of the <emu-xref aoid="BoundNames" id="_ref_7785"><a href="syntax-directed-operations.html#sec-static-semantics-boundnames">BoundNames</a></emu-xref> of <emu-nt id="_ref_22519"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> also occurs in the <emu-xref aoid="LexicallyDeclaredNames" id="_ref_7786"><a href="syntax-directed-operations.html#sec-static-semantics-lexicallydeclarednames">LexicallyDeclaredNames</a></emu-xref> of <emu-nt id="_ref_22520"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>.
</li>
</ul>
<emu-grammar><emu-production name="GeneratorDeclaration">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorDeclaration">GeneratorDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="fbyztjbh">
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt id="_ref_22521"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22522"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22523"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="dsczygsq">
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_22524"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22525"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="GeneratorExpression">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="32ghovyc">
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt optional="" id="_ref_22526"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22527"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22528"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>
If <emu-xref aoid="IsStrict" id="_ref_7787"><a href="ecmascript-language-source-code.html#sec-isstrict">IsStrict</a></emu-xref>(<emu-nt id="_ref_22529"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>) is <emu-val>true</emu-val>, the Early Error rules for <emu-grammar><emu-production name="UniqueFormalParameters" collapsed="" class=" inline">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ahjg9bb6"><emu-nt id="_ref_22530"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar> are applied.
</li>
<li>
If <emu-nt id="_ref_22531"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> is present and <emu-xref aoid="IsStrict" id="_ref_7788"><a href="ecmascript-language-source-code.html#sec-isstrict">IsStrict</a></emu-xref>(<emu-nt id="_ref_22532"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>) is <emu-val>true</emu-val>, it is a Syntax Error if the <emu-xref aoid="StringValue" id="_ref_7789"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22533"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> is either <emu-val>"eval"</emu-val> or <emu-val>"arguments"</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-xref aoid="FunctionBodyContainsUseStrict" id="_ref_7790"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-functionbodycontainsusestrict">FunctionBodyContainsUseStrict</a></emu-xref> of <emu-nt id="_ref_22534"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt> is <emu-val>true</emu-val> and <emu-xref aoid="IsSimpleParameterList" id="_ref_7791"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-issimpleparameterlist">IsSimpleParameterList</a></emu-xref> of <emu-nt id="_ref_22535"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> is <emu-val>false</emu-val>.
</li>
<li>
It is a Syntax Error if any element of the <emu-xref aoid="BoundNames" id="_ref_7792"><a href="syntax-directed-operations.html#sec-static-semantics-boundnames">BoundNames</a></emu-xref> of <emu-nt id="_ref_22536"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> also occurs in the <emu-xref aoid="LexicallyDeclaredNames" id="_ref_7793"><a href="syntax-directed-operations.html#sec-static-semantics-lexicallydeclarednames">LexicallyDeclaredNames</a></emu-xref> of <emu-nt id="_ref_22537"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>.
</li>
<li>
It is a Syntax Error if <emu-nt id="_ref_22538"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7794"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22539"><a href="ecmascript-language-functions-and-classes.html#prod-YieldExpression">YieldExpression</a></emu-nt> is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-nt id="_ref_22540"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7795"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22541"><a href="ecmascript-language-expressions.html#prod-SuperProperty">SuperProperty</a></emu-nt> is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-nt id="_ref_22542"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7796"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22543"><a href="ecmascript-language-expressions.html#prod-SuperProperty">SuperProperty</a></emu-nt> is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-nt id="_ref_22544"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7797"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22545"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt> is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-nt id="_ref_22546"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7798"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22547"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt> is <emu-val>true</emu-val>.
</li>
</ul>
</emu-clause>
<emu-clause id="sec-runtime-semantics-evaluategeneratorbody" oldids="sec-generator-function-definitions-runtime-semantics-evaluatebody" type="sdo" aoid="EvaluateGeneratorBody"><span id="sec-generator-function-definitions-runtime-semantics-evaluatebody"></span>
<h1><span class="secnum">15.5.2</span> Runtime Semantics: EvaluateGeneratorBody</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7799"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> EvaluateGeneratorBody takes arguments <var>functionObject</var> (an ECMAScript <emu-xref href="#function-object" id="_ref_7800"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>) and <var>argumentsList</var> (a <emu-xref href="#sec-list-and-record-specification-type" id="_ref_7801"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-xref href="#sec-ecmascript-language-types" id="_ref_7802"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types">ECMAScript language values</a></emu-xref>) and returns a <emu-xref href="#sec-completion-record-specification-type" id="_ref_7803"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">throw completion</a></emu-xref> or a <emu-xref href="#sec-completion-record-specification-type" id="_ref_7804"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">return completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="GeneratorBody" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="iqzbkm-h" id="prod-LwSgcEYg"><emu-nt id="_ref_22548"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="FunctionDeclarationInstantiation" id="_ref_7805"><a href="ordinary-and-exotic-objects-behaviours.html#sec-functiondeclarationinstantiation" class="e-user-code">FunctionDeclarationInstantiation</a></emu-xref>(<var>functionObject</var>, <var>argumentsList</var>).</li><li>Let <var>G</var> be ?&nbsp;<emu-xref aoid="OrdinaryCreateFromConstructor" id="_ref_7806"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinarycreatefromconstructor" class="e-user-code">OrdinaryCreateFromConstructor</a></emu-xref>(<var>functionObject</var>, <emu-val>"%GeneratorPrototype%"</emu-val>, « <var class="field">[[GeneratorState]]</var>, <var class="field">[[GeneratorContext]]</var>, <var class="field">[[GeneratorBrand]]</var>&nbsp;»).</li><li>Set <var>G</var>.<var class="field">[[GeneratorBrand]]</var> to <emu-const>empty</emu-const>.</li><li>Set <var>G</var>.<var class="field">[[GeneratorState]]</var> to <emu-const>suspended-start</emu-const>.</li><li>Perform <emu-xref aoid="GeneratorStart" id="_ref_7807"><a href="control-abstraction-objects.html#sec-generatorstart">GeneratorStart</a></emu-xref>(<var>G</var>, <emu-nt id="_ref_22549"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>).</li><li>Return <emu-xref aoid="ReturnCompletion" id="_ref_7808"><a href="ecmascript-data-types-and-values.html#sec-returncompletion">ReturnCompletion</a></emu-xref>(<var>G</var>).</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-runtime-semantics-instantiategeneratorfunctionobject" oldids="sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject" type="sdo" aoid="InstantiateGeneratorFunctionObject"><span id="sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject"></span>
<h1><span class="secnum">15.5.3</span> Runtime Semantics: InstantiateGeneratorFunctionObject</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7809"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> InstantiateGeneratorFunctionObject takes arguments <var>env</var> (an <emu-xref href="#sec-environment-records" id="_ref_7810"><a href="executable-code-and-execution-contexts.html#sec-environment-records">Environment Record</a></emu-xref>) and <var>privateEnv</var> (a <emu-xref href="#privateenvironment-record" id="_ref_7811"><a href="executable-code-and-execution-contexts.html#privateenvironment-record">PrivateEnvironment Record</a></emu-xref> or <emu-val>null</emu-val>) and returns an ECMAScript <emu-xref href="#function-object" id="_ref_7812"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="GeneratorDeclaration" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorDeclaration">GeneratorDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="fbyztjbh" id="prod-x_w-E_WI">
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt id="_ref_22550"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22551"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22552"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>name</var> be the <emu-xref aoid="StringValue" id="_ref_7813"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22553"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7814"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22554"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorDeclaration">GeneratorDeclaration</a></emu-nt>.</li><li>Let <var>F</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7815"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-generatorfunction-prototype-object" id="_ref_7816"><a href="control-abstraction-objects.html#sec-properties-of-the-generatorfunction-prototype-object">%GeneratorFunction.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_22555"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>, <emu-nt id="_ref_22556"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7817"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>F</var>, <var>name</var>).</li><li>Let <var>prototype</var> be <emu-xref aoid="OrdinaryObjectCreate" id="_ref_7818"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryobjectcreate">OrdinaryObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-generator-prototype" id="_ref_7819"><a href="control-abstraction-objects.html#sec-properties-of-generator-prototype">%GeneratorPrototype%</a></emu-xref>).</li><li>Perform !&nbsp;<emu-xref aoid="DefinePropertyOrThrow" id="_ref_7820"><a href="abstract-operations.html#sec-definepropertyorthrow">DefinePropertyOrThrow</a></emu-xref>(<var>F</var>, <emu-val>"prototype"</emu-val>, PropertyDescriptor { <var class="field">[[Value]]</var>: <var>prototype</var>, <var class="field">[[Writable]]</var>: <emu-val>true</emu-val>, <var class="field">[[Enumerable]]</var>: <emu-val>false</emu-val>, <var class="field">[[Configurable]]</var>: <emu-val>false</emu-val>&nbsp;}).</li><li>Return <var>F</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="GeneratorDeclaration" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorDeclaration">GeneratorDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="dsczygsq" id="prod-zyQVJwqE">
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_22557"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22558"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7821"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22559"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorDeclaration">GeneratorDeclaration</a></emu-nt>.</li><li>Let <var>F</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7822"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-generatorfunction-prototype-object" id="_ref_7823"><a href="control-abstraction-objects.html#sec-properties-of-the-generatorfunction-prototype-object">%GeneratorFunction.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_22560"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>, <emu-nt id="_ref_22561"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7824"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>F</var>, <emu-val>"default"</emu-val>).</li><li>Let <var>prototype</var> be <emu-xref aoid="OrdinaryObjectCreate" id="_ref_7825"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryobjectcreate">OrdinaryObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-generator-prototype" id="_ref_7826"><a href="control-abstraction-objects.html#sec-properties-of-generator-prototype">%GeneratorPrototype%</a></emu-xref>).</li><li>Perform !&nbsp;<emu-xref aoid="DefinePropertyOrThrow" id="_ref_7827"><a href="abstract-operations.html#sec-definepropertyorthrow">DefinePropertyOrThrow</a></emu-xref>(<var>F</var>, <emu-val>"prototype"</emu-val>, PropertyDescriptor { <var class="field">[[Value]]</var>: <var>prototype</var>, <var class="field">[[Writable]]</var>: <emu-val>true</emu-val>, <var class="field">[[Enumerable]]</var>: <emu-val>false</emu-val>, <var class="field">[[Configurable]]</var>: <emu-val>false</emu-val>&nbsp;}).</li><li>Return <var>F</var>.</li></ol></emu-alg>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>An anonymous <emu-nt id="_ref_22562"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorDeclaration">GeneratorDeclaration</a></emu-nt> can only occur as part of an <code>export default</code> declaration, and its function code is therefore always <emu-xref href="#sec-strict-mode-code" id="_ref_7828"><a href="ecmascript-language-source-code.html#sec-strict-mode-code">strict mode code</a></emu-xref>.</p>
</div></emu-note>
</emu-clause>
<emu-clause id="sec-runtime-semantics-instantiategeneratorfunctionexpression" type="sdo" aoid="InstantiateGeneratorFunctionExpression">
<h1><span class="secnum">15.5.4</span> Runtime Semantics: InstantiateGeneratorFunctionExpression</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7829"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> InstantiateGeneratorFunctionExpression takes optional argument <var>name</var> (a <emu-xref href="#property-key" id="_ref_7830"><a href="ecmascript-data-types-and-values.html#property-key">property key</a></emu-xref> or a <emu-xref href="#sec-private-names" id="_ref_7831"><a href="ecmascript-data-types-and-values.html#sec-private-names">Private Name</a></emu-xref>) and returns an ECMAScript <emu-xref href="#function-object" id="_ref_7832"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="GeneratorExpression" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="dsczygsq" id="prod-FnOrbSnb">
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_22563"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22564"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <var>name</var> is not present, set <var>name</var> to <emu-val>""</emu-val>.</li><li>Let <var>env</var> be the LexicalEnvironment of the <emu-xref href="#running-execution-context" id="_ref_7833"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>.</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_7834"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7835"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22565"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt>.</li><li>Let <var>closure</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7836"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-generatorfunction-prototype-object" id="_ref_7837"><a href="control-abstraction-objects.html#sec-properties-of-the-generatorfunction-prototype-object">%GeneratorFunction.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_22566"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>, <emu-nt id="_ref_22567"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7838"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>closure</var>, <var>name</var>).</li><li>Let <var>prototype</var> be <emu-xref aoid="OrdinaryObjectCreate" id="_ref_7839"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryobjectcreate">OrdinaryObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-generator-prototype" id="_ref_7840"><a href="control-abstraction-objects.html#sec-properties-of-generator-prototype">%GeneratorPrototype%</a></emu-xref>).</li><li>Perform !&nbsp;<emu-xref aoid="DefinePropertyOrThrow" id="_ref_7841"><a href="abstract-operations.html#sec-definepropertyorthrow">DefinePropertyOrThrow</a></emu-xref>(<var>closure</var>, <emu-val>"prototype"</emu-val>, PropertyDescriptor { <var class="field">[[Value]]</var>: <var>prototype</var>, <var class="field">[[Writable]]</var>: <emu-val>true</emu-val>, <var class="field">[[Enumerable]]</var>: <emu-val>false</emu-val>, <var class="field">[[Configurable]]</var>: <emu-val>false</emu-val>&nbsp;}).</li><li>Return <var>closure</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="GeneratorExpression" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="fbyztjbh" id="prod-sxTe1ywL">
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt id="_ref_22568"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22569"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22570"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li><emu-xref href="#assert" id="_ref_7842"><a href="notational-conventions.html#assert">Assert</a></emu-xref>: <var>name</var> is not present.</li><li>Set <var>name</var> to the <emu-xref aoid="StringValue" id="_ref_7843"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22571"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>.</li><li>Let <var>outerEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_7844"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s LexicalEnvironment.</li><li>Let <var>funcEnv</var> be <emu-xref aoid="NewDeclarativeEnvironment" id="_ref_7845"><a href="executable-code-and-execution-contexts.html#sec-newdeclarativeenvironment">NewDeclarativeEnvironment</a></emu-xref>(<var>outerEnv</var>).</li><li>Perform !&nbsp;<var>funcEnv</var>.<emu-xref aoid="CreateImmutableBinding" id="_ref_7846"><a href="executable-code-and-execution-contexts.html#abstract-createimmutablebinding">CreateImmutableBinding</a></emu-xref>(<var>name</var>, <emu-val>false</emu-val>).</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_7847"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7848"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22572"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt>.</li><li>Let <var>closure</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7849"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-generatorfunction-prototype-object" id="_ref_7850"><a href="control-abstraction-objects.html#sec-properties-of-the-generatorfunction-prototype-object">%GeneratorFunction.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_22573"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>, <emu-nt id="_ref_22574"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>funcEnv</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7851"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>closure</var>, <var>name</var>).</li><li>Let <var>prototype</var> be <emu-xref aoid="OrdinaryObjectCreate" id="_ref_7852"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryobjectcreate">OrdinaryObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-generator-prototype" id="_ref_7853"><a href="control-abstraction-objects.html#sec-properties-of-generator-prototype">%GeneratorPrototype%</a></emu-xref>).</li><li>Perform !&nbsp;<emu-xref aoid="DefinePropertyOrThrow" id="_ref_7854"><a href="abstract-operations.html#sec-definepropertyorthrow">DefinePropertyOrThrow</a></emu-xref>(<var>closure</var>, <emu-val>"prototype"</emu-val>, PropertyDescriptor { <var class="field">[[Value]]</var>: <var>prototype</var>, <var class="field">[[Writable]]</var>: <emu-val>true</emu-val>, <var class="field">[[Enumerable]]</var>: <emu-val>false</emu-val>, <var class="field">[[Configurable]]</var>: <emu-val>false</emu-val>&nbsp;}).</li><li>Perform !&nbsp;<var>funcEnv</var>.<emu-xref aoid="InitializeBinding" id="_ref_7855"><a href="executable-code-and-execution-contexts.html#abstract-initializebinding">InitializeBinding</a></emu-xref>(<var>name</var>, <var>closure</var>).</li><li>Return <var>closure</var>.</li></ol></emu-alg>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>The <emu-nt id="_ref_22575"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> in a <emu-nt id="_ref_22576"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt> can be referenced from inside the <emu-nt id="_ref_22577"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt>'s <emu-nt id="_ref_22578"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> to allow the generator code to call itself recursively. However, unlike in a <emu-nt id="_ref_22579"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorDeclaration">GeneratorDeclaration</a></emu-nt>, the <emu-nt id="_ref_22580"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> in a <emu-nt id="_ref_22581"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt> cannot be referenced from and does not affect the scope enclosing the <emu-nt id="_ref_22582"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt>.</p>
</div></emu-note>
</emu-clause>
<emu-clause id="sec-generator-function-definitions-runtime-semantics-evaluation" type="sdo">
<h1><span class="secnum">15.5.5</span> Runtime Semantics: Evaluation</h1>
<emu-grammar><emu-production name="GeneratorExpression" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="32ghovyc" id="prod-yHj7yISB">
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt optional="" id="_ref_22583"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22584"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22585"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="InstantiateGeneratorFunctionExpression" id="_ref_7856"><a href="ecmascript-language-functions-and-classes.html#sec-runtime-semantics-instantiategeneratorfunctionexpression">InstantiateGeneratorFunctionExpression</a></emu-xref> of <emu-nt id="_ref_22586"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="YieldExpression" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-YieldExpression">YieldExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="0d8zyjn8" id="prod-R-GDUsNW"><emu-t>yield</emu-t></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return ?&nbsp;<emu-xref aoid="Yield" id="_ref_7857"><a href="control-abstraction-objects.html#sec-yield" class="e-user-code">Yield</a></emu-xref>(<emu-val>undefined</emu-val>).</li></ol></emu-alg>
<emu-grammar><emu-production name="YieldExpression" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-YieldExpression">YieldExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="50ht6hl2" id="prod-WbSBzREt">
<emu-t>yield</emu-t>
<emu-nt id="_ref_22587"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>exprRef</var> be ?&nbsp;<emu-xref aoid="Evaluation" id="_ref_7858"><a href="syntax-directed-operations.html#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt id="_ref_22588"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>.</li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetValue" id="_ref_7859"><a href="ecmascript-data-types-and-values.html#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>exprRef</var>).</li><li>Return ?&nbsp;<emu-xref aoid="Yield" id="_ref_7860"><a href="control-abstraction-objects.html#sec-yield" class="e-user-code">Yield</a></emu-xref>(<var>value</var>).</li></ol></emu-alg>
<emu-grammar><emu-production name="YieldExpression" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-YieldExpression">YieldExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="r6m4ewun" id="prod-gD5_zJlG">
<emu-t>yield</emu-t>
<emu-t>*</emu-t>
<emu-nt id="_ref_22589"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>generatorKind</var> be <emu-xref aoid="GetGeneratorKind" id="_ref_7861"><a href="control-abstraction-objects.html#sec-getgeneratorkind">GetGeneratorKind</a></emu-xref>().</li><li><emu-xref href="#assert" id="_ref_7862"><a href="notational-conventions.html#assert">Assert</a></emu-xref>: <var>generatorKind</var> is either <emu-const>sync</emu-const> or <emu-const>async</emu-const>.</li><li>Let <var>exprRef</var> be ?&nbsp;<emu-xref aoid="Evaluation" id="_ref_7863"><a href="syntax-directed-operations.html#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt id="_ref_22590"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>.</li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetValue" id="_ref_7864"><a href="ecmascript-data-types-and-values.html#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>exprRef</var>).</li><li>Let <var>iteratorRecord</var> be ?&nbsp;<emu-xref aoid="GetIterator" id="_ref_7865"><a href="abstract-operations.html#sec-getiterator" class="e-user-code">GetIterator</a></emu-xref>(<var>value</var>, <var>generatorKind</var>).</li><li>Let <var>iterator</var> be <var>iteratorRecord</var>.<var class="field">[[Iterator]]</var>.</li><li>Let <var>received</var> be <emu-xref aoid="NormalCompletion" id="_ref_7866"><a href="ecmascript-data-types-and-values.html#sec-normalcompletion">NormalCompletion</a></emu-xref>(<emu-val>undefined</emu-val>).</li><li>Repeat,<ol><li>If <var>received</var> is a <emu-xref href="#sec-completion-record-specification-type" id="_ref_7867"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">normal completion</a></emu-xref>, then<ol><li>Let <var>innerResult</var> be ?&nbsp;<emu-xref aoid="Call" id="_ref_7868"><a href="abstract-operations.html#sec-call" class="e-user-code">Call</a></emu-xref>(<var>iteratorRecord</var>.<var class="field">[[NextMethod]]</var>, <var>iteratorRecord</var>.<var class="field">[[Iterator]]</var>, « <var>received</var>.<var class="field">[[Value]]</var>&nbsp;»).</li><li>If <var>generatorKind</var> is <emu-const>async</emu-const>, set <var>innerResult</var> to ?&nbsp;<emu-xref aoid="Await" id="_ref_7869"><a href="control-abstraction-objects.html#await" class="e-user-code">Await</a></emu-xref>(<var>innerResult</var>).</li><li>If <var>innerResult</var> <emu-xref href="#sec-object-type" id="_ref_7870"><a href="ecmascript-data-types-and-values.html#sec-object-type">is not an Object</a></emu-xref>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Let <var>done</var> be ?&nbsp;<emu-xref aoid="IteratorComplete" id="_ref_7871"><a href="abstract-operations.html#sec-iteratorcomplete" class="e-user-code">IteratorComplete</a></emu-xref>(<var>innerResult</var>).</li><li>If <var>done</var> is <emu-val>true</emu-val>, then<ol><li>Return ?&nbsp;<emu-xref aoid="IteratorValue" id="_ref_7872"><a href="abstract-operations.html#sec-iteratorvalue" class="e-user-code">IteratorValue</a></emu-xref>(<var>innerResult</var>).</li></ol></li><li>If <var>generatorKind</var> is <emu-const>async</emu-const>, set <var>received</var> to <emu-xref aoid="Completion" id="_ref_7873"><a href="notational-conventions.html#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="AsyncGeneratorYield" id="_ref_7874"><a href="control-abstraction-objects.html#sec-asyncgeneratoryield" class="e-user-code">AsyncGeneratorYield</a></emu-xref>(? <emu-xref aoid="IteratorValue" id="_ref_7875"><a href="abstract-operations.html#sec-iteratorvalue" class="e-user-code">IteratorValue</a></emu-xref>(<var>innerResult</var>))).</li><li>Else, set <var>received</var> to <emu-xref aoid="Completion" id="_ref_7876"><a href="notational-conventions.html#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="GeneratorYield" id="_ref_7877"><a href="control-abstraction-objects.html#sec-generatoryield">GeneratorYield</a></emu-xref>(<var>innerResult</var>)).</li></ol></li><li>Else if <var>received</var> is a <emu-xref href="#sec-completion-record-specification-type" id="_ref_7878"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">throw completion</a></emu-xref>, then<ol><li>Let <var>throw</var> be ?&nbsp;<emu-xref aoid="GetMethod" id="_ref_7879"><a href="abstract-operations.html#sec-getmethod" class="e-user-code">GetMethod</a></emu-xref>(<var>iterator</var>, <emu-val>"throw"</emu-val>).</li><li>If <var>throw</var> is not <emu-val>undefined</emu-val>, then<ol><li>Let <var>innerResult</var> be ?&nbsp;<emu-xref aoid="Call" id="_ref_7880"><a href="abstract-operations.html#sec-call" class="e-user-code">Call</a></emu-xref>(<var>throw</var>, <var>iterator</var>, « <var>received</var>.<var class="field">[[Value]]</var>&nbsp;»).</li><li>If <var>generatorKind</var> is <emu-const>async</emu-const>, set <var>innerResult</var> to ?&nbsp;<emu-xref aoid="Await" id="_ref_7881"><a href="control-abstraction-objects.html#await" class="e-user-code">Await</a></emu-xref>(<var>innerResult</var>).</li><li>NOTE: Exceptions from the inner <emu-xref href="#sec-iterator-interface" id="_ref_7882"><a href="control-abstraction-objects.html#sec-iterator-interface">iterator</a></emu-xref> <code>throw</code> method are propagated. <emu-xref href="#sec-completion-record-specification-type" id="_ref_7883"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">Normal completions</a></emu-xref> from an inner <code>throw</code> method are processed similarly to an inner <code>next</code>.</li><li>If <var>innerResult</var> <emu-xref href="#sec-object-type" id="_ref_7884"><a href="ecmascript-data-types-and-values.html#sec-object-type">is not an Object</a></emu-xref>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Let <var>done</var> be ?&nbsp;<emu-xref aoid="IteratorComplete" id="_ref_7885"><a href="abstract-operations.html#sec-iteratorcomplete" class="e-user-code">IteratorComplete</a></emu-xref>(<var>innerResult</var>).</li><li>If <var>done</var> is <emu-val>true</emu-val>, then<ol><li>Return ?&nbsp;<emu-xref aoid="IteratorValue" id="_ref_7886"><a href="abstract-operations.html#sec-iteratorvalue" class="e-user-code">IteratorValue</a></emu-xref>(<var>innerResult</var>).</li></ol></li><li>If <var>generatorKind</var> is <emu-const>async</emu-const>, set <var>received</var> to <emu-xref aoid="Completion" id="_ref_7887"><a href="notational-conventions.html#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="AsyncGeneratorYield" id="_ref_7888"><a href="control-abstraction-objects.html#sec-asyncgeneratoryield" class="e-user-code">AsyncGeneratorYield</a></emu-xref>(? <emu-xref aoid="IteratorValue" id="_ref_7889"><a href="abstract-operations.html#sec-iteratorvalue" class="e-user-code">IteratorValue</a></emu-xref>(<var>innerResult</var>))).</li><li>Else, set <var>received</var> to <emu-xref aoid="Completion" id="_ref_7890"><a href="notational-conventions.html#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="GeneratorYield" id="_ref_7891"><a href="control-abstraction-objects.html#sec-generatoryield">GeneratorYield</a></emu-xref>(<var>innerResult</var>)).</li></ol></li><li>Else,<ol><li>NOTE: If <var>iterator</var> does not have a <code>throw</code> method, this throw is going to terminate the <code>yield*</code> loop. But first we need to give <var>iterator</var> a chance to clean up.</li><li>Let <var>closeCompletion</var> be <emu-xref aoid="NormalCompletion" id="_ref_7892"><a href="ecmascript-data-types-and-values.html#sec-normalcompletion">NormalCompletion</a></emu-xref>(<emu-const>empty</emu-const>).</li><li>If <var>generatorKind</var> is <emu-const>async</emu-const>, perform ?&nbsp;<emu-xref aoid="AsyncIteratorClose" id="_ref_7893"><a href="abstract-operations.html#sec-asynciteratorclose" class="e-user-code">AsyncIteratorClose</a></emu-xref>(<var>iteratorRecord</var>, <var>closeCompletion</var>).</li><li>Else, perform ?&nbsp;<emu-xref aoid="IteratorClose" id="_ref_7894"><a href="abstract-operations.html#sec-iteratorclose" class="e-user-code">IteratorClose</a></emu-xref>(<var>iteratorRecord</var>, <var>closeCompletion</var>).</li><li>NOTE: The next step throws a <emu-val>TypeError</emu-val> to indicate that there was a <code>yield*</code> protocol violation: <var>iterator</var> does not have a <code>throw</code> method.</li><li>Throw a <emu-val>TypeError</emu-val> exception.</li></ol></li></ol></li><li>Else,<ol><li><emu-xref href="#assert" id="_ref_7895"><a href="notational-conventions.html#assert">Assert</a></emu-xref>: <var>received</var> is a <emu-xref href="#sec-completion-record-specification-type" id="_ref_7896"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">return completion</a></emu-xref>.</li><li>Let <var>return</var> be ?&nbsp;<emu-xref aoid="GetMethod" id="_ref_7897"><a href="abstract-operations.html#sec-getmethod" class="e-user-code">GetMethod</a></emu-xref>(<var>iterator</var>, <emu-val>"return"</emu-val>).</li><li>If <var>return</var> is <emu-val>undefined</emu-val>, then<ol><li>Let <var>receivedValue</var> be <var>received</var>.<var class="field">[[Value]]</var>.</li><li>If <var>generatorKind</var> is <emu-const>async</emu-const>, then<ol><li>Set <var>receivedValue</var> to ?&nbsp;<emu-xref aoid="Await" id="_ref_7898"><a href="control-abstraction-objects.html#await" class="e-user-code">Await</a></emu-xref>(<var>receivedValue</var>).</li></ol></li><li>Return <emu-xref aoid="ReturnCompletion" id="_ref_7899"><a href="ecmascript-data-types-and-values.html#sec-returncompletion">ReturnCompletion</a></emu-xref>(<var>receivedValue</var>).</li></ol></li><li>Let <var>innerReturnResult</var> be ?&nbsp;<emu-xref aoid="Call" id="_ref_7900"><a href="abstract-operations.html#sec-call" class="e-user-code">Call</a></emu-xref>(<var>return</var>, <var>iterator</var>, « <var>received</var>.<var class="field">[[Value]]</var>&nbsp;»).</li><li>If <var>generatorKind</var> is <emu-const>async</emu-const>, set <var>innerReturnResult</var> to ?&nbsp;<emu-xref aoid="Await" id="_ref_7901"><a href="control-abstraction-objects.html#await" class="e-user-code">Await</a></emu-xref>(<var>innerReturnResult</var>).</li><li>If <var>innerReturnResult</var> <emu-xref href="#sec-object-type" id="_ref_7902"><a href="ecmascript-data-types-and-values.html#sec-object-type">is not an Object</a></emu-xref>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Let <var>done</var> be ?&nbsp;<emu-xref aoid="IteratorComplete" id="_ref_7903"><a href="abstract-operations.html#sec-iteratorcomplete" class="e-user-code">IteratorComplete</a></emu-xref>(<var>innerReturnResult</var>).</li><li>If <var>done</var> is <emu-val>true</emu-val>, then<ol><li>Let <var>returnedValue</var> be ?&nbsp;<emu-xref aoid="IteratorValue" id="_ref_7904"><a href="abstract-operations.html#sec-iteratorvalue" class="e-user-code">IteratorValue</a></emu-xref>(<var>innerReturnResult</var>).</li><li>Return <emu-xref aoid="ReturnCompletion" id="_ref_7905"><a href="ecmascript-data-types-and-values.html#sec-returncompletion">ReturnCompletion</a></emu-xref>(<var>returnedValue</var>).</li></ol></li><li>If <var>generatorKind</var> is <emu-const>async</emu-const>, set <var>received</var> to <emu-xref aoid="Completion" id="_ref_7906"><a href="notational-conventions.html#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="AsyncGeneratorYield" id="_ref_7907"><a href="control-abstraction-objects.html#sec-asyncgeneratoryield" class="e-user-code">AsyncGeneratorYield</a></emu-xref>(? <emu-xref aoid="IteratorValue" id="_ref_7908"><a href="abstract-operations.html#sec-iteratorvalue" class="e-user-code">IteratorValue</a></emu-xref>(<var>innerReturnResult</var>))).</li><li>Else, set <var>received</var> to <emu-xref aoid="Completion" id="_ref_7909"><a href="notational-conventions.html#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="GeneratorYield" id="_ref_7910"><a href="control-abstraction-objects.html#sec-generatoryield">GeneratorYield</a></emu-xref>(<var>innerReturnResult</var>)).</li></ol></li></ol></li></ol></emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-async-generator-function-definitions">
<h1><span class="secnum">15.6</span> Async Generator Function Definitions</h1>
<h2>Syntax</h2>
<emu-grammar type="definition"><emu-production name="AsyncGeneratorDeclaration" params="Yield, Await, Default" id="prod-AsyncGeneratorDeclaration">
<emu-nt params="Yield, Await, Default"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorDeclaration">AsyncGeneratorDeclaration</a><emu-mods><emu-params>[Yield, Await, Default]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="vxevrvwx" id="prod-cOKIJmRw">
<emu-t>async</emu-t>
<emu-gann>[no <emu-nt id="_ref_22591"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt params="?Yield, ?Await" id="_ref_22592"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt params="+Yield, +Await" id="_ref_22593"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[+Yield, +Await]</emu-params></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22594"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="zdnckwse" constraints="+Default" id="prod-1L17zU6t"><emu-constraints>[+Default]</emu-constraints>
<emu-t>async</emu-t>
<emu-gann>[no <emu-nt id="_ref_22595"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-t>(</emu-t>
<emu-nt params="+Yield, +Await" id="_ref_22596"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[+Yield, +Await]</emu-params></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22597"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="AsyncGeneratorExpression" id="prod-AsyncGeneratorExpression">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="yh0wbqjf" id="prod-s18yr2Ij">
<emu-t>async</emu-t>
<emu-gann>[no <emu-nt id="_ref_22598"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt params="+Yield, +Await" optional="" id="_ref_22599"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[+Yield, +Await]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt params="+Yield, +Await" id="_ref_22600"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[+Yield, +Await]</emu-params></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22601"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="AsyncGeneratorMethod" params="Yield, Await" id="prod-AsyncGeneratorMethod">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorMethod">AsyncGeneratorMethod</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="bojlwy10" id="prod-ceV74b-L">
<emu-t>async</emu-t>
<emu-gann>[no <emu-nt id="_ref_22602"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
<emu-t>*</emu-t>
<emu-nt params="?Yield, ?Await" id="_ref_22603"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt params="+Yield, +Await" id="_ref_22604"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a><emu-mods><emu-params>[+Yield, +Await]</emu-params></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22605"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="AsyncGeneratorBody" id="prod-AsyncGeneratorBody">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="zqmkrekv" id="prod-9f9S8TE_">
<emu-nt params="+Yield, +Await" id="_ref_22606"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a><emu-mods><emu-params>[+Yield, +Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-note><span class="note">Note 1</span><div class="note-contents">
<p><emu-nt id="_ref_22607"><a href="ecmascript-language-functions-and-classes.html#prod-YieldExpression">YieldExpression</a></emu-nt> and <emu-nt id="_ref_22608"><a href="ecmascript-language-functions-and-classes.html#prod-AwaitExpression">AwaitExpression</a></emu-nt> cannot be used within the <emu-nt id="_ref_22609"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> of an async generator function because any expressions that are part of <emu-nt id="_ref_22610"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> are evaluated before the resulting AsyncGenerator is in a resumable state.</p>
</div></emu-note>
<emu-note><span class="note">Note 2</span><div class="note-contents">
<p><emu-xref href="#sec-algorithm-conventions-abstract-operations" id="_ref_7911"><a href="notational-conventions.html#sec-algorithm-conventions-abstract-operations">Abstract operations</a></emu-xref> relating to AsyncGenerators are defined in <emu-xref href="#sec-asyncgenerator-abstract-operations" id="_ref_469"><a href="control-abstraction-objects.html#sec-asyncgenerator-abstract-operations">27.6.3</a></emu-xref>.</p>
</div></emu-note>
<emu-clause id="sec-async-generator-function-definitions-static-semantics-early-errors">
<h1><span class="secnum">15.6.1</span> Static Semantics: Early Errors</h1>
<emu-grammar><emu-production name="AsyncGeneratorMethod" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorMethod">AsyncGeneratorMethod</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="2edb8sar">
<emu-t>async</emu-t>
<emu-t>*</emu-t>
<emu-nt id="_ref_22611"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22612"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22613"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>It is a Syntax Error if <emu-xref aoid="HasDirectSuper" id="_ref_7912"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hasdirectsuper">HasDirectSuper</a></emu-xref> of <emu-nt id="_ref_22614"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorMethod">AsyncGeneratorMethod</a></emu-nt> is <emu-val>true</emu-val>.</li>
<li>It is a Syntax Error if <emu-nt id="_ref_22615"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7913"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22616"><a href="ecmascript-language-functions-and-classes.html#prod-YieldExpression">YieldExpression</a></emu-nt> is <emu-val>true</emu-val>.</li>
<li>It is a Syntax Error if <emu-nt id="_ref_22617"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7914"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22618"><a href="ecmascript-language-functions-and-classes.html#prod-AwaitExpression">AwaitExpression</a></emu-nt> is <emu-val>true</emu-val>.</li>
<li>It is a Syntax Error if <emu-xref aoid="FunctionBodyContainsUseStrict" id="_ref_7915"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-functionbodycontainsusestrict">FunctionBodyContainsUseStrict</a></emu-xref> of <emu-nt id="_ref_22619"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt> is <emu-val>true</emu-val> and <emu-xref aoid="IsSimpleParameterList" id="_ref_7916"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-issimpleparameterlist">IsSimpleParameterList</a></emu-xref> of <emu-nt id="_ref_22620"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> is <emu-val>false</emu-val>.</li>
<li>It is a Syntax Error if any element of the <emu-xref aoid="BoundNames" id="_ref_7917"><a href="syntax-directed-operations.html#sec-static-semantics-boundnames">BoundNames</a></emu-xref> of <emu-nt id="_ref_22621"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> also occurs in the <emu-xref aoid="LexicallyDeclaredNames" id="_ref_7918"><a href="syntax-directed-operations.html#sec-static-semantics-lexicallydeclarednames">LexicallyDeclaredNames</a></emu-xref> of <emu-nt id="_ref_22622"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>.</li>
</ul>
<emu-grammar><emu-production name="AsyncGeneratorDeclaration">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorDeclaration">AsyncGeneratorDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="e9lmm5cj">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt id="_ref_22623"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22624"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22625"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="xruu4gg0">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_22626"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22627"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="AsyncGeneratorExpression">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="nplor0n0">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt optional="" id="_ref_22628"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22629"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22630"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>If <emu-xref aoid="IsStrict" id="_ref_7919"><a href="ecmascript-language-source-code.html#sec-isstrict">IsStrict</a></emu-xref>(<emu-nt id="_ref_22631"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>) is <emu-val>true</emu-val>, the Early Error rules for <emu-grammar><emu-production name="UniqueFormalParameters" collapsed="" class=" inline">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ahjg9bb6"><emu-nt id="_ref_22632"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar> are applied.</li>
<li>If <emu-nt id="_ref_22633"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> is present and <emu-xref aoid="IsStrict" id="_ref_7920"><a href="ecmascript-language-source-code.html#sec-isstrict">IsStrict</a></emu-xref>(<emu-nt id="_ref_22634"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>) is <emu-val>true</emu-val>, it is a Syntax Error if the <emu-xref aoid="StringValue" id="_ref_7921"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22635"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> is either <emu-val>"eval"</emu-val> or <emu-val>"arguments"</emu-val>.</li>
<li>It is a Syntax Error if <emu-xref aoid="FunctionBodyContainsUseStrict" id="_ref_7922"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-functionbodycontainsusestrict">FunctionBodyContainsUseStrict</a></emu-xref> of <emu-nt id="_ref_22636"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt> is <emu-val>true</emu-val> and <emu-xref aoid="IsSimpleParameterList" id="_ref_7923"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-issimpleparameterlist">IsSimpleParameterList</a></emu-xref> of <emu-nt id="_ref_22637"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> is <emu-val>false</emu-val>.</li>
<li>It is a Syntax Error if any element of the <emu-xref aoid="BoundNames" id="_ref_7924"><a href="syntax-directed-operations.html#sec-static-semantics-boundnames">BoundNames</a></emu-xref> of <emu-nt id="_ref_22638"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> also occurs in the <emu-xref aoid="LexicallyDeclaredNames" id="_ref_7925"><a href="syntax-directed-operations.html#sec-static-semantics-lexicallydeclarednames">LexicallyDeclaredNames</a></emu-xref> of <emu-nt id="_ref_22639"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>.</li>
<li>It is a Syntax Error if <emu-nt id="_ref_22640"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7926"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22641"><a href="ecmascript-language-functions-and-classes.html#prod-YieldExpression">YieldExpression</a></emu-nt> is <emu-val>true</emu-val>.</li>
<li>It is a Syntax Error if <emu-nt id="_ref_22642"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7927"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22643"><a href="ecmascript-language-functions-and-classes.html#prod-AwaitExpression">AwaitExpression</a></emu-nt> is <emu-val>true</emu-val>.</li>
<li>It is a Syntax Error if <emu-nt id="_ref_22644"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7928"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22645"><a href="ecmascript-language-expressions.html#prod-SuperProperty">SuperProperty</a></emu-nt> is <emu-val>true</emu-val>.</li>
<li>It is a Syntax Error if <emu-nt id="_ref_22646"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7929"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22647"><a href="ecmascript-language-expressions.html#prod-SuperProperty">SuperProperty</a></emu-nt> is <emu-val>true</emu-val>.</li>
<li>It is a Syntax Error if <emu-nt id="_ref_22648"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7930"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22649"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt> is <emu-val>true</emu-val>.</li>
<li>It is a Syntax Error if <emu-nt id="_ref_22650"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt> <emu-xref aoid="Contains" id="_ref_7931"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22651"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt> is <emu-val>true</emu-val>.</li>
</ul>
</emu-clause>
<emu-clause id="sec-runtime-semantics-evaluateasyncgeneratorbody" oldids="sec-asyncgenerator-definitions-evaluatebody" type="sdo" aoid="EvaluateAsyncGeneratorBody"><span id="sec-asyncgenerator-definitions-evaluatebody"></span>
<h1><span class="secnum">15.6.2</span> Runtime Semantics: EvaluateAsyncGeneratorBody</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7932"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> EvaluateAsyncGeneratorBody takes arguments <var>functionObject</var> (an ECMAScript <emu-xref href="#function-object" id="_ref_7933"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>) and <var>argumentsList</var> (a <emu-xref href="#sec-list-and-record-specification-type" id="_ref_7934"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-xref href="#sec-ecmascript-language-types" id="_ref_7935"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types">ECMAScript language values</a></emu-xref>) and returns a <emu-xref href="#sec-completion-record-specification-type" id="_ref_7936"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">throw completion</a></emu-xref> or a <emu-xref href="#sec-completion-record-specification-type" id="_ref_7937"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">return completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="AsyncGeneratorBody" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="iqzbkm-h" id="prod-SWMcozzE"><emu-nt id="_ref_22652"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="FunctionDeclarationInstantiation" id="_ref_7938"><a href="ordinary-and-exotic-objects-behaviours.html#sec-functiondeclarationinstantiation" class="e-user-code">FunctionDeclarationInstantiation</a></emu-xref>(<var>functionObject</var>, <var>argumentsList</var>).</li><li>Let <var>generator</var> be ?&nbsp;<emu-xref aoid="OrdinaryCreateFromConstructor" id="_ref_7939"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinarycreatefromconstructor" class="e-user-code">OrdinaryCreateFromConstructor</a></emu-xref>(<var>functionObject</var>, <emu-val>"%AsyncGeneratorPrototype%"</emu-val>, « <var class="field">[[AsyncGeneratorState]]</var>, <var class="field">[[AsyncGeneratorContext]]</var>, <var class="field">[[AsyncGeneratorQueue]]</var>, <var class="field">[[GeneratorBrand]]</var>&nbsp;»).</li><li>Set <var>generator</var>.<var class="field">[[GeneratorBrand]]</var> to <emu-const>empty</emu-const>.</li><li>Set <var>generator</var>.<var class="field">[[AsyncGeneratorState]]</var> to <emu-const>suspended-start</emu-const>.</li><li>Perform <emu-xref aoid="AsyncGeneratorStart" id="_ref_7940"><a href="control-abstraction-objects.html#sec-asyncgeneratorstart">AsyncGeneratorStart</a></emu-xref>(<var>generator</var>, <emu-nt id="_ref_22653"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>).</li><li>Return <emu-xref aoid="ReturnCompletion" id="_ref_7941"><a href="ecmascript-data-types-and-values.html#sec-returncompletion">ReturnCompletion</a></emu-xref>(<var>generator</var>).</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-runtime-semantics-instantiateasyncgeneratorfunctionobject" oldids="sec-asyncgenerator-definitions-instantiatefunctionobject" type="sdo" aoid="InstantiateAsyncGeneratorFunctionObject"><span id="sec-asyncgenerator-definitions-instantiatefunctionobject"></span>
<h1><span class="secnum">15.6.3</span> Runtime Semantics: InstantiateAsyncGeneratorFunctionObject</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7942"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> InstantiateAsyncGeneratorFunctionObject takes arguments <var>env</var> (an <emu-xref href="#sec-environment-records" id="_ref_7943"><a href="executable-code-and-execution-contexts.html#sec-environment-records">Environment Record</a></emu-xref>) and <var>privateEnv</var> (a <emu-xref href="#privateenvironment-record" id="_ref_7944"><a href="executable-code-and-execution-contexts.html#privateenvironment-record">PrivateEnvironment Record</a></emu-xref> or <emu-val>null</emu-val>) and returns an ECMAScript <emu-xref href="#function-object" id="_ref_7945"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="AsyncGeneratorDeclaration" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorDeclaration">AsyncGeneratorDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="e9lmm5cj" id="prod-JvNVLw_7">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt id="_ref_22654"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22655"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22656"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>name</var> be the <emu-xref aoid="StringValue" id="_ref_7946"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22657"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7947"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22658"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorDeclaration">AsyncGeneratorDeclaration</a></emu-nt>.</li><li>Let <var>F</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7948"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-asyncgeneratorfunction-prototype" id="_ref_7949"><a href="control-abstraction-objects.html#sec-properties-of-asyncgeneratorfunction-prototype">%AsyncGeneratorFunction.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_22659"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>, <emu-nt id="_ref_22660"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7950"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>F</var>, <var>name</var>).</li><li>Let <var>prototype</var> be <emu-xref aoid="OrdinaryObjectCreate" id="_ref_7951"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryobjectcreate">OrdinaryObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-asyncgenerator-prototype" id="_ref_7952"><a href="control-abstraction-objects.html#sec-properties-of-asyncgenerator-prototype">%AsyncGeneratorPrototype%</a></emu-xref>).</li><li>Perform !&nbsp;<emu-xref aoid="DefinePropertyOrThrow" id="_ref_7953"><a href="abstract-operations.html#sec-definepropertyorthrow">DefinePropertyOrThrow</a></emu-xref>(<var>F</var>, <emu-val>"prototype"</emu-val>, PropertyDescriptor { <var class="field">[[Value]]</var>: <var>prototype</var>, <var class="field">[[Writable]]</var>: <emu-val>true</emu-val>, <var class="field">[[Enumerable]]</var>: <emu-val>false</emu-val>, <var class="field">[[Configurable]]</var>: <emu-val>false</emu-val>&nbsp;}).</li><li>Return <var>F</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="AsyncGeneratorDeclaration" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorDeclaration">AsyncGeneratorDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="xruu4gg0" id="prod-G-CKcSEp">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_22661"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22662"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7954"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22663"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorDeclaration">AsyncGeneratorDeclaration</a></emu-nt>.</li><li>Let <var>F</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7955"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-asyncgeneratorfunction-prototype" id="_ref_7956"><a href="control-abstraction-objects.html#sec-properties-of-asyncgeneratorfunction-prototype">%AsyncGeneratorFunction.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_22664"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>, <emu-nt id="_ref_22665"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7957"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>F</var>, <emu-val>"default"</emu-val>).</li><li>Let <var>prototype</var> be <emu-xref aoid="OrdinaryObjectCreate" id="_ref_7958"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryobjectcreate">OrdinaryObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-asyncgenerator-prototype" id="_ref_7959"><a href="control-abstraction-objects.html#sec-properties-of-asyncgenerator-prototype">%AsyncGeneratorPrototype%</a></emu-xref>).</li><li>Perform !&nbsp;<emu-xref aoid="DefinePropertyOrThrow" id="_ref_7960"><a href="abstract-operations.html#sec-definepropertyorthrow">DefinePropertyOrThrow</a></emu-xref>(<var>F</var>, <emu-val>"prototype"</emu-val>, PropertyDescriptor { <var class="field">[[Value]]</var>: <var>prototype</var>, <var class="field">[[Writable]]</var>: <emu-val>true</emu-val>, <var class="field">[[Enumerable]]</var>: <emu-val>false</emu-val>, <var class="field">[[Configurable]]</var>: <emu-val>false</emu-val>&nbsp;}).</li><li>Return <var>F</var>.</li></ol></emu-alg>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>An anonymous <emu-nt id="_ref_22666"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorDeclaration">AsyncGeneratorDeclaration</a></emu-nt> can only occur as part of an <code>export default</code> declaration.</p>
</div></emu-note>
</emu-clause>
<emu-clause id="sec-runtime-semantics-instantiateasyncgeneratorfunctionexpression" type="sdo" aoid="InstantiateAsyncGeneratorFunctionExpression">
<h1><span class="secnum">15.6.4</span> Runtime Semantics: InstantiateAsyncGeneratorFunctionExpression</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7961"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> InstantiateAsyncGeneratorFunctionExpression takes optional argument <var>name</var> (a <emu-xref href="#property-key" id="_ref_7962"><a href="ecmascript-data-types-and-values.html#property-key">property key</a></emu-xref> or a <emu-xref href="#sec-private-names" id="_ref_7963"><a href="ecmascript-data-types-and-values.html#sec-private-names">Private Name</a></emu-xref>) and returns an ECMAScript <emu-xref href="#function-object" id="_ref_7964"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="AsyncGeneratorExpression" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="xruu4gg0" id="prod-A3m5kV04">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_22667"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22668"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <var>name</var> is not present, set <var>name</var> to <emu-val>""</emu-val>.</li><li>Let <var>env</var> be the LexicalEnvironment of the <emu-xref href="#running-execution-context" id="_ref_7965"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>.</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_7966"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7967"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22669"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt>.</li><li>Let <var>closure</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7968"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-asyncgeneratorfunction-prototype" id="_ref_7969"><a href="control-abstraction-objects.html#sec-properties-of-asyncgeneratorfunction-prototype">%AsyncGeneratorFunction.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_22670"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>, <emu-nt id="_ref_22671"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7970"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>closure</var>, <var>name</var>).</li><li>Let <var>prototype</var> be <emu-xref aoid="OrdinaryObjectCreate" id="_ref_7971"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryobjectcreate">OrdinaryObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-asyncgenerator-prototype" id="_ref_7972"><a href="control-abstraction-objects.html#sec-properties-of-asyncgenerator-prototype">%AsyncGeneratorPrototype%</a></emu-xref>).</li><li>Perform !&nbsp;<emu-xref aoid="DefinePropertyOrThrow" id="_ref_7973"><a href="abstract-operations.html#sec-definepropertyorthrow">DefinePropertyOrThrow</a></emu-xref>(<var>closure</var>, <emu-val>"prototype"</emu-val>, PropertyDescriptor { <var class="field">[[Value]]</var>: <var>prototype</var>, <var class="field">[[Writable]]</var>: <emu-val>true</emu-val>, <var class="field">[[Enumerable]]</var>: <emu-val>false</emu-val>, <var class="field">[[Configurable]]</var>: <emu-val>false</emu-val>&nbsp;}).</li><li>Return <var>closure</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="AsyncGeneratorExpression" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="e9lmm5cj" id="prod-7PTlQqLp">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt id="_ref_22672"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22673"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22674"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li><emu-xref href="#assert" id="_ref_7974"><a href="notational-conventions.html#assert">Assert</a></emu-xref>: <var>name</var> is not present.</li><li>Set <var>name</var> to the <emu-xref aoid="StringValue" id="_ref_7975"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22675"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>.</li><li>Let <var>outerEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_7976"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s LexicalEnvironment.</li><li>Let <var>funcEnv</var> be <emu-xref aoid="NewDeclarativeEnvironment" id="_ref_7977"><a href="executable-code-and-execution-contexts.html#sec-newdeclarativeenvironment">NewDeclarativeEnvironment</a></emu-xref>(<var>outerEnv</var>).</li><li>Perform !&nbsp;<var>funcEnv</var>.<emu-xref aoid="CreateImmutableBinding" id="_ref_7978"><a href="executable-code-and-execution-contexts.html#abstract-createimmutablebinding">CreateImmutableBinding</a></emu-xref>(<var>name</var>, <emu-val>false</emu-val>).</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_7979"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_7980"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22676"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt>.</li><li>Let <var>closure</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_7981"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-asyncgeneratorfunction-prototype" id="_ref_7982"><a href="control-abstraction-objects.html#sec-properties-of-asyncgeneratorfunction-prototype">%AsyncGeneratorFunction.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_22677"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>, <emu-nt id="_ref_22678"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>funcEnv</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_7983"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>closure</var>, <var>name</var>).</li><li>Let <var>prototype</var> be <emu-xref aoid="OrdinaryObjectCreate" id="_ref_7984"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryobjectcreate">OrdinaryObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-asyncgenerator-prototype" id="_ref_7985"><a href="control-abstraction-objects.html#sec-properties-of-asyncgenerator-prototype">%AsyncGeneratorPrototype%</a></emu-xref>).</li><li>Perform !&nbsp;<emu-xref aoid="DefinePropertyOrThrow" id="_ref_7986"><a href="abstract-operations.html#sec-definepropertyorthrow">DefinePropertyOrThrow</a></emu-xref>(<var>closure</var>, <emu-val>"prototype"</emu-val>, PropertyDescriptor { <var class="field">[[Value]]</var>: <var>prototype</var>, <var class="field">[[Writable]]</var>: <emu-val>true</emu-val>, <var class="field">[[Enumerable]]</var>: <emu-val>false</emu-val>, <var class="field">[[Configurable]]</var>: <emu-val>false</emu-val>&nbsp;}).</li><li>Perform !&nbsp;<var>funcEnv</var>.<emu-xref aoid="InitializeBinding" id="_ref_7987"><a href="executable-code-and-execution-contexts.html#abstract-initializebinding">InitializeBinding</a></emu-xref>(<var>name</var>, <var>closure</var>).</li><li>Return <var>closure</var>.</li></ol></emu-alg>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>The <emu-nt id="_ref_22679"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> in an <emu-nt id="_ref_22680"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt> can be referenced from inside the <emu-nt id="_ref_22681"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt>'s <emu-nt id="_ref_22682"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt> to allow the generator code to call itself recursively. However, unlike in an <emu-nt id="_ref_22683"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorDeclaration">AsyncGeneratorDeclaration</a></emu-nt>, the <emu-nt id="_ref_22684"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> in an <emu-nt id="_ref_22685"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt> cannot be referenced from and does not affect the scope enclosing the <emu-nt id="_ref_22686"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt>.</p>
</div></emu-note>
</emu-clause>
<emu-clause id="sec-asyncgenerator-definitions-evaluation" type="sdo">
<h1><span class="secnum">15.6.5</span> Runtime Semantics: Evaluation</h1>
<emu-grammar><emu-production name="AsyncGeneratorExpression" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="nplor0n0" id="prod-RTtPBoTs">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt optional="" id="_ref_22687"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22688"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22689"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="InstantiateAsyncGeneratorFunctionExpression" id="_ref_7988"><a href="ecmascript-language-functions-and-classes.html#sec-runtime-semantics-instantiateasyncgeneratorfunctionexpression">InstantiateAsyncGeneratorFunctionExpression</a></emu-xref> of <emu-nt id="_ref_22690"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt>.</li></ol></emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-class-definitions">
<h1><span class="secnum">15.7</span> Class Definitions</h1>
<h2>Syntax</h2>
<emu-grammar type="definition"><emu-production name="ClassDeclaration" params="Yield, Await, Default" id="prod-ClassDeclaration">
<emu-nt params="Yield, Await, Default"><a href="ecmascript-language-functions-and-classes.html#prod-ClassDeclaration">ClassDeclaration</a><emu-mods><emu-params>[Yield, Await, Default]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="r-8ix7mw" id="prod-kd27yk51">
<emu-t>class</emu-t>
<emu-nt params="?Yield, ?Await" id="_ref_22691"><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="?Yield, ?Await" id="_ref_22692"><a href="ecmascript-language-functions-and-classes.html#prod-ClassTail">ClassTail</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
<emu-rhs a="eish3c1z" constraints="+Default" id="prod-bStNnwN_"><emu-constraints>[+Default]</emu-constraints>
<emu-t>class</emu-t>
<emu-nt params="?Yield, ?Await" id="_ref_22693"><a href="ecmascript-language-functions-and-classes.html#prod-ClassTail">ClassTail</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="ClassExpression" params="Yield, Await" id="prod-ClassExpression">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-ClassExpression">ClassExpression</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="3vemrlhb" id="prod-Vthx67sj">
<emu-t>class</emu-t>
<emu-nt params="?Yield, ?Await" optional="" id="_ref_22694"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-nt params="?Yield, ?Await" id="_ref_22695"><a href="ecmascript-language-functions-and-classes.html#prod-ClassTail">ClassTail</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="ClassTail" params="Yield, Await" id="prod-ClassTail">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-ClassTail">ClassTail</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="0tcpjpju" id="prod-mIr25y7h">
<emu-nt params="?Yield, ?Await" optional="" id="_ref_22696"><a href="ecmascript-language-functions-and-classes.html#prod-ClassHeritage">ClassHeritage</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>{</emu-t>
<emu-nt params="?Yield, ?Await" optional="" id="_ref_22697"><a href="ecmascript-language-functions-and-classes.html#prod-ClassBody">ClassBody</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="ClassHeritage" params="Yield, Await" id="prod-ClassHeritage">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-ClassHeritage">ClassHeritage</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="eyngn05c">
<emu-t>extends</emu-t>
<emu-nt params="?Yield, ?Await" id="_ref_22698"><a href="ecmascript-language-expressions.html#prod-LeftHandSideExpression">LeftHandSideExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="ClassBody" params="Yield, Await" id="prod-ClassBody">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-ClassBody">ClassBody</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="hi6rf-a8" id="prod-VFbPG7Xd">
<emu-nt params="?Yield, ?Await" id="_ref_22699"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="ClassElementList" params="Yield, Await" id="prod-ClassElementList">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="l7zmtagw" id="prod-haKPgLO7">
<emu-nt params="?Yield, ?Await" id="_ref_22700"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
<emu-rhs a="ga1dtfdq" id="prod-sKhHHXFQ">
<emu-nt params="?Yield, ?Await" id="_ref_22701"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-nt params="?Yield, ?Await" id="_ref_22702"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="ClassElement" params="Yield, Await" id="prod-ClassElement">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ke2_9p84" id="prod-NjP_487X">
<emu-nt params="?Yield, ?Await" id="_ref_22703"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
<emu-rhs a="a0i06csv" id="prod-0XtyXojL">
<emu-t>static</emu-t>
<emu-nt params="?Yield, ?Await" id="_ref_22704"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
<emu-rhs a="guxzmt6t" id="prod-RVH9JhqU">
<emu-nt params="?Yield, ?Await" id="_ref_22705"><a href="ecmascript-language-functions-and-classes.html#prod-FieldDefinition">FieldDefinition</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-t>;</emu-t>
</emu-rhs>
<emu-rhs a="w56q4hpj" id="prod-8cGH1X5O">
<emu-t>static</emu-t>
<emu-nt params="?Yield, ?Await" id="_ref_22706"><a href="ecmascript-language-functions-and-classes.html#prod-FieldDefinition">FieldDefinition</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-t>;</emu-t>
</emu-rhs>
<emu-rhs a="2ui-f2qn" id="prod-MThA5IaK">
<emu-nt id="_ref_22707"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlock">ClassStaticBlock</a></emu-nt>
</emu-rhs>
<emu-rhs a="sg2sawim" id="prod-40k8u1X0">
<emu-t>;</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="FieldDefinition" params="Yield, Await" id="prod-FieldDefinition">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-FieldDefinition">FieldDefinition</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="tlc4azd3" id="prod-qdC94hXo">
<emu-nt params="?Yield, ?Await" id="_ref_22708"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-nt params="+In, ?Yield, ?Await" optional="" id="_ref_22709"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a><emu-mods><emu-params>[+In, ?Yield, ?Await]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="ClassElementName" params="Yield, Await" id="prod-ClassElementName">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="jbcjyldj" id="prod-KVWS267v">
<emu-nt params="?Yield, ?Await" id="_ref_22710"><a href="ecmascript-language-expressions.html#prod-PropertyName">PropertyName</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
<emu-rhs a="ie2-zc1c" id="prod-yD9JWieS">
<emu-nt id="_ref_22711"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="ClassStaticBlock" id="prod-ClassStaticBlock">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlock">ClassStaticBlock</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="hv6hopt7" id="prod-qUwUqfkW">
<emu-t>static</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22712"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockBody">ClassStaticBlockBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="ClassStaticBlockBody" id="prod-ClassStaticBlockBody">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockBody">ClassStaticBlockBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="oh0jsomm" id="prod-BArMnydQ">
<emu-nt id="_ref_22713"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockStatementList">ClassStaticBlockStatementList</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="ClassStaticBlockStatementList" id="prod-ClassStaticBlockStatementList">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockStatementList">ClassStaticBlockStatementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="7wzunuv6" id="prod-uVY-nrQL">
<emu-nt params="~Yield, +Await, ~Return" optional="" id="_ref_22714"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementList">StatementList</a><emu-mods><emu-params>[~Yield, +Await, ~Return]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>A class definition is always <emu-xref href="#sec-strict-mode-code" id="_ref_7989"><a href="ecmascript-language-source-code.html#sec-strict-mode-code">strict mode code</a></emu-xref>.</p>
</div></emu-note>
<emu-clause id="sec-class-definitions-static-semantics-early-errors">
<h1><span class="secnum">15.7.1</span> Static Semantics: Early Errors</h1>
<emu-grammar><emu-production name="ClassTail" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassTail">ClassTail</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="0uhgf3fw">
<emu-nt optional="" id="_ref_22715"><a href="ecmascript-language-functions-and-classes.html#prod-ClassHeritage">ClassHeritage</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>{</emu-t>
<emu-nt id="_ref_22716"><a href="ecmascript-language-functions-and-classes.html#prod-ClassBody">ClassBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>
<p>It is a Syntax Error if <emu-nt id="_ref_22717"><a href="ecmascript-language-functions-and-classes.html#prod-ClassHeritage">ClassHeritage</a></emu-nt> is not present and the following algorithm returns <emu-val>true</emu-val>:</p>
<emu-alg><ol><li>Let <var>constructor</var> be the <emu-xref aoid="ConstructorMethod" id="_ref_7990"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-constructormethod">ConstructorMethod</a></emu-xref> of <emu-nt id="_ref_22718"><a href="ecmascript-language-functions-and-classes.html#prod-ClassBody">ClassBody</a></emu-nt>.</li><li>If <var>constructor</var> is <emu-const>empty</emu-const>, return <emu-val>false</emu-val>.</li><li>Return <emu-xref aoid="HasDirectSuper" id="_ref_7991"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hasdirectsuper">HasDirectSuper</a></emu-xref> of <var>constructor</var>.</li></ol></emu-alg>
</li>
</ul>
<emu-grammar><emu-production name="ClassBody" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassBody">ClassBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="1y1dunax"><emu-nt id="_ref_22719"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>
It is a Syntax Error if the <emu-xref aoid="PrototypePropertyNameList" id="_ref_7992"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-prototypepropertynamelist">PrototypePropertyNameList</a></emu-xref> of <emu-nt id="_ref_22720"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt> contains more than one occurrence of <emu-val>"constructor"</emu-val>.
</li>
<li>
It is a Syntax Error if the <emu-xref aoid="PrivateBoundIdentifiers" id="_ref_7993"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-privateboundidentifiers">PrivateBoundIdentifiers</a></emu-xref> of <emu-nt id="_ref_22721"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt> contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries, and the getter and setter are either both static or both non-static.
</li>
</ul>
<emu-grammar><emu-production name="ClassElement" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="s8ilfl9g"><emu-nt id="_ref_22722"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>
It is a Syntax Error if the <emu-xref aoid="PropName" id="_ref_7994"><a href="syntax-directed-operations.html#sec-static-semantics-propname">PropName</a></emu-xref> of <emu-nt id="_ref_22723"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> is not <emu-val>"constructor"</emu-val> and <emu-xref aoid="HasDirectSuper" id="_ref_7995"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hasdirectsuper">HasDirectSuper</a></emu-xref> of <emu-nt id="_ref_22724"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if the <emu-xref aoid="PropName" id="_ref_7996"><a href="syntax-directed-operations.html#sec-static-semantics-propname">PropName</a></emu-xref> of <emu-nt id="_ref_22725"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> is <emu-val>"constructor"</emu-val> and <emu-xref aoid="SpecialMethod" id="_ref_7997"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-specialmethod">SpecialMethod</a></emu-xref> of <emu-nt id="_ref_22726"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> is <emu-val>true</emu-val>.
</li>
</ul>
<emu-grammar><emu-production name="ClassElement" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="-ljgtrpo">
<emu-t>static</emu-t>
<emu-nt id="_ref_22727"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>
It is a Syntax Error if <emu-xref aoid="HasDirectSuper" id="_ref_7998"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hasdirectsuper">HasDirectSuper</a></emu-xref> of <emu-nt id="_ref_22728"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if the <emu-xref aoid="PropName" id="_ref_7999"><a href="syntax-directed-operations.html#sec-static-semantics-propname">PropName</a></emu-xref> of <emu-nt id="_ref_22729"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> is <emu-val>"prototype"</emu-val>.
</li>
</ul>
<emu-grammar><emu-production name="ClassElement" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="bwbyf1-5">
<emu-nt id="_ref_22730"><a href="ecmascript-language-functions-and-classes.html#prod-FieldDefinition">FieldDefinition</a></emu-nt>
<emu-t>;</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>It is a Syntax Error if the <emu-xref aoid="PropName" id="_ref_8000"><a href="syntax-directed-operations.html#sec-static-semantics-propname">PropName</a></emu-xref> of <emu-nt id="_ref_22731"><a href="ecmascript-language-functions-and-classes.html#prod-FieldDefinition">FieldDefinition</a></emu-nt> is <emu-val>"constructor"</emu-val>.</li>
</ul>
<emu-grammar><emu-production name="ClassElement" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="cpyv1xvc">
<emu-t>static</emu-t>
<emu-nt id="_ref_22732"><a href="ecmascript-language-functions-and-classes.html#prod-FieldDefinition">FieldDefinition</a></emu-nt>
<emu-t>;</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>
It is a Syntax Error if the <emu-xref aoid="PropName" id="_ref_8001"><a href="syntax-directed-operations.html#sec-static-semantics-propname">PropName</a></emu-xref> of <emu-nt id="_ref_22733"><a href="ecmascript-language-functions-and-classes.html#prod-FieldDefinition">FieldDefinition</a></emu-nt> is either <emu-val>"prototype"</emu-val> or <emu-val>"constructor"</emu-val>.
</li>
</ul>
<emu-grammar><emu-production name="FieldDefinition">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FieldDefinition">FieldDefinition</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="rqzzdcte">
<emu-nt id="_ref_22734"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-nt optional="" id="_ref_22735"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>It is a Syntax Error if <emu-nt id="_ref_22736"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt> is present and <emu-xref aoid="ContainsArguments" id="_ref_8002"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsarguments">ContainsArguments</a></emu-xref> of <emu-nt id="_ref_22737"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt> is <emu-val>true</emu-val>.</li>
<li>It is a Syntax Error if <emu-nt id="_ref_22738"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt> is present and <emu-nt id="_ref_22739"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt> <emu-xref aoid="Contains" id="_ref_8003"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22740"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt> is <emu-val>true</emu-val>.</li>
</ul>
<emu-grammar><emu-production name="ClassElementName" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ie2-zc1c"><emu-nt id="_ref_22741"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>It is a Syntax Error if the <emu-xref aoid="StringValue" id="_ref_8004"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22742"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt> is <emu-val>"#constructor"</emu-val>.</li>
</ul>
<emu-grammar><emu-production name="ClassStaticBlockBody" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockBody">ClassStaticBlockBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="oh0jsomm"><emu-nt id="_ref_22743"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockStatementList">ClassStaticBlockStatementList</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>
It is a Syntax Error if the <emu-xref aoid="LexicallyDeclaredNames" id="_ref_8005"><a href="syntax-directed-operations.html#sec-static-semantics-lexicallydeclarednames">LexicallyDeclaredNames</a></emu-xref> of <emu-nt id="_ref_22744"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockStatementList">ClassStaticBlockStatementList</a></emu-nt> contains any duplicate entries.
</li>
<li>
It is a Syntax Error if any element of the <emu-xref aoid="LexicallyDeclaredNames" id="_ref_8006"><a href="syntax-directed-operations.html#sec-static-semantics-lexicallydeclarednames">LexicallyDeclaredNames</a></emu-xref> of <emu-nt id="_ref_22745"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockStatementList">ClassStaticBlockStatementList</a></emu-nt> also occurs in the <emu-xref aoid="VarDeclaredNames" id="_ref_8007"><a href="syntax-directed-operations.html#sec-static-semantics-vardeclarednames">VarDeclaredNames</a></emu-xref> of <emu-nt id="_ref_22746"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockStatementList">ClassStaticBlockStatementList</a></emu-nt>.
</li>
<li>
It is a Syntax Error if <emu-xref aoid="ContainsDuplicateLabels" id="_ref_8008"><a href="syntax-directed-operations.html#sec-static-semantics-containsduplicatelabels">ContainsDuplicateLabels</a></emu-xref> of <emu-nt id="_ref_22747"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockStatementList">ClassStaticBlockStatementList</a></emu-nt> with argument « » is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-xref aoid="ContainsUndefinedBreakTarget" id="_ref_8009"><a href="syntax-directed-operations.html#sec-static-semantics-containsundefinedbreaktarget">ContainsUndefinedBreakTarget</a></emu-xref> of <emu-nt id="_ref_22748"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockStatementList">ClassStaticBlockStatementList</a></emu-nt> with argument « » is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-xref aoid="ContainsUndefinedContinueTarget" id="_ref_8010"><a href="syntax-directed-operations.html#sec-static-semantics-containsundefinedcontinuetarget">ContainsUndefinedContinueTarget</a></emu-xref> of <emu-nt id="_ref_22749"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockStatementList">ClassStaticBlockStatementList</a></emu-nt> with arguments « » and « » is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-xref aoid="ContainsArguments" id="_ref_8011"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsarguments">ContainsArguments</a></emu-xref> of <emu-nt id="_ref_22750"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockStatementList">ClassStaticBlockStatementList</a></emu-nt> is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-nt id="_ref_22751"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockStatementList">ClassStaticBlockStatementList</a></emu-nt> <emu-xref aoid="Contains" id="_ref_8012"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22752"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt> is <emu-val>true</emu-val>.
</li>
<li>
It is a Syntax Error if <emu-nt id="_ref_22753"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockStatementList">ClassStaticBlockStatementList</a></emu-nt> <emu-xref aoid="Contains" id="_ref_8013"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <code>await</code> is <emu-val>true</emu-val>.
</li>
</ul>
</emu-clause>
<emu-clause id="sec-static-semantics-classelementkind" type="sdo" aoid="ClassElementKind">
<h1><span class="secnum">15.7.2</span> Static Semantics: ClassElementKind</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8014"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> ClassElementKind takes no arguments and returns <emu-const>constructor-method</emu-const>, <emu-const>non-constructor-method</emu-const>, or <emu-const>empty</emu-const>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="ClassElement" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="s8ilfl9g" id="prod-z4kY36XR"><emu-nt id="_ref_22754"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If the <emu-xref aoid="PropName" id="_ref_8015"><a href="syntax-directed-operations.html#sec-static-semantics-propname">PropName</a></emu-xref> of <emu-nt id="_ref_22755"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> is <emu-val>"constructor"</emu-val>, return <emu-const>constructor-method</emu-const>.</li><li>Return <emu-const>non-constructor-method</emu-const>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElement">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="-ljgtrpo" id="prod-WYqnrGO2">
<emu-t>static</emu-t>
<emu-nt id="_ref_22756"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt>
</emu-rhs>
<emu-rhs a="bwbyf1-5" id="prod-gbiOT0dB">
<emu-nt id="_ref_22757"><a href="ecmascript-language-functions-and-classes.html#prod-FieldDefinition">FieldDefinition</a></emu-nt>
<emu-t>;</emu-t>
</emu-rhs>
<emu-rhs a="cpyv1xvc" id="prod-aKP7bsri">
<emu-t>static</emu-t>
<emu-nt id="_ref_22758"><a href="ecmascript-language-functions-and-classes.html#prod-FieldDefinition">FieldDefinition</a></emu-nt>
<emu-t>;</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-const>non-constructor-method</emu-const>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElement" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="2ui-f2qn" id="prod--zCXluqv"><emu-nt id="_ref_22759"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlock">ClassStaticBlock</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-const>non-constructor-method</emu-const>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElement" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="sg2sawim" id="prod-U_NLPgRJ"><emu-t>;</emu-t></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-const>empty</emu-const>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-static-semantics-constructormethod" type="sdo" aoid="ConstructorMethod">
<h1><span class="secnum">15.7.3</span> Static Semantics: ConstructorMethod</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8016"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> ConstructorMethod takes no arguments and returns a <emu-nt id="_ref_22760"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-xref href="#sec-syntactic-grammar" id="_ref_8017"><a href="notational-conventions.html#sec-syntactic-grammar">Parse Node</a></emu-xref> or <emu-const>empty</emu-const>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="ClassElementList" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="crvluhmw" id="prod-5dD0G3pr"><emu-nt id="_ref_22761"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If the <emu-xref aoid="ClassElementKind" id="_ref_8018"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-classelementkind">ClassElementKind</a></emu-xref> of <emu-nt id="_ref_22762"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> is <emu-const>constructor-method</emu-const>, return <emu-nt id="_ref_22763"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt>.</li><li>Return <emu-const>empty</emu-const>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElementList" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="msulavvt" id="prod-6CQGn2J9">
<emu-nt id="_ref_22764"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt>
<emu-nt id="_ref_22765"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>head</var> be the <emu-xref aoid="ConstructorMethod" id="_ref_8019"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-constructormethod">ConstructorMethod</a></emu-xref> of <emu-nt id="_ref_22766"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt>.</li><li>If <var>head</var> is not <emu-const>empty</emu-const>, return <var>head</var>.</li><li>If the <emu-xref aoid="ClassElementKind" id="_ref_8020"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-classelementkind">ClassElementKind</a></emu-xref> of <emu-nt id="_ref_22767"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> is <emu-const>constructor-method</emu-const>, return <emu-nt id="_ref_22768"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt>.</li><li>Return <emu-const>empty</emu-const>.</li></ol></emu-alg>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>Early Error rules ensure that there is only one method definition named <emu-val>"constructor"</emu-val> and that it is not an <emu-xref href="#sec-object-type" id="_ref_8021"><a href="ecmascript-data-types-and-values.html#sec-object-type">accessor property</a></emu-xref> or generator definition.</p>
</div></emu-note>
</emu-clause>
<emu-clause id="sec-static-semantics-isstatic" type="sdo" aoid="IsStatic">
<h1><span class="secnum">15.7.4</span> Static Semantics: IsStatic</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8022"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> IsStatic takes no arguments and returns a Boolean. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="ClassElement" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="s8ilfl9g" id="prod-CtxLpivn"><emu-nt id="_ref_22769"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElement" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="-ljgtrpo" id="prod-lR6jUbAy">
<emu-t>static</emu-t>
<emu-nt id="_ref_22770"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElement" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="bwbyf1-5" id="prod-gXtZ0OpF">
<emu-nt id="_ref_22771"><a href="ecmascript-language-functions-and-classes.html#prod-FieldDefinition">FieldDefinition</a></emu-nt>
<emu-t>;</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElement" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="cpyv1xvc" id="prod-wyUVxCrb">
<emu-t>static</emu-t>
<emu-nt id="_ref_22772"><a href="ecmascript-language-functions-and-classes.html#prod-FieldDefinition">FieldDefinition</a></emu-nt>
<emu-t>;</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElement" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="2ui-f2qn" id="prod-1JW7WXBn"><emu-nt id="_ref_22773"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlock">ClassStaticBlock</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElement" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="sg2sawim" id="prod-LP0OJ3qJ"><emu-t>;</emu-t></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-static-semantics-nonconstructorelements" oldids="sec-static-semantics-nonconstructormethoddefinitions" type="sdo" aoid="NonConstructorElements"><span id="sec-static-semantics-nonconstructormethoddefinitions"></span>
<h1><span class="secnum">15.7.5</span> Static Semantics: NonConstructorElements</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8023"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> NonConstructorElements takes no arguments and returns a <emu-xref href="#sec-list-and-record-specification-type" id="_ref_8024"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-nt id="_ref_22774"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-xref href="#sec-syntactic-grammar" id="_ref_8025"><a href="notational-conventions.html#sec-syntactic-grammar">Parse Nodes</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="ClassElementList" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="crvluhmw" id="prod-19e_yBXp"><emu-nt id="_ref_22775"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If the <emu-xref aoid="ClassElementKind" id="_ref_8026"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-classelementkind">ClassElementKind</a></emu-xref> of <emu-nt id="_ref_22776"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> is <emu-const>non-constructor-method</emu-const>, then<ol><li>Return « <emu-nt id="_ref_22777"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt>&nbsp;».</li></ol></li><li>Return a new empty <emu-xref href="#sec-list-and-record-specification-type" id="_ref_8027"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElementList" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="msulavvt" id="prod-ax67ii0j">
<emu-nt id="_ref_22778"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt>
<emu-nt id="_ref_22779"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>list</var> be the <emu-xref aoid="NonConstructorElements" id="_ref_8028"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-nonconstructorelements">NonConstructorElements</a></emu-xref> of <emu-nt id="_ref_22780"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt>.</li><li>If the <emu-xref aoid="ClassElementKind" id="_ref_8029"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-classelementkind">ClassElementKind</a></emu-xref> of <emu-nt id="_ref_22781"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> is <emu-const>non-constructor-method</emu-const>, then<ol><li>Append <emu-nt id="_ref_22782"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> to <var>list</var>.</li></ol></li><li>Return <var>list</var>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-static-semantics-prototypepropertynamelist" type="sdo" aoid="PrototypePropertyNameList">
<h1><span class="secnum">15.7.6</span> Static Semantics: PrototypePropertyNameList</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8030"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> PrototypePropertyNameList takes no arguments and returns a <emu-xref href="#sec-list-and-record-specification-type" id="_ref_8031"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-xref href="#property-key" id="_ref_8032"><a href="ecmascript-data-types-and-values.html#property-key">property keys</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="ClassElementList" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="crvluhmw" id="prod-A14zfyT4"><emu-nt id="_ref_22783"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>propName</var> be the <emu-xref aoid="PropName" id="_ref_8033"><a href="syntax-directed-operations.html#sec-static-semantics-propname">PropName</a></emu-xref> of <emu-nt id="_ref_22784"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt>.</li><li>If <var>propName</var> is <emu-const>empty</emu-const>, return a new empty <emu-xref href="#sec-list-and-record-specification-type" id="_ref_8034"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>If <emu-xref aoid="IsStatic" id="_ref_8035"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-isstatic">IsStatic</a></emu-xref> of <emu-nt id="_ref_22785"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> is <emu-val>true</emu-val>, return a new empty <emu-xref href="#sec-list-and-record-specification-type" id="_ref_8036"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>Return « <var>propName</var>&nbsp;».</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElementList" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="msulavvt" id="prod-yD4OjNLB">
<emu-nt id="_ref_22786"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt>
<emu-nt id="_ref_22787"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>list</var> be the <emu-xref aoid="PrototypePropertyNameList" id="_ref_8037"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-prototypepropertynamelist">PrototypePropertyNameList</a></emu-xref> of <emu-nt id="_ref_22788"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt>.</li><li>Let <var>propName</var> be the <emu-xref aoid="PropName" id="_ref_8038"><a href="syntax-directed-operations.html#sec-static-semantics-propname">PropName</a></emu-xref> of <emu-nt id="_ref_22789"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt>.</li><li>If <var>propName</var> is <emu-const>empty</emu-const>, return <var>list</var>.</li><li>If <emu-xref aoid="IsStatic" id="_ref_8039"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-isstatic">IsStatic</a></emu-xref> of <emu-nt id="_ref_22790"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> is <emu-val>true</emu-val>, return <var>list</var>.</li><li>Return the <emu-xref href="#list-concatenation" id="_ref_8040"><a href="ecmascript-data-types-and-values.html#list-concatenation">list-concatenation</a></emu-xref> of <var>list</var> and « <var>propName</var>&nbsp;».</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-static-semantics-allprivateidentifiersvalid" type="sdo" aoid="AllPrivateIdentifiersValid">
<h1><span class="secnum">15.7.7</span> Static Semantics: AllPrivateIdentifiersValid</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8041"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> AllPrivateIdentifiersValid takes argument <var>names</var> (a <emu-xref href="#sec-list-and-record-specification-type" id="_ref_8042"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref> of Strings) and returns a Boolean.</p>
<p>Every grammar production alternative in this specification which is not listed below implicitly has the following default definition of AllPrivateIdentifiersValid:</p>
<emu-alg><ol><li>For each child node <var>child</var> of this <emu-xref href="#sec-syntactic-grammar" id="_ref_8043"><a href="notational-conventions.html#sec-syntactic-grammar">Parse Node</a></emu-xref>, do<ol><li>If <var>child</var> is an instance of a nonterminal, then<ol><li>If <emu-xref aoid="AllPrivateIdentifiersValid" id="_ref_8044"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-allprivateidentifiersvalid">AllPrivateIdentifiersValid</a></emu-xref> of <var>child</var> with argument <var>names</var> is <emu-val>false</emu-val>, return <emu-val>false</emu-val>.</li></ol></li></ol></li><li>Return <emu-val>true</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="MemberExpression" collapsed="">
<emu-nt><a href="ecmascript-language-expressions.html#prod-MemberExpression">MemberExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="0uk9afbi" id="prod-hH1hyF7o">
<emu-nt id="_ref_22791"><a href="ecmascript-language-expressions.html#prod-MemberExpression">MemberExpression</a></emu-nt>
<emu-t>.</emu-t>
<emu-nt id="_ref_22792"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <var>names</var> contains the <emu-xref aoid="StringValue" id="_ref_8045"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22793"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>, then<ol><li>Return <emu-xref aoid="AllPrivateIdentifiersValid" id="_ref_8046"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-allprivateidentifiersvalid">AllPrivateIdentifiersValid</a></emu-xref> of <emu-nt id="_ref_22794"><a href="ecmascript-language-expressions.html#prod-MemberExpression">MemberExpression</a></emu-nt> with argument <var>names</var>.</li></ol></li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="CallExpression" collapsed="">
<emu-nt><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="cysjk9wh" id="prod-9EwGAkEl">
<emu-nt id="_ref_22795"><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt>
<emu-t>.</emu-t>
<emu-nt id="_ref_22796"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <var>names</var> contains the <emu-xref aoid="StringValue" id="_ref_8047"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22797"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>, then<ol><li>Return <emu-xref aoid="AllPrivateIdentifiersValid" id="_ref_8048"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-allprivateidentifiersvalid">AllPrivateIdentifiersValid</a></emu-xref> of <emu-nt id="_ref_22798"><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt> with argument <var>names</var>.</li></ol></li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="OptionalChain" collapsed="">
<emu-nt><a href="ecmascript-language-expressions.html#prod-OptionalChain">OptionalChain</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="0xlnjlpz" id="prod-GLUsMLG4">
<emu-t>?.</emu-t>
<emu-nt id="_ref_22799"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <var>names</var> contains the <emu-xref aoid="StringValue" id="_ref_8049"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22800"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>, return <emu-val>true</emu-val>.</li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="OptionalChain" collapsed="">
<emu-nt><a href="ecmascript-language-expressions.html#prod-OptionalChain">OptionalChain</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="dnp-fbqk" id="prod-LZl0sxgi">
<emu-nt id="_ref_22801"><a href="ecmascript-language-expressions.html#prod-OptionalChain">OptionalChain</a></emu-nt>
<emu-t>.</emu-t>
<emu-nt id="_ref_22802"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <var>names</var> contains the <emu-xref aoid="StringValue" id="_ref_8050"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22803"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>, then<ol><li>Return <emu-xref aoid="AllPrivateIdentifiersValid" id="_ref_8051"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-allprivateidentifiersvalid">AllPrivateIdentifiersValid</a></emu-xref> of <emu-nt id="_ref_22804"><a href="ecmascript-language-expressions.html#prod-OptionalChain">OptionalChain</a></emu-nt> with argument <var>names</var>.</li></ol></li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassBody" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassBody">ClassBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="1y1dunax" id="prod-7rm6mrow"><emu-nt id="_ref_22805"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>newNames</var> be the <emu-xref href="#list-concatenation" id="_ref_8052"><a href="ecmascript-data-types-and-values.html#list-concatenation">list-concatenation</a></emu-xref> of <var>names</var> and the <emu-xref aoid="PrivateBoundIdentifiers" id="_ref_8053"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-privateboundidentifiers">PrivateBoundIdentifiers</a></emu-xref> of <emu-nt id="_ref_22806"><a href="ecmascript-language-functions-and-classes.html#prod-ClassBody">ClassBody</a></emu-nt>.</li><li>Return <emu-xref aoid="AllPrivateIdentifiersValid" id="_ref_8054"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-allprivateidentifiersvalid">AllPrivateIdentifiersValid</a></emu-xref> of <emu-nt id="_ref_22807"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt> with argument <var>newNames</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="RelationalExpression" collapsed="">
<emu-nt><a href="ecmascript-language-expressions.html#prod-RelationalExpression">RelationalExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="bfkxjj0f" id="prod-5aKAQc0s">
<emu-nt id="_ref_22808"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>
<emu-t>in</emu-t>
<emu-nt id="_ref_22809"><a href="ecmascript-language-expressions.html#prod-ShiftExpression">ShiftExpression</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <var>names</var> contains the <emu-xref aoid="StringValue" id="_ref_8055"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22810"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>, then<ol><li>Return <emu-xref aoid="AllPrivateIdentifiersValid" id="_ref_8056"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-allprivateidentifiersvalid">AllPrivateIdentifiersValid</a></emu-xref> of <emu-nt id="_ref_22811"><a href="ecmascript-language-expressions.html#prod-ShiftExpression">ShiftExpression</a></emu-nt> with argument <var>names</var>.</li></ol></li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-static-semantics-privateboundidentifiers" type="sdo" aoid="PrivateBoundIdentifiers">
<h1><span class="secnum">15.7.8</span> Static Semantics: PrivateBoundIdentifiers</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8057"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> PrivateBoundIdentifiers takes no arguments and returns a <emu-xref href="#sec-list-and-record-specification-type" id="_ref_8058"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref> of Strings. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="FieldDefinition" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FieldDefinition">FieldDefinition</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="rqzzdcte" id="prod-QQ9gR7rA">
<emu-nt id="_ref_22812"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-nt optional="" id="_ref_22813"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return the <emu-xref aoid="PrivateBoundIdentifiers" id="_ref_8059"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-privateboundidentifiers">PrivateBoundIdentifiers</a></emu-xref> of <emu-nt id="_ref_22814"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElementName" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ie2-zc1c" id="prod-3FDawUhc"><emu-nt id="_ref_22815"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return a <emu-xref href="#sec-list-and-record-specification-type" id="_ref_8060"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref> whose sole element is the <emu-xref aoid="StringValue" id="_ref_8061"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22816"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElementName">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="bmyo-0oj" id="prod-T6diBlyd">
<emu-nt id="_ref_22817"><a href="ecmascript-language-expressions.html#prod-PropertyName">PropertyName</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="ClassElement">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="2ui-f2qn" id="prod-8T9v42E5">
<emu-nt id="_ref_22818"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlock">ClassStaticBlock</a></emu-nt>
</emu-rhs>
<emu-rhs a="sg2sawim" id="prod-mMa7qdyC">
<emu-t>;</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return a new empty <emu-xref href="#sec-list-and-record-specification-type" id="_ref_8062"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElementList" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="msulavvt" id="prod-PTQtTdvS">
<emu-nt id="_ref_22819"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt>
<emu-nt id="_ref_22820"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>names1</var> be the <emu-xref aoid="PrivateBoundIdentifiers" id="_ref_8063"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-privateboundidentifiers">PrivateBoundIdentifiers</a></emu-xref> of <emu-nt id="_ref_22821"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementList">ClassElementList</a></emu-nt>.</li><li>Let <var>names2</var> be the <emu-xref aoid="PrivateBoundIdentifiers" id="_ref_8064"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-privateboundidentifiers">PrivateBoundIdentifiers</a></emu-xref> of <emu-nt id="_ref_22822"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt>.</li><li>Return the <emu-xref href="#list-concatenation" id="_ref_8065"><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>
<emu-grammar><emu-production name="MethodDefinition">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="f2ayx1_q" id="prod-pxy6kYq7">
<emu-nt id="_ref_22823"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22824"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22825"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="s7vk7pda" id="prod-axmlrr3F">
<emu-t>get</emu-t>
<emu-nt id="_ref_22826"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22827"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="lbu40xzc" id="prod-9-TzGQnW">
<emu-t>set</emu-t>
<emu-nt id="_ref_22828"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22829"><a href="ecmascript-language-functions-and-classes.html#prod-PropertySetParameterList">PropertySetParameterList</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22830"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="GeneratorMethod">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorMethod">GeneratorMethod</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="e6yupcp1" id="prod-Qvq1cmEs">
<emu-t>*</emu-t>
<emu-nt id="_ref_22831"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22832"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22833"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="AsyncMethod">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncMethod">AsyncMethod</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="cfy3_9l8" id="prod-zTa8Ph70">
<emu-t>async</emu-t>
<emu-nt id="_ref_22834"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22835"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22836"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="AsyncGeneratorMethod">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorMethod">AsyncGeneratorMethod</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="2edb8sar" id="prod-1nK7U43p">
<emu-t>async</emu-t>
<emu-t>*</emu-t>
<emu-nt id="_ref_22837"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22838"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22839"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return the <emu-xref aoid="PrivateBoundIdentifiers" id="_ref_8066"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-privateboundidentifiers">PrivateBoundIdentifiers</a></emu-xref> of <emu-nt id="_ref_22840"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-static-semantics-containsarguments" type="sdo" aoid="ContainsArguments">
<h1><span class="secnum">15.7.9</span> Static Semantics: ContainsArguments</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8067"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> ContainsArguments takes no arguments and returns a Boolean.</p>
<p>Every grammar production alternative in this specification which is not listed below implicitly has the following default definition of ContainsArguments:</p>
<emu-alg><ol><li>For each child node <var>child</var> of this <emu-xref href="#sec-syntactic-grammar" id="_ref_8068"><a href="notational-conventions.html#sec-syntactic-grammar">Parse Node</a></emu-xref>, do<ol><li>If <var>child</var> is an instance of a nonterminal, then<ol><li>If <emu-xref aoid="ContainsArguments" id="_ref_8069"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsarguments">ContainsArguments</a></emu-xref> of <var>child</var> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li></ol></li></ol></li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="IdentifierReference" collapsed="">
<emu-nt><a href="ecmascript-language-expressions.html#prod-IdentifierReference">IdentifierReference</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="bras6mo_" id="prod-K0gmEtvp"><emu-nt id="_ref_22841"><a href="ecmascript-language-expressions.html#prod-Identifier">Identifier</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If the <emu-xref aoid="StringValue" id="_ref_8070"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22842"><a href="ecmascript-language-expressions.html#prod-Identifier">Identifier</a></emu-nt> is <emu-val>"arguments"</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="FunctionDeclaration">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="gxoavzvy" id="prod-cYRKXADu">
<emu-t>function</emu-t>
<emu-nt id="_ref_22843"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22844"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22845"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="smus6qca" id="prod-fA8Y53Jv">
<emu-t>function</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_22846"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22847"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="FunctionExpression">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="g3mtfiqq" id="prod-DKZGJMJp">
<emu-t>function</emu-t>
<emu-nt optional="" id="_ref_22848"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22849"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22850"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="GeneratorDeclaration">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorDeclaration">GeneratorDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="fbyztjbh" id="prod-Uf4haGDs">
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt id="_ref_22851"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22852"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22853"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="dsczygsq" id="prod-7bSRnJkd">
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_22854"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22855"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="GeneratorExpression">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="32ghovyc" id="prod-RyrSiZbO">
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt optional="" id="_ref_22856"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22857"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22858"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="AsyncGeneratorDeclaration">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorDeclaration">AsyncGeneratorDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="e9lmm5cj" id="prod-3lM6XkIw">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt id="_ref_22859"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22860"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22861"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="xruu4gg0" id="prod-w57asuPi">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_22862"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22863"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="AsyncGeneratorExpression">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="nplor0n0" id="prod-H3uNNgf7">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-t>*</emu-t>
<emu-nt optional="" id="_ref_22864"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22865"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22866"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="AsyncFunctionDeclaration">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionDeclaration">AsyncFunctionDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="4mmt35rm" id="prod-k_4DyjCo">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-nt id="_ref_22867"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22868"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22869"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="agdmcdye" id="prod-TdFyphFg">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_22870"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22871"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="AsyncFunctionExpression">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="1_djgdhl" id="prod-nEJuWHii">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-nt optional="" id="_ref_22872"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22873"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22874"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="MethodDefinition">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="f2ayx1_q" id="prod-6Kc2wh10">
<emu-nt id="_ref_22875"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22876"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22877"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="s7vk7pda" id="prod-9ZjrMW3N">
<emu-t>get</emu-t>
<emu-nt id="_ref_22878"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22879"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="lbu40xzc" id="prod-WPITwaqC">
<emu-t>set</emu-t>
<emu-nt id="_ref_22880"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22881"><a href="ecmascript-language-functions-and-classes.html#prod-PropertySetParameterList">PropertySetParameterList</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22882"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="GeneratorMethod">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorMethod">GeneratorMethod</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="e6yupcp1" id="prod-6uQ7SWxA">
<emu-t>*</emu-t>
<emu-nt id="_ref_22883"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22884"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22885"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="AsyncGeneratorMethod">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorMethod">AsyncGeneratorMethod</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="2edb8sar" id="prod-mThhZsRd">
<emu-t>async</emu-t>
<emu-t>*</emu-t>
<emu-nt id="_ref_22886"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22887"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22888"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="AsyncMethod">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncMethod">AsyncMethod</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="cfy3_9l8" id="prod-UU7zbVYJ">
<emu-t>async</emu-t>
<emu-nt id="_ref_22889"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22890"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22891"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="ContainsArguments" id="_ref_8071"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-containsarguments">ContainsArguments</a></emu-xref> of <emu-nt id="_ref_22892"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-runtime-semantics-classfielddefinitionevaluation" type="sdo" aoid="ClassFieldDefinitionEvaluation">
<h1><span class="secnum">15.7.10</span> Runtime Semantics: ClassFieldDefinitionEvaluation</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8072"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> ClassFieldDefinitionEvaluation takes argument <var>homeObject</var> (an Object) and returns either a <emu-xref href="#sec-completion-record-specification-type" id="_ref_8073"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">normal completion containing</a></emu-xref> a <emu-xref href="#sec-classfielddefinition-record-specification-type" id="_ref_8074"><a href="ecmascript-data-types-and-values.html#sec-classfielddefinition-record-specification-type">ClassFieldDefinition Record</a></emu-xref> or an <emu-xref href="#sec-completion-record-specification-type" id="_ref_8075"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="FieldDefinition" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FieldDefinition">FieldDefinition</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="rqzzdcte" id="prod-deOh_-BS">
<emu-nt id="_ref_22893"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-nt optional="" id="_ref_22894"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>name</var> be ?&nbsp;<emu-xref aoid="Evaluation" id="_ref_8076"><a href="syntax-directed-operations.html#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt id="_ref_22895"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>.</li><li>If <emu-nt id="_ref_22896"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt> is present, then<ol><li>Let <var>formalParameterList</var> be an instance of the production <emu-grammar><emu-production name="FormalParameters" collapsed="" class=" inline">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="n7nathbb"><emu-gann>[empty]</emu-gann></emu-rhs>
</emu-production>
</emu-grammar>.</li><li>Let <var>env</var> be the LexicalEnvironment of the <emu-xref href="#running-execution-context" id="_ref_8077"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>.</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_8078"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the empty sequence of Unicode code points.</li><li>Let <var>initializer</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_8079"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-function-prototype-object" id="_ref_8080"><a href="fundamental-objects.html#sec-properties-of-the-function-prototype-object">%Function.prototype%</a></emu-xref>, <var>sourceText</var>, <var>formalParameterList</var>, <emu-nt id="_ref_22897"><a href="ecmascript-language-expressions.html#prod-Initializer">Initializer</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="MakeMethod" id="_ref_8081"><a href="ordinary-and-exotic-objects-behaviours.html#sec-makemethod">MakeMethod</a></emu-xref>(<var>initializer</var>, <var>homeObject</var>).</li><li>Set <var>initializer</var>.<var class="field">[[ClassFieldInitializerName]]</var> to <var>name</var>.</li></ol></li><li>Else,<ol><li>Let <var>initializer</var> be <emu-const>empty</emu-const>.</li></ol></li><li>Return the <emu-xref href="#sec-classfielddefinition-record-specification-type" id="_ref_8082"><a href="ecmascript-data-types-and-values.html#sec-classfielddefinition-record-specification-type">ClassFieldDefinition Record</a></emu-xref> { <var class="field">[[Name]]</var>: <var>name</var>, <var class="field">[[Initializer]]</var>: <var>initializer</var>&nbsp;}.</li></ol></emu-alg>
<emu-note><span class="note">Note</span><div class="note-contents">
The function created for <var>initializer</var> is never directly accessible to ECMAScript code.
</div></emu-note>
</emu-clause>
<emu-clause id="sec-runtime-semantics-classstaticblockdefinitionevaluation" type="sdo" aoid="ClassStaticBlockDefinitionEvaluation">
<h1><span class="secnum">15.7.11</span> Runtime Semantics: ClassStaticBlockDefinitionEvaluation</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8083"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> ClassStaticBlockDefinitionEvaluation takes argument <var>homeObject</var> (an Object) and returns a <emu-xref href="#sec-classstaticblockdefinition-record-specification-type" id="_ref_8084"><a href="ecmascript-data-types-and-values.html#sec-classstaticblockdefinition-record-specification-type">ClassStaticBlockDefinition Record</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="ClassStaticBlock" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlock">ClassStaticBlock</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="hv6hopt7" id="prod-sy-617ri">
<emu-t>static</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22898"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockBody">ClassStaticBlockBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>lex</var> be the <emu-xref href="#running-execution-context" id="_ref_8085"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s LexicalEnvironment.</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_8086"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the empty sequence of Unicode code points.</li><li>Let <var>formalParameters</var> be an instance of the production <emu-grammar><emu-production name="FormalParameters" collapsed="" class=" inline">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="n7nathbb"><emu-gann>[empty]</emu-gann></emu-rhs>
</emu-production>
</emu-grammar>.</li><li id="step-synthetic-class-static-block-fn">Let <var>bodyFunction</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_8087"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-function-prototype-object" id="_ref_8088"><a href="fundamental-objects.html#sec-properties-of-the-function-prototype-object">%Function.prototype%</a></emu-xref>, <var>sourceText</var>, <var>formalParameters</var>, <emu-nt id="_ref_22899"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockBody">ClassStaticBlockBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>lex</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="MakeMethod" id="_ref_8089"><a href="ordinary-and-exotic-objects-behaviours.html#sec-makemethod">MakeMethod</a></emu-xref>(<var>bodyFunction</var>, <var>homeObject</var>).</li><li>Return the <emu-xref href="#sec-classstaticblockdefinition-record-specification-type" id="_ref_8090"><a href="ecmascript-data-types-and-values.html#sec-classstaticblockdefinition-record-specification-type">ClassStaticBlockDefinition Record</a></emu-xref> { <var class="field">[[BodyFunction]]</var>: <var>bodyFunction</var>&nbsp;}.</li></ol></emu-alg>
<emu-note><span class="note">Note</span><div class="note-contents">The function <var>bodyFunction</var> is never directly accessible to ECMAScript code.</div></emu-note>
</emu-clause>
<emu-clause id="sec-runtime-semantics-evaluateclassstaticblockbody" type="sdo" aoid="EvaluateClassStaticBlockBody">
<h1><span class="secnum">15.7.12</span> Runtime Semantics: EvaluateClassStaticBlockBody</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8091"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> EvaluateClassStaticBlockBody takes argument <var>functionObject</var> (an ECMAScript <emu-xref href="#function-object" id="_ref_8092"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>) and returns a <emu-xref href="#sec-completion-record-specification-type" id="_ref_8093"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">return completion</a></emu-xref> or a <emu-xref href="#sec-completion-record-specification-type" id="_ref_8094"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">throw completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="ClassStaticBlockBody" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockBody">ClassStaticBlockBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="oh0jsomm" id="prod-1dy60deL"><emu-nt id="_ref_22900"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockStatementList">ClassStaticBlockStatementList</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li><emu-xref href="#assert" id="_ref_8095"><a href="notational-conventions.html#assert">Assert</a></emu-xref>: <var>functionObject</var> is a synthetic function created by <emu-xref aoid="ClassStaticBlockDefinitionEvaluation" id="_ref_8096"><a href="ecmascript-language-functions-and-classes.html#sec-runtime-semantics-classstaticblockdefinitionevaluation">ClassStaticBlockDefinitionEvaluation</a></emu-xref> step <emu-xref href="#step-synthetic-class-static-block-fn" id="_ref_470"><a href="ecmascript-language-functions-and-classes.html#step-synthetic-class-static-block-fn">5</a></emu-xref>.</li><li>Perform !&nbsp;<emu-xref aoid="FunctionDeclarationInstantiation" id="_ref_8097"><a href="ordinary-and-exotic-objects-behaviours.html#sec-functiondeclarationinstantiation">FunctionDeclarationInstantiation</a></emu-xref>(<var>functionObject</var>, «&nbsp;»).</li><li>Perform ?&nbsp;<emu-xref aoid="Evaluation" id="_ref_8098"><a href="syntax-directed-operations.html#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt id="_ref_22901"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockStatementList">ClassStaticBlockStatementList</a></emu-nt>.</li><li>Return <emu-xref aoid="ReturnCompletion" id="_ref_8099"><a href="ecmascript-data-types-and-values.html#sec-returncompletion">ReturnCompletion</a></emu-xref>(<emu-val>undefined</emu-val>).</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-static-semantics-classelementevaluation" type="sdo" aoid="ClassElementEvaluation">
<h1><span class="secnum">15.7.13</span> Runtime Semantics: ClassElementEvaluation</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8100"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> ClassElementEvaluation takes argument <var>object</var> (an Object) and returns either a <emu-xref href="#sec-completion-record-specification-type" id="_ref_8101"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">normal completion containing</a></emu-xref> either a <emu-xref href="#sec-classfielddefinition-record-specification-type" id="_ref_8102"><a href="ecmascript-data-types-and-values.html#sec-classfielddefinition-record-specification-type">ClassFieldDefinition Record</a></emu-xref>, a <emu-xref href="#sec-classstaticblockdefinition-record-specification-type" id="_ref_8103"><a href="ecmascript-data-types-and-values.html#sec-classstaticblockdefinition-record-specification-type">ClassStaticBlockDefinition Record</a></emu-xref>, a <emu-xref href="#sec-privateelement-specification-type" id="_ref_8104"><a href="ecmascript-data-types-and-values.html#sec-privateelement-specification-type">PrivateElement</a></emu-xref>, or <emu-const>unused</emu-const>, or an <emu-xref href="#sec-completion-record-specification-type" id="_ref_8105"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="ClassElement">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="bwbyf1-5" id="prod-tPq9hD-G">
<emu-nt id="_ref_22902"><a href="ecmascript-language-functions-and-classes.html#prod-FieldDefinition">FieldDefinition</a></emu-nt>
<emu-t>;</emu-t>
</emu-rhs>
<emu-rhs a="cpyv1xvc" id="prod-Cn1oLmsN">
<emu-t>static</emu-t>
<emu-nt id="_ref_22903"><a href="ecmascript-language-functions-and-classes.html#prod-FieldDefinition">FieldDefinition</a></emu-nt>
<emu-t>;</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return ?&nbsp;<emu-xref aoid="ClassFieldDefinitionEvaluation" id="_ref_8106"><a href="ecmascript-language-functions-and-classes.html#sec-runtime-semantics-classfielddefinitionevaluation" class="e-user-code">ClassFieldDefinitionEvaluation</a></emu-xref> of <emu-nt id="_ref_22904"><a href="ecmascript-language-functions-and-classes.html#prod-FieldDefinition">FieldDefinition</a></emu-nt> with argument <var>object</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElement">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="s8ilfl9g" id="prod-RV4ZOA0y">
<emu-nt id="_ref_22905"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt>
</emu-rhs>
<emu-rhs a="-ljgtrpo" id="prod-DNhqQKHO">
<emu-t>static</emu-t>
<emu-nt id="_ref_22906"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return ?&nbsp;<emu-xref aoid="MethodDefinitionEvaluation" id="_ref_8107"><a href="ecmascript-language-functions-and-classes.html#sec-runtime-semantics-methoddefinitionevaluation" class="e-user-code">MethodDefinitionEvaluation</a></emu-xref> of <emu-nt id="_ref_22907"><a href="ecmascript-language-functions-and-classes.html#prod-MethodDefinition">MethodDefinition</a></emu-nt> with arguments <var>object</var> and <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElement" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="2ui-f2qn" id="prod-Hb23PvBK"><emu-nt id="_ref_22908"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlock">ClassStaticBlock</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return the <emu-xref aoid="ClassStaticBlockDefinitionEvaluation" id="_ref_8108"><a href="ecmascript-language-functions-and-classes.html#sec-runtime-semantics-classstaticblockdefinitionevaluation">ClassStaticBlockDefinitionEvaluation</a></emu-xref> of <emu-nt id="_ref_22909"><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlock">ClassStaticBlock</a></emu-nt> with argument <var>object</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElement" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="sg2sawim" id="prod-V88LvFxI"><emu-t>;</emu-t></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-const>unused</emu-const>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-runtime-semantics-classdefinitionevaluation" oldids="sec-default-constructor-functions" type="sdo" aoid="ClassDefinitionEvaluation"><span id="sec-default-constructor-functions"></span>
<h1><span class="secnum">15.7.14</span> Runtime Semantics: ClassDefinitionEvaluation</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8109"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> ClassDefinitionEvaluation takes arguments <var>classBinding</var> (a String or <emu-val>undefined</emu-val>), <var>className</var> (a <emu-xref href="#property-key" id="_ref_8110"><a href="ecmascript-data-types-and-values.html#property-key">property key</a></emu-xref> or a <emu-xref href="#sec-private-names" id="_ref_8111"><a href="ecmascript-data-types-and-values.html#sec-private-names">Private Name</a></emu-xref>), and <var>sourceText</var> (<emu-xref href="#sec-source-text" id="_ref_8112"><a href="ecmascript-language-source-code.html#sec-source-text">ECMAScript source text</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type" id="_ref_8113"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">normal completion containing</a></emu-xref> a <emu-xref href="#function-object" id="_ref_8114"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref> or an <emu-xref href="#sec-completion-record-specification-type" id="_ref_8115"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">abrupt completion</a></emu-xref>.</p>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>For ease of specification, private methods and accessors are included alongside private fields in the <var class="field">[[PrivateElements]]</var> slot of class instances. However, any given object has either all or none of the private methods and accessors defined by a given class. This feature has been designed so that implementations may choose to implement private methods and accessors using a strategy which does not require tracking each method or accessor individually.</p>
<p>For example, an implementation could directly associate instance private methods with their corresponding <emu-xref href="#sec-private-names" id="_ref_8116"><a href="ecmascript-data-types-and-values.html#sec-private-names">Private Name</a></emu-xref> and track, for each object, which class <emu-xref href="#constructor" id="_ref_8117"><a href="ecmascript-data-types-and-values.html#constructor">constructors</a></emu-xref> have run with that object as their <code>this</code> value. Looking up an instance private method on an object then consists of checking that the class <emu-xref href="#constructor" id="_ref_8118"><a href="ecmascript-data-types-and-values.html#constructor">constructor</a></emu-xref> which defines the method has been used to initialize the object, then returning the method associated with the <emu-xref href="#sec-private-names" id="_ref_8119"><a href="ecmascript-data-types-and-values.html#sec-private-names">Private Name</a></emu-xref>.</p>
<p>This differs from private fields: because field initializers can throw during class instantiation, an individual object may have some proper subset of the private fields of a given class, and so private fields must in general be tracked individually.</p>
</div></emu-note>
<p>It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="ClassTail" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassTail">ClassTail</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uopqpdqx" id="prod-AcPtObVs">
<emu-nt optional="" id="_ref_22910"><a href="ecmascript-language-functions-and-classes.html#prod-ClassHeritage">ClassHeritage</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>{</emu-t>
<emu-nt optional="" id="_ref_22911"><a href="ecmascript-language-functions-and-classes.html#prod-ClassBody">ClassBody</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>env</var> be the LexicalEnvironment of the <emu-xref href="#running-execution-context" id="_ref_8120"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>.</li><li>Let <var>classEnv</var> be <emu-xref aoid="NewDeclarativeEnvironment" id="_ref_8121"><a href="executable-code-and-execution-contexts.html#sec-newdeclarativeenvironment">NewDeclarativeEnvironment</a></emu-xref>(<var>env</var>).</li><li>If <var>classBinding</var> is not <emu-val>undefined</emu-val>, then<ol><li>Perform !&nbsp;<var>classEnv</var>.<emu-xref aoid="CreateImmutableBinding" id="_ref_8122"><a href="executable-code-and-execution-contexts.html#abstract-createimmutablebinding">CreateImmutableBinding</a></emu-xref>(<var>classBinding</var>, <emu-val>true</emu-val>).</li></ol></li><li>Let <var>outerPrivateEnvironment</var> be the <emu-xref href="#running-execution-context" id="_ref_8123"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>classPrivateEnvironment</var> be <emu-xref aoid="NewPrivateEnvironment" id="_ref_8124"><a href="executable-code-and-execution-contexts.html#sec-newprivateenvironment">NewPrivateEnvironment</a></emu-xref>(<var>outerPrivateEnvironment</var>).</li><li>If <emu-nt id="_ref_22912"><a href="ecmascript-language-functions-and-classes.html#prod-ClassBody">ClassBody</a></emu-nt> is present, then<ol><li>For each String <var>dn</var> of the <emu-xref aoid="PrivateBoundIdentifiers" id="_ref_8125"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-privateboundidentifiers">PrivateBoundIdentifiers</a></emu-xref> of <emu-nt id="_ref_22913"><a href="ecmascript-language-functions-and-classes.html#prod-ClassBody">ClassBody</a></emu-nt>, do<ol><li>If <var>classPrivateEnvironment</var>.<var class="field">[[Names]]</var> contains a <emu-xref href="#sec-private-names" id="_ref_8126"><a href="ecmascript-data-types-and-values.html#sec-private-names">Private Name</a></emu-xref> <var>pn</var> such that <var>pn</var>.<var class="field">[[Description]]</var> is <var>dn</var>, then<ol><li><emu-xref href="#assert" id="_ref_8127"><a href="notational-conventions.html#assert">Assert</a></emu-xref>: This is only possible for getter/setter pairs.</li></ol></li><li>Else,<ol><li>Let <var>name</var> be a new <emu-xref href="#sec-private-names" id="_ref_8128"><a href="ecmascript-data-types-and-values.html#sec-private-names">Private Name</a></emu-xref> whose <var class="field">[[Description]]</var> is <var>dn</var>.</li><li>Append <var>name</var> to <var>classPrivateEnvironment</var>.<var class="field">[[Names]]</var>.</li></ol></li></ol></li></ol></li><li>If <emu-nt id="_ref_22914"><a href="ecmascript-language-functions-and-classes.html#prod-ClassHeritage">ClassHeritage</a></emu-nt> is not present, then<ol><li>Let <var>protoParent</var> be <emu-xref href="#sec-properties-of-the-object-prototype-object" id="_ref_8129"><a href="fundamental-objects.html#sec-properties-of-the-object-prototype-object">%Object.prototype%</a></emu-xref>.</li><li>Let <var>constructorParent</var> be <emu-xref href="#sec-properties-of-the-function-prototype-object" id="_ref_8130"><a href="fundamental-objects.html#sec-properties-of-the-function-prototype-object">%Function.prototype%</a></emu-xref>.</li></ol></li><li>Else,<ol><li>Set the <emu-xref href="#running-execution-context" id="_ref_8131"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s LexicalEnvironment to <var>classEnv</var>.</li><li>NOTE: The <emu-xref href="#running-execution-context" id="_ref_8132"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment is <var>outerPrivateEnvironment</var> when evaluating <emu-nt id="_ref_22915"><a href="ecmascript-language-functions-and-classes.html#prod-ClassHeritage">ClassHeritage</a></emu-nt>.</li><li>Let <var>superclassRef</var> be <emu-xref aoid="Completion" id="_ref_8133"><a href="notational-conventions.html#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="Evaluation" id="_ref_8134"><a href="syntax-directed-operations.html#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt id="_ref_22916"><a href="ecmascript-language-functions-and-classes.html#prod-ClassHeritage">ClassHeritage</a></emu-nt>).</li><li>Set the <emu-xref href="#running-execution-context" id="_ref_8135"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s LexicalEnvironment to <var>env</var>.</li><li>Let <var>superclass</var> be ?&nbsp;<emu-xref aoid="GetValue" id="_ref_8136"><a href="ecmascript-data-types-and-values.html#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(? <var>superclassRef</var>).</li><li>If <var>superclass</var> is <emu-val>null</emu-val>, then<ol><li>Let <var>protoParent</var> be <emu-val>null</emu-val>.</li><li>Let <var>constructorParent</var> be <emu-xref href="#sec-properties-of-the-function-prototype-object" id="_ref_8137"><a href="fundamental-objects.html#sec-properties-of-the-function-prototype-object">%Function.prototype%</a></emu-xref>.</li></ol></li><li>Else if <emu-xref aoid="IsConstructor" id="_ref_8138"><a href="abstract-operations.html#sec-isconstructor">IsConstructor</a></emu-xref>(<var>superclass</var>) is <emu-val>false</emu-val>, then<ol><li>Throw a <emu-val>TypeError</emu-val> exception.</li></ol></li><li>Else,<ol><li>Let <var>protoParent</var> be ?&nbsp;<emu-xref aoid="Get" id="_ref_8139"><a href="abstract-operations.html#sec-get-o-p" class="e-user-code">Get</a></emu-xref>(<var>superclass</var>, <emu-val>"prototype"</emu-val>).</li><li>If <var>protoParent</var> <emu-xref href="#sec-object-type" id="_ref_8140"><a href="ecmascript-data-types-and-values.html#sec-object-type">is not an Object</a></emu-xref> and <var>protoParent</var> is not <emu-val>null</emu-val>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Let <var>constructorParent</var> be <var>superclass</var>.</li></ol></li></ol></li><li>Let <var>proto</var> be <emu-xref aoid="OrdinaryObjectCreate" id="_ref_8141"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryobjectcreate">OrdinaryObjectCreate</a></emu-xref>(<var>protoParent</var>).</li><li>If <emu-nt id="_ref_22917"><a href="ecmascript-language-functions-and-classes.html#prod-ClassBody">ClassBody</a></emu-nt> is not present, let <var>constructor</var> be <emu-const>empty</emu-const>.</li><li>Else, let <var>constructor</var> be the <emu-xref aoid="ConstructorMethod" id="_ref_8142"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-constructormethod">ConstructorMethod</a></emu-xref> of <emu-nt id="_ref_22918"><a href="ecmascript-language-functions-and-classes.html#prod-ClassBody">ClassBody</a></emu-nt>.</li><li>Set the <emu-xref href="#running-execution-context" id="_ref_8143"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s LexicalEnvironment to <var>classEnv</var>.</li><li>Set the <emu-xref href="#running-execution-context" id="_ref_8144"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment to <var>classPrivateEnvironment</var>.</li><li>If <var>constructor</var> is <emu-const>empty</emu-const>, then<ol><li>Let <var>defaultConstructor</var> be a new <emu-xref href="#sec-abstract-closure" id="_ref_8145"><a href="ecmascript-data-types-and-values.html#sec-abstract-closure">Abstract Closure</a></emu-xref> with no parameters that captures nothing and performs the following steps when called:<ol><li>Let <var>args</var> be the <emu-xref href="#sec-list-and-record-specification-type" id="_ref_8146"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref> of arguments that was passed to this function by <var class="field">[[Call]]</var> or <var class="field">[[Construct]]</var>.</li><li>If NewTarget is <emu-val>undefined</emu-val>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Let <var>F</var> be the <emu-xref href="#active-function-object" id="_ref_8147"><a href="executable-code-and-execution-contexts.html#active-function-object">active function object</a></emu-xref>.</li><li>If <var>F</var>.<var class="field">[[ConstructorKind]]</var> is <emu-const>derived</emu-const>, then<ol><li>NOTE: This branch behaves similarly to <code>constructor(...args) { super(...args);&nbsp;}</code>. The most notable distinction is that while the aforementioned <emu-xref href="#sec-source-text" id="_ref_8148"><a href="ecmascript-language-source-code.html#sec-source-text">ECMAScript source text</a></emu-xref> observably calls the <emu-xref href="#sec-well-known-symbols" id="_ref_8149"><a href="ecmascript-data-types-and-values.html#sec-well-known-symbols">%Symbol.iterator%</a></emu-xref> method on <code>%Array.prototype%</code>, this function does not.</li><li>Let <var>func</var> be !&nbsp;<var>F</var>.<var class="field">[[GetPrototypeOf]]</var>().</li><li>If <emu-xref aoid="IsConstructor" id="_ref_8150"><a href="abstract-operations.html#sec-isconstructor">IsConstructor</a></emu-xref>(<var>func</var>) is <emu-val>false</emu-val>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Let <var>result</var> be ?&nbsp;<emu-xref aoid="Construct" id="_ref_8151"><a href="abstract-operations.html#sec-construct" class="e-user-code">Construct</a></emu-xref>(<var>func</var>, <var>args</var>, NewTarget).</li></ol></li><li>Else,<ol><li>NOTE: This branch behaves similarly to <code>constructor() {}</code>.</li><li>Let <var>result</var> be ?&nbsp;<emu-xref aoid="OrdinaryCreateFromConstructor" id="_ref_8152"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinarycreatefromconstructor" class="e-user-code">OrdinaryCreateFromConstructor</a></emu-xref>(NewTarget, <emu-val>"%Object.prototype%"</emu-val>).</li></ol></li><li>Perform ?&nbsp;<emu-xref aoid="InitializeInstanceElements" id="_ref_8153"><a href="abstract-operations.html#sec-initializeinstanceelements" class="e-user-code">InitializeInstanceElements</a></emu-xref>(<var>result</var>, <var>F</var>).</li><li>Return <emu-xref aoid="NormalCompletion" id="_ref_8154"><a href="ecmascript-data-types-and-values.html#sec-normalcompletion">NormalCompletion</a></emu-xref>(<var>result</var>).</li></ol></li><li>Let <var>F</var> be <emu-xref aoid="CreateBuiltinFunction" id="_ref_8155"><a href="ordinary-and-exotic-objects-behaviours.html#sec-createbuiltinfunction">CreateBuiltinFunction</a></emu-xref>(<var>defaultConstructor</var>, 0, <var>className</var>, « <var class="field">[[ConstructorKind]]</var>, <var class="field">[[SourceText]]</var>, <var class="field">[[PrivateMethods]]</var>, <var class="field">[[Fields]]</var>&nbsp;», <emu-xref href="#current-realm" id="_ref_8156"><a href="executable-code-and-execution-contexts.html#current-realm">the current Realm Record</a></emu-xref>, <var>constructorParent</var>).</li></ol></li><li>Else,<ol><li>Let <var>constructorInfo</var> be !&nbsp;<emu-xref aoid="DefineMethod" id="_ref_8157"><a href="ecmascript-language-functions-and-classes.html#sec-runtime-semantics-definemethod">DefineMethod</a></emu-xref> of <var>constructor</var> with arguments <var>proto</var> and <var>constructorParent</var>.</li><li>Let <var>F</var> be <var>constructorInfo</var>.<var class="field">[[Closure]]</var>.</li><li>Perform <emu-xref aoid="MakeClassConstructor" id="_ref_8158"><a href="ordinary-and-exotic-objects-behaviours.html#sec-makeclassconstructor">MakeClassConstructor</a></emu-xref>(<var>F</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_8159"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>F</var>, <var>className</var>).</li></ol></li><li>Set <var>F</var>.<var class="field">[[SourceText]]</var> to <var>sourceText</var>.</li><li>Perform <emu-xref aoid="MakeConstructor" id="_ref_8160"><a href="ordinary-and-exotic-objects-behaviours.html#sec-makeconstructor">MakeConstructor</a></emu-xref>(<var>F</var>, <emu-val>false</emu-val>, <var>proto</var>).</li><li>If <emu-nt id="_ref_22919"><a href="ecmascript-language-functions-and-classes.html#prod-ClassHeritage">ClassHeritage</a></emu-nt> is present, set <var>F</var>.<var class="field">[[ConstructorKind]]</var> to <emu-const>derived</emu-const>.</li><li>Perform !&nbsp;<emu-xref aoid="DefineMethodProperty" id="_ref_8161"><a href="ordinary-and-exotic-objects-behaviours.html#sec-definemethodproperty">DefineMethodProperty</a></emu-xref>(<var>proto</var>, <emu-val>"constructor"</emu-val>, <var>F</var>, <emu-val>false</emu-val>).</li><li>If <emu-nt id="_ref_22920"><a href="ecmascript-language-functions-and-classes.html#prod-ClassBody">ClassBody</a></emu-nt> is not present, let <var>elements</var> be a new empty <emu-xref href="#sec-list-and-record-specification-type" id="_ref_8162"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>Else, let <var>elements</var> be the <emu-xref aoid="NonConstructorElements" id="_ref_8163"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-nonconstructorelements">NonConstructorElements</a></emu-xref> of <emu-nt id="_ref_22921"><a href="ecmascript-language-functions-and-classes.html#prod-ClassBody">ClassBody</a></emu-nt>.</li><li>Let <var>instancePrivateMethods</var> be a new empty <emu-xref href="#sec-list-and-record-specification-type" id="_ref_8164"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>Let <var>staticPrivateMethods</var> be a new empty <emu-xref href="#sec-list-and-record-specification-type" id="_ref_8165"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>Let <var>instanceFields</var> be a new empty <emu-xref href="#sec-list-and-record-specification-type" id="_ref_8166"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>Let <var>staticElements</var> be a new empty <emu-xref href="#sec-list-and-record-specification-type" id="_ref_8167"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>For each <emu-nt id="_ref_22922"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElement">ClassElement</a></emu-nt> <var>e</var> of <var>elements</var>, do<ol><li>If <emu-xref aoid="IsStatic" id="_ref_8168"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-isstatic">IsStatic</a></emu-xref> of <var>e</var> is <emu-val>false</emu-val>, then<ol><li>Let <var>element</var> be <emu-xref aoid="Completion" id="_ref_8169"><a href="notational-conventions.html#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="ClassElementEvaluation" id="_ref_8170"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-classelementevaluation" class="e-user-code">ClassElementEvaluation</a></emu-xref> of <var>e</var> with argument <var>proto</var>).</li></ol></li><li>Else,<ol><li>Let <var>element</var> be <emu-xref aoid="Completion" id="_ref_8171"><a href="notational-conventions.html#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="ClassElementEvaluation" id="_ref_8172"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-classelementevaluation" class="e-user-code">ClassElementEvaluation</a></emu-xref> of <var>e</var> with argument <var>F</var>).</li></ol></li><li>If <var>element</var> is an <emu-xref href="#sec-completion-record-specification-type" id="_ref_8173"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">abrupt completion</a></emu-xref>, then<ol><li>Set the <emu-xref href="#running-execution-context" id="_ref_8174"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s LexicalEnvironment to <var>env</var>.</li><li>Set the <emu-xref href="#running-execution-context" id="_ref_8175"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment to <var>outerPrivateEnvironment</var>.</li><li>Return ?&nbsp;<var>element</var>.</li></ol></li><li>Set <var>element</var> to !&nbsp;<var>element</var>.</li><li>If <var>element</var> is a <emu-xref href="#sec-privateelement-specification-type" id="_ref_8176"><a href="ecmascript-data-types-and-values.html#sec-privateelement-specification-type">PrivateElement</a></emu-xref>, then<ol><li><emu-xref href="#assert" id="_ref_8177"><a href="notational-conventions.html#assert">Assert</a></emu-xref>: <var>element</var>.<var class="field">[[Kind]]</var> is either <emu-const>method</emu-const> or <emu-const>accessor</emu-const>.</li><li>If <emu-xref aoid="IsStatic" id="_ref_8178"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-isstatic">IsStatic</a></emu-xref> of <var>e</var> is <emu-val>false</emu-val>, let <var>container</var> be <var>instancePrivateMethods</var>.</li><li>Else, let <var>container</var> be <var>staticPrivateMethods</var>.</li><li>If <var>container</var> contains a <emu-xref href="#sec-privateelement-specification-type" id="_ref_8179"><a href="ecmascript-data-types-and-values.html#sec-privateelement-specification-type">PrivateElement</a></emu-xref> <var>pe</var> such that <var>pe</var>.<var class="field">[[Key]]</var> is <var>element</var>.<var class="field">[[Key]]</var>, then<ol><li><emu-xref href="#assert" id="_ref_8180"><a href="notational-conventions.html#assert">Assert</a></emu-xref>: <var>element</var>.<var class="field">[[Kind]]</var> and <var>pe</var>.<var class="field">[[Kind]]</var> are both <emu-const>accessor</emu-const>.</li><li>If <var>element</var>.<var class="field">[[Get]]</var> is <emu-val>undefined</emu-val>, then<ol><li>Let <var>combined</var> be <emu-xref href="#sec-privateelement-specification-type" id="_ref_8181"><a href="ecmascript-data-types-and-values.html#sec-privateelement-specification-type">PrivateElement</a></emu-xref> { <var class="field">[[Key]]</var>: <var>element</var>.<var class="field">[[Key]]</var>, <var class="field">[[Kind]]</var>: <emu-const>accessor</emu-const>, <var class="field">[[Get]]</var>: <var>pe</var>.<var class="field">[[Get]]</var>, <var class="field">[[Set]]</var>: <var>element</var>.<var class="field">[[Set]]</var>&nbsp;}.</li></ol></li><li>Else,<ol><li>Let <var>combined</var> be <emu-xref href="#sec-privateelement-specification-type" id="_ref_8182"><a href="ecmascript-data-types-and-values.html#sec-privateelement-specification-type">PrivateElement</a></emu-xref> { <var class="field">[[Key]]</var>: <var>element</var>.<var class="field">[[Key]]</var>, <var class="field">[[Kind]]</var>: <emu-const>accessor</emu-const>, <var class="field">[[Get]]</var>: <var>element</var>.<var class="field">[[Get]]</var>, <var class="field">[[Set]]</var>: <var>pe</var>.<var class="field">[[Set]]</var>&nbsp;}.</li></ol></li><li>Replace <var>pe</var> in <var>container</var> with <var>combined</var>.</li></ol></li><li>Else,<ol><li>Append <var>element</var> to <var>container</var>.</li></ol></li></ol></li><li>Else if <var>element</var> is a <emu-xref href="#sec-classfielddefinition-record-specification-type" id="_ref_8183"><a href="ecmascript-data-types-and-values.html#sec-classfielddefinition-record-specification-type">ClassFieldDefinition Record</a></emu-xref>, then<ol><li>If <emu-xref aoid="IsStatic" id="_ref_8184"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-isstatic">IsStatic</a></emu-xref> of <var>e</var> is <emu-val>false</emu-val>, append <var>element</var> to <var>instanceFields</var>.</li><li>Else, append <var>element</var> to <var>staticElements</var>.</li></ol></li><li>Else if <var>element</var> is a <emu-xref href="#sec-classstaticblockdefinition-record-specification-type" id="_ref_8185"><a href="ecmascript-data-types-and-values.html#sec-classstaticblockdefinition-record-specification-type">ClassStaticBlockDefinition Record</a></emu-xref>, then<ol><li>Append <var>element</var> to <var>staticElements</var>.</li></ol></li></ol></li><li>Set the <emu-xref href="#running-execution-context" id="_ref_8186"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s LexicalEnvironment to <var>env</var>.</li><li>If <var>classBinding</var> is not <emu-val>undefined</emu-val>, then<ol><li>Perform !&nbsp;<var>classEnv</var>.<emu-xref aoid="InitializeBinding" id="_ref_8187"><a href="executable-code-and-execution-contexts.html#abstract-initializebinding">InitializeBinding</a></emu-xref>(<var>classBinding</var>, <var>F</var>).</li></ol></li><li>Set <var>F</var>.<var class="field">[[PrivateMethods]]</var> to <var>instancePrivateMethods</var>.</li><li>Set <var>F</var>.<var class="field">[[Fields]]</var> to <var>instanceFields</var>.</li><li>For each <emu-xref href="#sec-privateelement-specification-type" id="_ref_8188"><a href="ecmascript-data-types-and-values.html#sec-privateelement-specification-type">PrivateElement</a></emu-xref> <var>method</var> of <var>staticPrivateMethods</var>, do<ol><li>Perform !&nbsp;<emu-xref aoid="PrivateMethodOrAccessorAdd" id="_ref_8189"><a href="abstract-operations.html#sec-privatemethodoraccessoradd">PrivateMethodOrAccessorAdd</a></emu-xref>(<var>F</var>, <var>method</var>).</li></ol></li><li>For each element <var>elementRecord</var> of <var>staticElements</var>, do<ol><li>If <var>elementRecord</var> is a <emu-xref href="#sec-classfielddefinition-record-specification-type" id="_ref_8190"><a href="ecmascript-data-types-and-values.html#sec-classfielddefinition-record-specification-type">ClassFieldDefinition Record</a></emu-xref>, then<ol><li>Let <var>result</var> be <emu-xref aoid="Completion" id="_ref_8191"><a href="notational-conventions.html#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="DefineField" id="_ref_8192"><a href="abstract-operations.html#sec-definefield" class="e-user-code">DefineField</a></emu-xref>(<var>F</var>, <var>elementRecord</var>)).</li></ol></li><li>Else,<ol><li><emu-xref href="#assert" id="_ref_8193"><a href="notational-conventions.html#assert">Assert</a></emu-xref>: <var>elementRecord</var> is a <emu-xref href="#sec-classstaticblockdefinition-record-specification-type" id="_ref_8194"><a href="ecmascript-data-types-and-values.html#sec-classstaticblockdefinition-record-specification-type">ClassStaticBlockDefinition Record</a></emu-xref>.</li><li>Let <var>result</var> be <emu-xref aoid="Completion" id="_ref_8195"><a href="notational-conventions.html#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="Call" id="_ref_8196"><a href="abstract-operations.html#sec-call" class="e-user-code">Call</a></emu-xref>(<var>elementRecord</var>.<var class="field">[[BodyFunction]]</var>, <var>F</var>)).</li></ol></li><li>If <var>result</var> is an <emu-xref href="#sec-completion-record-specification-type" id="_ref_8197"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">abrupt completion</a></emu-xref>, then<ol><li>Set the <emu-xref href="#running-execution-context" id="_ref_8198"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment to <var>outerPrivateEnvironment</var>.</li><li>Return ?&nbsp;<var>result</var>.</li></ol></li></ol></li><li>Set the <emu-xref href="#running-execution-context" id="_ref_8199"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment to <var>outerPrivateEnvironment</var>.</li><li>Return <var>F</var>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-runtime-semantics-bindingclassdeclarationevaluation" type="sdo" aoid="BindingClassDeclarationEvaluation">
<h1><span class="secnum">15.7.15</span> Runtime Semantics: BindingClassDeclarationEvaluation</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8200"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> BindingClassDeclarationEvaluation takes no arguments and returns either a <emu-xref href="#sec-completion-record-specification-type" id="_ref_8201"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">normal completion containing</a></emu-xref> a <emu-xref href="#function-object" id="_ref_8202"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref> or an <emu-xref href="#sec-completion-record-specification-type" id="_ref_8203"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="ClassDeclaration" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassDeclaration">ClassDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="tusuwhcv" id="prod-JmEOsNvO">
<emu-t>class</emu-t>
<emu-nt id="_ref_22923"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-nt id="_ref_22924"><a href="ecmascript-language-functions-and-classes.html#prod-ClassTail">ClassTail</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>className</var> be the <emu-xref aoid="StringValue" id="_ref_8204"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22925"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8205"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22926"><a href="ecmascript-language-functions-and-classes.html#prod-ClassDeclaration">ClassDeclaration</a></emu-nt>.</li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="ClassDefinitionEvaluation" id="_ref_8206"><a href="ecmascript-language-functions-and-classes.html#sec-runtime-semantics-classdefinitionevaluation" class="e-user-code">ClassDefinitionEvaluation</a></emu-xref> of <emu-nt id="_ref_22927"><a href="ecmascript-language-functions-and-classes.html#prod-ClassTail">ClassTail</a></emu-nt> with arguments <var>className</var>, <var>className</var>, and <var>sourceText</var>.</li><li>Let <var>env</var> be the <emu-xref href="#running-execution-context" id="_ref_8207"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s LexicalEnvironment.</li><li>Perform ?&nbsp;<emu-xref aoid="InitializeBoundName" id="_ref_8208"><a href="syntax-directed-operations.html#sec-initializeboundname" class="e-user-code">InitializeBoundName</a></emu-xref>(<var>className</var>, <var>value</var>, <var>env</var>).</li><li>Return <var>value</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassDeclaration" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassDeclaration">ClassDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="1ghyizwr" id="prod-qOUNT0OA">
<emu-t>class</emu-t>
<emu-nt id="_ref_22928"><a href="ecmascript-language-functions-and-classes.html#prod-ClassTail">ClassTail</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8209"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22929"><a href="ecmascript-language-functions-and-classes.html#prod-ClassDeclaration">ClassDeclaration</a></emu-nt>.</li><li>Return ?&nbsp;<emu-xref aoid="ClassDefinitionEvaluation" id="_ref_8210"><a href="ecmascript-language-functions-and-classes.html#sec-runtime-semantics-classdefinitionevaluation" class="e-user-code">ClassDefinitionEvaluation</a></emu-xref> of <emu-nt id="_ref_22930"><a href="ecmascript-language-functions-and-classes.html#prod-ClassTail">ClassTail</a></emu-nt> with arguments <emu-val>undefined</emu-val>, <emu-val>"default"</emu-val>, and <var>sourceText</var>.</li></ol></emu-alg>
<emu-note><span class="note">Note</span><div class="note-contents">
<p><emu-grammar><emu-production name="ClassDeclaration" collapsed="" class=" inline">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassDeclaration">ClassDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="1ghyizwr">
<emu-t>class</emu-t>
<emu-nt id="_ref_22931"><a href="ecmascript-language-functions-and-classes.html#prod-ClassTail">ClassTail</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar> only occurs as part of an <emu-nt id="_ref_22932"><a href="ecmascript-language-scripts-and-modules.html#prod-ExportDeclaration">ExportDeclaration</a></emu-nt> and establishing its binding is handled as part of the evaluation action for that production. See <emu-xref href="#sec-exports-runtime-semantics-evaluation" id="_ref_471"><a href="ecmascript-language-scripts-and-modules.html#sec-exports-runtime-semantics-evaluation">16.2.3.7</a></emu-xref>.</p>
</div></emu-note>
</emu-clause>
<emu-clause id="sec-class-definitions-runtime-semantics-evaluation" type="sdo">
<h1><span class="secnum">15.7.16</span> Runtime Semantics: Evaluation</h1>
<emu-grammar><emu-production name="ClassDeclaration" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassDeclaration">ClassDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="tusuwhcv" id="prod-P7ajQhl1">
<emu-t>class</emu-t>
<emu-nt id="_ref_22933"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-nt id="_ref_22934"><a href="ecmascript-language-functions-and-classes.html#prod-ClassTail">ClassTail</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Perform ?&nbsp;<emu-xref aoid="BindingClassDeclarationEvaluation" id="_ref_8211"><a href="ecmascript-language-functions-and-classes.html#sec-runtime-semantics-bindingclassdeclarationevaluation" class="e-user-code">BindingClassDeclarationEvaluation</a></emu-xref> of this <emu-nt id="_ref_22935"><a href="ecmascript-language-functions-and-classes.html#prod-ClassDeclaration">ClassDeclaration</a></emu-nt>.</li><li>Return <emu-const>empty</emu-const>.</li></ol></emu-alg>
<emu-note><span class="note">Note</span><div class="note-contents">
<p><emu-grammar><emu-production name="ClassDeclaration" collapsed="" class=" inline">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassDeclaration">ClassDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="1ghyizwr">
<emu-t>class</emu-t>
<emu-nt id="_ref_22936"><a href="ecmascript-language-functions-and-classes.html#prod-ClassTail">ClassTail</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar> only occurs as part of an <emu-nt id="_ref_22937"><a href="ecmascript-language-scripts-and-modules.html#prod-ExportDeclaration">ExportDeclaration</a></emu-nt> and is never directly evaluated.</p>
</div></emu-note>
<emu-grammar><emu-production name="ClassExpression" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassExpression">ClassExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="1ghyizwr" id="prod-lm9h8Kwa">
<emu-t>class</emu-t>
<emu-nt id="_ref_22938"><a href="ecmascript-language-functions-and-classes.html#prod-ClassTail">ClassTail</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8212"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22939"><a href="ecmascript-language-functions-and-classes.html#prod-ClassExpression">ClassExpression</a></emu-nt>.</li><li>Return ?&nbsp;<emu-xref aoid="ClassDefinitionEvaluation" id="_ref_8213"><a href="ecmascript-language-functions-and-classes.html#sec-runtime-semantics-classdefinitionevaluation" class="e-user-code">ClassDefinitionEvaluation</a></emu-xref> of <emu-nt id="_ref_22940"><a href="ecmascript-language-functions-and-classes.html#prod-ClassTail">ClassTail</a></emu-nt> with arguments <emu-val>undefined</emu-val>, <emu-val>""</emu-val>, and <var>sourceText</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassExpression" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassExpression">ClassExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="tusuwhcv" id="prod-l8XcpxuG">
<emu-t>class</emu-t>
<emu-nt id="_ref_22941"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-nt id="_ref_22942"><a href="ecmascript-language-functions-and-classes.html#prod-ClassTail">ClassTail</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>className</var> be the <emu-xref aoid="StringValue" id="_ref_8214"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22943"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8215"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_22944"><a href="ecmascript-language-functions-and-classes.html#prod-ClassExpression">ClassExpression</a></emu-nt>.</li><li>Return ?&nbsp;<emu-xref aoid="ClassDefinitionEvaluation" id="_ref_8216"><a href="ecmascript-language-functions-and-classes.html#sec-runtime-semantics-classdefinitionevaluation" class="e-user-code">ClassDefinitionEvaluation</a></emu-xref> of <emu-nt id="_ref_22945"><a href="ecmascript-language-functions-and-classes.html#prod-ClassTail">ClassTail</a></emu-nt> with arguments <var>className</var>, <var>className</var>, and <var>sourceText</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassElementName" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ie2-zc1c" id="prod-jq_5Nm3c"><emu-nt id="_ref_22946"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>privateIdentifier</var> be the <emu-xref aoid="StringValue" id="_ref_8217"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_22947"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>.</li><li>Let <var>privateEnvRec</var> be the <emu-xref href="#running-execution-context" id="_ref_8218"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>names</var> be <var>privateEnvRec</var>.<var class="field">[[Names]]</var>.</li><li><emu-xref href="#assert" id="_ref_8219"><a href="notational-conventions.html#assert">Assert</a></emu-xref>: Exactly one element of <var>names</var> is a <emu-xref href="#sec-private-names" id="_ref_8220"><a href="ecmascript-data-types-and-values.html#sec-private-names">Private Name</a></emu-xref> whose <var class="field">[[Description]]</var> is <var>privateIdentifier</var>.</li><li>Let <var>privateName</var> be the <emu-xref href="#sec-private-names" id="_ref_8221"><a href="ecmascript-data-types-and-values.html#sec-private-names">Private Name</a></emu-xref> in <var>names</var> whose <var class="field">[[Description]]</var> is <var>privateIdentifier</var>.</li><li>Return <var>privateName</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ClassStaticBlockStatementList" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-ClassStaticBlockStatementList">ClassStaticBlockStatementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="n7nathbb" id="prod-sVEE0xLy"><emu-gann>[empty]</emu-gann></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>undefined</emu-val>.</li></ol></emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-async-function-definitions">
<h1><span class="secnum">15.8</span> Async Function Definitions</h1>
<h2>Syntax</h2>
<emu-grammar type="definition"><emu-production name="AsyncFunctionDeclaration" params="Yield, Await, Default" id="prod-AsyncFunctionDeclaration">
<emu-nt params="Yield, Await, Default"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionDeclaration">AsyncFunctionDeclaration</a><emu-mods><emu-params>[Yield, Await, Default]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="9rildsyw" id="prod-iAuKx0s9">
<emu-t>async</emu-t>
<emu-gann>[no <emu-nt id="_ref_22948"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
<emu-t>function</emu-t>
<emu-nt params="?Yield, ?Await" id="_ref_22949"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt params="~Yield, +Await" id="_ref_22950"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[~Yield, +Await]</emu-params></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22951"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="_vbcugdo" constraints="+Default" id="prod-TaHP58mu"><emu-constraints>[+Default]</emu-constraints>
<emu-t>async</emu-t>
<emu-gann>[no <emu-nt id="_ref_22952"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
<emu-t>function</emu-t>
<emu-t>(</emu-t>
<emu-nt params="~Yield, +Await" id="_ref_22953"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[~Yield, +Await]</emu-params></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22954"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="AsyncFunctionExpression" id="prod-AsyncFunctionExpression">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="mviccgpw" id="prod-LFCRNt3l">
<emu-t>async</emu-t>
<emu-gann>[no <emu-nt id="_ref_22955"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
<emu-t>function</emu-t>
<emu-nt params="~Yield, +Await" optional="" id="_ref_22956"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[~Yield, +Await]</emu-params><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt params="~Yield, +Await" id="_ref_22957"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a><emu-mods><emu-params>[~Yield, +Await]</emu-params></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22958"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="AsyncMethod" params="Yield, Await" id="prod-AsyncMethod">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncMethod">AsyncMethod</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="tzooi3sy" id="prod-80co-gZ6">
<emu-t>async</emu-t>
<emu-gann>[no <emu-nt id="_ref_22959"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
<emu-nt params="?Yield, ?Await" id="_ref_22960"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt params="~Yield, +Await" id="_ref_22961"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a><emu-mods><emu-params>[~Yield, +Await]</emu-params></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22962"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="AsyncFunctionBody" id="prod-AsyncFunctionBody">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="j_tcfidx" id="prod-LKwCGkpu">
<emu-nt params="~Yield, +Await" id="_ref_22963"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a><emu-mods><emu-params>[~Yield, +Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="AwaitExpression" params="Yield" id="prod-AwaitExpression">
<emu-nt params="Yield"><a href="ecmascript-language-functions-and-classes.html#prod-AwaitExpression">AwaitExpression</a><emu-mods><emu-params>[Yield]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="wzxw5xwu" id="prod-daps6IoT">
<emu-t>await</emu-t>
<emu-nt params="?Yield, +Await" id="_ref_22964"><a href="ecmascript-language-expressions.html#prod-UnaryExpression">UnaryExpression</a><emu-mods><emu-params>[?Yield, +Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-note><span class="note">Note 1</span><div class="note-contents">
<p><code>await</code> is parsed as a <emu-xref href="#sec-keywords-and-reserved-words" id="_ref_8222"><a href="ecmascript-language-lexical-grammar.html#sec-keywords-and-reserved-words">keyword</a></emu-xref> of an <emu-nt id="_ref_22965"><a href="ecmascript-language-functions-and-classes.html#prod-AwaitExpression">AwaitExpression</a></emu-nt> when the <sub>[Await]</sub> parameter is present. The <sub>[Await]</sub> parameter is present in the top level of the following contexts, although the parameter may be absent in some contexts depending on the nonterminals, such as <emu-nt id="_ref_22966"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>:</p>
<ul>
<li>In an <emu-nt id="_ref_22967"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>.</li>
<li>In the <emu-nt id="_ref_22968"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> of an <emu-nt id="_ref_22969"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionDeclaration">AsyncFunctionDeclaration</a></emu-nt>, <emu-nt id="_ref_22970"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt>, <emu-nt id="_ref_22971"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorDeclaration">AsyncGeneratorDeclaration</a></emu-nt>, or <emu-nt id="_ref_22972"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt>. <emu-nt id="_ref_22973"><a href="ecmascript-language-functions-and-classes.html#prod-AwaitExpression">AwaitExpression</a></emu-nt> in this position is a Syntax error via <emu-xref href="#sec-static-semantic-rules" id="_ref_8223"><a href="notational-conventions.html#sec-static-semantic-rules">static semantics</a></emu-xref>.</li>
<li>In a <emu-nt id="_ref_22974"><a href="ecmascript-language-scripts-and-modules.html#prod-Module">Module</a></emu-nt>.</li>
</ul>
<p>When <emu-nt id="_ref_22975"><a href="ecmascript-language-scripts-and-modules.html#prod-Script">Script</a></emu-nt> is the syntactic <emu-xref href="#sec-context-free-grammars" id="_ref_8224"><a href="notational-conventions.html#sec-context-free-grammars">goal symbol</a></emu-xref>, <code>await</code> may be parsed as an identifier when the <sub>[Await]</sub> parameter is absent. This includes the following contexts:</p>
<ul>
<li>Anywhere outside of an <emu-nt id="_ref_22976"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt> or <emu-nt id="_ref_22977"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> of an <emu-nt id="_ref_22978"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionDeclaration">AsyncFunctionDeclaration</a></emu-nt>, <emu-nt id="_ref_22979"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt>, <emu-nt id="_ref_22980"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorDeclaration">AsyncGeneratorDeclaration</a></emu-nt>, or <emu-nt id="_ref_22981"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt>.</li>
<li>In the <emu-nt id="_ref_22982"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> of a <emu-nt id="_ref_22983"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt>, <emu-nt id="_ref_22984"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt>, or <emu-nt id="_ref_22985"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt>.</li>
</ul>
</div></emu-note>
<emu-note><span class="note">Note 2</span><div class="note-contents">
<p>Unlike <emu-nt id="_ref_22986"><a href="ecmascript-language-functions-and-classes.html#prod-YieldExpression">YieldExpression</a></emu-nt>, it is a Syntax Error to omit the operand of an <emu-nt id="_ref_22987"><a href="ecmascript-language-functions-and-classes.html#prod-AwaitExpression">AwaitExpression</a></emu-nt>. You must await something.</p>
</div></emu-note>
<emu-clause id="sec-async-function-definitions-static-semantics-early-errors">
<h1><span class="secnum">15.8.1</span> Static Semantics: Early Errors</h1>
<emu-grammar><emu-production name="AsyncMethod" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncMethod">AsyncMethod</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="cfy3_9l8">
<emu-t>async</emu-t>
<emu-nt id="_ref_22988"><a href="ecmascript-language-functions-and-classes.html#prod-ClassElementName">ClassElementName</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22989"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_22990"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>It is a Syntax Error if <emu-xref aoid="FunctionBodyContainsUseStrict" id="_ref_8225"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-functionbodycontainsusestrict">FunctionBodyContainsUseStrict</a></emu-xref> of <emu-nt id="_ref_22991"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt> is <emu-val>true</emu-val> and <emu-xref aoid="IsSimpleParameterList" id="_ref_8226"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-issimpleparameterlist">IsSimpleParameterList</a></emu-xref> of <emu-nt id="_ref_22992"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> is <emu-val>false</emu-val>.</li>
<li>It is a Syntax Error if <emu-xref aoid="HasDirectSuper" id="_ref_8227"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hasdirectsuper">HasDirectSuper</a></emu-xref> of <emu-nt id="_ref_22993"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncMethod">AsyncMethod</a></emu-nt> is <emu-val>true</emu-val>.</li>
<li>It is a Syntax Error if <emu-nt id="_ref_22994"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_8228"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_22995"><a href="ecmascript-language-functions-and-classes.html#prod-AwaitExpression">AwaitExpression</a></emu-nt> is <emu-val>true</emu-val>.</li>
<li>It is a Syntax Error if any element of the <emu-xref aoid="BoundNames" id="_ref_8229"><a href="syntax-directed-operations.html#sec-static-semantics-boundnames">BoundNames</a></emu-xref> of <emu-nt id="_ref_22996"><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> also occurs in the <emu-xref aoid="LexicallyDeclaredNames" id="_ref_8230"><a href="syntax-directed-operations.html#sec-static-semantics-lexicallydeclarednames">LexicallyDeclaredNames</a></emu-xref> of <emu-nt id="_ref_22997"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>.</li>
</ul>
<emu-grammar><emu-production name="AsyncFunctionDeclaration">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionDeclaration">AsyncFunctionDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="4mmt35rm">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-nt id="_ref_22998"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_22999"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_23000"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
<emu-rhs a="agdmcdye">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_23001"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_23002"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="AsyncFunctionExpression">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="1_djgdhl">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-nt optional="" id="_ref_23003"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_23004"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_23005"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>It is a Syntax Error if <emu-xref aoid="FunctionBodyContainsUseStrict" id="_ref_8231"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-functionbodycontainsusestrict">FunctionBodyContainsUseStrict</a></emu-xref> of <emu-nt id="_ref_23006"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt> is <emu-val>true</emu-val> and <emu-xref aoid="IsSimpleParameterList" id="_ref_8232"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-issimpleparameterlist">IsSimpleParameterList</a></emu-xref> of <emu-nt id="_ref_23007"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> is <emu-val>false</emu-val>.</li>
<li>It is a Syntax Error if <emu-nt id="_ref_23008"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_8233"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_23009"><a href="ecmascript-language-functions-and-classes.html#prod-AwaitExpression">AwaitExpression</a></emu-nt> is <emu-val>true</emu-val>.</li>
<li>If <emu-xref aoid="IsStrict" id="_ref_8234"><a href="ecmascript-language-source-code.html#sec-isstrict">IsStrict</a></emu-xref>(<emu-nt id="_ref_23010"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>) is <emu-val>true</emu-val>, the Early Error rules for <emu-grammar><emu-production name="UniqueFormalParameters" collapsed="" class=" inline">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-UniqueFormalParameters">UniqueFormalParameters</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ahjg9bb6"><emu-nt id="_ref_23011"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar> are applied.</li>
<li>If <emu-nt id="_ref_23012"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> is present and <emu-xref aoid="IsStrict" id="_ref_8235"><a href="ecmascript-language-source-code.html#sec-isstrict">IsStrict</a></emu-xref>(<emu-nt id="_ref_23013"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>) is <emu-val>true</emu-val>, it is a Syntax Error if the <emu-xref aoid="StringValue" id="_ref_8236"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_23014"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> is either <emu-val>"eval"</emu-val> or <emu-val>"arguments"</emu-val>.</li>
<li>It is a Syntax Error if any element of the <emu-xref aoid="BoundNames" id="_ref_8237"><a href="syntax-directed-operations.html#sec-static-semantics-boundnames">BoundNames</a></emu-xref> of <emu-nt id="_ref_23015"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> also occurs in the <emu-xref aoid="LexicallyDeclaredNames" id="_ref_8238"><a href="syntax-directed-operations.html#sec-static-semantics-lexicallydeclarednames">LexicallyDeclaredNames</a></emu-xref> of <emu-nt id="_ref_23016"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>.</li>
<li>It is a Syntax Error if <emu-nt id="_ref_23017"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_8239"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_23018"><a href="ecmascript-language-expressions.html#prod-SuperProperty">SuperProperty</a></emu-nt> is <emu-val>true</emu-val>.</li>
<li>It is a Syntax Error if <emu-nt id="_ref_23019"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt> <emu-xref aoid="Contains" id="_ref_8240"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_23020"><a href="ecmascript-language-expressions.html#prod-SuperProperty">SuperProperty</a></emu-nt> is <emu-val>true</emu-val>.</li>
<li>It is a Syntax Error if <emu-nt id="_ref_23021"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt> <emu-xref aoid="Contains" id="_ref_8241"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_23022"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt> is <emu-val>true</emu-val>.</li>
<li>It is a Syntax Error if <emu-nt id="_ref_23023"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt> <emu-xref aoid="Contains" id="_ref_8242"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_23024"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt> is <emu-val>true</emu-val>.</li>
</ul>
</emu-clause>
<emu-clause id="sec-runtime-semantics-instantiateasyncfunctionobject" oldids="sec-async-function-definitions-InstantiateFunctionObject" type="sdo" aoid="InstantiateAsyncFunctionObject"><span id="sec-async-function-definitions-InstantiateFunctionObject"></span>
<h1><span class="secnum">15.8.2</span> Runtime Semantics: InstantiateAsyncFunctionObject</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8243"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> InstantiateAsyncFunctionObject takes arguments <var>env</var> (an <emu-xref href="#sec-environment-records" id="_ref_8244"><a href="executable-code-and-execution-contexts.html#sec-environment-records">Environment Record</a></emu-xref>) and <var>privateEnv</var> (a <emu-xref href="#privateenvironment-record" id="_ref_8245"><a href="executable-code-and-execution-contexts.html#privateenvironment-record">PrivateEnvironment Record</a></emu-xref> or <emu-val>null</emu-val>) and returns an ECMAScript <emu-xref href="#function-object" id="_ref_8246"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="AsyncFunctionDeclaration" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionDeclaration">AsyncFunctionDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="4mmt35rm" id="prod-VjNDNC25">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-nt id="_ref_23025"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_23026"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_23027"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>name</var> be the <emu-xref aoid="StringValue" id="_ref_8247"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_23028"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8248"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_23029"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionDeclaration">AsyncFunctionDeclaration</a></emu-nt>.</li><li>Let <var>F</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_8249"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-async-function-prototype-properties" id="_ref_8250"><a href="control-abstraction-objects.html#sec-async-function-prototype-properties">%AsyncFunction.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_23030"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>, <emu-nt id="_ref_23031"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_8251"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>F</var>, <var>name</var>).</li><li>Return <var>F</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="AsyncFunctionDeclaration" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionDeclaration">AsyncFunctionDeclaration</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="agdmcdye" id="prod-QVYl6PrK">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_23032"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_23033"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8252"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_23034"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionDeclaration">AsyncFunctionDeclaration</a></emu-nt>.</li><li>Let <var>F</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_8253"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-async-function-prototype-properties" id="_ref_8254"><a href="control-abstraction-objects.html#sec-async-function-prototype-properties">%AsyncFunction.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_23035"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>, <emu-nt id="_ref_23036"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_8255"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>F</var>, <emu-val>"default"</emu-val>).</li><li>Return <var>F</var>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-runtime-semantics-instantiateasyncfunctionexpression" type="sdo" aoid="InstantiateAsyncFunctionExpression">
<h1><span class="secnum">15.8.3</span> Runtime Semantics: InstantiateAsyncFunctionExpression</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8256"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> InstantiateAsyncFunctionExpression takes optional argument <var>name</var> (a <emu-xref href="#property-key" id="_ref_8257"><a href="ecmascript-data-types-and-values.html#property-key">property key</a></emu-xref> or a <emu-xref href="#sec-private-names" id="_ref_8258"><a href="ecmascript-data-types-and-values.html#sec-private-names">Private Name</a></emu-xref>) and returns an ECMAScript <emu-xref href="#function-object" id="_ref_8259"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="AsyncFunctionExpression" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="agdmcdye" id="prod-3RN98Vrc">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_23037"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_23038"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <var>name</var> is not present, set <var>name</var> to <emu-val>""</emu-val>.</li><li>Let <var>env</var> be the LexicalEnvironment of the <emu-xref href="#running-execution-context" id="_ref_8260"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>.</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_8261"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8262"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_23039"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt>.</li><li>Let <var>closure</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_8263"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-async-function-prototype-properties" id="_ref_8264"><a href="control-abstraction-objects.html#sec-async-function-prototype-properties">%AsyncFunction.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_23040"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>, <emu-nt id="_ref_23041"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_8265"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>closure</var>, <var>name</var>).</li><li>Return <var>closure</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="AsyncFunctionExpression" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="4mmt35rm" id="prod-iEhgnbem">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-nt id="_ref_23042"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_23043"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_23044"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li><emu-xref href="#assert" id="_ref_8266"><a href="notational-conventions.html#assert">Assert</a></emu-xref>: <var>name</var> is not present.</li><li>Set <var>name</var> to the <emu-xref aoid="StringValue" id="_ref_8267"><a href="ecmascript-language-expressions.html#sec-static-semantics-stringvalue">StringValue</a></emu-xref> of <emu-nt id="_ref_23045"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt>.</li><li>Let <var>outerEnv</var> be the LexicalEnvironment of the <emu-xref href="#running-execution-context" id="_ref_8268"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>.</li><li>Let <var>funcEnv</var> be <emu-xref aoid="NewDeclarativeEnvironment" id="_ref_8269"><a href="executable-code-and-execution-contexts.html#sec-newdeclarativeenvironment">NewDeclarativeEnvironment</a></emu-xref>(<var>outerEnv</var>).</li><li>Perform !&nbsp;<var>funcEnv</var>.<emu-xref aoid="CreateImmutableBinding" id="_ref_8270"><a href="executable-code-and-execution-contexts.html#abstract-createimmutablebinding">CreateImmutableBinding</a></emu-xref>(<var>name</var>, <emu-val>false</emu-val>).</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_8271"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8272"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_23046"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt>.</li><li>Let <var>closure</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_8273"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-async-function-prototype-properties" id="_ref_8274"><a href="control-abstraction-objects.html#sec-async-function-prototype-properties">%AsyncFunction.prototype%</a></emu-xref>, <var>sourceText</var>, <emu-nt id="_ref_23047"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>, <emu-nt id="_ref_23048"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>, <emu-const>non-lexical-this</emu-const>, <var>funcEnv</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_8275"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>closure</var>, <var>name</var>).</li><li>Perform !&nbsp;<var>funcEnv</var>.<emu-xref aoid="InitializeBinding" id="_ref_8276"><a href="executable-code-and-execution-contexts.html#abstract-initializebinding">InitializeBinding</a></emu-xref>(<var>name</var>, <var>closure</var>).</li><li>Return <var>closure</var>.</li></ol></emu-alg>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>The <emu-nt id="_ref_23049"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> in an <emu-nt id="_ref_23050"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt> can be referenced from inside the <emu-nt id="_ref_23051"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt>'s <emu-nt id="_ref_23052"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt> to allow the function to call itself recursively. However, unlike in a <emu-nt id="_ref_23053"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt>, the <emu-nt id="_ref_23054"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a></emu-nt> in a <emu-nt id="_ref_23055"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt> cannot be referenced from and does not affect the scope enclosing the <emu-nt id="_ref_23056"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt>.</p>
</div></emu-note>
</emu-clause>
<emu-clause id="sec-runtime-semantics-evaluateasyncfunctionbody" oldids="sec-async-function-definitions-EvaluateBody" type="sdo" aoid="EvaluateAsyncFunctionBody"><span id="sec-async-function-definitions-EvaluateBody"></span>
<h1><span class="secnum">15.8.4</span> Runtime Semantics: EvaluateAsyncFunctionBody</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8277"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> EvaluateAsyncFunctionBody takes arguments <var>functionObject</var> (an ECMAScript <emu-xref href="#function-object" id="_ref_8278"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>) and <var>argumentsList</var> (a <emu-xref href="#sec-list-and-record-specification-type" id="_ref_8279"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-xref href="#sec-ecmascript-language-types" id="_ref_8280"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types">ECMAScript language values</a></emu-xref>) and returns a <emu-xref href="#sec-completion-record-specification-type" id="_ref_8281"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">return completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="AsyncFunctionBody" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="iqzbkm-h" id="prod-jL__NzW5"><emu-nt id="_ref_23057"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>promiseCapability</var> be !&nbsp;<emu-xref aoid="NewPromiseCapability" id="_ref_8282"><a href="control-abstraction-objects.html#sec-newpromisecapability">NewPromiseCapability</a></emu-xref>(<emu-xref href="#sec-promise-constructor" id="_ref_8283"><a href="control-abstraction-objects.html#sec-promise-constructor">%Promise%</a></emu-xref>).</li><li>Let <var>completion</var> be <emu-xref aoid="Completion" id="_ref_8284"><a href="notational-conventions.html#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="FunctionDeclarationInstantiation" id="_ref_8285"><a href="ordinary-and-exotic-objects-behaviours.html#sec-functiondeclarationinstantiation" class="e-user-code">FunctionDeclarationInstantiation</a></emu-xref>(<var>functionObject</var>, <var>argumentsList</var>)).</li><li>If <var>completion</var> is an <emu-xref href="#sec-completion-record-specification-type" id="_ref_8286"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">abrupt completion</a></emu-xref>, then<ol><li>Perform !&nbsp;<emu-xref aoid="Call" id="_ref_8287"><a href="abstract-operations.html#sec-call">Call</a></emu-xref>(<var>promiseCapability</var>.<var class="field">[[Reject]]</var>, <emu-val>undefined</emu-val>, « <var>completion</var>.<var class="field">[[Value]]</var>&nbsp;»).</li></ol></li><li>Else,<ol><li>Perform <emu-xref aoid="AsyncFunctionStart" id="_ref_8288"><a href="control-abstraction-objects.html#sec-async-functions-abstract-operations-async-function-start" class="e-user-code">AsyncFunctionStart</a></emu-xref>(<var>promiseCapability</var>, <emu-nt id="_ref_23058"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>).</li></ol></li><li>Return <emu-xref aoid="ReturnCompletion" id="_ref_8289"><a href="ecmascript-data-types-and-values.html#sec-returncompletion">ReturnCompletion</a></emu-xref>(<var>promiseCapability</var>.<var class="field">[[Promise]]</var>).</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-async-function-definitions-runtime-semantics-evaluation" type="sdo">
<h1><span class="secnum">15.8.5</span> Runtime Semantics: Evaluation</h1>
<emu-grammar><emu-production name="AsyncFunctionExpression">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="1_djgdhl" id="prod-o1t7r8mz">
<emu-t>async</emu-t>
<emu-t>function</emu-t>
<emu-nt optional="" id="_ref_23059"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>(</emu-t>
<emu-nt id="_ref_23060"><a href="ecmascript-language-functions-and-classes.html#prod-FormalParameters">FormalParameters</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>{</emu-t>
<emu-nt id="_ref_23061"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="InstantiateAsyncFunctionExpression" id="_ref_8290"><a href="ecmascript-language-functions-and-classes.html#sec-runtime-semantics-instantiateasyncfunctionexpression">InstantiateAsyncFunctionExpression</a></emu-xref> of <emu-nt id="_ref_23062"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt>.</li></ol></emu-alg>
<emu-grammar><emu-production name="AwaitExpression" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AwaitExpression">AwaitExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="7ylag141" id="prod-AKHRjjan">
<emu-t>await</emu-t>
<emu-nt id="_ref_23063"><a href="ecmascript-language-expressions.html#prod-UnaryExpression">UnaryExpression</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>exprRef</var> be ?&nbsp;<emu-xref aoid="Evaluation" id="_ref_8291"><a href="syntax-directed-operations.html#sec-evaluation" class="e-user-code">Evaluation</a></emu-xref> of <emu-nt id="_ref_23064"><a href="ecmascript-language-expressions.html#prod-UnaryExpression">UnaryExpression</a></emu-nt>.</li><li>Let <var>value</var> be ?&nbsp;<emu-xref aoid="GetValue" id="_ref_8292"><a href="ecmascript-data-types-and-values.html#sec-getvalue" class="e-user-code">GetValue</a></emu-xref>(<var>exprRef</var>).</li><li>Return ?&nbsp;<emu-xref aoid="Await" id="_ref_8293"><a href="control-abstraction-objects.html#await" class="e-user-code">Await</a></emu-xref>(<var>value</var>).</li></ol></emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-async-arrow-function-definitions">
<h1><span class="secnum">15.9</span> Async Arrow Function Definitions</h1>
<h2>Syntax</h2>
<emu-grammar type="definition"><emu-production name="AsyncArrowFunction" params="In, Yield, Await" id="prod-AsyncArrowFunction">
<emu-nt params="In, Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowFunction">AsyncArrowFunction</a><emu-mods><emu-params>[In, Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="u1dc5ef3" id="prod-YIoJOc1p">
<emu-t>async</emu-t>
<emu-gann>[no <emu-nt id="_ref_23065"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
<emu-nt params="?Yield" id="_ref_23066"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowBindingIdentifier">AsyncArrowBindingIdentifier</a><emu-mods><emu-params>[?Yield]</emu-params></emu-mods></emu-nt>
<emu-gann>[no <emu-nt id="_ref_23067"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
<emu-t>=&gt;</emu-t>
<emu-nt params="?In" id="_ref_23068"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a><emu-mods><emu-params>[?In]</emu-params></emu-mods></emu-nt>
</emu-rhs>
<emu-rhs a="callcover" id="prod-WTX_aban">
<emu-nt params="?Yield, ?Await" id="_ref_23069"><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-gann>[no <emu-nt id="_ref_23070"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
<emu-t>=&gt;</emu-t>
<emu-nt params="?In" id="_ref_23071"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a><emu-mods><emu-params>[?In]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="AsyncConciseBody" params="In" id="prod-AsyncConciseBody">
<emu-nt params="In"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a><emu-mods><emu-params>[In]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="bpu3_ipt" id="prod-Dfs5WPuP">
<emu-gann>[lookahead ≠ <emu-t>{</emu-t>]</emu-gann>
<emu-nt params="?In, +Await" id="_ref_23072"><a href="ecmascript-language-functions-and-classes.html#prod-ExpressionBody">ExpressionBody</a><emu-mods><emu-params>[?In, +Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
<emu-rhs a="bm-b5ose" id="prod-Kq4Uu2cU">
<emu-t>{</emu-t>
<emu-nt id="_ref_23073"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="AsyncArrowBindingIdentifier" params="Yield" id="prod-AsyncArrowBindingIdentifier">
<emu-nt params="Yield"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowBindingIdentifier">AsyncArrowBindingIdentifier</a><emu-mods><emu-params>[Yield]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="yuozsg2r" id="prod-I7oDJnBY">
<emu-nt params="?Yield, +Await" id="_ref_23074"><a href="ecmascript-language-expressions.html#prod-BindingIdentifier">BindingIdentifier</a><emu-mods><emu-params>[?Yield, +Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="CoverCallExpressionAndAsyncArrowHead" params="Yield, Await" id="prod-CoverCallExpressionAndAsyncArrowHead">
<emu-nt params="Yield, Await"><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a><emu-mods><emu-params>[Yield, Await]</emu-params></emu-mods></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="90e-xzcw" id="prod-HT-vtkeW">
<emu-nt params="?Yield, ?Await" id="_ref_23075"><a href="ecmascript-language-expressions.html#prod-MemberExpression">MemberExpression</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
<emu-nt params="?Yield, ?Await" id="_ref_23076"><a href="ecmascript-language-expressions.html#prod-Arguments">Arguments</a><emu-mods><emu-params>[?Yield, ?Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<h2>Supplemental Syntax</h2>
<p>
When processing an instance of the production<br>
<emu-grammar><emu-production name="AsyncArrowFunction" collapsed="" class=" inline">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowFunction">AsyncArrowFunction</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="auwv8gbh">
<emu-nt id="_ref_23077"><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt>
<emu-t>=&gt;</emu-t>
<emu-nt id="_ref_23078"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar><br>
the interpretation of <emu-nt id="_ref_23079"><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt> is refined using the following grammar:
</p>
<emu-grammar type="definition"><emu-production name="AsyncArrowHead" id="prod-AsyncArrowHead">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowHead">AsyncArrowHead</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ydfl_ghb">
<emu-t>async</emu-t>
<emu-gann>[no <emu-nt id="_ref_23080"><a href="ecmascript-language-lexical-grammar.html#prod-LineTerminator">LineTerminator</a></emu-nt> here]</emu-gann>
<emu-nt params="~Yield, +Await" id="_ref_23081"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFormalParameters">ArrowFormalParameters</a><emu-mods><emu-params>[~Yield, +Await]</emu-params></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-clause id="sec-async-arrow-function-definitions-static-semantics-early-errors">
<h1><span class="secnum">15.9.1</span> Static Semantics: Early Errors</h1>
<emu-grammar><emu-production name="AsyncArrowFunction" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowFunction">AsyncArrowFunction</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="dqxgopsb">
<emu-t>async</emu-t>
<emu-nt id="_ref_23082"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowBindingIdentifier">AsyncArrowBindingIdentifier</a></emu-nt>
<emu-t>=&gt;</emu-t>
<emu-nt id="_ref_23083"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li>It is a Syntax Error if any element of the <emu-xref aoid="BoundNames" id="_ref_8294"><a href="syntax-directed-operations.html#sec-static-semantics-boundnames">BoundNames</a></emu-xref> of <emu-nt id="_ref_23084"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowBindingIdentifier">AsyncArrowBindingIdentifier</a></emu-nt> also occurs in the <emu-xref aoid="LexicallyDeclaredNames" id="_ref_8295"><a href="syntax-directed-operations.html#sec-static-semantics-lexicallydeclarednames">LexicallyDeclaredNames</a></emu-xref> of <emu-nt id="_ref_23085"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt>.</li>
</ul>
<emu-grammar><emu-production name="AsyncArrowFunction" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowFunction">AsyncArrowFunction</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="auwv8gbh">
<emu-nt id="_ref_23086"><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt>
<emu-t>=&gt;</emu-t>
<emu-nt id="_ref_23087"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<ul>
<li><emu-nt id="_ref_23088"><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt> <emu-xref href="#must-cover" id="_ref_8296"><a href="notational-conventions.html#must-cover">must cover</a></emu-xref> an <emu-nt id="_ref_23089"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowHead">AsyncArrowHead</a></emu-nt>.</li>
<li>It is a Syntax Error if <emu-nt id="_ref_23090"><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt> <emu-xref aoid="Contains" id="_ref_8297"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_23091"><a href="ecmascript-language-functions-and-classes.html#prod-YieldExpression">YieldExpression</a></emu-nt> is <emu-val>true</emu-val>.</li>
<li>It is a Syntax Error if <emu-nt id="_ref_23092"><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt> <emu-xref aoid="Contains" id="_ref_8298"><a href="syntax-directed-operations.html#sec-static-semantics-contains">Contains</a></emu-xref> <emu-nt id="_ref_23093"><a href="ecmascript-language-functions-and-classes.html#prod-AwaitExpression">AwaitExpression</a></emu-nt> is <emu-val>true</emu-val>.</li>
<li>It is a Syntax Error if any element of the <emu-xref aoid="BoundNames" id="_ref_8299"><a href="syntax-directed-operations.html#sec-static-semantics-boundnames">BoundNames</a></emu-xref> of <emu-nt id="_ref_23094"><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt> also occurs in the <emu-xref aoid="LexicallyDeclaredNames" id="_ref_8300"><a href="syntax-directed-operations.html#sec-static-semantics-lexicallydeclarednames">LexicallyDeclaredNames</a></emu-xref> of <emu-nt id="_ref_23095"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt>.</li>
<li>It is a Syntax Error if <emu-xref aoid="AsyncConciseBodyContainsUseStrict" id="_ref_8301"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-asyncconcisebodycontainsusestrict">AsyncConciseBodyContainsUseStrict</a></emu-xref> of <emu-nt id="_ref_23096"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt> is <emu-val>true</emu-val> and <emu-xref aoid="IsSimpleParameterList" id="_ref_8302"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-issimpleparameterlist">IsSimpleParameterList</a></emu-xref> of <emu-nt id="_ref_23097"><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt> is <emu-val>false</emu-val>.</li>
</ul>
</emu-clause>
<emu-clause id="sec-static-semantics-asyncconcisebodycontainsusestrict" oldids="sec-async-arrow-function-definitions-static-semantics-containsusestrict" type="sdo" aoid="AsyncConciseBodyContainsUseStrict"><span id="sec-async-arrow-function-definitions-static-semantics-containsusestrict"></span>
<h1><span class="secnum">15.9.2</span> Static Semantics: AsyncConciseBodyContainsUseStrict</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8303"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> AsyncConciseBodyContainsUseStrict takes no arguments and returns a Boolean. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="AsyncConciseBody" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="39f4t7jo" id="prod-ua51hPgJ"><emu-nt id="_ref_23098"><a href="ecmascript-language-functions-and-classes.html#prod-ExpressionBody">ExpressionBody</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="AsyncConciseBody" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="bm-b5ose" id="prod-NdVhlp_L">
<emu-t>{</emu-t>
<emu-nt id="_ref_23099"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="FunctionBodyContainsUseStrict" id="_ref_8304"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-functionbodycontainsusestrict">FunctionBodyContainsUseStrict</a></emu-xref> of <emu-nt id="_ref_23100"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-runtime-semantics-evaluateasyncconcisebody" oldids="sec-async-arrow-function-definitions-EvaluateBody" type="sdo" aoid="EvaluateAsyncConciseBody"><span id="sec-async-arrow-function-definitions-EvaluateBody"></span>
<h1><span class="secnum">15.9.3</span> Runtime Semantics: EvaluateAsyncConciseBody</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8305"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> EvaluateAsyncConciseBody takes arguments <var>functionObject</var> (an ECMAScript <emu-xref href="#function-object" id="_ref_8306"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>) and <var>argumentsList</var> (a <emu-xref href="#sec-list-and-record-specification-type" id="_ref_8307"><a href="ecmascript-data-types-and-values.html#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-xref href="#sec-ecmascript-language-types" id="_ref_8308"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types">ECMAScript language values</a></emu-xref>) and returns a <emu-xref href="#sec-completion-record-specification-type" id="_ref_8309"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">return completion</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="AsyncConciseBody" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="39f4t7jo" id="prod-NeT6IfHf"><emu-nt id="_ref_23101"><a href="ecmascript-language-functions-and-classes.html#prod-ExpressionBody">ExpressionBody</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>promiseCapability</var> be !&nbsp;<emu-xref aoid="NewPromiseCapability" id="_ref_8310"><a href="control-abstraction-objects.html#sec-newpromisecapability">NewPromiseCapability</a></emu-xref>(<emu-xref href="#sec-promise-constructor" id="_ref_8311"><a href="control-abstraction-objects.html#sec-promise-constructor">%Promise%</a></emu-xref>).</li><li>Let <var>completion</var> be <emu-xref aoid="Completion" id="_ref_8312"><a href="notational-conventions.html#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="FunctionDeclarationInstantiation" id="_ref_8313"><a href="ordinary-and-exotic-objects-behaviours.html#sec-functiondeclarationinstantiation" class="e-user-code">FunctionDeclarationInstantiation</a></emu-xref>(<var>functionObject</var>, <var>argumentsList</var>)).</li><li>If <var>completion</var> is an <emu-xref href="#sec-completion-record-specification-type" id="_ref_8314"><a href="ecmascript-data-types-and-values.html#sec-completion-record-specification-type">abrupt completion</a></emu-xref>, then<ol><li>Perform !&nbsp;<emu-xref aoid="Call" id="_ref_8315"><a href="abstract-operations.html#sec-call">Call</a></emu-xref>(<var>promiseCapability</var>.<var class="field">[[Reject]]</var>, <emu-val>undefined</emu-val>, « <var>completion</var>.<var class="field">[[Value]]</var>&nbsp;»).</li></ol></li><li>Else,<ol><li>Perform <emu-xref aoid="AsyncFunctionStart" id="_ref_8316"><a href="control-abstraction-objects.html#sec-async-functions-abstract-operations-async-function-start" class="e-user-code">AsyncFunctionStart</a></emu-xref>(<var>promiseCapability</var>, <emu-nt id="_ref_23102"><a href="ecmascript-language-functions-and-classes.html#prod-ExpressionBody">ExpressionBody</a></emu-nt>).</li></ol></li><li>Return <emu-xref aoid="ReturnCompletion" id="_ref_8317"><a href="ecmascript-data-types-and-values.html#sec-returncompletion">ReturnCompletion</a></emu-xref>(<var>promiseCapability</var>.<var class="field">[[Promise]]</var>).</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-runtime-semantics-instantiateasyncarrowfunctionexpression" type="sdo" aoid="InstantiateAsyncArrowFunctionExpression">
<h1><span class="secnum">15.9.4</span> Runtime Semantics: InstantiateAsyncArrowFunctionExpression</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8318"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> InstantiateAsyncArrowFunctionExpression takes optional argument <var>name</var> (a <emu-xref href="#property-key" id="_ref_8319"><a href="ecmascript-data-types-and-values.html#property-key">property key</a></emu-xref> or a <emu-xref href="#sec-private-names" id="_ref_8320"><a href="ecmascript-data-types-and-values.html#sec-private-names">Private Name</a></emu-xref>) and returns an ECMAScript <emu-xref href="#function-object" id="_ref_8321"><a href="ecmascript-data-types-and-values.html#function-object">function object</a></emu-xref>. It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="AsyncArrowFunction" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowFunction">AsyncArrowFunction</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="dqxgopsb" id="prod-kBFLOl9Q">
<emu-t>async</emu-t>
<emu-nt id="_ref_23103"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowBindingIdentifier">AsyncArrowBindingIdentifier</a></emu-nt>
<emu-t>=&gt;</emu-t>
<emu-nt id="_ref_23104"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <var>name</var> is not present, set <var>name</var> to <emu-val>""</emu-val>.</li><li>Let <var>env</var> be the LexicalEnvironment of the <emu-xref href="#running-execution-context" id="_ref_8322"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>.</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_8323"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8324"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_23105"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowFunction">AsyncArrowFunction</a></emu-nt>.</li><li>Let <var>parameters</var> be <emu-nt id="_ref_23106"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowBindingIdentifier">AsyncArrowBindingIdentifier</a></emu-nt>.</li><li>Let <var>closure</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_8325"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-async-function-prototype-properties" id="_ref_8326"><a href="control-abstraction-objects.html#sec-async-function-prototype-properties">%AsyncFunction.prototype%</a></emu-xref>, <var>sourceText</var>, <var>parameters</var>, <emu-nt id="_ref_23107"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt>, <emu-const>lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_8327"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>closure</var>, <var>name</var>).</li><li>Return <var>closure</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="AsyncArrowFunction" collapsed="">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowFunction">AsyncArrowFunction</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="auwv8gbh" id="prod-YQv2CZBp">
<emu-nt id="_ref_23108"><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt>
<emu-t>=&gt;</emu-t>
<emu-nt id="_ref_23109"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <var>name</var> is not present, set <var>name</var> to <emu-val>""</emu-val>.</li><li>Let <var>env</var> be the LexicalEnvironment of the <emu-xref href="#running-execution-context" id="_ref_8328"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>.</li><li>Let <var>privateEnv</var> be the <emu-xref href="#running-execution-context" id="_ref_8329"><a href="executable-code-and-execution-contexts.html#running-execution-context">running execution context</a></emu-xref>'s PrivateEnvironment.</li><li>Let <var>sourceText</var> be the <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8330"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">source text matched by</a></emu-xref> <emu-nt id="_ref_23110"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowFunction">AsyncArrowFunction</a></emu-nt>.</li><li>Let <var>head</var> be the <emu-nt id="_ref_23111"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowHead">AsyncArrowHead</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar" id="_ref_8331"><a href="notational-conventions.html#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_23112"><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt>.</li><li>Let <var>parameters</var> be the <emu-nt id="_ref_23113"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFormalParameters">ArrowFormalParameters</a></emu-nt> of <var>head</var>.</li><li>Let <var>closure</var> be <emu-xref aoid="OrdinaryFunctionCreate" id="_ref_8332"><a href="ordinary-and-exotic-objects-behaviours.html#sec-ordinaryfunctioncreate">OrdinaryFunctionCreate</a></emu-xref>(<emu-xref href="#sec-async-function-prototype-properties" id="_ref_8333"><a href="control-abstraction-objects.html#sec-async-function-prototype-properties">%AsyncFunction.prototype%</a></emu-xref>, <var>sourceText</var>, <var>parameters</var>, <emu-nt id="_ref_23114"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt>, <emu-const>lexical-this</emu-const>, <var>env</var>, <var>privateEnv</var>).</li><li>Perform <emu-xref aoid="SetFunctionName" id="_ref_8334"><a href="ordinary-and-exotic-objects-behaviours.html#sec-setfunctionname">SetFunctionName</a></emu-xref>(<var>closure</var>, <var>name</var>).</li><li>Return <var>closure</var>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-async-arrow-function-definitions-runtime-semantics-evaluation" type="sdo">
<h1><span class="secnum">15.9.5</span> Runtime Semantics: Evaluation</h1>
<emu-grammar><emu-production name="AsyncArrowFunction">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowFunction">AsyncArrowFunction</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="dqxgopsb" id="prod---LSw2Ps">
<emu-t>async</emu-t>
<emu-nt id="_ref_23115"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowBindingIdentifier">AsyncArrowBindingIdentifier</a></emu-nt>
<emu-t>=&gt;</emu-t>
<emu-nt id="_ref_23116"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt>
</emu-rhs>
<emu-rhs a="auwv8gbh" id="prod-vJszVz5M">
<emu-nt id="_ref_23117"><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt>
<emu-t>=&gt;</emu-t>
<emu-nt id="_ref_23118"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="InstantiateAsyncArrowFunctionExpression" id="_ref_8335"><a href="ecmascript-language-functions-and-classes.html#sec-runtime-semantics-instantiateasyncarrowfunctionexpression">InstantiateAsyncArrowFunctionExpression</a></emu-xref> of <emu-nt id="_ref_23119"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowFunction">AsyncArrowFunction</a></emu-nt>.</li></ol></emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-tail-position-calls">
<h1><span class="secnum">15.10</span> Tail Position Calls</h1>
<emu-clause id="sec-isintailposition" type="abstract operation" aoid="IsInTailPosition">
<h1><span class="secnum">15.10.1</span> Static Semantics: IsInTailPosition ( <var>call</var> )</h1>
<p>The abstract operation IsInTailPosition takes argument <var>call</var> (a <emu-nt id="_ref_23120"><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt> <emu-xref href="#sec-syntactic-grammar" id="_ref_8336"><a href="notational-conventions.html#sec-syntactic-grammar">Parse Node</a></emu-xref>, a <emu-nt id="_ref_23121"><a href="ecmascript-language-expressions.html#prod-MemberExpression">MemberExpression</a></emu-nt> <emu-xref href="#sec-syntactic-grammar" id="_ref_8337"><a href="notational-conventions.html#sec-syntactic-grammar">Parse Node</a></emu-xref>, or an <emu-nt id="_ref_23122"><a href="ecmascript-language-expressions.html#prod-OptionalChain">OptionalChain</a></emu-nt> <emu-xref href="#sec-syntactic-grammar" id="_ref_8338"><a href="notational-conventions.html#sec-syntactic-grammar">Parse Node</a></emu-xref>) and returns a Boolean. It performs the following steps when called:</p>
<emu-alg><ol><li>If <emu-xref aoid="IsStrict" id="_ref_8339"><a href="ecmascript-language-source-code.html#sec-isstrict">IsStrict</a></emu-xref>(<var>call</var>) is <emu-val>false</emu-val>, return <emu-val>false</emu-val>.</li><li>If <var>call</var> is not contained within a <emu-nt id="_ref_23123"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>, a <emu-nt id="_ref_23124"><a href="ecmascript-language-functions-and-classes.html#prod-ConciseBody">ConciseBody</a></emu-nt>, or an <emu-nt id="_ref_23125"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt>, return <emu-val>false</emu-val>.</li><li>Let <var>body</var> be the <emu-nt id="_ref_23126"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt>, <emu-nt id="_ref_23127"><a href="ecmascript-language-functions-and-classes.html#prod-ConciseBody">ConciseBody</a></emu-nt>, or <emu-nt id="_ref_23128"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt> that most closely contains <var>call</var>.</li><li>If <var>body</var> is the <emu-nt id="_ref_23129"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> of a <emu-nt id="_ref_23130"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorBody">GeneratorBody</a></emu-nt>, return <emu-val>false</emu-val>.</li><li>If <var>body</var> is the <emu-nt id="_ref_23131"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> of an <emu-nt id="_ref_23132"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionBody">AsyncFunctionBody</a></emu-nt>, return <emu-val>false</emu-val>.</li><li>If <var>body</var> is the <emu-nt id="_ref_23133"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionBody">FunctionBody</a></emu-nt> of an <emu-nt id="_ref_23134"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorBody">AsyncGeneratorBody</a></emu-nt>, return <emu-val>false</emu-val>.</li><li>If <var>body</var> is an <emu-nt id="_ref_23135"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncConciseBody">AsyncConciseBody</a></emu-nt>, return <emu-val>false</emu-val>.</li><li>Return the result of <emu-xref aoid="HasCallInTailPosition" id="_ref_8340"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <var>body</var> with argument <var>call</var>.</li></ol></emu-alg>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>Tail Position calls are only defined in <emu-xref href="#sec-strict-mode-code" id="_ref_8341"><a href="ecmascript-language-source-code.html#sec-strict-mode-code">strict mode code</a></emu-xref> because of a common non-standard language extension (see <emu-xref href="#sec-addrestrictedfunctionproperties" id="_ref_472"><a href="ordinary-and-exotic-objects-behaviours.html#sec-addrestrictedfunctionproperties">10.2.4</a></emu-xref>) that enables observation of the chain of caller contexts.</p>
</div></emu-note>
</emu-clause>
<emu-clause id="sec-static-semantics-hascallintailposition" type="sdo" oldids="sec-statement-rules,sec-expression-rules" aoid="HasCallInTailPosition"><span id="sec-expression-rules"></span><span id="sec-statement-rules"></span>
<h1><span class="secnum">15.10.2</span> Static Semantics: HasCallInTailPosition</h1>
<p>The <emu-xref href="#sec-algorithm-conventions-syntax-directed-operations" id="_ref_8342"><a href="notational-conventions.html#sec-algorithm-conventions-syntax-directed-operations">syntax-directed operation</a></emu-xref> HasCallInTailPosition takes argument <var>call</var> (a <emu-nt id="_ref_23136"><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt> <emu-xref href="#sec-syntactic-grammar" id="_ref_8343"><a href="notational-conventions.html#sec-syntactic-grammar">Parse Node</a></emu-xref>, a <emu-nt id="_ref_23137"><a href="ecmascript-language-expressions.html#prod-MemberExpression">MemberExpression</a></emu-nt> <emu-xref href="#sec-syntactic-grammar" id="_ref_8344"><a href="notational-conventions.html#sec-syntactic-grammar">Parse Node</a></emu-xref>, or an <emu-nt id="_ref_23138"><a href="ecmascript-language-expressions.html#prod-OptionalChain">OptionalChain</a></emu-nt> <emu-xref href="#sec-syntactic-grammar" id="_ref_8345"><a href="notational-conventions.html#sec-syntactic-grammar">Parse Node</a></emu-xref>) and returns a Boolean.</p>
<emu-note><span class="note">Note 1</span><div class="note-contents">
<p><var>call</var> is a <emu-xref href="#sec-syntactic-grammar" id="_ref_8346"><a href="notational-conventions.html#sec-syntactic-grammar">Parse Node</a></emu-xref> that represents a specific range of source text. When the following algorithms compare <var>call</var> to another <emu-xref href="#sec-syntactic-grammar" id="_ref_8347"><a href="notational-conventions.html#sec-syntactic-grammar">Parse Node</a></emu-xref>, it is a test of whether they represent the same source text.</p>
</div></emu-note>
<emu-note><span class="note">Note 2</span><div class="note-contents">
<p>A potential tail position call that is immediately followed by return <emu-xref aoid="GetValue" id="_ref_8348"><a href="ecmascript-data-types-and-values.html#sec-getvalue">GetValue</a></emu-xref> of the call result is also a possible tail position call. A function call cannot return a <emu-xref href="#sec-reference-record-specification-type" id="_ref_8349"><a href="ecmascript-data-types-and-values.html#sec-reference-record-specification-type">Reference Record</a></emu-xref>, so such a <emu-xref aoid="GetValue" id="_ref_8350"><a href="ecmascript-data-types-and-values.html#sec-getvalue">GetValue</a></emu-xref> operation will always return the same value as the actual function call result.</p>
</div></emu-note>
<p>It is defined piecewise over the following productions:</p>
<emu-grammar><emu-production name="StatementList" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-StatementList">StatementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="dbrzeh7l" id="prod-F5ertWhw">
<emu-nt id="_ref_23139"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementList">StatementList</a></emu-nt>
<emu-nt id="_ref_23140"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementListItem">StatementListItem</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>has</var> be <emu-xref aoid="HasCallInTailPosition" id="_ref_8351"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23141"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementList">StatementList</a></emu-nt> with argument <var>call</var>.</li><li>If <var>has</var> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_8352"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23142"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementListItem">StatementListItem</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="FunctionStatementList">
<emu-nt><a href="ecmascript-language-functions-and-classes.html#prod-FunctionStatementList">FunctionStatementList</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="n7nathbb" id="prod-kIL-80Vx">
<emu-gann>[empty]</emu-gann>
</emu-rhs>
</emu-production>
<emu-production name="StatementListItem">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-StatementListItem">StatementListItem</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="1vn3ibwe" id="prod-pXbgumyQ">
<emu-nt id="_ref_23143"><a href="ecmascript-language-statements-and-declarations.html#prod-Declaration">Declaration</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="Statement">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="iwwn8atx" id="prod-lv2KeoQI">
<emu-nt id="_ref_23144"><a href="ecmascript-language-statements-and-declarations.html#prod-VariableStatement">VariableStatement</a></emu-nt>
</emu-rhs>
<emu-rhs a="cziqu-45" id="prod-6SIyyGLy">
<emu-nt id="_ref_23145"><a href="ecmascript-language-statements-and-declarations.html#prod-EmptyStatement">EmptyStatement</a></emu-nt>
</emu-rhs>
<emu-rhs a="gsqkt2bv" id="prod-J7MnLCgE">
<emu-nt id="_ref_23146"><a href="ecmascript-language-statements-and-declarations.html#prod-ExpressionStatement">ExpressionStatement</a></emu-nt>
</emu-rhs>
<emu-rhs a="hx0ynljx" id="prod-ptINeFLS">
<emu-nt id="_ref_23147"><a href="ecmascript-language-statements-and-declarations.html#prod-ContinueStatement">ContinueStatement</a></emu-nt>
</emu-rhs>
<emu-rhs a="q4uv-sm3" id="prod-g-hVFlsz">
<emu-nt id="_ref_23148"><a href="ecmascript-language-statements-and-declarations.html#prod-BreakStatement">BreakStatement</a></emu-nt>
</emu-rhs>
<emu-rhs a="hntake-o" id="prod-5GevwvIH">
<emu-nt id="_ref_23149"><a href="ecmascript-language-statements-and-declarations.html#prod-ThrowStatement">ThrowStatement</a></emu-nt>
</emu-rhs>
<emu-rhs a="iseu28qi" id="prod-h7wdVS_8">
<emu-nt id="_ref_23150"><a href="ecmascript-language-statements-and-declarations.html#prod-DebuggerStatement">DebuggerStatement</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="Block">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="gbpaspne" id="prod-XaV9YBUk">
<emu-t>{</emu-t>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="ReturnStatement">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-ReturnStatement">ReturnStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="cykzgrgr" id="prod-1dE_5B3o">
<emu-t>return</emu-t>
<emu-t>;</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="LabelledItem">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-LabelledItem">LabelledItem</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="-nqupnlb" id="prod-vYyfX_-t">
<emu-nt id="_ref_23151"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionDeclaration">FunctionDeclaration</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="ForInOfStatement">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-ForInOfStatement">ForInOfStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="jqzgi_en" id="prod-UxPxs8d_">
<emu-t>for</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_23152"><a href="ecmascript-language-expressions.html#prod-LeftHandSideExpression">LeftHandSideExpression</a></emu-nt>
<emu-t>of</emu-t>
<emu-nt id="_ref_23153"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>
<emu-t>)</emu-t>
<emu-nt id="_ref_23154"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
</emu-rhs>
<emu-rhs a="7m-adytu" id="prod-SXpahyTC">
<emu-t>for</emu-t>
<emu-t>(</emu-t>
<emu-t>var</emu-t>
<emu-nt id="_ref_23155"><a href="ecmascript-language-statements-and-declarations.html#prod-ForBinding">ForBinding</a></emu-nt>
<emu-t>of</emu-t>
<emu-nt id="_ref_23156"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>
<emu-t>)</emu-t>
<emu-nt id="_ref_23157"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
</emu-rhs>
<emu-rhs a="b3wzboyu" id="prod-wCPQQMFx">
<emu-t>for</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_23158"><a href="ecmascript-language-statements-and-declarations.html#prod-ForDeclaration">ForDeclaration</a></emu-nt>
<emu-t>of</emu-t>
<emu-nt id="_ref_23159"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>
<emu-t>)</emu-t>
<emu-nt id="_ref_23160"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="CaseBlock">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-CaseBlock">CaseBlock</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="gbpaspne" id="prod-xbbhi7s4">
<emu-t>{</emu-t>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="IfStatement" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-IfStatement">IfStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="fuhqe2xq" id="prod-Ko_HI6eh">
<emu-t>if</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_23161"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
<emu-t>)</emu-t>
<emu-nt id="_ref_23162"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
<emu-t>else</emu-t>
<emu-nt id="_ref_23163"><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>has</var> be <emu-xref aoid="HasCallInTailPosition" id="_ref_8353"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of the first <emu-nt id="_ref_23164"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt> with argument <var>call</var>.</li><li>If <var>has</var> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_8354"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of the second <emu-nt id="_ref_23165"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="IfStatement">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-IfStatement">IfStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="9ogvciaf" id="prod-y6CLSCid">
<emu-t>if</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_23166"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
<emu-t>)</emu-t>
<emu-nt id="_ref_23167"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="DoWhileStatement">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-DoWhileStatement">DoWhileStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="jocmqoht" id="prod-S9zGaOvQ">
<emu-t>do</emu-t>
<emu-nt id="_ref_23168"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
<emu-t>while</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_23169"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
<emu-t>)</emu-t>
<emu-t>;</emu-t>
</emu-rhs>
</emu-production>
<emu-production name="WhileStatement">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-WhileStatement">WhileStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="92j78-b5" id="prod-w8fD4eQR">
<emu-t>while</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_23170"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
<emu-t>)</emu-t>
<emu-nt id="_ref_23171"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="ForStatement">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-ForStatement">ForStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="_do88got" id="prod-5zL2KF3R">
<emu-t>for</emu-t>
<emu-t>(</emu-t>
<emu-nt optional="" id="_ref_23172"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>;</emu-t>
<emu-nt optional="" id="_ref_23173"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>;</emu-t>
<emu-nt optional="" id="_ref_23174"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-nt id="_ref_23175"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
</emu-rhs>
<emu-rhs a="sodmtko8" id="prod-NaXtYhbG">
<emu-t>for</emu-t>
<emu-t>(</emu-t>
<emu-t>var</emu-t>
<emu-nt id="_ref_23176"><a href="ecmascript-language-statements-and-declarations.html#prod-VariableDeclarationList">VariableDeclarationList</a></emu-nt>
<emu-t>;</emu-t>
<emu-nt optional="" id="_ref_23177"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>;</emu-t>
<emu-nt optional="" id="_ref_23178"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-nt id="_ref_23179"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
</emu-rhs>
<emu-rhs a="k8b-ryxj" id="prod-dAMDtYUP">
<emu-t>for</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_23180"><a href="ecmascript-language-statements-and-declarations.html#prod-LexicalDeclaration">LexicalDeclaration</a></emu-nt>
<emu-nt optional="" id="_ref_23181"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>;</emu-t>
<emu-nt optional="" id="_ref_23182"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>)</emu-t>
<emu-nt id="_ref_23183"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="ForInOfStatement">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-ForInOfStatement">ForInOfStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="v1ibcd1w" id="prod-bQapuc86">
<emu-t>for</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_23184"><a href="ecmascript-language-expressions.html#prod-LeftHandSideExpression">LeftHandSideExpression</a></emu-nt>
<emu-t>in</emu-t>
<emu-nt id="_ref_23185"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
<emu-t>)</emu-t>
<emu-nt id="_ref_23186"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
</emu-rhs>
<emu-rhs a="7pgjrcn-" id="prod-MjZJhgTY">
<emu-t>for</emu-t>
<emu-t>(</emu-t>
<emu-t>var</emu-t>
<emu-nt id="_ref_23187"><a href="ecmascript-language-statements-and-declarations.html#prod-ForBinding">ForBinding</a></emu-nt>
<emu-t>in</emu-t>
<emu-nt id="_ref_23188"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
<emu-t>)</emu-t>
<emu-nt id="_ref_23189"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
</emu-rhs>
<emu-rhs a="jzctgxkp" id="prod-1PyeafOE">
<emu-t>for</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_23190"><a href="ecmascript-language-statements-and-declarations.html#prod-ForDeclaration">ForDeclaration</a></emu-nt>
<emu-t>in</emu-t>
<emu-nt id="_ref_23191"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
<emu-t>)</emu-t>
<emu-nt id="_ref_23192"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="WithStatement">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-WithStatement">WithStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="i70kview" id="prod-CNjVnvTr">
<emu-t>with</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_23193"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
<emu-t>)</emu-t>
<emu-nt id="_ref_23194"><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="HasCallInTailPosition" id="_ref_8355"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23195"><a href="ecmascript-language-statements-and-declarations.html#prod-Statement">Statement</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="LabelledStatement">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-LabelledStatement">LabelledStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ubbvtbun" id="prod-EJFE0gRP">
<emu-nt id="_ref_23196"><a href="ecmascript-language-expressions.html#prod-LabelIdentifier">LabelIdentifier</a></emu-nt>
<emu-t>:</emu-t>
<emu-nt id="_ref_23197"><a href="ecmascript-language-statements-and-declarations.html#prod-LabelledItem">LabelledItem</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_8356"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23198"><a href="ecmascript-language-statements-and-declarations.html#prod-LabelledItem">LabelledItem</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ReturnStatement" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-ReturnStatement">ReturnStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="tpdzx2lh" id="prod-dyDXTOIV">
<emu-t>return</emu-t>
<emu-nt id="_ref_23199"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
<emu-t>;</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_8357"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23200"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="SwitchStatement" collapsed="">
<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" id="prod-5fN7_rAP">
<emu-t>switch</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_23201"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
<emu-t>)</emu-t>
<emu-nt id="_ref_23202"><a href="ecmascript-language-statements-and-declarations.html#prod-CaseBlock">CaseBlock</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_8358"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23203"><a href="ecmascript-language-statements-and-declarations.html#prod-CaseBlock">CaseBlock</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="CaseBlock" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-CaseBlock">CaseBlock</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ududlhou" id="prod-qQu0U2NT">
<emu-t>{</emu-t>
<emu-nt optional="" id="_ref_23204"><a href="ecmascript-language-statements-and-declarations.html#prod-CaseClauses">CaseClauses</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-nt id="_ref_23205"><a href="ecmascript-language-statements-and-declarations.html#prod-DefaultClause">DefaultClause</a></emu-nt>
<emu-nt optional="" id="_ref_23206"><a href="ecmascript-language-statements-and-declarations.html#prod-CaseClauses">CaseClauses</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
<emu-t>}</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>has</var> be <emu-val>false</emu-val>.</li><li>If the first <emu-nt id="_ref_23207"><a href="ecmascript-language-statements-and-declarations.html#prod-CaseClauses">CaseClauses</a></emu-nt> is present, set <var>has</var> to <emu-xref aoid="HasCallInTailPosition" id="_ref_8359"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of the first <emu-nt id="_ref_23208"><a href="ecmascript-language-statements-and-declarations.html#prod-CaseClauses">CaseClauses</a></emu-nt> with argument <var>call</var>.</li><li>If <var>has</var> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Set <var>has</var> to <emu-xref aoid="HasCallInTailPosition" id="_ref_8360"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23209"><a href="ecmascript-language-statements-and-declarations.html#prod-DefaultClause">DefaultClause</a></emu-nt> with argument <var>call</var>.</li><li>If <var>has</var> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>If the second <emu-nt id="_ref_23210"><a href="ecmascript-language-statements-and-declarations.html#prod-CaseClauses">CaseClauses</a></emu-nt> is present, set <var>has</var> to <emu-xref aoid="HasCallInTailPosition" id="_ref_8361"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of the second <emu-nt id="_ref_23211"><a href="ecmascript-language-statements-and-declarations.html#prod-CaseClauses">CaseClauses</a></emu-nt> with argument <var>call</var>.</li><li>Return <var>has</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="CaseClauses" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-CaseClauses">CaseClauses</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="addji9rs" id="prod-NriAn6Ov">
<emu-nt id="_ref_23212"><a href="ecmascript-language-statements-and-declarations.html#prod-CaseClauses">CaseClauses</a></emu-nt>
<emu-nt id="_ref_23213"><a href="ecmascript-language-statements-and-declarations.html#prod-CaseClause">CaseClause</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>has</var> be <emu-xref aoid="HasCallInTailPosition" id="_ref_8362"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23214"><a href="ecmascript-language-statements-and-declarations.html#prod-CaseClauses">CaseClauses</a></emu-nt> with argument <var>call</var>.</li><li>If <var>has</var> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_8363"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23215"><a href="ecmascript-language-statements-and-declarations.html#prod-CaseClause">CaseClause</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="CaseClause" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-CaseClause">CaseClause</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="x20nmjyd" id="prod-E0jD9ho5">
<emu-t>case</emu-t>
<emu-nt id="_ref_23216"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
<emu-t>:</emu-t>
<emu-nt optional="" id="_ref_23217"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementList">StatementList</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="DefaultClause" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-DefaultClause">DefaultClause</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="z4ihpgum" id="prod-VmaCE56t">
<emu-t>default</emu-t>
<emu-t>:</emu-t>
<emu-nt optional="" id="_ref_23218"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementList">StatementList</a><emu-mods><emu-opt>opt</emu-opt></emu-mods></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <emu-nt id="_ref_23219"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementList">StatementList</a></emu-nt> is present, return <emu-xref aoid="HasCallInTailPosition" id="_ref_8364"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23220"><a href="ecmascript-language-statements-and-declarations.html#prod-StatementList">StatementList</a></emu-nt> with argument <var>call</var>.</li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="TryStatement" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-TryStatement">TryStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="qhfov2lc" id="prod-osswrj81">
<emu-t>try</emu-t>
<emu-nt id="_ref_23221"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt>
<emu-nt id="_ref_23222"><a href="ecmascript-language-statements-and-declarations.html#prod-Catch">Catch</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_8365"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23223"><a href="ecmascript-language-statements-and-declarations.html#prod-Catch">Catch</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="TryStatement">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-TryStatement">TryStatement</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="xsakufa6" id="prod-Gpv9b_Iv">
<emu-t>try</emu-t>
<emu-nt id="_ref_23224"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt>
<emu-nt id="_ref_23225"><a href="ecmascript-language-statements-and-declarations.html#prod-Finally">Finally</a></emu-nt>
</emu-rhs>
<emu-rhs a="gxlzfd5s" id="prod-fwryg5gk">
<emu-t>try</emu-t>
<emu-nt id="_ref_23226"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt>
<emu-nt id="_ref_23227"><a href="ecmascript-language-statements-and-declarations.html#prod-Catch">Catch</a></emu-nt>
<emu-nt id="_ref_23228"><a href="ecmascript-language-statements-and-declarations.html#prod-Finally">Finally</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_8366"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23229"><a href="ecmascript-language-statements-and-declarations.html#prod-Finally">Finally</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="Catch" collapsed="">
<emu-nt><a href="ecmascript-language-statements-and-declarations.html#prod-Catch">Catch</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="3ce8nhiw" id="prod-WuWbjiYu">
<emu-t>catch</emu-t>
<emu-t>(</emu-t>
<emu-nt id="_ref_23230"><a href="ecmascript-language-statements-and-declarations.html#prod-CatchParameter">CatchParameter</a></emu-nt>
<emu-t>)</emu-t>
<emu-nt id="_ref_23231"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_8367"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23232"><a href="ecmascript-language-statements-and-declarations.html#prod-Block">Block</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="AssignmentExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="uglis9ea" id="prod-EisiYgar">
<emu-nt id="_ref_23233"><a href="ecmascript-language-functions-and-classes.html#prod-YieldExpression">YieldExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="k987eemp" id="prod-vU1F8zv6">
<emu-nt id="_ref_23234"><a href="ecmascript-language-functions-and-classes.html#prod-ArrowFunction">ArrowFunction</a></emu-nt>
</emu-rhs>
<emu-rhs a="a3kew9kn" id="prod-dfzrjfnA">
<emu-nt id="_ref_23235"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncArrowFunction">AsyncArrowFunction</a></emu-nt>
</emu-rhs>
<emu-rhs a="ijpo4eaq" id="prod-UQL2MJzG">
<emu-nt id="_ref_23236"><a href="ecmascript-language-expressions.html#prod-LeftHandSideExpression">LeftHandSideExpression</a></emu-nt>
<emu-t>=</emu-t>
<emu-nt id="_ref_23237"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="xzqhr---" id="prod-HJVm6lHU">
<emu-nt id="_ref_23238"><a href="ecmascript-language-expressions.html#prod-LeftHandSideExpression">LeftHandSideExpression</a></emu-nt>
<emu-nt id="_ref_23239"><a href="ecmascript-language-expressions.html#prod-AssignmentOperator">AssignmentOperator</a></emu-nt>
<emu-nt id="_ref_23240"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="devkzibl" id="prod-oNpXbeRs">
<emu-nt id="_ref_23241"><a href="ecmascript-language-expressions.html#prod-LeftHandSideExpression">LeftHandSideExpression</a></emu-nt>
<emu-t>&amp;&amp;=</emu-t>
<emu-nt id="_ref_23242"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="dt1frwiy" id="prod-TNQR4MPF">
<emu-nt id="_ref_23243"><a href="ecmascript-language-expressions.html#prod-LeftHandSideExpression">LeftHandSideExpression</a></emu-nt>
<emu-t>||=</emu-t>
<emu-nt id="_ref_23244"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="dbifpqxa" id="prod-ML4QjaEz">
<emu-nt id="_ref_23245"><a href="ecmascript-language-expressions.html#prod-LeftHandSideExpression">LeftHandSideExpression</a></emu-nt>
<emu-t>??=</emu-t>
<emu-nt id="_ref_23246"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="BitwiseANDExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-BitwiseANDExpression">BitwiseANDExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="qq3twiws" id="prod-YGqkdmtG">
<emu-nt id="_ref_23247"><a href="ecmascript-language-expressions.html#prod-BitwiseANDExpression">BitwiseANDExpression</a></emu-nt>
<emu-t>&amp;</emu-t>
<emu-nt id="_ref_23248"><a href="ecmascript-language-expressions.html#prod-EqualityExpression">EqualityExpression</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="BitwiseXORExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-BitwiseXORExpression">BitwiseXORExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="tgmxlg5x" id="prod-N6UlC2YT">
<emu-nt id="_ref_23249"><a href="ecmascript-language-expressions.html#prod-BitwiseXORExpression">BitwiseXORExpression</a></emu-nt>
<emu-t>^</emu-t>
<emu-nt id="_ref_23250"><a href="ecmascript-language-expressions.html#prod-BitwiseANDExpression">BitwiseANDExpression</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="BitwiseORExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-BitwiseORExpression">BitwiseORExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="aw36khwc" id="prod-xCUjATPv">
<emu-nt id="_ref_23251"><a href="ecmascript-language-expressions.html#prod-BitwiseORExpression">BitwiseORExpression</a></emu-nt>
<emu-t>|</emu-t>
<emu-nt id="_ref_23252"><a href="ecmascript-language-expressions.html#prod-BitwiseXORExpression">BitwiseXORExpression</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="EqualityExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-EqualityExpression">EqualityExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="dxo0lfgu" id="prod-slB6AVFT">
<emu-nt id="_ref_23253"><a href="ecmascript-language-expressions.html#prod-EqualityExpression">EqualityExpression</a></emu-nt>
<emu-t>==</emu-t>
<emu-nt id="_ref_23254"><a href="ecmascript-language-expressions.html#prod-RelationalExpression">RelationalExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="cn2twrby" id="prod--y8v2xFz">
<emu-nt id="_ref_23255"><a href="ecmascript-language-expressions.html#prod-EqualityExpression">EqualityExpression</a></emu-nt>
<emu-t>!=</emu-t>
<emu-nt id="_ref_23256"><a href="ecmascript-language-expressions.html#prod-RelationalExpression">RelationalExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="4hu79ipe" id="prod-3nwl9Xq9">
<emu-nt id="_ref_23257"><a href="ecmascript-language-expressions.html#prod-EqualityExpression">EqualityExpression</a></emu-nt>
<emu-t>===</emu-t>
<emu-nt id="_ref_23258"><a href="ecmascript-language-expressions.html#prod-RelationalExpression">RelationalExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="irptryux" id="prod-gkNFox60">
<emu-nt id="_ref_23259"><a href="ecmascript-language-expressions.html#prod-EqualityExpression">EqualityExpression</a></emu-nt>
<emu-t>!==</emu-t>
<emu-nt id="_ref_23260"><a href="ecmascript-language-expressions.html#prod-RelationalExpression">RelationalExpression</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="RelationalExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-RelationalExpression">RelationalExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="0hbjkrqw" id="prod-moN-TY1a">
<emu-nt id="_ref_23261"><a href="ecmascript-language-expressions.html#prod-RelationalExpression">RelationalExpression</a></emu-nt>
<emu-t>&lt;</emu-t>
<emu-nt id="_ref_23262"><a href="ecmascript-language-expressions.html#prod-ShiftExpression">ShiftExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="gziyg7ut" id="prod-9RitMb2a">
<emu-nt id="_ref_23263"><a href="ecmascript-language-expressions.html#prod-RelationalExpression">RelationalExpression</a></emu-nt>
<emu-t>&gt;</emu-t>
<emu-nt id="_ref_23264"><a href="ecmascript-language-expressions.html#prod-ShiftExpression">ShiftExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="kcktdtrm" id="prod-Ov8fY5LR">
<emu-nt id="_ref_23265"><a href="ecmascript-language-expressions.html#prod-RelationalExpression">RelationalExpression</a></emu-nt>
<emu-t>&lt;=</emu-t>
<emu-nt id="_ref_23266"><a href="ecmascript-language-expressions.html#prod-ShiftExpression">ShiftExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="3cupp_tq" id="prod-Qjes4HD-">
<emu-nt id="_ref_23267"><a href="ecmascript-language-expressions.html#prod-RelationalExpression">RelationalExpression</a></emu-nt>
<emu-t>&gt;=</emu-t>
<emu-nt id="_ref_23268"><a href="ecmascript-language-expressions.html#prod-ShiftExpression">ShiftExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="1ec9rmdp" id="prod-a-QEMe-f">
<emu-nt id="_ref_23269"><a href="ecmascript-language-expressions.html#prod-RelationalExpression">RelationalExpression</a></emu-nt>
<emu-t>instanceof</emu-t>
<emu-nt id="_ref_23270"><a href="ecmascript-language-expressions.html#prod-ShiftExpression">ShiftExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="9mtjpkmx" id="prod-K4Kmo-4o">
<emu-nt id="_ref_23271"><a href="ecmascript-language-expressions.html#prod-RelationalExpression">RelationalExpression</a></emu-nt>
<emu-t>in</emu-t>
<emu-nt id="_ref_23272"><a href="ecmascript-language-expressions.html#prod-ShiftExpression">ShiftExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="bfkxjj0f" id="prod-HF09HkQT">
<emu-nt id="_ref_23273"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>
<emu-t>in</emu-t>
<emu-nt id="_ref_23274"><a href="ecmascript-language-expressions.html#prod-ShiftExpression">ShiftExpression</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="ShiftExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-ShiftExpression">ShiftExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="tg9tkm4d" id="prod-uY5on6s_">
<emu-nt id="_ref_23275"><a href="ecmascript-language-expressions.html#prod-ShiftExpression">ShiftExpression</a></emu-nt>
<emu-t>&lt;&lt;</emu-t>
<emu-nt id="_ref_23276"><a href="ecmascript-language-expressions.html#prod-AdditiveExpression">AdditiveExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="vimn88nj" id="prod-2EFbRVMb">
<emu-nt id="_ref_23277"><a href="ecmascript-language-expressions.html#prod-ShiftExpression">ShiftExpression</a></emu-nt>
<emu-t>&gt;&gt;</emu-t>
<emu-nt id="_ref_23278"><a href="ecmascript-language-expressions.html#prod-AdditiveExpression">AdditiveExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="n_furjdr" id="prod-DGTb9f0a">
<emu-nt id="_ref_23279"><a href="ecmascript-language-expressions.html#prod-ShiftExpression">ShiftExpression</a></emu-nt>
<emu-t>&gt;&gt;&gt;</emu-t>
<emu-nt id="_ref_23280"><a href="ecmascript-language-expressions.html#prod-AdditiveExpression">AdditiveExpression</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="AdditiveExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-AdditiveExpression">AdditiveExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="dkl7f70y" id="prod-NqWi91A3">
<emu-nt id="_ref_23281"><a href="ecmascript-language-expressions.html#prod-AdditiveExpression">AdditiveExpression</a></emu-nt>
<emu-t>+</emu-t>
<emu-nt id="_ref_23282"><a href="ecmascript-language-expressions.html#prod-MultiplicativeExpression">MultiplicativeExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="7gvefllu" id="prod-yLTyBgd3">
<emu-nt id="_ref_23283"><a href="ecmascript-language-expressions.html#prod-AdditiveExpression">AdditiveExpression</a></emu-nt>
<emu-t>-</emu-t>
<emu-nt id="_ref_23284"><a href="ecmascript-language-expressions.html#prod-MultiplicativeExpression">MultiplicativeExpression</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="MultiplicativeExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-MultiplicativeExpression">MultiplicativeExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="-5_iophl" id="prod-siUuH5zP">
<emu-nt id="_ref_23285"><a href="ecmascript-language-expressions.html#prod-MultiplicativeExpression">MultiplicativeExpression</a></emu-nt>
<emu-nt id="_ref_23286"><a href="ecmascript-language-expressions.html#prod-MultiplicativeOperator">MultiplicativeOperator</a></emu-nt>
<emu-nt id="_ref_23287"><a href="ecmascript-language-expressions.html#prod-ExponentiationExpression">ExponentiationExpression</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="ExponentiationExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-ExponentiationExpression">ExponentiationExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="0zbfzgb0" id="prod-QjBqEERx">
<emu-nt id="_ref_23288"><a href="ecmascript-language-expressions.html#prod-UpdateExpression">UpdateExpression</a></emu-nt>
<emu-t>**</emu-t>
<emu-nt id="_ref_23289"><a href="ecmascript-language-expressions.html#prod-ExponentiationExpression">ExponentiationExpression</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="UpdateExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-UpdateExpression">UpdateExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="i_jjg0ex" id="prod-AxYNo76R">
<emu-nt id="_ref_23290"><a href="ecmascript-language-expressions.html#prod-LeftHandSideExpression">LeftHandSideExpression</a></emu-nt>
<emu-t>++</emu-t>
</emu-rhs>
<emu-rhs a="jr0tcoqg" id="prod-8wEdzYlR">
<emu-nt id="_ref_23291"><a href="ecmascript-language-expressions.html#prod-LeftHandSideExpression">LeftHandSideExpression</a></emu-nt>
<emu-t>--</emu-t>
</emu-rhs>
<emu-rhs a="vwgxygda" id="prod-DlZME4qQ">
<emu-t>++</emu-t>
<emu-nt id="_ref_23292"><a href="ecmascript-language-expressions.html#prod-UnaryExpression">UnaryExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="onrvwudi" id="prod-tSq265UP">
<emu-t>--</emu-t>
<emu-nt id="_ref_23293"><a href="ecmascript-language-expressions.html#prod-UnaryExpression">UnaryExpression</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="UnaryExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-UnaryExpression">UnaryExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="v9wiw5nl" id="prod-AObKG7bs">
<emu-t>delete</emu-t>
<emu-nt id="_ref_23294"><a href="ecmascript-language-expressions.html#prod-UnaryExpression">UnaryExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="5dgdjy7z" id="prod-bZ_A9_ek">
<emu-t>void</emu-t>
<emu-nt id="_ref_23295"><a href="ecmascript-language-expressions.html#prod-UnaryExpression">UnaryExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="qxosuesc" id="prod-wEjVGAri">
<emu-t>typeof</emu-t>
<emu-nt id="_ref_23296"><a href="ecmascript-language-expressions.html#prod-UnaryExpression">UnaryExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="o0kdmush" id="prod-qq9s9o6K">
<emu-t>+</emu-t>
<emu-nt id="_ref_23297"><a href="ecmascript-language-expressions.html#prod-UnaryExpression">UnaryExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="odzkxnu5" id="prod-i-bNI229">
<emu-t>-</emu-t>
<emu-nt id="_ref_23298"><a href="ecmascript-language-expressions.html#prod-UnaryExpression">UnaryExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="b9nqec7b" id="prod-qryce9Aj">
<emu-t>~</emu-t>
<emu-nt id="_ref_23299"><a href="ecmascript-language-expressions.html#prod-UnaryExpression">UnaryExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="ulcvcjyx" id="prod-U263_8yR">
<emu-t>!</emu-t>
<emu-nt id="_ref_23300"><a href="ecmascript-language-expressions.html#prod-UnaryExpression">UnaryExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="shlomml6" id="prod-tMRR2AUd">
<emu-nt id="_ref_23301"><a href="ecmascript-language-functions-and-classes.html#prod-AwaitExpression">AwaitExpression</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="CallExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ljkqw-iw" id="prod-ErkBAfx1">
<emu-nt id="_ref_23302"><a href="ecmascript-language-expressions.html#prod-SuperCall">SuperCall</a></emu-nt>
</emu-rhs>
<emu-rhs a="kyx2iyhy" id="prod-MHB-4I6F">
<emu-nt id="_ref_23303"><a href="ecmascript-language-expressions.html#prod-ImportCall">ImportCall</a></emu-nt>
</emu-rhs>
<emu-rhs a="2u2urbmg" id="prod-tR1iepZf">
<emu-nt id="_ref_23304"><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt>
<emu-t>[</emu-t>
<emu-nt id="_ref_23305"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
<emu-t>]</emu-t>
</emu-rhs>
<emu-rhs a="u6lsbvgu" id="prod-jkDZ--BF">
<emu-nt id="_ref_23306"><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt>
<emu-t>.</emu-t>
<emu-nt id="_ref_23307"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt>
</emu-rhs>
<emu-rhs a="cysjk9wh" id="prod-qcy6aC3l">
<emu-nt id="_ref_23308"><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt>
<emu-t>.</emu-t>
<emu-nt id="_ref_23309"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="NewExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-NewExpression">NewExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="51p618ta" id="prod-wDQSEiH6">
<emu-t>new</emu-t>
<emu-nt id="_ref_23310"><a href="ecmascript-language-expressions.html#prod-NewExpression">NewExpression</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="MemberExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-MemberExpression">MemberExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="a74xd7de" id="prod-O9zU8IeQ">
<emu-nt id="_ref_23311"><a href="ecmascript-language-expressions.html#prod-MemberExpression">MemberExpression</a></emu-nt>
<emu-t>[</emu-t>
<emu-nt id="_ref_23312"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
<emu-t>]</emu-t>
</emu-rhs>
<emu-rhs a="frbj984t" id="prod-pLKWI9AB">
<emu-nt id="_ref_23313"><a href="ecmascript-language-expressions.html#prod-MemberExpression">MemberExpression</a></emu-nt>
<emu-t>.</emu-t>
<emu-nt id="_ref_23314"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt>
</emu-rhs>
<emu-rhs a="x4tzletw" id="prod-hqYKqnVA">
<emu-nt id="_ref_23315"><a href="ecmascript-language-expressions.html#prod-SuperProperty">SuperProperty</a></emu-nt>
</emu-rhs>
<emu-rhs a="yb7id2be" id="prod-wTfT9w68">
<emu-nt id="_ref_23316"><a href="ecmascript-language-expressions.html#prod-MetaProperty">MetaProperty</a></emu-nt>
</emu-rhs>
<emu-rhs a="cfq-hbbx" id="prod-pXKW4iCP">
<emu-t>new</emu-t>
<emu-nt id="_ref_23317"><a href="ecmascript-language-expressions.html#prod-MemberExpression">MemberExpression</a></emu-nt>
<emu-nt id="_ref_23318"><a href="ecmascript-language-expressions.html#prod-Arguments">Arguments</a></emu-nt>
</emu-rhs>
<emu-rhs a="0uk9afbi" id="prod-AGU05Shk">
<emu-nt id="_ref_23319"><a href="ecmascript-language-expressions.html#prod-MemberExpression">MemberExpression</a></emu-nt>
<emu-t>.</emu-t>
<emu-nt id="_ref_23320"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>
</emu-rhs>
</emu-production>
<emu-production name="PrimaryExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-PrimaryExpression">PrimaryExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="jo4mwtvh" id="prod-9Nj5RIni">
<emu-t>this</emu-t>
</emu-rhs>
<emu-rhs a="i2hxnrih" id="prod-_yZN8EJG">
<emu-nt id="_ref_23321"><a href="ecmascript-language-expressions.html#prod-IdentifierReference">IdentifierReference</a></emu-nt>
</emu-rhs>
<emu-rhs a="kul-a19e" id="prod-49th_4jp">
<emu-nt id="_ref_23322"><a href="ecmascript-language-expressions.html#prod-Literal">Literal</a></emu-nt>
</emu-rhs>
<emu-rhs a="g_mjk5cm" id="prod-VCC2b-df">
<emu-nt id="_ref_23323"><a href="ecmascript-language-expressions.html#prod-ArrayLiteral">ArrayLiteral</a></emu-nt>
</emu-rhs>
<emu-rhs a="zreje_zz" id="prod-57nYHC9R">
<emu-nt id="_ref_23324"><a href="ecmascript-language-expressions.html#prod-ObjectLiteral">ObjectLiteral</a></emu-nt>
</emu-rhs>
<emu-rhs a="jc7szv1s" id="prod-mJe0J4L3">
<emu-nt id="_ref_23325"><a href="ecmascript-language-functions-and-classes.html#prod-FunctionExpression">FunctionExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="2m5tsvzv" id="prod-tCjmqARP">
<emu-nt id="_ref_23326"><a href="ecmascript-language-functions-and-classes.html#prod-ClassExpression">ClassExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="q7f39ayg" id="prod-_eR92TK3">
<emu-nt id="_ref_23327"><a href="ecmascript-language-functions-and-classes.html#prod-GeneratorExpression">GeneratorExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="rvibtigb" id="prod-Jg_ST3R4">
<emu-nt id="_ref_23328"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncFunctionExpression">AsyncFunctionExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="naptrn97" id="prod-9ZhC3H4R">
<emu-nt id="_ref_23329"><a href="ecmascript-language-functions-and-classes.html#prod-AsyncGeneratorExpression">AsyncGeneratorExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="mbzy6lvr" id="prod-iAVN3dH2">
<emu-nt id="_ref_23330"><a href="ecmascript-language-lexical-grammar.html#prod-RegularExpressionLiteral">RegularExpressionLiteral</a></emu-nt>
</emu-rhs>
<emu-rhs a="2zis6bbu" id="prod-uEE3vhkY">
<emu-nt id="_ref_23331"><a href="ecmascript-language-expressions.html#prod-TemplateLiteral">TemplateLiteral</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="Expression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="1px9pijq" id="prod-5uO1VxFZ">
<emu-nt id="_ref_23332"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>
</emu-rhs>
<emu-rhs a="cwoazx1t" id="prod-tcddXWO2">
<emu-nt id="_ref_23333"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
<emu-t>,</emu-t>
<emu-nt id="_ref_23334"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_8368"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23335"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ConditionalExpression" collapsed="">
<emu-nt><a href="ecmascript-language-expressions.html#prod-ConditionalExpression">ConditionalExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="d4vlxget" id="prod-OM1J5OMs">
<emu-nt id="_ref_23336"><a href="ecmascript-language-expressions.html#prod-ShortCircuitExpression">ShortCircuitExpression</a></emu-nt>
<emu-t>?</emu-t>
<emu-nt id="_ref_23337"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>
<emu-t>:</emu-t>
<emu-nt id="_ref_23338"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>has</var> be <emu-xref aoid="HasCallInTailPosition" id="_ref_8369"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of the first <emu-nt id="_ref_23339"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt> with argument <var>call</var>.</li><li>If <var>has</var> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_8370"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of the second <emu-nt id="_ref_23340"><a href="ecmascript-language-expressions.html#prod-AssignmentExpression">AssignmentExpression</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="LogicalANDExpression" collapsed="">
<emu-nt><a href="ecmascript-language-expressions.html#prod-LogicalANDExpression">LogicalANDExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="iybiqszh" id="prod-tjpyq_vi">
<emu-nt id="_ref_23341"><a href="ecmascript-language-expressions.html#prod-LogicalANDExpression">LogicalANDExpression</a></emu-nt>
<emu-t>&amp;&amp;</emu-t>
<emu-nt id="_ref_23342"><a href="ecmascript-language-expressions.html#prod-BitwiseORExpression">BitwiseORExpression</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_8371"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23343"><a href="ecmascript-language-expressions.html#prod-BitwiseORExpression">BitwiseORExpression</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="LogicalORExpression" collapsed="">
<emu-nt><a href="ecmascript-language-expressions.html#prod-LogicalORExpression">LogicalORExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="tku92t5q" id="prod-mF39BKcc">
<emu-nt id="_ref_23344"><a href="ecmascript-language-expressions.html#prod-LogicalORExpression">LogicalORExpression</a></emu-nt>
<emu-t>||</emu-t>
<emu-nt id="_ref_23345"><a href="ecmascript-language-expressions.html#prod-LogicalANDExpression">LogicalANDExpression</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_8372"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23346"><a href="ecmascript-language-expressions.html#prod-LogicalANDExpression">LogicalANDExpression</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="CoalesceExpression" collapsed="">
<emu-nt><a href="ecmascript-language-expressions.html#prod-CoalesceExpression">CoalesceExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="3eoigfmu" id="prod-XrXVT2tR">
<emu-nt id="_ref_23347"><a href="ecmascript-language-expressions.html#prod-CoalesceExpressionHead">CoalesceExpressionHead</a></emu-nt>
<emu-t>??</emu-t>
<emu-nt id="_ref_23348"><a href="ecmascript-language-expressions.html#prod-BitwiseORExpression">BitwiseORExpression</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_8373"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23349"><a href="ecmascript-language-expressions.html#prod-BitwiseORExpression">BitwiseORExpression</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="CallExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="7jj-96li" id="prod-bByIrGsD">
<emu-nt id="_ref_23350"><a href="ecmascript-language-functions-and-classes.html#prod-CoverCallExpressionAndAsyncArrowHead">CoverCallExpressionAndAsyncArrowHead</a></emu-nt>
</emu-rhs>
<emu-rhs a="qugahahu" id="prod-lkRAvRUF">
<emu-nt id="_ref_23351"><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt>
<emu-nt id="_ref_23352"><a href="ecmascript-language-expressions.html#prod-Arguments">Arguments</a></emu-nt>
</emu-rhs>
<emu-rhs a="rc744wey" id="prod-e9jubpnL">
<emu-nt id="_ref_23353"><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt>
<emu-nt id="_ref_23354"><a href="ecmascript-language-expressions.html#prod-TemplateLiteral">TemplateLiteral</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If this <emu-nt id="_ref_23355"><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt> is <var>call</var>, return <emu-val>true</emu-val>.</li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="OptionalExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-OptionalExpression">OptionalExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="tne-ixmh" id="prod-qFVLp3q-">
<emu-nt id="_ref_23356"><a href="ecmascript-language-expressions.html#prod-MemberExpression">MemberExpression</a></emu-nt>
<emu-nt id="_ref_23357"><a href="ecmascript-language-expressions.html#prod-OptionalChain">OptionalChain</a></emu-nt>
</emu-rhs>
<emu-rhs a="vah6zjkb" id="prod-UqoX45R5">
<emu-nt id="_ref_23358"><a href="ecmascript-language-expressions.html#prod-CallExpression">CallExpression</a></emu-nt>
<emu-nt id="_ref_23359"><a href="ecmascript-language-expressions.html#prod-OptionalChain">OptionalChain</a></emu-nt>
</emu-rhs>
<emu-rhs a="m-2pf2bd" id="prod-pHLlfSmO">
<emu-nt id="_ref_23360"><a href="ecmascript-language-expressions.html#prod-OptionalExpression">OptionalExpression</a></emu-nt>
<emu-nt id="_ref_23361"><a href="ecmascript-language-expressions.html#prod-OptionalChain">OptionalChain</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_8374"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23362"><a href="ecmascript-language-expressions.html#prod-OptionalChain">OptionalChain</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="OptionalChain">
<emu-nt><a href="ecmascript-language-expressions.html#prod-OptionalChain">OptionalChain</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="kktyttw7" id="prod-gfhvmXSt">
<emu-t>?.</emu-t>
<emu-t>[</emu-t>
<emu-nt id="_ref_23363"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
<emu-t>]</emu-t>
</emu-rhs>
<emu-rhs a="w-4ch2am" id="prod-hHSELWtc">
<emu-t>?.</emu-t>
<emu-nt id="_ref_23364"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt>
</emu-rhs>
<emu-rhs a="0xlnjlpz" id="prod-dlN3twzl">
<emu-t>?.</emu-t>
<emu-nt id="_ref_23365"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>
</emu-rhs>
<emu-rhs a="jgl-kve-" id="prod-Yn8_Hl_k">
<emu-nt id="_ref_23366"><a href="ecmascript-language-expressions.html#prod-OptionalChain">OptionalChain</a></emu-nt>
<emu-t>[</emu-t>
<emu-nt id="_ref_23367"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
<emu-t>]</emu-t>
</emu-rhs>
<emu-rhs a="lf2imwfr" id="prod-IKKs3v0D">
<emu-nt id="_ref_23368"><a href="ecmascript-language-expressions.html#prod-OptionalChain">OptionalChain</a></emu-nt>
<emu-t>.</emu-t>
<emu-nt id="_ref_23369"><a href="ecmascript-language-lexical-grammar.html#prod-IdentifierName">IdentifierName</a></emu-nt>
</emu-rhs>
<emu-rhs a="dnp-fbqk" id="prod-NQG4pluL">
<emu-nt id="_ref_23370"><a href="ecmascript-language-expressions.html#prod-OptionalChain">OptionalChain</a></emu-nt>
<emu-t>.</emu-t>
<emu-nt id="_ref_23371"><a href="ecmascript-language-lexical-grammar.html#prod-PrivateIdentifier">PrivateIdentifier</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="OptionalChain">
<emu-nt><a href="ecmascript-language-expressions.html#prod-OptionalChain">OptionalChain</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="ynxeowdb" id="prod-PSEzAHN6">
<emu-t>?.</emu-t>
<emu-nt id="_ref_23372"><a href="ecmascript-language-expressions.html#prod-Arguments">Arguments</a></emu-nt>
</emu-rhs>
<emu-rhs a="eogoekck" id="prod-pk-z4M2l">
<emu-nt id="_ref_23373"><a href="ecmascript-language-expressions.html#prod-OptionalChain">OptionalChain</a></emu-nt>
<emu-nt id="_ref_23374"><a href="ecmascript-language-expressions.html#prod-Arguments">Arguments</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If this <emu-nt id="_ref_23375"><a href="ecmascript-language-expressions.html#prod-OptionalChain">OptionalChain</a></emu-nt> is <var>call</var>, return <emu-val>true</emu-val>.</li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="MemberExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-MemberExpression">MemberExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="fj52gjle" id="prod-o5ILpQ4m">
<emu-nt id="_ref_23376"><a href="ecmascript-language-expressions.html#prod-MemberExpression">MemberExpression</a></emu-nt>
<emu-nt id="_ref_23377"><a href="ecmascript-language-expressions.html#prod-TemplateLiteral">TemplateLiteral</a></emu-nt>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If this <emu-nt id="_ref_23378"><a href="ecmascript-language-expressions.html#prod-MemberExpression">MemberExpression</a></emu-nt> is <var>call</var>, return <emu-val>true</emu-val>.</li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="PrimaryExpression" collapsed="">
<emu-nt><a href="ecmascript-language-expressions.html#prod-PrimaryExpression">PrimaryExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="yrb110hm" id="prod-pxpI2tU_"><emu-nt id="_ref_23379"><a href="ecmascript-language-expressions.html#prod-CoverParenthesizedExpressionAndArrowParameterList">CoverParenthesizedExpressionAndArrowParameterList</a></emu-nt></emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Let <var>expr</var> be the <emu-nt id="_ref_23380"><a href="ecmascript-language-expressions.html#prod-ParenthesizedExpression">ParenthesizedExpression</a></emu-nt> that is <emu-xref href="#sec-syntactic-grammar" id="_ref_8375"><a href="notational-conventions.html#sec-syntactic-grammar">covered</a></emu-xref> by <emu-nt id="_ref_23381"><a href="ecmascript-language-expressions.html#prod-CoverParenthesizedExpressionAndArrowParameterList">CoverParenthesizedExpressionAndArrowParameterList</a></emu-nt>.</li><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_8376"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <var>expr</var> with argument <var>call</var>.</li></ol></emu-alg>
<emu-grammar><emu-production name="ParenthesizedExpression">
<emu-nt><a href="ecmascript-language-expressions.html#prod-ParenthesizedExpression">ParenthesizedExpression</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="s6bvnd5v" id="prod-lff4OQNv">
<emu-t>(</emu-t>
<emu-nt id="_ref_23382"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt>
<emu-t>)</emu-t>
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>Return <emu-xref aoid="HasCallInTailPosition" id="_ref_8377"><a href="ecmascript-language-functions-and-classes.html#sec-static-semantics-hascallintailposition">HasCallInTailPosition</a></emu-xref> of <emu-nt id="_ref_23383"><a href="ecmascript-language-expressions.html#prod-Expression">Expression</a></emu-nt> with argument <var>call</var>.</li></ol></emu-alg>
</emu-clause>
<emu-clause id="sec-preparefortailcall" type="abstract operation" aoid="PrepareForTailCall">
<h1><span class="secnum">15.10.3</span> PrepareForTailCall ( )</h1>
<p>The abstract operation PrepareForTailCall takes no arguments and returns <emu-const>unused</emu-const>. It performs the following steps when called:</p>
<emu-alg><ol><li><emu-xref href="#assert" id="_ref_8378"><a href="notational-conventions.html#assert">Assert</a></emu-xref>: The current <emu-xref href="#sec-execution-contexts" id="_ref_8379"><a href="executable-code-and-execution-contexts.html#sec-execution-contexts">execution context</a></emu-xref> will not subsequently be used for the evaluation of any ECMAScript code or built-in functions. The invocation of Call subsequent to the invocation of this abstract operation will create and push a new <emu-xref href="#sec-execution-contexts" id="_ref_8380"><a href="executable-code-and-execution-contexts.html#sec-execution-contexts">execution context</a></emu-xref> before performing any such evaluation.</li><li>Discard all resources associated with the current <emu-xref href="#sec-execution-contexts" id="_ref_8381"><a href="executable-code-and-execution-contexts.html#sec-execution-contexts">execution context</a></emu-xref>.</li><li>Return <emu-const>unused</emu-const>.</li></ol></emu-alg>
<p>A tail position call must either release any transient internal resources associated with the currently executing function <emu-xref href="#sec-execution-contexts" id="_ref_8382"><a href="executable-code-and-execution-contexts.html#sec-execution-contexts">execution context</a></emu-xref> before invoking the target function or reuse those resources in support of the target function.</p>
<emu-note><span class="note">Note</span><div class="note-contents">
<p>For example, a tail position call should only grow an implementation's activation record stack by the amount that the size of the target function's activation record exceeds the size of the calling function's activation record. If the target function's activation record is smaller, then the total size of the stack should decrease.</p>
</div></emu-note>
</emu-clause>
</emu-clause>
</emu-clause></div></body></html>