whatwg / whatwg/html

Running the same failing module script breaks ECMA assumptions

Open
#8,553 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
9.4k
Forks
3.2k
PR merge metrics
PR metrics pending

Description

Having a page like:

<script type="module" src="runtimefail.js"></script>
<script type="module" src="runtimefail.js"></script>

where runtimefail.js throws some non parse error.

Means the evaluate method of a Source Text Module Record is called twice.
This is a problem as described by https://github.com/tc39/ecma262/issues/2823 .
It call Evaluate on the exact same module as modules are cached as described in https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-single-module-script .

To me it looks like this is a ECMAscript issue, but the An error to rethrow field of a script could perhaps provide an alternative way to solve this.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the HTML Standard's “fetch a single module script” algorithm and the linked ECMA-262 Source Text Module Record evaluation rules, then review TC39 issue 2823. Determine how repeated failing module scripts should be specified, including whether the script's “An error to rethrow” field is relevant; done means the HTML and ECMAScript behavior is resolved and documented consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
web-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.