<commit_before><emu-annex id="todo">
  <h1>Todo &amp; Known Issues</h1>
  <p>This list is not complete. It also does not duplicate any information on the <a href="https://github.com/tc39/ecmascript-asyncawait/issues">Github issues list</a>. It serves as a reminder to the author only.</p>
  <ol>
    <li>Updates to CreateDynamicFunction for creating dynamic async functions.</li>
    <li>Semantics (mostly runtime) for async methods.</li>
    <li>EvaluateBody semantics for AsyncConciseBody.</li>
    <li>IteratorBindingInitialization runtime semantics.</li>
  </ol>
</emu-annex>
<emu-annex id="desugaring">
  <h1>Informative Desugaring</h1>
  <pre><code>
async function &lt;name>?&lt;argumentlist>&lt;body>

=>

function &lt;name>?&lt;argumentlist>{ return spawn(function*() &lt;body>, this); }
  </pre></code>

  <p>The `spawn` used in the above desugaring is a call to the following algorithm.  This algorithm does not need to be exposed directly as an API to user code, it is part of the semantics of async functions.</p>

<pre><code language="javascript">
function spawn(genF, self) {
    return new Promise(function(resolve, reject) {
        var gen = genF.call(self);<commit_msg>Todo: Await semantics.<commit_after><emu-annex id="todo">
  <h1>Todo &amp; Known Issues</h1>
  <p>This list is not complete. It also does not duplicate any information on the <a href="https://github.com/tc39/ecmascript-asyncawait/issues">Github issues list</a>. It serves as a reminder to the author only.</p>
  <ol>
    <li>Updates to CreateDynamicFunction for creating dynamic async functions.</li>
    <li>Semantics (mostly runtime) for async methods.</li>
    <li>EvaluateBody semantics for AsyncConciseBody.</li>
    <li>IteratorBindingInitialization runtime semantics.</li>
    <li>Await semantics.</li>
  </ol>
</emu-annex>
<emu-annex id="desugaring">
  <h1>Informative Desugaring</h1>
  <pre><code>
async function &lt;name>?&lt;argumentlist>&lt;body>

=>

function &lt;name>?&lt;argumentlist>{ return spawn(function*() &lt;body>, this); }
  </pre></code>

  <p>The `spawn` used in the above desugaring is a call to the following algorithm.  This algorithm does not need to be exposed directly as an API to user code, it is part of the semantics of async functions.</p>

<pre><code language="javascript">
function spawn(genF, self) {
    return new Promise(function(resolve, reject) {
        var gen = genF.call(self);
{'fraction_non_alphanumeric': 0.13427268959801078, 'fraction_numerical': 0.004973062577704103, 'mean_word_length': 4.640186915887851, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 77, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1626233', 'n_tokens_mistral': 785, 'n_tokens_neox': 760, 'n_words': 247}