diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5676f2b220..b963a5530c 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -4,6 +4,7 @@ If you are changing the signature or behavior of an existing construct, please c * [Web IDL](https://webidl.spec.whatwg.org/) — [file an issue](https://github.com/whatwg/webidl/issues/new) * [HTML Standard](https://html.spec.whatwg.org/) — [file an issue](https://github.com/whatwg/html/issues/new) * [ECMAScript Intl API](https://tc39.es/ecma402/) - [file an issue](https://github.com/tc39/ecma402/issues/new) +* [WebAssembly](https://webassembly.github.io/spec/) - [file an issue](https://github.com/WebAssembly/spec/issues/new) Note: please ensure that the "Allow edits and access to secrets by maintainers" checkbox remains checked. --> diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 237f4c9cc3..6a14def1f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,12 +5,14 @@ on: [pull_request, push] jobs: build: name: 'build & lint ecmarkup' - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 - - uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae - name: 'nvm install lts/* && npm ci' + - uses: actions/checkout@v4 + - uses: ljharb/actions/node/install@7f214d8efdbdcefc96ad9689663ef387a195deec + name: 'nvm install lts/* && npm ci --no-audit' + env: + NPM_CONFIG_AUDIT: false with: node-version: lts/* use-npm-ci: true diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 424c2d3f97..9856f27625 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,17 +8,19 @@ on: jobs: deploy: name: 'deploy github pages' - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 if: ${{ github.repository == 'tc39/ecma262' }} steps: - - uses: actions/checkout@v3 - - uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae - name: 'nvm install lts/* && npm ci' + - uses: actions/checkout@v4 + - uses: ljharb/actions/node/install@7f214d8efdbdcefc96ad9689663ef387a195deec + name: 'nvm install lts/* && npm ci --no-audit' + env: + NPM_CONFIG_AUDIT: false with: node-version: lts/* use-npm-ci: true - run: npm run build-only - - run: ./scripts/auto-deploy.sh + - run: ./scripts/deploy-github-pages.sh env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/enforce-format.yml b/.github/workflows/enforce-format.yml index d2358e0e47..ea456fd544 100644 --- a/.github/workflows/enforce-format.yml +++ b/.github/workflows/enforce-format.yml @@ -5,12 +5,14 @@ on: [pull_request] jobs: build: name: 'enforce format' - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 - - uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae - name: 'nvm install lts/* && npm ci' + - uses: actions/checkout@v4 + - uses: ljharb/actions/node/install@7f214d8efdbdcefc96ad9689663ef387a195deec + name: 'nvm install lts/* && npm ci --no-audit' + env: + NPM_CONFIG_AUDIT: false with: node-version: lts/* use-npm-ci: true diff --git a/.github/workflows/esmeta-installer/action.yml b/.github/workflows/esmeta-installer/action.yml new file mode 100644 index 0000000000..d540b5b457 --- /dev/null +++ b/.github/workflows/esmeta-installer/action.yml @@ -0,0 +1,37 @@ +name: 'install esmeta' + +runs: + using: "composite" + steps: + - name: setup JDK + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + - name: setup SBT + uses: sbt/setup-sbt@v1 + - name: set esmeta version and path + shell: bash + run: | + # v0.7.3 + echo "ESMETA_VERSION=9066adf1edefd5d7e8dbc6eaa878242bb591cc2b" >> $GITHUB_ENV + echo "ESMETA_HOME=vendor/esmeta" >> $GITHUB_ENV + - name: clone esmeta + shell: bash + run: | + mkdir -p "${ESMETA_HOME}" + cd ${ESMETA_HOME} + git init + git remote add origin https://github.com/es-meta/esmeta.git + git fetch --depth 1 origin "$ESMETA_VERSION" + git checkout FETCH_HEAD + - name: build esmeta + shell: bash + run: | + cd "${ESMETA_HOME}" + sbt assembly + - name: link ecma262 + shell: bash + run: | + rmdir "${ESMETA_HOME}"/ecma262 \ + && ln -s "$(pwd)" "${ESMETA_HOME}"/ecma262 diff --git a/.github/workflows/esmeta-typecheck.yml b/.github/workflows/esmeta-typecheck.yml index 6dc9325942..247254dda1 100644 --- a/.github/workflows/esmeta-typecheck.yml +++ b/.github/workflows/esmeta-typecheck.yml @@ -5,35 +5,18 @@ on: [pull_request] jobs: esmeta-typecheck: name: 'esmeta typecheck' - runs-on: ubuntu-latest - - env: - ESMETA_HOME: vendor/esmeta - + runs-on: ubuntu-22.04 steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup JDK - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 17 - - name: download esmeta - run: | - mkdir -p "${ESMETA_HOME}" - cd "${ESMETA_HOME}" - git init - git remote add origin https://github.com/es-meta/esmeta.git - git fetch --depth 1 origin 088029201f0de736fdb8f30ca0a96bef26a52089 ;# v0.4.1 - git checkout FETCH_HEAD - - name: build esmeta - run: | - cd "${ESMETA_HOME}" - sbt assembly - - name: link - run: | - rmdir "${ESMETA_HOME}"/ecma262 \ - && ln -s "$(pwd)" "${ESMETA_HOME}"/ecma262 + - name: checkout + uses: actions/checkout@v4 + - name: install esmeta + uses: ./.github/workflows/esmeta-installer - name: typecheck - run: '"${ESMETA_HOME}"/bin/esmeta tycheck -status -tycheck:log -tycheck:ignore=esmeta-ignore.json' - + run: '"${ESMETA_HOME}"/bin/esmeta tycheck -status -extract:log -tycheck:log -tycheck:ignore=esmeta-ignore.json' + - name: create logs archive + run: 'tar --verbose --verbose --create --gzip --file esmeta-logs.tar.gz --directory="${ESMETA_HOME}" logs/' + - name: upload logs archive + uses: actions/upload-artifact@v4 + with: + name: esmeta-logs + path: esmeta-logs.tar.gz diff --git a/.github/workflows/esmeta-yetcheck.yml b/.github/workflows/esmeta-yetcheck.yml new file mode 100644 index 0000000000..d45ba03cdc --- /dev/null +++ b/.github/workflows/esmeta-yetcheck.yml @@ -0,0 +1,25 @@ +name: 'esmeta yet phrases detection' + +on: [pull_request] + +jobs: + esmeta-yetcheck: + name: 'esmeta yet phrases detection' + runs-on: ubuntu-22.04 + steps: + - name: checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: install esmeta + uses: ./.github/workflows/esmeta-installer + - name: check for newly-introduced phrases + env: + FILE_PATH: spec.html + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.sha }} + run: | + "${ESMETA_HOME}"/bin/esmeta yet-check \ + -status -yet-check:github-alert -yet-check:log \ + "${BASE_SHA}" "${HEAD_SHA}" + cat "${ESMETA_HOME}"/logs/yet-check/summary.md >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/ipr.yml b/.github/workflows/ipr.yml index 608b514867..4abe4a6147 100644 --- a/.github/workflows/ipr.yml +++ b/.github/workflows/ipr.yml @@ -11,16 +11,18 @@ on: jobs: build: name: 'check IPR form' - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 - - uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae - name: 'nvm install lts/* && npm ci' + - uses: actions/checkout@v4 + - uses: ljharb/actions/node/install@7f214d8efdbdcefc96ad9689663ef387a195deec + name: 'nvm install lts/* && npm ci --no-audit' + env: + NPM_CONFIG_AUDIT: false with: node-version: lts/* use-npm-ci: true - - run: 'npm run ipr-check' + - run: npm run ipr-check ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'HEAD' }} env: GH_TOKEN: ${{ secrets.GH_IPR_TOKEN }} GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml new file mode 100644 index 0000000000..8ca579b64e --- /dev/null +++ b/.github/workflows/pr-preview.yml @@ -0,0 +1,116 @@ +name: 'ecma262' + +on: + pull_request_target: + types: [opened, synchronize, reopened, labeled] + +jobs: + check-membership: + name: 'check membership' + runs-on: ubuntu-22.04 + outputs: + result: ${{ steps.test-membership.outputs.result }} + should-run: ${{ steps.should-run.outputs.result }} + steps: + - uses: actions/github-script@v7 + id: should-run + with: + result-encoding: string + script: | + const { action, label } = context.payload; + + // Run on opened/synchronize for members, or when 'request preview' label is added + if (action === 'labeled' && label?.name === 'request preview') { + return 'yes'; + } else if (action === 'opened' || action === 'synchronize' || action === 'reopened') { + return 'check-membership'; + } + return 'no'; + + - uses: actions/github-script@v7 + id: test-membership + if: steps.should-run.outputs.result == 'check-membership' + env: + AUTHOR: ${{ github.event.pull_request.user.login }} + with: + result-encoding: string + script: | + const author = process.env.AUTHOR; + if (author === 'jmdyck') return 'yes'; + try { + const result = await github.request('GET /orgs/{org}/members/{username}', { + org: 'tc39', + username: author, + headers: { + 'X-GitHub-Api-Version': '2022-11-28' + } + }); + return 'yes'; + } catch (e) { + console.log({ author }, e); + return 'no'; + } + - run: echo "${{steps.test-membership.outputs.result}}" + + build: + name: 'publish PR preview' + runs-on: ubuntu-22.04 + needs: check-membership + if: needs.check-membership.outputs.should-run == 'yes' || (needs.check-membership.outputs.should-run == 'check-membership' && needs.check-membership.outputs.result == 'yes') + + permissions: + contents: write + pull-requests: write + + steps: + - name: Remove 'request preview' label + if: github.event.action == 'labeled' && github.event.label.name == 'request preview' + uses: actions/github-script@v7 + with: + script: | + await github.rest.issues.removeLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + name: 'request preview' + }); + + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + - name: Overwrite snapshot scripts with versions from main + run: | + git remote add upstream https://github.com/${{ github.event.pull_request.base.repo.full_name }}.git + git fetch upstream main + git checkout upstream/main -- scripts/insert-snapshot-warning.js scripts/deploy-github-pages.sh + + - uses: ljharb/actions/node/install@7f214d8efdbdcefc96ad9689663ef387a195deec + name: 'nvm install lts/* && npm ci --no-audit' + env: + NPM_CONFIG_AUDIT: false + with: + node-version: lts/* + use-npm-ci: true + - run: npm run build-only + - run: node scripts/insert-snapshot-warning.js + - run: ./scripts/deploy-github-pages.sh --pr ${{ github.event.number }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - id: get-preview-url + name: Get preview url + run: | + gh_pages_url="https://$(printf '%s' "$GITHUB_REPOSITORY" \ + | sed 's#/#.github.io/#; s#^tc39.github.io/#tc39.es/#')" + echo "url=$gh_pages_url" >> $GITHUB_OUTPUT + - name: Post preview comment + uses: phulsechinmay/rewritable-pr-comment@v0.3.0 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COMMENT_IDENTIFIER: tc39_pr_preview_comment + message: > + The rendered spec preview for this PR is available as a single page at + ${{ steps.get-preview-url.outputs.url }}/pr/${{ github.event.number }} + and as multiple pages at + ${{ steps.get-preview-url.outputs.url }}/pr/${{ github.event.number }}/multipage . diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml deleted file mode 100644 index d2dd361ea5..0000000000 --- a/.github/workflows/preview-build.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Build Preview - -on: [pull_request] - -jobs: - build: - name: 'build PR preview' - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae - name: 'nvm install lts/* && npm ci' - with: - node-version: lts/* - use-npm-ci: true - - run: npm run build-only - - run: node scripts/insert_snapshot_warning - - run: echo ${{ github.event.number }} > out/pr.txt - - uses: actions/upload-artifact@v3 - with: - name: out - path: out/ diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml deleted file mode 100644 index c3ab4f7f83..0000000000 --- a/.github/workflows/preview.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Upload Preview - -on: - workflow_run: - workflows: ["Build Preview"] - types: - - completed - -jobs: - upload: - name: 'upload PR preview' - runs-on: ubuntu-latest - if: > - ${{ - github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'success' && - github.repository == 'tc39/ecma262' - }} - - steps: - - uses: actions/checkout@v3 - - uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae - name: 'nvm install lts/* && npm ci' - with: - node-version: lts/* - use-npm-ci: true - - name: 'Download artifact' - uses: actions/github-script@v3.1.0 - with: - script: | - const { owner, repo } = context.repo; - const artifacts = await github.actions.listWorkflowRunArtifacts({ - owner, - repo, - run_id: ${{ github.event.workflow_run.id }}, - }); - const { id: artifact_id } = artifacts.data.artifacts.find((artifact) => artifact.name == 'out'); - const download = await github.actions.downloadArtifact({ - owner, - repo, - artifact_id, - archive_format: 'zip', - }); - const fs = require('fs'); - fs.writeFileSync('${{ github.workspace }}/out.zip', Buffer.from(download.data)); - - run: unzip -o out.zip -d out - - name: 'debug info' - uses: actions/github-script@v3.1.0 - with: - script: | - console.log(${{ toJson(github.event) }}); - - run: head -n1 out/pr.txt | grep -e '^[1-9][0-9]*$' - name: 'validate PR number from archive' - - run: echo "PULL_REQUEST=$(head -n1 out/pr.txt)" >> $GITHUB_ENV - - run: rm out/pr.txt && echo $PULL_REQUEST - - run: node scripts/publish-preview - env: - CI_PREVIEW_TOKEN: ${{ secrets.CI_PREVIEW_TOKEN }} - GITHUB_HEAD_SHA: ${{ github.event.workflow_run.head_commit.id }} diff --git a/.github/workflows/publish-biblio.yml b/.github/workflows/publish-biblio.yml index dad842ff86..436913a490 100644 --- a/.github/workflows/publish-biblio.yml +++ b/.github/workflows/publish-biblio.yml @@ -5,6 +5,10 @@ on: branches: - main +permissions: + id-token: write # needed for trusted publishing + contents: read + jobs: publish: name: 'publish ecma262-biblio' @@ -13,20 +17,22 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v5 with: fetch-depth: 0 - name: Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v5 with: node-version: 'lts/*' registry-url: 'https://registry.npmjs.org' + # needed for trusted publishing + - name: Update npm + run: npm install -g npm@latest + - name: Install dependencies - run: npm ci + run: npm ci --no-audit - name: Publish biblio run: scripts/publish-biblio.sh - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_FOR_TC39_USER }} diff --git a/.github/workflows/require-allow-edits.yml b/.github/workflows/require-allow-edits.yml index 9021ca22ef..d38d96743b 100644 --- a/.github/workflows/require-allow-edits.yml +++ b/.github/workflows/require-allow-edits.yml @@ -6,7 +6,7 @@ jobs: _: name: "Require “Allow Edits”" - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: ljharb/require-allow-edits@main diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml new file mode 100644 index 0000000000..61c4d2b1e2 --- /dev/null +++ b/.github/workflows/spellcheck.yml @@ -0,0 +1,24 @@ +name: 'ecma-262' + +on: [pull_request] + +jobs: + spellcheck: + name: 'check for newly-introduced spelling errors' + runs-on: ubuntu-22.04 + + steps: + - run: sudo apt-get install aspell + - uses: actions/checkout@v4 + with: + # Number of commits to fetch. 0 indicates all history for all branches and tags. + # Default: 1 + fetch-depth: 0 + - uses: ljharb/actions/node/install@7f214d8efdbdcefc96ad9689663ef387a195deec + name: 'nvm install lts/* && npm ci --no-audit' + env: + NPM_CONFIG_AUDIT: false + with: + node-version: lts/* + use-npm-ci: true + - run: node scripts/spellcheck.mjs origin/"${GITHUB_BASE_REF}" diff --git a/.gitignore b/.gitignore index 1d3e390a13..21fcbc8f9d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules/ out/ vendor/esmeta test*.js +aspell.txt # lockfiles we don't use are ignored npm-shrinkwrap.json diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9fbc383dd7..f2a4e6bfca 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,12 +1,14 @@ -### Contributing to ECMAScript +# Contributing to ECMAScript Contributors to ECMAScript and TC39 are expected to follow our [Code of Conduct](https://tc39.es/code-of-conduct/). +**Please do not open issues or pull requests in this repository to suggest new features.** See the [new feature proposals](#new-feature-proposals) section below for more details. + If you are not an Ecma member, any non-trivial contributions require signing a legal agreement with Ecma. See the section "Required Legal Agreements" below for details. -#### Issues and Pull Requests +## Issues and Pull Requests -For small changes to ECMAScript, you can contribute by filing an issue or a pull request against the current text of ECMA-262 standard in this repository. +Issues and PRs in the ecma262 repository are appropriate for minor modifications to the existing specification, for example to fix typos, clarify wording, or correct accidental changes introduced by earlier commits. New features use the feature request process described below. To file an issue, go to the ecma262 [issues page](https://github.com/tc39/ecma262/issues). From there, [search](https://guides.github.com/features/issues/) in the existing issues to see if an issue already exists to track your problem. If so, add a comment to the existing issue; otherwise, [file a new issue](https://help.github.com/articles/creating-an-issue/) documenting the problem. @@ -20,23 +22,22 @@ Commits in pull requests should have a first line which starts with a tag, follo If changes in the upstream `main` branch cause your PR to have conflicts, you should rebase your branch to `main` and force-push it to your repo (rather than doing a merge commit). -Issues and PRs in the ecma262 repository are appropriate for minor modifications to the existing specification, for example to make behavior more consistent in an edge case, match what is implemented by the large majority of actual implementations, or to clarify wording. New features use the feature request process described below. - -##### Downstream dependencies +### Downstream dependencies If you are changing the signature or behavior of an existing construct, please check if this affects downstream dependencies (searching for the construct's name is sufficient) and if needed file an issue: * [Web IDL](https://heycam.github.io/webidl/) — [file an issue](https://github.com/heycam/webidl/issues/new) * [HTML Standard](https://html.spec.whatwg.org/) — [file an issue](https://github.com/whatwg/html/issues/new) * [ECMAScript Intl API](https://tc39.es/ecma402/) - [file an issue](https://github.com/tc39/ecma402/issues/new) +* [WebAssembly](https://webassembly.github.io/spec/) - [file an issue](https://github.com/WebAssembly/spec/issues/new) -#### New feature proposals +## New feature proposals TC39 is open to accepting new feature requests for ECMAScript, referred to as "proposals". Proposals go through a four-stage process which is documented in the [TC39 process document](https://tc39.es/process-document/). Feature requests for future versions of ECMAScript should not be made in this repository. Instead, they are developed in separate GitHub repositories, which are then merged into the main repository once they have received "Stage 4". -##### Creating a new proposal +### Creating a new proposal To make a feature request, document the problem and a sketch of the solution with others in the community, including TC39 members. One place to do this is the [TC39 Discourse](https://es.discourse.group/); another is the [Matrix chat room][]. @@ -44,13 +45,13 @@ Your goal will be to convince others that your proposal is a useful addition to You can look at [existing proposals](https://github.com/tc39/proposals/) for examples of how proposals are structured, and some delegates use [this template](https://github.com/tc39/template-for-proposals) when creating repositories for their proposals. Proposals need to have a repository and be moved to the TC39 org on GitHub once they reach Stage 1. -##### TC39 meetings and champions +### TC39 meetings and champions If you have a new proposal you want to get into the language, you first need a TC39 "champion": a member of the committee who will make the case for the proposal at [in-person TC39 meetings](https://github.com/tc39/agendas#agendas) and help it move through the process. If you are a TC39 member, you can be a champion; otherwise, find a TC39 member to work with for this (e.g., through the [TC39 discussion group](https://es.discourse.group/) or the [Matrix chat room][]). Proposals may have multiple champions (a "champion group"). TC39 meets six times a year, mostly in the United States, to discuss proposals. It is possible for members to join meetings remotely. At meetings, we discuss ways to resolve issues and feature requests. We spend most of the time considering proposals and advancing them through the stage process. Meetings follow an agenda which is developed in the [agendas GitHub repository](https://github.com/tc39/agendas/). After the meeting, notes are published in the [notes GitHub repository](https://github.com/tc39/tc39-notes/). To advance your proposal towards inclusion in the final specification, ensure that it is included on the agenda for an upcoming meeting and propose advancement at that time. -##### Helping with existing proposals +### Helping with existing proposals TC39 is currently considering adding several new features to the language. These proposals are linked from [the proposals repository](https://github.com/tc39/proposals). There are many ways to help with existing proposals: * File issues in the individual proposal repository to provide constructive criticism and feedback. @@ -62,7 +63,7 @@ TC39 is currently considering adding several new features to the language. These To track what's going on with a particular proposal, you can look in issues and commits in the individual proposal repository, read presentation slides which are linked from the TC39 agenda, and read the notes which came from the subsequent meetings. You can also reach out via the [Matrix chat room][], the [discussion group](https://es.discourse.group/), or direct communication with a proposal champion, if the other resources are unclear. -#### Required legal agreements +## Required legal agreements People associated with Ecma member organizations have a legal agreement in place with Ecma to ensure that intellectual property rights (IPR) of their contributions are appropriately licensed to be available to all ECMAScript programmers and implementers. For non-members to contribute, you are required to make these rights available by signing a Contributor License Agreement (CLA) for non-trivial contributions. diff --git a/PUBLISHING.md b/PUBLISHING.md new file mode 100644 index 0000000000..f69554b9bc --- /dev/null +++ b/PUBLISHING.md @@ -0,0 +1,20 @@ +# Publishing the annual PDF + +First, make sure you've provided appropriate front matter. `title`, `shortname`, `version`, and `date` are **mandatory**. If generating a final annual edition, date should reflect the date of the Ecma GA which will ratify the Standard. For example: + +``` +title: ECMAScript® 2024 Language Specification +shortname: ECMA-262 +version: 15th Edition +date: 2024-06-25 +``` + +Use the package script `build-for-pdf`. Importantly, you want to make sure your image directory files wind up in the same output directory as your markup. Your `ecmarkup` command should include the options `--assets external`, `--assets-dir out`, and `--printable`. + +Then, run `prince` to generate your PDF. + +```shell +prince --script ./node_modules/ecmarkup/js/print.js out/index.html -o path/to/output.pdf +``` + +Spend 5-10 minutes double-checking the PDF for egregious layout issues. That means quickly skimming all 800+ pages looking for whitespace or content split in a confusing manner. Tinker with print-only styles only as needed. Compare cover & table of contents to previous years. diff --git a/biblio/package.json b/biblio/package.json index 31ec63fc83..5fb010ec7f 100644 --- a/biblio/package.json +++ b/biblio/package.json @@ -15,5 +15,10 @@ "files": [ "biblio.json" ], - "license": "SEE LICENSE IN LICENSE.md" + "license": "SEE LICENSE IN LICENSE.md", + "repository": { + "type": "git", + "url": "git+https://github.com/tc39/ecma262.git", + "directory": "./biblio" + } } diff --git a/esmeta-ignore.json b/esmeta-ignore.json index dcb6101596..0d84cfb4ad 100644 --- a/esmeta-ignore.json +++ b/esmeta-ignore.json @@ -1,45 +1,13 @@ [ - "AddEntriesFromIterable", - "ArrayAssignmentPattern[0,0].DestructuringAssignmentEvaluation", - "ArrayAssignmentPattern[0,1].DestructuringAssignmentEvaluation", - "ArrayAssignmentPattern[0,2].DestructuringAssignmentEvaluation", - "ArrayAssignmentPattern[0,3].DestructuringAssignmentEvaluation", - "ArrayAssignmentPattern[1,0].DestructuringAssignmentEvaluation", - "ArrayAssignmentPattern[2,0].DestructuringAssignmentEvaluation", - "ArrayAssignmentPattern[2,1].DestructuringAssignmentEvaluation", - "ArrayAssignmentPattern[2,2].DestructuringAssignmentEvaluation", - "ArrayAssignmentPattern[2,3].DestructuringAssignmentEvaluation", - "ArrayCreate", - "AsyncGeneratorBody[0,0].EvaluateAsyncGeneratorBody", - "BindingPattern[1,0].BindingInitialization", - "BoundFunctionCreate", - "Catch[0,0].CatchClauseEvaluation", - "Catch[1,0].CatchClauseEvaluation", + "AsyncFromSyncIteratorContinuation", + "AsyncGeneratorYield", "ClassStaticBlockBody[0,0].EvaluateClassStaticBlockBody", - "CreateBuiltinFunction", - "CreateMappedArgumentsObject", - "CreateSharedByteDataBlock", - "ForIn/OfBodyEvaluation", + "CompareTypedArrayElements", + "DoWait", + "EvaluateImportCall", "FunctionBody[0,0].EvaluateFunctionBody", - "GeneratorBody[0,0].EvaluateGeneratorBody", - "GetGlobalObject", - "GetMethod", - "GetPromiseResolve", - "GetThisValue", - "InnerModuleEvaluation", - "LabelledItem[1,0].LabelledEvaluation", - "LengthOfArrayLike", - "MethodDefinition[0,0].DefineMethod", - "ModuleNamespaceCreate", - "OrdinaryFunctionCreate", - "ProxyCreate", - "ScriptEvaluation", - "SerializeJSONObject", - "SourceTextModuleRecord.ExecuteModule", - "SourceTextModuleRecord.ResolveExport", - "SpeciesConstructor", - "Statement[0,0].LabelledEvaluation", - "Statement[1,0].LabelledEvaluation", - "Statement[2,0].LabelledEvaluation", - "StringCreate" + "FunctionDeclarationInstantiation", + "GetViewByteLength", + "Record[SourceTextModuleRecord].ExecuteModule", + "TypedArrayLength" ] \ No newline at end of file diff --git a/img/ecma-logo.svg b/img/ecma-logo.svg index 9fee7c8f3b..32020be0a5 100644 --- a/img/ecma-logo.svg +++ b/img/ecma-logo.svg @@ -1,120 +1 @@ - -image/svg+xml \ No newline at end of file + \ No newline at end of file diff --git a/img/figure-1.svg b/img/figure-1.svg index abb4252cb0..0605417e46 100644 --- a/img/figure-1.svg +++ b/img/figure-1.svg @@ -15,7 +15,7 @@ marker-end: url(#arrowhead); } path.d { stroke-dasharray: 2,2; } - text { font-family: Helvetica, Arial, Liberation Sans, sans-serif; } + text { font-family: Arial, Liberation Sans, sans-serif; } text.pn { font-family: "Courier New", monospace; } text.on { font-weight: bold; } text.ons { font-weight: bold; font-size: 60%; } diff --git a/img/figure-2.svg b/img/figure-2.svg index fe1ac95e65..0afff6683c 100644 --- a/img/figure-2.svg +++ b/img/figure-2.svg @@ -68,7 +68,7 @@ stroke-dasharray: 6, 6; } - text { font-family: Helvetica, Arial, Liberation Sans, sans-serif; } + text { font-family: Arial, Liberation Sans, sans-serif; } text { font-size: 14px; } @@ -83,14 +83,14 @@ - - - + + + - Function.prototype + Function.prototype - @@hasInstance() + %Symbol.hasInstance%() apply() bind() call() @@ -104,7 +104,7 @@ %GeneratorFunction.prototype% - @@toStringTag = + %Symbol.toStringTag% = "GeneratorFunction" @@ -127,26 +127,26 @@ - - - + + + - %IteratorPrototype% + %Iterator.prototype% - @@iterator() : object + %Symbol.iterator%() : object - - - - + + + + - %GeneratorPrototype% + %GeneratorPrototype% - @@toStringTag = "Generator" + %Symbol.toStringTag% = "Generator" next() : object @@ -189,7 +189,7 @@ - + %GeneratorFunction.prototype% @@ -242,12 +242,12 @@ - - - + + + - - + + @@ -272,8 +272,8 @@ constructor prototype - - constructor + + constructor prototype diff --git a/img/module-graph-cycle-async.svg b/img/module-graph-cycle-async.svg index d9da548aa3..76bd0290fd 100644 --- a/img/module-graph-cycle-async.svg +++ b/img/module-graph-cycle-async.svg @@ -1,69 +1 @@ - - - - - - - - - - -A - - -B - - -C - - -D - - -E - - - - - - - - - - +ABCDE diff --git a/img/module-graph-cycle.svg b/img/module-graph-cycle.svg index ecf7d58520..12628e8ed6 100644 --- a/img/module-graph-cycle.svg +++ b/img/module-graph-cycle.svg @@ -1,63 +1 @@ - - - - - - - - - - -A - - -B - - -C - - - - - - - - - +ABC diff --git a/img/module-graph-missing.svg b/img/module-graph-missing.svg index e37d9f7614..a23f0eeb25 100644 --- a/img/module-graph-missing.svg +++ b/img/module-graph-missing.svg @@ -1,48 +1 @@ - - - - - - - - - - -A - - -??? - - - - - +A??? diff --git a/img/module-graph-simple.svg b/img/module-graph-simple.svg index 055ad7a660..527bcd8307 100644 --- a/img/module-graph-simple.svg +++ b/img/module-graph-simple.svg @@ -1,56 +1 @@ - - - - - - - - - - -A - - -B - - -C - - - - - - +ABC diff --git a/package-lock.json b/package-lock.json index bd2ac49ed1..85fa04ab70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,15 +9,51 @@ "version": "1.0.0", "license": "SEE LICENSE IN https://tc39.es/ecma262/#sec-copyright-and-software-license", "devDependencies": { - "ecmarkup": "^18.3.1", - "glob": "^7.1.6", - "jsdom": "^15.0.0", - "pagedjs": "^0.4.3", - "pagedjs-cli": "^0.4.3", - "tar-stream": "^2.2.0", - "tiny-json-http": "^7.1.2" + "ecmarkup": "^24.0.0", + "jsdom": "^27.0.0" } }, + "node_modules/@asamuzakjp/css-color": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-2.8.3.tgz", + "integrity": "sha512-GIc76d9UI1hCvOATjZPyHFmE5qhRccp3/zGfMPapK3jBi+yocEzp6BBB0UnfRYP9NP4FANqUZYb0hnfs3TM3hw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@csstools/css-calc": "^2.1.1", + "@csstools/css-color-parser": "^3.0.7", + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3", + "lru-cache": "^10.4.3" + } + }, + "node_modules/@asamuzakjp/css-color/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/@asamuzakjp/dom-selector": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/@asamuzakjp/dom-selector/-/dom-selector-6.5.5.tgz", + "integrity": "sha512-kI2MX9pmImjxWT8nxDZY+MuN6r1jJGe7WxizEbsAEPB/zxfW5wYLIiPG1v3UKgEOOP8EsDkp0ZL99oRFAdPM8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@asamuzakjp/nwsapi": "^2.3.9", + "bidi-js": "^1.0.3", + "css-tree": "^3.1.0", + "is-potential-custom-element-name": "^1.0.1" + } + }, + "node_modules/@asamuzakjp/nwsapi": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@asamuzakjp/nwsapi/-/nwsapi-2.3.9.tgz", + "integrity": "sha512-n8GuYSrI9bF7FFZ/SjhwevlHc8xaVlb/7HmHelnc/PZXBD2ZR49NnN9sMMuDdEGPeeRQ5d0hqlSlEpgCX3Wl0Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@babel/code-frame": { "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", @@ -85,30 +121,143 @@ "dev": true, "license": "MIT" }, - "node_modules/@babel/polyfill": { - "version": "7.12.1", + "node_modules/@csstools/color-helpers": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.1.0.tgz", + "integrity": "sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "engines": { + "node": ">=18" + } + }, + "node_modules/@csstools/css-calc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.4.tgz", + "integrity": "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], "license": "MIT", - "dependencies": { - "core-js": "^2.6.5", - "regenerator-runtime": "^0.13.4" + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" } }, - "node_modules/@babel/runtime": { - "version": "7.24.0", + "node_modules/@csstools/css-color-parser": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.1.0.tgz", + "integrity": "sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], "license": "MIT", "dependencies": { - "regenerator-runtime": "^0.14.0" + "@csstools/color-helpers": "^5.1.0", + "@csstools/css-calc": "^2.1.4" }, "engines": { - "node": ">=6.9.0" + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" } }, - "node_modules/@babel/runtime/node_modules/regenerator-runtime": { - "version": "0.14.1", + "node_modules/@csstools/css-parser-algorithms": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz", + "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==", "dev": true, - "license": "MIT" + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-syntax-patches-for-csstree": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.0.14.tgz", + "integrity": "sha512-zSlIxa20WvMojjpCSy8WrNpcZ61RqfTfX3XTaOeVlGJrt/8HF3YbzgFZa01yTbT4GWQLwfTcC3EB8i3XnB647Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "postcss": "^8.4" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz", + "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + } }, "node_modules/@esfx/async-canceltoken": { "version": "1.0.0", @@ -195,948 +344,868 @@ "node": ">= 8" } }, - "node_modules/@pdf-lib/standard-fonts": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "pako": "^1.0.6" - } - }, - "node_modules/@pdf-lib/upng": { - "version": "1.0.1", + "node_modules/agent-base": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", "dev": true, "license": "MIT", - "dependencies": { - "pako": "^1.0.10" - } - }, - "node_modules/@puppeteer/browsers": { - "version": "1.4.6", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "debug": "4.3.4", - "extract-zip": "2.0.1", - "progress": "2.0.3", - "proxy-agent": "6.3.0", - "tar-fs": "3.0.4", - "unbzip2-stream": "1.4.3", - "yargs": "17.7.1" - }, - "bin": { - "browsers": "lib/cjs/main-cli.js" - }, "engines": { - "node": ">=16.3.0" - }, - "peerDependencies": { - "typescript": ">= 4.7.4" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "node": ">= 14" } }, - "node_modules/@puppeteer/browsers/node_modules/debug": { - "version": "4.3.4", + "node_modules/ansi-styles": { + "version": "4.3.0", "dev": true, "license": "MIT", "dependencies": { - "ms": "2.1.2" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=6.0" + "node": ">=8" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@puppeteer/browsers/node_modules/ms": { - "version": "2.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "node_modules/array-back": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", "dev": true, "engines": { - "node": ">= 10" + "node": ">=6" } }, - "node_modules/@tootallnate/quickjs-emscripten": { - "version": "0.23.0", + "node_modules/asynckit": { + "version": "0.4.0", "dev": true, "license": "MIT" }, - "node_modules/@types/node": { - "version": "20.11.25", + "node_modules/bidi-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.0.3.tgz", + "integrity": "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { - "undici-types": "~5.26.4" + "require-from-string": "^2.0.2" } }, - "node_modules/@types/yauzl": { - "version": "2.10.3", + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { - "@types/node": "*" + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" } }, - "node_modules/abab": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", - "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", - "deprecated": "Use your platform's native atob() and btoa() methods instead", - "dev": true - }, - "node_modules/accepts": { - "version": "1.3.8", + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "dev": true, "license": "MIT", "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" }, "engines": { - "node": ">= 0.6" + "node": ">= 0.4" } }, - "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "node_modules/color-convert": { + "version": "2.0.1", "dev": true, - "bin": { - "acorn": "bin/acorn" + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" }, "engines": { - "node": ">=0.4.0" + "node": ">=7.0.0" } }, - "node_modules/acorn-globals": { - "version": "4.3.4", + "node_modules/color-name": { + "version": "1.1.4", "dev": true, - "license": "MIT", - "dependencies": { - "acorn": "^6.0.1", - "acorn-walk": "^6.0.1" - } + "license": "MIT" }, - "node_modules/acorn-globals/node_modules/acorn": { - "version": "6.4.1", + "node_modules/combined-stream": { + "version": "1.0.8", "dev": true, "license": "MIT", - "bin": { - "acorn": "bin/acorn" + "dependencies": { + "delayed-stream": "~1.0.0" }, "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-walk": { - "version": "6.2.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.4.0" + "node": ">= 0.8" } }, - "node_modules/agent-base": { - "version": "7.1.0", + "node_modules/command-line-args": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", + "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", "dev": true, - "license": "MIT", "dependencies": { - "debug": "^4.3.4" + "array-back": "^3.1.0", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" }, "engines": { - "node": ">= 14" + "node": ">=4.0.0" } }, - "node_modules/agent-base/node_modules/debug": { - "version": "4.3.4", + "node_modules/command-line-usage": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", + "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", "dev": true, - "license": "MIT", "dependencies": { - "ms": "2.1.2" + "array-back": "^4.0.2", + "chalk": "^2.4.2", + "table-layout": "^1.0.2", + "typical": "^5.2.0" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=8.0.0" } }, - "node_modules/agent-base/node_modules/ms": { - "version": "2.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ajv": { - "version": "6.12.6", + "node_modules/command-line-usage/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, - "license": "MIT", "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "color-convert": "^1.9.0" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "engines": { + "node": ">=4" } }, - "node_modules/ansi-regex": { - "version": "6.0.1", + "node_modules/command-line-usage/node_modules/array-back": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", + "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", "dev": true, - "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "node": ">=8" } }, - "node_modules/ansi-styles": { - "version": "4.3.0", + "node_modules/command-line-usage/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, - "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": ">=4" } }, - "node_modules/argparse": { - "version": "2.0.1", + "node_modules/command-line-usage/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, - "license": "Python-2.0" - }, - "node_modules/array-back": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "dev": true, - "engines": { - "node": ">=6" + "dependencies": { + "color-name": "1.1.3" } }, - "node_modules/array-equal": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "dev": true, - "license": "MIT" + "node_modules/command-line-usage/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true }, - "node_modules/asn1": { - "version": "0.2.4", + "node_modules/command-line-usage/node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", "dev": true, - "license": "MIT", - "dependencies": { - "safer-buffer": "~2.1.0" + "engines": { + "node": ">=8" } }, - "node_modules/assert-plus": { - "version": "1.0.0", + "node_modules/css-tree": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-3.1.0.tgz", + "integrity": "sha512-0eW44TGN5SQXU1mWSkKwFstI/22X2bG1nYzZTYMAWjylYURhse752YgbE4Cx46AC+bAvI+/dYTPRk1LqSUnu6w==", "dev": true, "license": "MIT", + "dependencies": { + "mdn-data": "2.12.2", + "source-map-js": "^1.0.1" + }, "engines": { - "node": ">=0.8" + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" } }, - "node_modules/ast-types": { - "version": "0.13.4", + "node_modules/cssstyle": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-5.3.0.tgz", + "integrity": "sha512-RveJPnk3m7aarYQ2bJ6iw+Urh55S6FzUiqtBq+TihnTDP4cI8y/TYDqGOyqgnG1J1a6BxJXZsV9JFSTulm9Z7g==", "dev": true, "license": "MIT", "dependencies": { - "tslib": "^2.0.1" + "@asamuzakjp/css-color": "^4.0.3", + "@csstools/css-syntax-patches-for-csstree": "^1.0.14", + "css-tree": "^3.1.0" }, "engines": { - "node": ">=4" + "node": ">=20" } }, - "node_modules/ast-types/node_modules/tslib": { - "version": "2.6.2", - "dev": true, - "license": "0BSD" - }, - "node_modules/asynckit": { - "version": "0.4.0", + "node_modules/cssstyle/node_modules/@asamuzakjp/css-color": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-4.0.4.tgz", + "integrity": "sha512-cKjSKvWGmAziQWbCouOsFwb14mp1betm8Y7Fn+yglDMUUu3r9DCbJ9iJbeFDenLMqFbIMC0pQP8K+B8LAxX3OQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "@csstools/css-calc": "^2.1.4", + "@csstools/css-color-parser": "^3.0.10", + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4", + "lru-cache": "^11.1.0" + } }, - "node_modules/aws-sign2": { - "version": "0.7.0", + "node_modules/data-urls": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-6.0.0.tgz", + "integrity": "sha512-BnBS08aLUM+DKamupXs3w2tJJoqU+AkaE/+6vQxi/G/DPmIZFJJp9Dkb1kM03AZx8ADehDUZgsNxju3mPXZYIA==", "dev": true, - "license": "Apache-2.0", + "license": "MIT", + "dependencies": { + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^15.0.0" + }, "engines": { - "node": "*" + "node": ">=20" } }, - "node_modules/aws4": { - "version": "1.9.1", - "dev": true, - "license": "MIT" - }, - "node_modules/b4a": { - "version": "1.6.6", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/balanced-match": { - "version": "1.0.0", + "node_modules/decimal.js": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.5.0.tgz", + "integrity": "sha512-8vDa8Qxvr/+d94hSh5P3IJwI5t8/c0KsMp+g8bNw9cY2icONa5aPfvKeieW1WlG0WQYwwhJ7mjui2xtiePQSXw==", "dev": true, "license": "MIT" }, - "node_modules/bare-events": { - "version": "2.2.1", - "dev": true, - "license": "Apache-2.0", - "optional": true + "node_modules/dedent-js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dedent-js/-/dedent-js-1.0.1.tgz", + "integrity": "sha512-OUepMozQULMLUmhxS95Vudo0jb0UchLimi3+pQ2plj61Fcy8axbP9hbiD4Sz6DPqn6XG3kfmziVfQ1rSys5AJQ==", + "dev": true }, - "node_modules/base64-js": { - "version": "1.5.1", + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" + "engines": { + "node": ">=4.0.0" + } }, - "node_modules/basic-ftp": { - "version": "5.0.5", + "node_modules/delayed-stream": { + "version": "1.0.0", "dev": true, "license": "MIT", "engines": { - "node": ">=10.0.0" + "node": ">=0.4.0" } }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", "dev": true, - "license": "BSD-3-Clause", + "license": "MIT", "dependencies": { - "tweetnacl": "^0.14.3" + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" } }, - "node_modules/bl": { - "version": "4.1.0", + "node_modules/ecmarkdown": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/ecmarkdown/-/ecmarkdown-8.1.0.tgz", + "integrity": "sha512-dx6cM6RFjzAXkWr2KQRikED4gy70NFQ0vTI4XUQM/LWcjUYRJUbGdd7nd++trXi5az1JSe49TeeCIVMKDXOtcQ==", "dev": true, - "license": "MIT", "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" + "escape-html": "^1.0.1" } }, - "node_modules/body-parser": { - "version": "1.20.2", + "node_modules/ecmarkup": { + "version": "24.0.0", + "resolved": "https://registry.npmjs.org/ecmarkup/-/ecmarkup-24.0.0.tgz", + "integrity": "sha512-JsP1UEgWTpUU7r6aHlcDYDQN0KINY8dCdiq7ZdRBOH9GvL3R0uBZuZaLvBO4aTc2qQMHhk1EKVi6MmtyU0MZzQ==", "dev": true, "license": "MIT", "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" + "chalk": "^4.1.2", + "command-line-args": "^5.2.0", + "command-line-usage": "^6.1.1", + "dedent-js": "^1.0.1", + "ecmarkdown": "^8.1.0", + "eslint-formatter-codeframe": "^7.32.1", + "fast-glob": "^3.2.7", + "grammarkdown": "^3.3.2", + "highlight.js": "11.0.1", + "html-escape": "^1.0.2", + "js-yaml": "^3.13.1", + "jsdom": "^25.0.1", + "nwsapi": "2.2.0", + "parse5": "^6.0.1", + "prex": "^0.4.7", + "promise-debounce": "^1.0.1" + }, + "bin": { + "ecmarkup": "bin/ecmarkup.js", + "emu-format": "bin/emu-format.js" }, "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" + "node": ">= 24" + } + }, + "node_modules/ecmarkup/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" } }, - "node_modules/body-parser/node_modules/qs": { - "version": "6.11.0", + "node_modules/ecmarkup/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.0.4" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=0.6" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/brace-expansion": { - "version": "1.1.11", + "node_modules/ecmarkup/node_modules/cssstyle": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.2.1.tgz", + "integrity": "sha512-9+vem03dMXG7gDmZ62uqmRiMRNtinIZ9ZyuF6BdxzfOD+FdN5hretzynkn0ReS2DO2GSw76RWHs0UmJPI2zUjw==", "dev": true, "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" + "@asamuzakjp/css-color": "^2.8.2", + "rrweb-cssom": "^0.8.0" }, "engines": { - "node": ">=8" + "node": ">=18" } }, - "node_modules/browser-process-hrtime": { - "version": "1.0.0", + "node_modules/ecmarkup/node_modules/cssstyle/node_modules/rrweb-cssom": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==", "dev": true, - "license": "BSD-2-Clause" + "license": "MIT" }, - "node_modules/buffer": { - "version": "5.7.1", + "node_modules/ecmarkup/node_modules/data-urls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], "license": "MIT", "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" + }, + "engines": { + "node": ">=18" } }, - "node_modules/buffer-crc32": { - "version": "0.2.13", + "node_modules/ecmarkup/node_modules/form-data": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", + "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", "dev": true, "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, "engines": { - "node": "*" + "node": ">= 6" } }, - "node_modules/bytes": { - "version": "3.1.2", + "node_modules/ecmarkup/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "license": "MIT", "engines": { - "node": ">= 0.8" + "node": ">=8" } }, - "node_modules/call-bind": { - "version": "1.0.7", + "node_modules/ecmarkup/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, - "license": "MIT", "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" + "argparse": "^1.0.7", + "esprima": "^4.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/callsites": { - "version": "3.1.0", + "node_modules/ecmarkup/node_modules/jsdom": { + "version": "25.0.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-25.0.1.tgz", + "integrity": "sha512-8i7LzZj7BF8uplX+ZyOlIz86V6TAsSs+np6m1kpW9u0JWi4z/1t+FzcK1aek+ybTnAC4KhBL4uXCNT0wcUIeCw==", "dev": true, "license": "MIT", + "dependencies": { + "cssstyle": "^4.1.0", + "data-urls": "^5.0.0", + "decimal.js": "^10.4.3", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.5", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.12", + "parse5": "^7.1.2", + "rrweb-cssom": "^0.7.1", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^5.0.0", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0", + "ws": "^8.18.0", + "xml-name-validator": "^5.0.0" + }, "engines": { - "node": ">=6" + "node": ">=18" + }, + "peerDependencies": { + "canvas": "^2.11.2" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } } }, - "node_modules/caseless": { - "version": "0.12.0", + "node_modules/ecmarkup/node_modules/jsdom/node_modules/nwsapi": { + "version": "2.2.18", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.18.tgz", + "integrity": "sha512-p1TRH/edngVEHVbwqWnxUViEmq5znDvyB+Sik5cmuLpGOIfDf/39zLiq3swPF8Vakqn+gvNiOQAZu8djYlQILA==", "dev": true, - "license": "Apache-2.0" + "license": "MIT" }, - "node_modules/chalk": { - "version": "5.3.0", + "node_modules/ecmarkup/node_modules/jsdom/node_modules/parse5": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz", + "integrity": "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==", "dev": true, "license": "MIT", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" + "dependencies": { + "entities": "^4.5.0" }, "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/chromium-bidi": { - "version": "0.4.16", + "node_modules/ecmarkup/node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true + }, + "node_modules/ecmarkup/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "license": "Apache-2.0", "dependencies": { - "mitt": "3.0.0" + "has-flag": "^4.0.0" }, - "peerDependencies": { - "devtools-protocol": "*" + "engines": { + "node": ">=8" } }, - "node_modules/clear-cut": { - "version": "2.0.2", - "dev": true, - "license": "MIT" - }, - "node_modules/cli-cursor": { - "version": "4.0.0", + "node_modules/ecmarkup/node_modules/tough-cookie": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", + "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", "dev": true, - "license": "MIT", + "license": "BSD-3-Clause", "dependencies": { - "restore-cursor": "^4.0.0" + "tldts": "^6.1.32" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=16" } }, - "node_modules/cli-spinners": { - "version": "2.9.2", + "node_modules/ecmarkup/node_modules/tr46": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", + "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", "dev": true, "license": "MIT", - "engines": { - "node": ">=6" + "dependencies": { + "punycode": "^2.3.1" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=18" } }, - "node_modules/cliui": { - "version": "8.0.1", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, + "node_modules/ecmarkup/node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=12" } }, - "node_modules/cliui/node_modules/ansi-regex": { - "version": "5.0.1", + "node_modules/ecmarkup/node_modules/whatwg-url": { + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.1.1.tgz", + "integrity": "sha512-mDGf9diDad/giZ/Sm9Xi2YcyzaFpbdLpJPr+E9fSkyQ7KpQD4SdFcugkRQYzhmfI4KeV4Qpnn2sKPdo+kmsgRQ==", "dev": true, "license": "MIT", + "dependencies": { + "tr46": "^5.0.0", + "webidl-conversions": "^7.0.0" + }, "engines": { - "node": ">=8" + "node": ">=18" } }, - "node_modules/cliui/node_modules/strip-ansi": { - "version": "6.0.1", + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=8" + "node": ">= 0.4" } }, - "node_modules/clone": { - "version": "1.0.4", + "node_modules/es-errors": { + "version": "1.3.0", "dev": true, "license": "MIT", "engines": { - "node": ">=0.8" + "node": ">= 0.4" } }, - "node_modules/color-convert": { - "version": "2.0.1", + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", "dev": true, "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "es-errors": "^1.3.0" }, "engines": { - "node": ">=7.0.0" + "node": ">= 0.4" } }, - "node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/combined-stream": { - "version": "1.0.8", + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", "dev": true, "license": "MIT", "dependencies": { - "delayed-stream": "~1.0.0" + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { - "node": ">= 0.8" + "node": ">= 0.4" } }, - "node_modules/command-line-args": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", - "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", + "node_modules/escape-html": { + "version": "1.0.3", "dev": true, - "dependencies": { - "array-back": "^3.1.0", - "find-replace": "^3.0.0", - "lodash.camelcase": "^4.3.0", - "typical": "^4.0.0" - }, + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "dev": true, + "license": "MIT", "engines": { - "node": ">=4.0.0" + "node": ">=0.8.0" } }, - "node_modules/command-line-usage": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", - "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", + "node_modules/eslint-formatter-codeframe": { + "version": "7.32.1", + "resolved": "https://registry.npmjs.org/eslint-formatter-codeframe/-/eslint-formatter-codeframe-7.32.1.tgz", + "integrity": "sha512-DK/3Q3+zVKq/7PdSYiCxPrsDF8H/TRMK5n8Hziwr4IMkMy+XiKSwbpj25AdajS63I/B61Snetq4uVvX9fOLyAg==", "dev": true, "dependencies": { - "array-back": "^4.0.2", - "chalk": "^2.4.2", - "table-layout": "^1.0.2", - "typical": "^5.2.0" + "@babel/code-frame": "7.12.11", + "chalk": "^4.0.0" }, "engines": { - "node": ">=8.0.0" + "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/command-line-usage/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/eslint-formatter-codeframe/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "color-convert": "^1.9.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/command-line-usage/node_modules/array-back": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", - "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", + "node_modules/eslint-formatter-codeframe/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { "node": ">=8" } }, - "node_modules/command-line-usage/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "node_modules/eslint-formatter-codeframe/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=4" - } - }, - "node_modules/command-line-usage/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" + "node": ">=8" } }, - "node_modules/command-line-usage/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/command-line-usage/node_modules/typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "node_modules/esprima": { + "version": "4.0.1", "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/commander": { - "version": "11.1.0", + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, - "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, "engines": { - "node": ">=16" + "node": ">=8.6.0" } }, - "node_modules/concat-map": { - "version": "0.0.1", + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, - "license": "MIT" + "dependencies": { + "reusify": "^1.0.4" + } }, - "node_modules/content-disposition": { - "version": "0.5.4", + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "license": "MIT", "dependencies": { - "safe-buffer": "5.2.1" + "to-regex-range": "^5.0.1" }, "engines": { - "node": ">= 0.6" + "node": ">=8" } }, - "node_modules/content-type": { - "version": "1.0.5", + "node_modules/find-replace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", + "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", "dev": true, - "license": "MIT", + "dependencies": { + "array-back": "^3.0.1" + }, "engines": { - "node": ">= 0.6" + "node": ">=4.0.0" } }, - "node_modules/cookie": { - "version": "0.5.0", + "node_modules/function-bind": { + "version": "1.1.2", "dev": true, "license": "MIT", - "engines": { - "node": ">= 0.6" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "dev": true, - "license": "MIT" - }, - "node_modules/core-js": { - "version": "2.6.12", - "dev": true, - "hasInstallScript": true, - "license": "MIT" - }, - "node_modules/core-util-is": { - "version": "1.0.2", - "dev": true, - "license": "MIT" - }, - "node_modules/cosmiconfig": { - "version": "8.2.0", + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "dev": true, "license": "MIT", "dependencies": { - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0" + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" }, "engines": { - "node": ">=14" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/d-fischer" - } - }, - "node_modules/cross-fetch": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "node-fetch": "^2.6.12" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/cross-fetch/node_modules/node-fetch": { - "version": "2.7.0", + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", "dev": true, "license": "MIT", "dependencies": { - "whatwg-url": "^5.0.0" + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" }, "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } + "node": ">= 0.4" } }, - "node_modules/css-tree": { - "version": "1.1.3", + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, - "license": "MIT", "dependencies": { - "mdn-data": "2.0.14", - "source-map": "^0.6.1" + "is-glob": "^4.0.1" }, "engines": { - "node": ">=8.0.0" + "node": ">= 6" } }, - "node_modules/cssom": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", - "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==", - "dev": true - }, - "node_modules/cssstyle": { - "version": "2.3.0", + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "dev": true, "license": "MIT", - "dependencies": { - "cssom": "~0.3.6" - }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/cssstyle/node_modules/cssom": { - "version": "0.3.8", + "node_modules/grammarkdown": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/grammarkdown/-/grammarkdown-3.3.2.tgz", + "integrity": "sha512-inNbeEotDr7MENqoZlms3x4gBzvK73wR2NGpNVnw4oEZcsq2METUbAh0J3VWtEqd9t2+U3poEqiJ9CDgBXr5Tg==", "dev": true, - "license": "MIT" - }, - "node_modules/d": { - "version": "1.0.2", - "dev": true, - "license": "ISC", - "dependencies": { - "es5-ext": "^0.10.64", - "type": "^2.7.2" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/dashdash": { - "version": "1.14.1", - "dev": true, - "license": "MIT", "dependencies": { - "assert-plus": "^1.0.0" + "@esfx/async-canceltoken": "^1.0.0-pre.13", + "@esfx/cancelable": "^1.0.0-pre.13", + "@esfx/disposable": "^1.0.0-pre.13" }, - "engines": { - "node": ">=0.10" + "bin": { + "grammarkdown": "bin/grammarkdown" } }, - "node_modules/data-uri-to-buffer": { - "version": "4.0.1", + "node_modules/has-flag": { + "version": "3.0.0", "dev": true, "license": "MIT", "engines": { - "node": ">= 12" + "node": ">=4" } }, - "node_modules/data-urls": { + "node_modules/has-symbols": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, "license": "MIT", - "dependencies": { - "abab": "^2.0.0", - "whatwg-mimetype": "^2.2.0", - "whatwg-url": "^7.0.0" - } - }, - "node_modules/data-urls/node_modules/whatwg-url": { - "version": "7.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - }, - "node_modules/debug": { - "version": "2.6.9", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/decimal.js": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", - "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", - "dev": true - }, - "node_modules/dedent-js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dedent-js/-/dedent-js-1.0.1.tgz", - "integrity": "sha512-OUepMozQULMLUmhxS95Vudo0jb0UchLimi3+pQ2plj61Fcy8axbP9hbiD4Sz6DPqn6XG3kfmziVfQ1rSys5AJQ==", - "dev": true - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/deep-is": { - "version": "0.1.3", - "dev": true, - "license": "MIT" - }, - "node_modules/defaults": { - "version": "1.0.4", - "dev": true, - "license": "MIT", - "dependencies": { - "clone": "^1.0.2" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/define-data-property": { - "version": "1.1.4", + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, "license": "MIT", "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" + "has-symbols": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -1145,234 +1214,63 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/degenerator": { - "version": "5.0.1", + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, "license": "MIT", "dependencies": { - "ast-types": "^0.13.4", - "escodegen": "^2.1.0", - "esprima": "^4.0.1" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/degenerator/node_modules/escodegen": { - "version": "2.1.0", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", - "esutils": "^2.0.2" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=6.0" + "function-bind": "^1.1.2" }, - "optionalDependencies": { - "source-map": "~0.6.1" - } - }, - "node_modules/degenerator/node_modules/estraverse": { - "version": "5.3.0", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "dev": true, - "license": "MIT", "engines": { - "node": ">= 0.8" + "node": ">= 0.4" } }, - "node_modules/destroy": { - "version": "1.2.0", + "node_modules/highlight.js": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.0.1.tgz", + "integrity": "sha512-EqYpWyTF2s8nMfttfBA2yLKPNoZCO33pLS4MnbXQ4hECf1TKujCt1Kq7QAdrio7roL4+CqsfjqwYj4tYgq0pJQ==", "dev": true, - "license": "MIT", "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/devtools-protocol": { - "version": "0.0.1147663", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/domexception": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "webidl-conversions": "^4.0.2" + "node": ">=12.0.0" } }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", + "node_modules/html-encoding-sniffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", "dev": true, "license": "MIT", "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/ecmarkdown": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/ecmarkdown/-/ecmarkdown-8.1.0.tgz", - "integrity": "sha512-dx6cM6RFjzAXkWr2KQRikED4gy70NFQ0vTI4XUQM/LWcjUYRJUbGdd7nd++trXi5az1JSe49TeeCIVMKDXOtcQ==", - "dev": true, - "dependencies": { - "escape-html": "^1.0.1" - } - }, - "node_modules/ecmarkup": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/ecmarkup/-/ecmarkup-18.3.1.tgz", - "integrity": "sha512-ouyfwgVjtvyF9AdAQnI9krCWNE5srK90XGPym8vs6WPtjUso6Pq887DwAYBDbga9lrfwezWo5n8hGu9amYYu1g==", - "dev": true, - "dependencies": { - "chalk": "^4.1.2", - "command-line-args": "^5.2.0", - "command-line-usage": "^6.1.1", - "dedent-js": "^1.0.1", - "ecmarkdown": "^8.1.0", - "eslint-formatter-codeframe": "^7.32.1", - "fast-glob": "^3.2.7", - "grammarkdown": "^3.3.2", - "highlight.js": "11.0.1", - "html-escape": "^1.0.2", - "js-yaml": "^3.13.1", - "jsdom": "^19.0.0", - "nwsapi": "2.2.0", - "parse5": "^6.0.1", - "prex": "^0.4.7", - "promise-debounce": "^1.0.1" - }, - "bin": { - "ecmarkup": "bin/ecmarkup.js", - "emu-format": "bin/emu-format.js" - }, - "engines": { - "node": ">= 12 || ^11.10.1 || ^10.13 || ^8.10" - } - }, - "node_modules/ecmarkup/node_modules/acorn-globals": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", - "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", - "dev": true, - "dependencies": { - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1" - } - }, - "node_modules/ecmarkup/node_modules/acorn-globals/node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ecmarkup/node_modules/acorn-walk": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", - "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ecmarkup/node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/ecmarkup/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/ecmarkup/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "whatwg-encoding": "^3.1.1" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=18" } }, - "node_modules/ecmarkup/node_modules/data-urls": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", - "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", - "dev": true, - "dependencies": { - "abab": "^2.0.6", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^11.0.0" - }, - "engines": { - "node": ">=12" - } + "node_modules/html-escape": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/html-escape/-/html-escape-1.0.2.tgz", + "integrity": "sha512-r4cqVc7QAX1/jpPsW9OJNsTTtFhcf+ZBqoA3rWOddMg/y+n6ElKfz+IGKbvV2RTeECDzyrQXa2rpo3IFFrANWg==", + "dev": true }, - "node_modules/ecmarkup/node_modules/data-urls/node_modules/whatwg-url": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", - "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "node_modules/http-proxy-agent": { + "version": "7.0.2", "dev": true, + "license": "MIT", "dependencies": { - "tr46": "^3.0.0", - "webidl-conversions": "^7.0.0" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { - "node": ">=12" + "node": ">= 14" } }, - "node_modules/ecmarkup/node_modules/debug": { + "node_modules/http-proxy-agent/node_modules/debug": { "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -1385,2750 +1283,363 @@ } } }, - "node_modules/ecmarkup/node_modules/domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "deprecated": "Use your platform's native DOMException instead", + "node_modules/http-proxy-agent/node_modules/ms": { + "version": "2.1.2", "dev": true, - "dependencies": { - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" - } + "license": "MIT" }, - "node_modules/ecmarkup/node_modules/escodegen": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", - "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dev": true, + "license": "MIT", "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", - "esutils": "^2.0.2" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=6.0" + "agent-base": "^7.1.2", + "debug": "4" }, - "optionalDependencies": { - "source-map": "~0.6.1" - } - }, - "node_modules/ecmarkup/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, "engines": { - "node": ">=4.0" + "node": ">= 14" } }, - "node_modules/ecmarkup/node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.3.4", "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/ecmarkup/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ecmarkup/node_modules/html-encoding-sniffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", - "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", - "dev": true, - "dependencies": { - "whatwg-encoding": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/ecmarkup/node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "dev": true, - "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/ecmarkup/node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dev": true, - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/ecmarkup/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ecmarkup/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/ecmarkup/node_modules/jsdom": { - "version": "19.0.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-19.0.0.tgz", - "integrity": "sha512-RYAyjCbxy/vri/CfnjUWJQQtZ3LKlLnDqj+9XLNnJPgEGeirZs3hllKR20re8LUZ6o1b1X4Jat+Qd26zmP41+A==", - "dev": true, - "dependencies": { - "abab": "^2.0.5", - "acorn": "^8.5.0", - "acorn-globals": "^6.0.0", - "cssom": "^0.5.0", - "cssstyle": "^2.3.0", - "data-urls": "^3.0.1", - "decimal.js": "^10.3.1", - "domexception": "^4.0.0", - "escodegen": "^2.0.0", - "form-data": "^4.0.0", - "html-encoding-sniffer": "^3.0.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", - "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.0", - "parse5": "6.0.1", - "saxes": "^5.0.1", - "symbol-tree": "^3.2.4", - "tough-cookie": "^4.0.0", - "w3c-hr-time": "^1.0.2", - "w3c-xmlserializer": "^3.0.0", - "webidl-conversions": "^7.0.0", - "whatwg-encoding": "^2.0.0", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^10.0.0", - "ws": "^8.2.3", - "xml-name-validator": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "canvas": "^2.5.0" - }, - "peerDependenciesMeta": { - "canvas": { - "optional": true - } - } - }, - "node_modules/ecmarkup/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/ecmarkup/node_modules/saxes": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", - "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", - "dev": true, - "dependencies": { - "xmlchars": "^2.2.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/ecmarkup/node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true - }, - "node_modules/ecmarkup/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ecmarkup/node_modules/tough-cookie": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", - "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", - "dev": true, - "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.2.0", - "url-parse": "^1.5.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ecmarkup/node_modules/tr46": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", - "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", - "dev": true, - "dependencies": { - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/ecmarkup/node_modules/universalify": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", - "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/ecmarkup/node_modules/w3c-xmlserializer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-3.0.0.tgz", - "integrity": "sha512-3WFqGEgSXIyGhOmAFtlicJNMjEps8b1MG31NCA0/vOF9+nKMUW1ckhi9cnNHmf88Rzw5V+dwIwsm2C7X8k9aQg==", - "dev": true, - "dependencies": { - "xml-name-validator": "^4.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/ecmarkup/node_modules/webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/ecmarkup/node_modules/whatwg-encoding": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", - "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", - "dev": true, - "dependencies": { - "iconv-lite": "0.6.3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/ecmarkup/node_modules/whatwg-mimetype": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", - "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/ecmarkup/node_modules/whatwg-url": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-10.0.0.tgz", - "integrity": "sha512-CLxxCmdUby142H5FZzn4D8ikO1cmypvXVQktsgosNy4a4BHrDHeciBBGZhb0bNoR5/MltoCatso+vFjjGx8t0w==", - "dev": true, - "dependencies": { - "tr46": "^3.0.0", - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/ecmarkup/node_modules/xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "dev": true, - "license": "MIT" - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/encodeurl": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "dev": true, - "license": "MIT", - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/error-ex": { - "version": "1.3.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, - "node_modules/es-define-property": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.2.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es5-ext": { - "version": "0.10.64", - "dev": true, - "hasInstallScript": true, - "license": "ISC", - "dependencies": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "esniff": "^2.0.1", - "next-tick": "^1.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/es6-iterator": { - "version": "2.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "node_modules/es6-symbol": { - "version": "3.1.4", - "dev": true, - "license": "ISC", - "dependencies": { - "d": "^1.0.2", - "ext": "^1.7.0" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/escalade": { - "version": "3.1.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "dev": true, - "license": "MIT" - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/escodegen": { - "version": "1.14.1", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=4.0" - }, - "optionalDependencies": { - "source-map": "~0.6.1" - } - }, - "node_modules/eslint-formatter-codeframe": { - "version": "7.32.1", - "resolved": "https://registry.npmjs.org/eslint-formatter-codeframe/-/eslint-formatter-codeframe-7.32.1.tgz", - "integrity": "sha512-DK/3Q3+zVKq/7PdSYiCxPrsDF8H/TRMK5n8Hziwr4IMkMy+XiKSwbpj25AdajS63I/B61Snetq4uVvX9fOLyAg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "7.12.11", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/eslint-formatter-codeframe/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/eslint-formatter-codeframe/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint-formatter-codeframe/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/esniff": { - "version": "2.0.1", - "dev": true, - "license": "ISC", - "dependencies": { - "d": "^1.0.1", - "es5-ext": "^0.10.62", - "event-emitter": "^0.3.5", - "type": "^2.7.2" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "dev": true, - "license": "BSD-2-Clause", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/etag": { - "version": "1.8.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/event-emitter": { - "version": "0.3.5", - "dev": true, - "license": "MIT", - "dependencies": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "node_modules/express": { - "version": "4.18.3", - "dev": true, - "license": "MIT", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.2", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.5.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.11.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/express/node_modules/qs": { - "version": "6.11.0", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ext": { - "version": "1.7.0", - "dev": true, - "license": "ISC", - "dependencies": { - "type": "^2.7.2" - } - }, - "node_modules/extend": { - "version": "3.0.2", - "dev": true, - "license": "MIT" - }, - "node_modules/extract-zip": { - "version": "2.0.1", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" - }, - "bin": { - "extract-zip": "cli.js" - }, - "engines": { - "node": ">= 10.17.0" - }, - "optionalDependencies": { - "@types/yauzl": "^2.9.1" - } - }, - "node_modules/extract-zip/node_modules/debug": { - "version": "4.3.4", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/extract-zip/node_modules/ms": { - "version": "2.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "license": "MIT" - }, - "node_modules/fast-deep-equal": { - "version": "3.1.1", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-fifo": { - "version": "1.3.2", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "dev": true, - "license": "MIT" - }, - "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/fd-slicer": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "pend": "~1.2.0" - } - }, - "node_modules/fetch-blob": { - "version": "3.2.0", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "paypal", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "dependencies": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - }, - "engines": { - "node": "^12.20 || >= 14.13" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/finalhandler": { - "version": "1.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/find-replace": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", - "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", - "dev": true, - "dependencies": { - "array-back": "^3.0.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/forever-agent": { - "version": "0.6.1", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "*" - } - }, - "node_modules/form-data": { - "version": "2.3.3", - "dev": true, - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/formdata-polyfill": { - "version": "4.0.10", - "dev": true, - "license": "MIT", - "dependencies": { - "fetch-blob": "^3.1.2" - }, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fs-constants": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/fs-extra": { - "version": "11.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "dev": true, - "license": "ISC" - }, - "node_modules/function-bind": { - "version": "1.1.2", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "dev": true, - "license": "ISC", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.4", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-stream": { - "version": "5.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/get-uri": { - "version": "6.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "basic-ftp": "^5.0.2", - "data-uri-to-buffer": "^6.0.2", - "debug": "^4.3.4", - "fs-extra": "^11.2.0" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/get-uri/node_modules/data-uri-to-buffer": { - "version": "6.0.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, - "node_modules/get-uri/node_modules/debug": { - "version": "4.3.4", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/get-uri/node_modules/ms": { - "version": "2.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/getpass": { - "version": "0.1.7", - "dev": true, - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0" - } - }, - "node_modules/glob": { - "version": "7.1.6", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/gopd": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "dev": true, - "license": "ISC" - }, - "node_modules/grammarkdown": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/grammarkdown/-/grammarkdown-3.3.2.tgz", - "integrity": "sha512-inNbeEotDr7MENqoZlms3x4gBzvK73wR2NGpNVnw4oEZcsq2METUbAh0J3VWtEqd9t2+U3poEqiJ9CDgBXr5Tg==", - "dev": true, - "dependencies": { - "@esfx/async-canceltoken": "^1.0.0-pre.13", - "@esfx/cancelable": "^1.0.0-pre.13", - "@esfx/disposable": "^1.0.0-pre.13" - }, - "bin": { - "grammarkdown": "bin/grammarkdown" - } - }, - "node_modules/har-schema": { - "version": "2.0.0", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=4" - } - }, - "node_modules/har-validator": { - "version": "5.1.3", - "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/highlight.js": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.0.1.tgz", - "integrity": "sha512-EqYpWyTF2s8nMfttfBA2yLKPNoZCO33pLS4MnbXQ4hECf1TKujCt1Kq7QAdrio7roL4+CqsfjqwYj4tYgq0pJQ==", - "dev": true, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/html-encoding-sniffer": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "whatwg-encoding": "^1.0.1" - } - }, - "node_modules/html-entities": { - "version": "2.5.2", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/mdevils" - }, - { - "type": "patreon", - "url": "https://patreon.com/mdevils" - } - ], - "license": "MIT" - }, - "node_modules/html-escape": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/html-escape/-/html-escape-1.0.2.tgz", - "integrity": "sha512-r4cqVc7QAX1/jpPsW9OJNsTTtFhcf+ZBqoA3rWOddMg/y+n6ElKfz+IGKbvV2RTeECDzyrQXa2rpo3IFFrANWg==", - "dev": true - }, - "node_modules/http-errors": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/http-proxy-agent": { - "version": "7.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.0", - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/http-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/http-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/http-signature": { - "version": "1.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, - "node_modules/https-proxy-agent": { - "version": "7.0.4", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.0.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/https-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/https-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "dev": true, - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "BSD-3-Clause" - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "dev": true, - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "dev": true, - "license": "ISC" - }, - "node_modules/ip-address": { - "version": "9.0.5", - "dev": true, - "license": "MIT", - "dependencies": { - "jsbn": "1.1.0", - "sprintf-js": "^1.1.3" - }, - "engines": { - "node": ">= 12" - } - }, - "node_modules/ip-address/node_modules/jsbn": { - "version": "1.1.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ip-regex": { - "version": "2.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "dev": true, - "license": "MIT" - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-interactive": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-potential-custom-element-name": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", - "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", - "dev": true - }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/is-unicode-supported": { - "version": "1.3.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/isstream": { - "version": "0.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/jsbn": { - "version": "0.1.1", - "dev": true, - "license": "MIT" - }, - "node_modules/jsdom": { - "version": "15.2.1", - "dev": true, - "license": "MIT", - "dependencies": { - "abab": "^2.0.0", - "acorn": "^7.1.0", - "acorn-globals": "^4.3.2", - "array-equal": "^1.0.0", - "cssom": "^0.4.1", - "cssstyle": "^2.0.0", - "data-urls": "^1.1.0", - "domexception": "^1.0.1", - "escodegen": "^1.11.1", - "html-encoding-sniffer": "^1.0.2", - "nwsapi": "^2.2.0", - "parse5": "5.1.0", - "pn": "^1.1.0", - "request": "^2.88.0", - "request-promise-native": "^1.0.7", - "saxes": "^3.1.9", - "symbol-tree": "^3.2.2", - "tough-cookie": "^3.0.1", - "w3c-hr-time": "^1.0.1", - "w3c-xmlserializer": "^1.1.2", - "webidl-conversions": "^4.0.2", - "whatwg-encoding": "^1.0.5", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^7.0.0", - "ws": "^7.0.0", - "xml-name-validator": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "peerDependencies": { - "canvas": "^2.5.0" - }, - "peerDependenciesMeta": { - "canvas": { - "optional": true - } - } - }, - "node_modules/jsdom/node_modules/acorn": { - "version": "7.2.0", - "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/jsdom/node_modules/cssom": { - "version": "0.4.4", - "dev": true, - "license": "MIT" - }, - "node_modules/jsdom/node_modules/parse5": { - "version": "5.1.0", - "dev": true, - "license": "MIT" - }, - "node_modules/jsdom/node_modules/tough-cookie": { - "version": "3.0.1", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "ip-regex": "^2.1.0", - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/jsdom/node_modules/whatwg-url": { - "version": "7.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - }, - "node_modules/jsdom/node_modules/ws": { - "version": "7.5.9", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "dev": true, - "license": "MIT" - }, - "node_modules/json-schema": { - "version": "0.2.3", - "dev": true - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "dev": true, - "license": "MIT" - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "dev": true, - "license": "ISC" - }, - "node_modules/jsonfile": { - "version": "6.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/jsprim": { - "version": "1.4.1", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "license": "MIT", - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "node_modules/katex": { - "version": "0.16.9", - "dev": true, - "funding": [ - "https://opencollective.com/katex", - "https://github.com/sponsors/katex" - ], - "license": "MIT", - "dependencies": { - "commander": "^8.3.0" - }, - "bin": { - "katex": "cli.js" - } - }, - "node_modules/katex/node_modules/commander": { - "version": "8.3.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 12" - } - }, - "node_modules/levn": { - "version": "0.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "dev": true, - "license": "MIT" - }, - "node_modules/lodash": { - "version": "4.17.21", - "dev": true, - "license": "MIT" - }, - "node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "dev": true - }, - "node_modules/lodash.sortby": { - "version": "4.7.0", - "dev": true, - "license": "MIT" - }, - "node_modules/log-symbols": { - "version": "5.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^5.0.0", - "is-unicode-supported": "^1.1.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lru-cache": { - "version": "7.18.3", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/mathjax": { - "version": "3.2.2", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/mdn-data": { - "version": "2.0.14", - "dev": true, - "license": "CC0-1.0" - }, - "node_modules/media-typer": { - "version": "0.3.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/methods": { - "version": "1.1.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "dev": true, - "license": "MIT", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "dev": true, - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/minimatch": { - "version": "3.0.4", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/mitt": { - "version": "3.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/mkdirp-classic": { - "version": "0.5.3", - "dev": true, - "license": "MIT" - }, - "node_modules/ms": { - "version": "2.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/negotiator": { - "version": "0.6.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netmask": { - "version": "2.0.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/next-tick": { - "version": "1.1.0", - "dev": true, - "license": "ISC" - }, - "node_modules/node-domexception": { - "version": "1.0.0", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "engines": { - "node": ">=10.5.0" - } - }, - "node_modules/node-fetch": { - "version": "3.3.2", - "dev": true, - "license": "MIT", - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "node_modules/nwsapi": { - "version": "2.2.0", - "dev": true, - "license": "MIT" - }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "*" - } - }, - "node_modules/object-inspect": { - "version": "1.13.1", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "dev": true, - "license": "MIT", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/once": { - "version": "1.4.0", - "dev": true, - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/onetime": { - "version": "5.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/optionator": { - "version": "0.8.3", - "dev": true, - "license": "MIT", - "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/ora": { - "version": "6.3.1", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^5.0.0", - "cli-cursor": "^4.0.0", - "cli-spinners": "^2.6.1", - "is-interactive": "^2.0.0", - "is-unicode-supported": "^1.1.0", - "log-symbols": "^5.1.0", - "stdin-discarder": "^0.1.0", - "strip-ansi": "^7.0.1", - "wcwidth": "^1.0.1" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/pac-proxy-agent": { - "version": "7.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@tootallnate/quickjs-emscripten": "^0.23.0", - "agent-base": "^7.0.2", - "debug": "^4.3.4", - "get-uri": "^6.0.1", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.2", - "pac-resolver": "^7.0.0", - "socks-proxy-agent": "^8.0.2" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/pac-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/pac-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/pac-resolver": { - "version": "7.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "degenerator": "^5.0.0", - "netmask": "^2.0.2" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/pagedjs": { - "version": "0.4.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/polyfill": "^7.10.1", - "@babel/runtime": "^7.21.0", - "clear-cut": "^2.0.2", - "css-tree": "^1.1.3", - "event-emitter": "^0.3.5" - } - }, - "node_modules/pagedjs-cli": { - "version": "0.4.3", - "dev": true, - "license": "MIT", - "dependencies": { - "commander": "^11.0.0", - "express": "^4.18.2", - "html-entities": "^2.4.0", - "katex": "^0.16.8", - "lodash": "^4.17.21", - "mathjax": "^3.2.2", - "node-fetch": "^3.3.1", - "ora": "^6.3.1", - "pagedjs": "^0.4.3", - "pdf-lib": "1.17.1", - "puppeteer": "^20.9.0", - "replace-ext": "^2.0.0" - }, - "bin": { - "pagedjs-cli": "src/cli.js" - } - }, - "node_modules/pako": { - "version": "1.0.11", - "dev": true, - "license": "(MIT AND Zlib)" - }, - "node_modules/parent-module": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/parse-json": { - "version": "5.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "dev": true - }, - "node_modules/parseurl": { - "version": "1.3.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-to-regexp": { - "version": "0.1.7", - "dev": true, - "license": "MIT" - }, - "node_modules/path-type": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/pdf-lib": { - "version": "1.17.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@pdf-lib/standard-fonts": "^1.0.0", - "@pdf-lib/upng": "^1.0.1", - "pako": "^1.0.11", - "tslib": "^1.11.1" - } - }, - "node_modules/pend": { - "version": "1.2.0", - "dev": true, - "license": "MIT" - }, - "node_modules/performance-now": { - "version": "2.1.0", - "dev": true, - "license": "MIT" - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pn": { - "version": "1.1.0", - "dev": true, - "license": "MIT" - }, - "node_modules/prelude-ls": { - "version": "1.1.2", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/prex": { - "version": "0.4.9", - "resolved": "https://registry.npmjs.org/prex/-/prex-0.4.9.tgz", - "integrity": "sha512-pQCB9AH8MXQRBaelDkhnTkqY6GRiXt1xWlx2hBReZYZwVA0m7EQcnF/K55zr87cCADDHmdD+qq7G6a8Pu+BRFA==", - "deprecated": "This package has been deprecated in favor of several '@esfx/*' packages that replace it. Please see the README for more information", - "dev": true, - "dependencies": { - "@esfx/cancelable": "^1.0.0 || >=1.0.0-pre.13", - "@esfx/disposable": "^1.0.0 || >=1.0.0-pre.13" - } - }, - "node_modules/progress": { - "version": "2.0.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/promise-debounce": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-debounce/-/promise-debounce-1.0.1.tgz", - "integrity": "sha512-jq3Crngf1DaaOXQIOUkPr7LsW4UsWyn0KW1MJ+yMn5njTJ+F1AuHmjjwJhod9HuoNSSMspSLS9PS3V7BrexwjQ==", - "dev": true - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "dev": true, - "license": "MIT", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/proxy-agent": { - "version": "6.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.0.2", - "debug": "^4.3.4", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.0", - "lru-cache": "^7.14.1", - "pac-proxy-agent": "^7.0.0", - "proxy-from-env": "^1.1.0", - "socks-proxy-agent": "^8.0.1" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/proxy-agent/node_modules/debug": { - "version": "4.3.4", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/proxy-agent/node_modules/ms": { - "version": "2.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "dev": true, - "license": "MIT" - }, - "node_modules/psl": { - "version": "1.8.0", - "dev": true, - "license": "MIT" - }, - "node_modules/pump": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/punycode": { - "version": "2.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/puppeteer": { - "version": "20.9.0", - "dev": true, - "hasInstallScript": true, - "license": "Apache-2.0", - "dependencies": { - "@puppeteer/browsers": "1.4.6", - "cosmiconfig": "8.2.0", - "puppeteer-core": "20.9.0" - }, - "engines": { - "node": ">=16.3.0" - } - }, - "node_modules/puppeteer-core": { - "version": "20.9.0", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@puppeteer/browsers": "1.4.6", - "chromium-bidi": "0.4.16", - "cross-fetch": "4.0.0", - "debug": "4.3.4", - "devtools-protocol": "0.0.1147663", - "ws": "8.13.0" - }, - "engines": { - "node": ">=16.3.0" - }, - "peerDependencies": { - "typescript": ">= 4.7.4" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/puppeteer-core/node_modules/debug": { - "version": "4.3.4", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/puppeteer-core/node_modules/ms": { - "version": "2.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/qs": { - "version": "6.5.2", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/querystringify": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "dev": true - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/queue-tick": { - "version": "1.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/range-parser": { - "version": "1.2.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.2", - "dev": true, - "license": "MIT", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/readable-stream": { - "version": "3.6.0", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/reduce-flatten": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", - "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/regenerator-runtime": { - "version": "0.13.11", - "dev": true, - "license": "MIT" - }, - "node_modules/replace-ext": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10" - } - }, - "node_modules/request": { - "version": "2.88.2", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/request-promise-core": { - "version": "1.1.3", - "dev": true, - "license": "ISC", - "dependencies": { - "lodash": "^4.17.15" - }, - "engines": { - "node": ">=0.10.0" - }, - "peerDependencies": { - "request": "^2.34" - } - }, - "node_modules/request-promise-native": { - "version": "1.0.8", - "dev": true, - "license": "ISC", - "dependencies": { - "request-promise-core": "1.1.3", - "stealthy-require": "^1.1.1", - "tough-cookie": "^2.3.3" - }, - "engines": { - "node": ">=0.12.0" - }, - "peerDependencies": { - "request": "^2.34" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/restore-cursor": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true } - ], - "license": "MIT" + } }, - "node_modules/safer-buffer": { + "node_modules/https-proxy-agent/node_modules/ms": { "version": "2.1.2", "dev": true, "license": "MIT" }, - "node_modules/saxes": { - "version": "3.1.11", + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, - "license": "ISC", + "license": "MIT", "dependencies": { - "xmlchars": "^2.1.1" + "safer-buffer": ">= 2.1.2 < 3.0.0" }, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/send": { - "version": "0.18.0", + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, - "license": "MIT", "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" + "is-extglob": "^2.1.1" }, "engines": { - "node": ">= 0.8.0" + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" } }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-tokens": { + "version": "4.0.0", "dev": true, "license": "MIT" }, - "node_modules/serve-static": { - "version": "1.15.0", + "node_modules/jsdom": { + "version": "27.0.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-27.0.0.tgz", + "integrity": "sha512-lIHeR1qlIRrIN5VMccd8tI2Sgw6ieYXSVktcSHaNe3Z5nE/tcPQYQWOq00wxMvYOsz+73eAkNenVvmPC6bba9A==", "dev": true, "license": "MIT", "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" + "@asamuzakjp/dom-selector": "^6.5.4", + "cssstyle": "^5.3.0", + "data-urls": "^6.0.0", + "decimal.js": "^10.5.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.6", + "is-potential-custom-element-name": "^1.0.1", + "parse5": "^7.3.0", + "rrweb-cssom": "^0.8.0", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^6.0.0", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^8.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^15.0.0", + "ws": "^8.18.2", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "canvas": "^3.0.0" }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jsdom/node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "dev": true, + "license": "BSD-2-Clause", "engines": { - "node": ">= 0.8.0" + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/set-function-length": { - "version": "1.2.1", + "node_modules/jsdom/node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", "dev": true, "license": "MIT", "dependencies": { - "define-data-property": "^1.1.2", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.3", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.1" + "entities": "^6.0.0" }, - "engines": { - "node": ">= 0.4" + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/setprototypeof": { - "version": "1.2.0", + "node_modules/jsdom/node_modules/rrweb-cssom": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==", "dev": true, - "license": "ISC" + "license": "MIT" + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "11.2.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.1.tgz", + "integrity": "sha512-r8LA6i4LP4EeWOhqBaZZjDWwehd1xUJPCJd9Sv300H0ZmcUER4+JPh7bqqZeqs1o5pgtgvXm+d9UGrB5zZGDiQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "20 || >=22" + } }, - "node_modules/side-channel": { - "version": "1.0.6", + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", "dev": true, "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" - }, "engines": { "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/signal-exit": { - "version": "3.0.7", + "node_modules/mdn-data": { + "version": "2.12.2", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.12.2.tgz", + "integrity": "sha512-IEn+pegP1aManZuckezWCO+XZQDplx1366JoVhTpMpBB1sPey/SbveZQUosKiKiGYjg1wH4pMlNgXbCiYgihQA==", "dev": true, - "license": "ISC" + "license": "CC0-1.0" }, - "node_modules/smart-buffer": { - "version": "4.2.0", + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, - "license": "MIT", "engines": { - "node": ">= 6.0.0", - "npm": ">= 3.0.0" + "node": ">= 8" } }, - "node_modules/socks": { - "version": "2.8.1", + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "license": "MIT", "dependencies": { - "ip-address": "^9.0.5", - "smart-buffer": "^4.2.0" + "braces": "^3.0.3", + "picomatch": "^2.3.1" }, "engines": { - "node": ">= 10.0.0", - "npm": ">= 3.0.0" + "node": ">=8.6" } }, - "node_modules/socks-proxy-agent": { - "version": "8.0.2", + "node_modules/mime-db": { + "version": "1.52.0", "dev": true, "license": "MIT", - "dependencies": { - "agent-base": "^7.0.2", - "debug": "^4.3.4", - "socks": "^2.7.1" - }, "engines": { - "node": ">= 14" + "node": ">= 0.6" } }, - "node_modules/socks-proxy-agent/node_modules/debug": { - "version": "4.3.4", + "node_modules/mime-types": { + "version": "2.1.35", "dev": true, "license": "MIT", "dependencies": { - "ms": "2.1.2" + "mime-db": "1.52.0" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true + "node": ">= 0.6" + } + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" } + ], + "license": "MIT", + "peer": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/socks-proxy-agent/node_modules/ms": { - "version": "2.1.2", + "node_modules/nwsapi": { + "version": "2.2.0", "dev": true, "license": "MIT" }, - "node_modules/source-map": { - "version": "0.6.1", + "node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } + "license": "MIT" }, - "node_modules/sprintf-js": { - "version": "1.1.3", + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true, - "license": "BSD-3-Clause" + "license": "ISC", + "peer": true }, - "node_modules/sshpk": { - "version": "1.16.1", + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, - "license": "MIT", - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, "engines": { - "node": ">=0.10.0" + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/statuses": { - "version": "2.0.1", + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "license": "MIT", + "peer": true, + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, "engines": { - "node": ">= 0.8" + "node": "^10 || ^12 || >=14" } }, - "node_modules/stdin-discarder": { - "version": "0.1.0", + "node_modules/prex": { + "version": "0.4.9", + "resolved": "https://registry.npmjs.org/prex/-/prex-0.4.9.tgz", + "integrity": "sha512-pQCB9AH8MXQRBaelDkhnTkqY6GRiXt1xWlx2hBReZYZwVA0m7EQcnF/K55zr87cCADDHmdD+qq7G6a8Pu+BRFA==", + "deprecated": "This package has been deprecated in favor of several '@esfx/*' packages that replace it. Please see the README for more information", "dev": true, - "license": "MIT", "dependencies": { - "bl": "^5.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "@esfx/cancelable": "^1.0.0 || >=1.0.0-pre.13", + "@esfx/disposable": "^1.0.0 || >=1.0.0-pre.13" } }, - "node_modules/stdin-discarder/node_modules/bl": { - "version": "5.1.0", + "node_modules/promise-debounce": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-debounce/-/promise-debounce-1.0.1.tgz", + "integrity": "sha512-jq3Crngf1DaaOXQIOUkPr7LsW4UsWyn0KW1MJ+yMn5njTJ+F1AuHmjjwJhod9HuoNSSMspSLS9PS3V7BrexwjQ==", + "dev": true + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, "license": "MIT", - "dependencies": { - "buffer": "^6.0.3", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" + "engines": { + "node": ">=6" } }, - "node_modules/stdin-discarder/node_modules/buffer": { - "version": "6.0.3", + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true, "funding": [ { @@ -4143,85 +1654,95 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } + ] }, - "node_modules/stealthy-require": { - "version": "1.1.1", + "node_modules/reduce-flatten": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", "dev": true, - "license": "ISC", "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/streamx": { - "version": "2.16.1", + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true, "license": "MIT", - "dependencies": { - "fast-fifo": "^1.1.0", - "queue-tick": "^1.0.1" - }, - "optionalDependencies": { - "bare-events": "^2.2.0" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/string_decoder": { - "version": "1.3.0", + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.2.0" + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" } }, - "node_modules/string-width": { - "version": "4.2.3", + "node_modules/rrweb-cssom": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.7.1.tgz", + "integrity": "sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==", "dev": true, - "license": "MIT", + "license": "MIT" + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" + "queue-microtask": "^1.2.2" } }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "5.0.1", + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } + "license": "MIT" }, - "node_modules/string-width/node_modules/strip-ansi": { - "version": "6.0.1", + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", "dev": true, - "license": "MIT", + "license": "ISC", "dependencies": { - "ansi-regex": "^5.0.1" + "xmlchars": "^2.2.0" }, "engines": { - "node": ">=8" + "node": ">=v12.22.7" } }, - "node_modules/strip-ansi": { - "version": "7.1.0", + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, + "license": "BSD-3-Clause", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "node": ">=0.10.0" } }, "node_modules/supports-color": { @@ -4273,56 +1794,32 @@ "node": ">=8" } }, - "node_modules/tar-fs": { - "version": "3.0.4", - "dev": true, - "license": "MIT", - "dependencies": { - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^3.1.5" - } - }, - "node_modules/tar-fs/node_modules/tar-stream": { - "version": "3.1.7", - "dev": true, - "license": "MIT", - "dependencies": { - "b4a": "^1.6.4", - "fast-fifo": "^1.2.0", - "streamx": "^2.15.0" - } - }, - "node_modules/tar-stream": { - "version": "2.2.0", + "node_modules/tldts": { + "version": "6.1.82", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.82.tgz", + "integrity": "sha512-KCTjNL9F7j8MzxgfTgjT+v21oYH38OidFty7dH00maWANAI2IsLw2AnThtTJi9HKALHZKQQWnNebYheadacD+g==", "dev": true, "license": "MIT", "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" + "tldts-core": "^6.1.82" }, - "engines": { - "node": ">=6" + "bin": { + "tldts": "bin/cli.js" } }, - "node_modules/through": { - "version": "2.3.8", + "node_modules/tldts-core": { + "version": "6.1.82", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.82.tgz", + "integrity": "sha512-Jabl32m21tt/d/PbDO88R43F8aY98Piiz6BVH9ShUlOAiiAELhEqwrAmBocjAqnCfoUeIsRU+h3IEzZd318F3w==", "dev": true, "license": "MIT" }, - "node_modules/tiny-json-http": { - "version": "7.2.0", - "dev": true, - "license": "Apache-2.0" - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -4330,81 +1827,50 @@ "node": ">=8.0" } }, - "node_modules/toidentifier": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.6" - } - }, "node_modules/tough-cookie": { - "version": "2.5.0", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-6.0.0.tgz", + "integrity": "sha512-kXuRi1mtaKMrsLUxz3sQYvVl37B0Ns6MzfrtV5DvJceE9bPyspOqk9xxv7XbZWcfLWbFmm997vl83qUWVJA64w==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" + "tldts": "^7.0.5" }, "engines": { - "node": ">=0.8" + "node": ">=16" } }, - "node_modules/tr46": { - "version": "1.0.1", + "node_modules/tough-cookie/node_modules/tldts": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-7.0.15.tgz", + "integrity": "sha512-heYRCiGLhtI+U/D0V8YM3QRwPfsLJiP+HX+YwiHZTnWzjIKC+ZCxQRYlzvOoTEc6KIP62B1VeAN63diGCng2hg==", "dev": true, "license": "MIT", "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/tslib": { - "version": "1.14.1", - "dev": true, - "license": "0BSD" - }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "safe-buffer": "^5.0.1" + "tldts-core": "^7.0.15" }, - "engines": { - "node": "*" + "bin": { + "tldts": "bin/cli.js" } }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "dev": true, - "license": "Unlicense" - }, - "node_modules/type": { - "version": "2.7.2", - "dev": true, - "license": "ISC" - }, - "node_modules/type-check": { - "version": "0.3.2", + "node_modules/tough-cookie/node_modules/tldts-core": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-7.0.15.tgz", + "integrity": "sha512-YBkp2VfS9VTRMPNL2PA6PMESmxV1JEVoAr5iBlZnB5JG3KUrWzNCB3yNNkRa2FZkqClaBgfNYCp8PgpYmpjkZw==", "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } + "license": "MIT" }, - "node_modules/type-is": { - "version": "1.6.18", + "node_modules/tr46": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-6.0.0.tgz", + "integrity": "sha512-bLVMLPtstlZ4iMQHpFHTR7GAGj2jxi8Dg0s2h2MafAE4uSWF98FC/3MomU51iQAMf8/qDUbKWf5GxuvvVcXEhw==", "dev": true, "license": "MIT", "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" + "punycode": "^2.3.1" }, "engines": { - "node": ">= 0.6" + "node": ">=20" } }, "node_modules/typical": { @@ -4416,174 +1882,64 @@ "node": ">=8" } }, - "node_modules/unbzip2-stream": { - "version": "1.4.3", + "node_modules/w3c-xmlserializer": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", "dev": true, "license": "MIT", "dependencies": { - "buffer": "^5.2.1", - "through": "^2.3.8" - } - }, - "node_modules/undici-types": { - "version": "5.26.5", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/universalify": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "dev": true, - "license": "MIT", + "xml-name-validator": "^5.0.0" + }, "engines": { - "node": ">= 0.8" + "node": ">=18" } }, - "node_modules/uri-js": { - "version": "4.2.2", + "node_modules/webidl-conversions": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-8.0.0.tgz", + "integrity": "sha512-n4W4YFyz5JzOfQeA8oN7dUYpR+MBP3PIUsn2jLjWXwK5ASUzt0Jc/A5sAUZoCYFJRGF0FBKJ+1JjN43rNdsQzA==", "dev": true, "license": "BSD-2-Clause", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/url-parse": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", - "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "dev": true, - "dependencies": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "dev": true, - "license": "MIT" - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/uuid": { - "version": "3.4.0", - "dev": true, - "license": "MIT", - "bin": { - "uuid": "bin/uuid" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "dev": true, - "license": "MIT", "engines": { - "node": ">= 0.8" - } - }, - "node_modules/verror": { - "version": "1.10.0", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "node_modules/w3c-hr-time": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "browser-process-hrtime": "^1.0.0" - } - }, - "node_modules/w3c-xmlserializer": { - "version": "1.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "domexception": "^1.0.1", - "webidl-conversions": "^4.0.2", - "xml-name-validator": "^3.0.0" + "node": ">=20" } }, - "node_modules/wcwidth": { - "version": "1.0.1", + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", "dev": true, "license": "MIT", "dependencies": { - "defaults": "^1.0.3" - } - }, - "node_modules/web-streams-polyfill": { - "version": "3.3.3", - "dev": true, - "license": "MIT", + "iconv-lite": "0.6.3" + }, "engines": { - "node": ">= 8" + "node": ">=18" } }, - "node_modules/webidl-conversions": { - "version": "4.0.2", - "dev": true, - "license": "BSD-2-Clause" - }, - "node_modules/whatwg-encoding": { - "version": "1.0.5", + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", "dev": true, "license": "MIT", - "dependencies": { - "iconv-lite": "0.4.24" + "engines": { + "node": ">=18" } }, - "node_modules/whatwg-mimetype": { - "version": "2.3.0", - "dev": true, - "license": "MIT" - }, "node_modules/whatwg-url": { - "version": "5.0.0", + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-15.1.0.tgz", + "integrity": "sha512-2ytDk0kiEj/yu90JOAp44PVPUkO9+jVhyf+SybKlRHSDlvOOZhdPIrr7xTH64l4WixO2cP+wQIcgujkGBPPz6g==", "dev": true, "license": "MIT", "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/whatwg-url/node_modules/tr46": { - "version": "0.0.3", - "dev": true, - "license": "MIT" - }, - "node_modules/whatwg-url/node_modules/webidl-conversions": { - "version": "3.0.1", - "dev": true, - "license": "BSD-2-Clause" - }, - "node_modules/word-wrap": { - "version": "1.2.3", - "dev": true, - "license": "MIT", + "tr46": "^6.0.0", + "webidl-conversions": "^8.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=20" } }, "node_modules/wordwrapjs": { @@ -4608,48 +1964,10 @@ "node": ">=8" } }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "5.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "6.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "dev": true, - "license": "ISC" - }, "node_modules/ws": { - "version": "8.13.0", + "version": "8.18.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", + "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", "dev": true, "license": "MIT", "engines": { @@ -4669,56 +1987,19 @@ } }, "node_modules/xml-name-validator": { - "version": "3.0.0", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", "dev": true, - "license": "Apache-2.0" + "license": "Apache-2.0", + "engines": { + "node": ">=18" + } }, "node_modules/xmlchars": { "version": "2.2.0", "dev": true, "license": "MIT" - }, - "node_modules/y18n": { - "version": "5.0.8", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "17.7.1", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/yauzl": { - "version": "2.10.0", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } } } } diff --git a/package.json b/package.json index 99a69bd79c..78ce7f576c 100644 --- a/package.json +++ b/package.json @@ -4,15 +4,15 @@ "version": "1.0.0", "description": "The ECMAScript specification", "scripts": { - "ipr-check": "node scripts/check-form tc39/ecma262 HEAD --all", + "ipr-check": "node scripts/check-form tc39/ecma262", "build-head": "npm run build-only -- --lint-spec --strict", "prebuild-only": "npm run clean && mkdir out && cp -R img out", "build-only": "ecmarkup --verbose spec.html --multipage out", "build": "npm run build-head", - "build-for-pdf": "ecmarkup --verbose spec.html --old-toc --assets external out/index.html", - "pdf": "npm run build-for-pdf && pagedjs-cli --page-size a4 out/index.html -o out/index.pdf", + "build-for-pdf": "npm run prebuild-only && ecmarkup --verbose spec.html out/index.html --assets external --assets-dir out --printable --lint-spec --strict", + "pdf": "npm run build-for-pdf && prince-books --script ./node_modules/ecmarkup/js/print.js out/index.html -o out/ECMA-262.pdf", "prebuild-snapshot": "npm run clean", - "build-snapshot": "npm run build-head && node scripts/insert_snapshot_warning.js", + "build-snapshot": "npm run build-head && node scripts/insert-snapshot-warning.js", "clean": "rm -rf out", "format": "emu-format --write spec.html", "test": "exit 0", @@ -23,15 +23,8 @@ "author": "ECMA TC39", "license": "SEE LICENSE IN https://tc39.es/ecma262/#sec-copyright-and-software-license", "homepage": "https://tc39.es/ecma262/", - "dependencies": { - }, "devDependencies": { - "ecmarkup": "^18.3.1", - "glob": "^7.1.6", - "jsdom": "^15.0.0", - "pagedjs": "^0.4.3", - "pagedjs-cli": "^0.4.3", - "tar-stream": "^2.2.0", - "tiny-json-http": "^7.1.2" + "ecmarkup": "^24.0.0", + "jsdom": "^27.0.0" } } diff --git a/scripts/check-form.js b/scripts/check-form.js index 2282f62540..9c9cd8cf77 100644 --- a/scripts/check-form.js +++ b/scripts/check-form.js @@ -19,16 +19,22 @@ if (!key) { const sheetData = `https://sheets.googleapis.com/v4/spreadsheets/${sheetID}/values/Sheet1!A2:A?key=${key}`; -const [,, slug, branch, all] = process.argv; - -if (!slug || !branch) { - throw 'args required: slug, branch'; +const { values, positionals } = require('util').parseArgs({ + allowPositionals: true, + strict: true, +}); +if (positionals.length < 1 || positionals.length > 2) { + throw 'usage: node check-form.js [ref]'; } -if (typeof all !== 'undefined' && all !== '--all') { - throw '`all` arg, if provided, must be `--all`' +const [slug, ref = 'HEAD'] = positionals; + +console.debug({ slug, ref }); + +if (!slug || !ref) { + throw 'args required: slug, ref'; } -const sha = String(execSync(`git rev-parse --short ${branch}`)).trim(); +const sha = String(execSync(`git rev-parse ${ref}`)).trim(); const request = async (url, method = 'GET', postData) => { // adapted from https://medium.com/@gevorggalstyan/how-to-promisify-node-js-http-https-requests-76a5a58ed90c @@ -99,6 +105,16 @@ const legacyCommitsWithUnknownAuthors = new Set([ 'f424bf075fe582ed8acc36e8a420ee713a21561a', // https://github.com/tc39/ecma262/pull/3142 'bea8d0d682fcf2be2a29564bd2ae66ab9dcce21c', // https://github.com/tc39/ecma262/pull/612, user deleted their github '329069469609d8f05ad64c328e2295c171050ce4', // https://github.com/tc39/ecma262/pull/3249, commit email doesn't point to the github user + '57f427b18bf7e629565ac2fcf2392ba7b7d0d8fb', // https://github.com/tc39/ecma262/pull/3127, user account deactivated + 'aada40840dc152d4759b0e3353542e971db08ee7', // tutizaraz (signed) renamed their account to riwom -> dbarabashh + '57f427b18bf7e629565ac2fcf2392ba7b7d0d8fb', // https://github.com/tc39/ecma262/pull/3377, bojavou has not signed the form + 'f55b180957aa626ef8f87311e2e3b469dff0bf17', // rbuckton, microsoft email detached + 'fc03120c4abd8883b424a3864040f9101c022c24', // rbuckton, microsoft email detached + '0209d8571b41e1c7dd18befd2ba45312680d6fcd', // rbuckton, microsoft email detached + '51e28c71cea1c73e3f22a007a058ebbf5ebc06aa', // rbuckton, microsoft email detached + 'aab1ea3bd4d03c85d6f4a91503b4169346ab7271', // rbuckton, microsoft email detached + '94c6c6be7e694083393ac8cf1ee8dc8189ce8005', // https://github.com/tc39/ecma262/pull/2331, user account deactivated + '4895a117eb54edd829f2010092bae8f41c2b174a', // hriztam, https://github.com/tc39/ecma262/pull/3760 ]); function getAuthorFromCommit(commitObj) { @@ -116,7 +132,7 @@ async function getAllCommits(page = 1) { const commitsURL = `https://api.github.com/repos/${slug}/commits?anon=1&per_page=${perPage}&page=${page}&sha=${sha}`; const commits = await request(commitsURL).then((json) => JSON.parse(json)); return [...new Set([].concat( - commits.flatMap(x => getAuthorFromCommit(x) || []), + commits.filter(x => !legacyCommitsWithUnknownAuthors.has(x?.sha)).flatMap(x => getAuthorFromCommit(x) || []), commits.length < perPage ? [] : await getAllCommits(page + 1), ))]; } @@ -211,7 +227,6 @@ const legacy = new Set([ 'himsngh', 'angleKH', 'ivan-pan', - 'szuend', 'chrikrah', 'viktmv', 'bathos', @@ -241,7 +256,6 @@ const legacy = new Set([ 'DmitrySoshnikov', 'jsreeram', 'antony-jeong', - 'bojavou', ].map(x => x.toLowerCase())); Promise.all([usernames, authors, delegates, emeriti]).then(([usernames, authors, delegates, emeriti]) => { diff --git a/scripts/auto-deploy.sh b/scripts/deploy-github-pages.sh similarity index 50% rename from scripts/auto-deploy.sh rename to scripts/deploy-github-pages.sh index 41657f2f0f..00578b6f24 100755 --- a/scripts/auto-deploy.sh +++ b/scripts/deploy-github-pages.sh @@ -2,16 +2,27 @@ set -euxo pipefail +DEST_DIR="gh-pages" +COMMIT_MESSAGE="Update gh-pages" +if [[ "${1:-}" == "--pr" && -n "${2:-}" ]]; then + DEST_DIR="gh-pages/pr/$2" + COMMIT_MESSAGE="Update gh-pages for PR $2" +fi declare -r GH_USER_EMAIL="bot@tc39" declare -r GH_USER_NAME="Bot" -declare -r COMMIT_MESSAGE="Update gh-pages" +declare -r COMMIT_MESSAGE cd "$(dirname "$BASH_SOURCE")"/.. git clone --depth 1 --branch gh-pages "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" gh-pages -find gh-pages -type f \! \( -path 'gh-pages/2*' -o -path 'gh-pages/.git*' \) -exec rm -rf {} \; -cp -r out/* gh-pages +if [[ "${1:-}" == "--pr" ]]; then + rm -rf "$DEST_DIR" +else + find gh-pages \( -path 'gh-pages/.git' -o -path 'gh-pages/pr' -o -path 'gh-pages/2*' \) -prune -o -type f -exec rm -f {} + +fi +mkdir -p "$DEST_DIR" +cp -r out/* "$DEST_DIR" cd gh-pages git config user.email "${GH_USER_EMAIL}" diff --git a/scripts/insert-snapshot-warning.js b/scripts/insert-snapshot-warning.js new file mode 100644 index 0000000000..52f1dd1e2c --- /dev/null +++ b/scripts/insert-snapshot-warning.js @@ -0,0 +1,135 @@ +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const { JSDOM, VirtualConsole } = require('jsdom'); +const { execSync } = require('child_process'); + +const COMMIT = String(execSync('git rev-parse --verify HEAD')).trim(); + +const WARNING_HTML = ` +
+ This is a commit snapshot of the specification +

+ This document contains the contents of the specification as of + commit ${COMMIT}, + and should only be used as a historical reference. This commit may not + have even been merged into the specification. +

+

+ Do not attempt to implement this version of the specification. Do not + reference this version as authoritative in any way. Instead, see + https://tc39.es/ecma262 for the + living specification. +

+
+ +`; + +const WARNING_CSS = ` +details.annoying-warning { + background-color: #920800; + background-image: linear-gradient(transparent 40%, rgba(255, 255, 255, 0.2)); + border: solid rgba(0, 0, 0, 0.4); + border-radius: 3px; + border-width: 1px 1px 0 1px; + box-shadow: 0 0 0.5em rgba(0, 0, 0, 0.5); + color: rgba(255, 255, 255, 0.95); + opacity: .95; + position: fixed; + left: 5%; + margin: 0 auto; + right: 5%; + z-index: 10; +} + +details.annoying-warning[open] { + top: 10%; + top: calc(5vw + 5vh); + max-width: 1024px; + outline: solid 10000px rgba(255, 255, 255, 0.6); +} + +details.annoying-warning:not([open]) { + bottom: 0; + left: 0; + right: 0; + border-radius: 0; +} + +details.annoying-warning > summary { + display: list-item; /* polyfill */ + font-size: 0.875em; + font-weight: bold; + letter-spacing: 0.02em; + padding: 10px 5px; + text-align: center; + text-transform: uppercase; + text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.85); + cursor: default; +} + +details.annoying-warning > summary::after { + content: " Expand"; + position: absolute; + top: 0; + right: 5px; + font-size: smaller; + font-weight: bold; +} + +details.annoying-warning[open] > summary::after { + content: " Collapse"; +} + +details.annoying-warning p { + padding: 0 7.5% 1em; + line-height: 1.4; + margin: 0; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.85); +} + +details.annoying-warning a { + color: white; + text-decoration: underline; +} +`; + +console.log('Inserting snapshot reference warning...'); + +const virtualConsole = new VirtualConsole(); +virtualConsole.on('error', () => { + // Suppress warnings from e.g. CSS features not supported by JSDOM +}); + +(async () => { + let files = ['out/index.html', ...fs.readdirSync('out/multipage').filter(f => f.endsWith('.html')).map(f => 'out/multipage/' + f)]; + for (let file of files) { + console.log(file); + let dom = await JSDOM.fromFile(file, { contentType: 'text/html; charset=utf-8', virtualConsole }); + const { document } = dom.window; + + const style = document.createElement('style'); + style.textContent = WARNING_CSS; + document.head.append(style); + + // insert WARNING_HTML in beginning of body so it renders + // first even on slower devices and browsers + document.body.insertAdjacentHTML('afterbegin', WARNING_HTML); + + fs.writeFileSync(file, dom.serialize(), 'utf8'); + } + console.log('Done!'); +})().catch(e => { + console.error(e); + process.exit(1); +}); diff --git a/scripts/insert_snapshot_warning.js b/scripts/insert_snapshot_warning.js deleted file mode 100644 index e2d02e6bfc..0000000000 --- a/scripts/insert_snapshot_warning.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -const fs = require('fs'); -const path = require('path'); -const { JSDOM } = require('jsdom'); -const { execSync } = require('child_process'); - -const COMMIT = String(execSync('git rev-parse --verify HEAD')).trim(); - -const WARNING_HTML = fs.readFileSync(path.join(__dirname, 'snapshot_warning.html'), 'utf8') - .replace(/{COMMIT}/g, COMMIT); -const WARNING_CSS = fs.readFileSync(path.join(__dirname, 'snapshot_warning.css'), 'utf8'); - -console.log('Inserting snapshot reference warning...'); - -JSDOM.fromFile('./out/index.html', { contentType: 'text/html; charset=utf-8' }).then((dom) => { - const { document } = dom.window; - - const style = document.createElement('style'); - style.textContent = WARNING_CSS; - document.head.append(style); - - // insert WARNING_HTML in beginning of body so it renders - // first even on slower devices and browsers - document.body.insertAdjacentHTML('afterbegin', WARNING_HTML); - - fs.writeFileSync('./out/index.html', dom.serialize(), 'utf8'); - - console.log('Done!'); -}).catch((reason) => { - console.error(reason); - process.exitCode = 1; -}); diff --git a/scripts/publish-biblio.sh b/scripts/publish-biblio.sh index 2f7ac07ba0..b658a5d921 100755 --- a/scripts/publish-biblio.sh +++ b/scripts/publish-biblio.sh @@ -10,7 +10,7 @@ cp LICENSE.md biblio/ cd biblio COMMIT_COUNT=$(git rev-list --count HEAD) -npm version --no-git-tag-version "2.1.${COMMIT_COUNT}" +npm version --no-git-tag-version "2.2.${COMMIT_COUNT}" SHORT_COMMIT=$(git rev-parse --short HEAD) LONG_COMMIT=$(git rev-parse --verify HEAD) diff --git a/scripts/publish-preview.js b/scripts/publish-preview.js deleted file mode 100755 index 212d1df813..0000000000 --- a/scripts/publish-preview.js +++ /dev/null @@ -1,100 +0,0 @@ -'use strict'; - -const { join } = require('path'); -const glob = require('glob').sync; -const tiny = require('tiny-json-http'); -const fs = require('fs'); -const zlib = require('zlib'); -const tar = require('tar-stream'); - - -async function go() { - const { - PULL_REQUEST, - GITHUB_HEAD_SHA, - GITHUB_REPOSITORY = 'tc39/ecma262', - } = process.env; - - if (!PULL_REQUEST) { throw new ReferenceError('Missing env var PULL_REQUEST'); } - if (!GITHUB_HEAD_SHA) { throw new ReferenceError('Missing env var GITHUB_HEAD_SHA'); } - - const dir = join(__dirname, '..', 'out'); - const files = glob(join(dir, '**'), { nodir: true }); - - if (!files.length) { throw new ReferenceError('No preview files found to publish'); } - - console.log(`Publishing preview build of PR ${PULL_REQUEST} (SHA ${GITHUB_HEAD_SHA})`); - - const compressed = await compress(files, dir); - console.log(`Packed to ${compressed.length / 1000}kB`); - - const data = { - pr: PULL_REQUEST, - sha: GITHUB_HEAD_SHA, - compressed, - }; - - const [user, repo] = GITHUB_REPOSITORY.split('/'); - const url = `https://ci.tc39.es/preview/${user}/${repo}`; - - const payloadSize = JSON.stringify(data).length; - console.log(`Payload size: ${payloadSize / 1000}kB`); - if (payloadSize >= 1000 * 1000 * 6) { - throw Error('Payloads must be under 6MB'); - } - - console.log(`URL posted to: ${url}`); - await tiny.post({ url, data }); - console.log('Sent to preview!') -} - -async function compress(files, basedir) { - return new Promise((resolve, reject) => { - files = [...files]; - const pack = tar.pack(); - - const compressStream = zlib.createBrotliCompress({ - params: { - [zlib.constants.BROTLI_PARAM_QUALITY]: 5, // 30% larger and 100x faster than the default (11) - } - }); - - pack.on('error', reject); - - function packEntry(err) { - if (err) { - reject(err); - return; - } - if (files.length === 0) { - pack.finalize(); - return; - } - - const file = files.pop(); - const name = file.replace(basedir, '').slice(1); - const size = fs.statSync(file).size; - console.log(`Packaging: ${name} (${size / 1000}kB)`); - - const entry = pack.entry({ name, size }, packEntry); - - const readStream = fs.createReadStream(file); - - readStream.on('error', reject); - readStream.pipe(entry); - } - packEntry(); - - const stream = pack.pipe(compressStream); - const chunks = []; - stream.on('data', (chunk) => chunks.push(chunk)); - stream.on('error', reject); - stream.on('end', () => resolve(Buffer.concat(chunks).toString('base64'))); - }); -} - - -go().catch((err) => { - console.error(err); - process.exitCode = 1; -}); diff --git a/scripts/snapshot_warning.css b/scripts/snapshot_warning.css deleted file mode 100644 index 399d56d42f..0000000000 --- a/scripts/snapshot_warning.css +++ /dev/null @@ -1,66 +0,0 @@ -details.annoying-warning { - background-color: #920800; - background-image: linear-gradient(transparent 40%, rgba(255, 255, 255, 0.2)); - border: solid rgba(0, 0, 0, 0.4); - border-radius: 3px; - border-width: 1px 1px 0 1px; - box-shadow: 0 0 0.5em rgba(0, 0, 0, 0.5); - color: rgba(255, 255, 255, 0.95); - opacity: .95; - position: fixed; - left: 5%; - margin: 0 auto; - right: 5%; - z-index: 10; -} - -details.annoying-warning[open] { - top: 10%; - top: calc(5vw + 5vh); - max-width: 1024px; - outline: solid 10000px rgba(255, 255, 255, 0.6); -} - -details.annoying-warning:not([open]) { - bottom: 0; - left: 0; - right: 0; - border-radius: 0; -} - -details.annoying-warning > summary { - display: list-item; /* polyfill */ - font-size: 0.875em; - font-weight: bold; - letter-spacing: 0.02em; - padding: 10px 5px; - text-align: center; - text-transform: uppercase; - text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.85); - cursor: default; -} - -details.annoying-warning > summary::after { - content: " Expand"; - position: absolute; - top: 0; - right: 5px; - font-size: smaller; - font-weight: bold; -} - -details.annoying-warning[open] > summary::after { - content: " Collapse"; -} - -details.annoying-warning p { - padding: 0 7.5% 1em; - line-height: 1.4; - margin: 0; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.85); -} - -details.annoying-warning a { - color: white; - text-decoration: underline; -} diff --git a/scripts/snapshot_warning.html b/scripts/snapshot_warning.html deleted file mode 100644 index 3e2043ea2f..0000000000 --- a/scripts/snapshot_warning.html +++ /dev/null @@ -1,15 +0,0 @@ -
- This is a commit snapshot of the specification -

- This document contains the contents of the specification as of - commit {COMMIT}, - and should only be used as a historical reference. This commit may not - have even been merged into the specification. -

-

- Do not attempt to implement this version of the specification. Do not - reference this version as authoritative in any way. Instead, see - https://tc39.es/ecma262 for the - living specification. -

-
diff --git a/scripts/spellcheck.mjs b/scripts/spellcheck.mjs new file mode 100644 index 0000000000..7b9c5ac739 --- /dev/null +++ b/scripts/spellcheck.mjs @@ -0,0 +1,72 @@ +import { promisify } from 'node:util'; +import { exec } from 'node:child_process'; +const execP = promisify(exec); +import { writeFile } from 'node:fs/promises'; + +const MIN_WORD_SIZE = 3; + +const BASE_REF = process.argv[2]; +const ASPELL_OPTS = [ + '--add-html-check=alt,title,caption,variants', + '--ignore-case', + '--master=en_GB-ize', + '--mode=html', + '--run-together', + '--run-together-limit=99', + '--run-together-min=2', + 'list', +].join(' '); + +function makeDict(words) { + return `personal_ws-1.1 en ${words.length}\n${words.join('\n')}`; +} + +function lines(text) { + if (text.length === 0) return []; + return text.split('\n'); +} + +console.log(`base ref: ${BASE_REF}`); + +let { stdout } = await execP(`git show "${BASE_REF}":spec.html | aspell ${ASPELL_OPTS} | sort -fu`); + +let existingWords = lines(stdout.trim()); + +let existingComponents = Array.from(new Set( + existingWords + .flatMap(word => [...word.matchAll(/(?:^[a-z]|[A-Z])[a-z]{2,}/g)]) + .map(([w]) => w.toLowerCase()) +)); + +({ stdout } = await execP(`echo ${existingComponents.map(w => JSON.stringify(w)).join(' ')} | aspell ${ASPELL_OPTS} | sort -fu`)); + +let existingComponentsReduced = lines(stdout.trim()); + +await writeFile('aspell.txt', makeDict(existingComponentsReduced)); + +({ stdout } = await execP(`echo ${existingWords.map(w => JSON.stringify(w)).join(' ')} | aspell --personal=./aspell.txt ${ASPELL_OPTS}`)); + +let novel = [...existingComponentsReduced, ...lines(stdout.trim())].filter(w => w.length >= MIN_WORD_SIZE); +novel.sort(); +console.log(`\npreviously used novel words: ${novel.join(', ')}`); +await writeFile('aspell.txt', makeDict(novel)); + +({ stdout } = await execP(`aspell --personal=./aspell.txt ${ASPELL_OPTS} list w.length >= MIN_WORD_SIZE); + +if (misspellings.length > 0) { + console.log(`\nmisspellings: ${misspellings.join(', ')}`); + let pattern = misspellings.map(w => `-e ${JSON.stringify(w)}`).join(' --or '); + ({ stdout } = await execP(`git grep --line-number --column --fixed-strings --only-matching ${pattern} -- spec.html`)); + + console.log(''); + + let info = lines(stdout.trim()); + for (let warning of info) { + let [match, file, line, col, typo] = warning.match(/^([^:]+):(\d+):(\d+):(.*)$/); + let title = 'Potential Typo'; + let message = `${JSON.stringify(typo)} is not a previously used word or composed of previously used words. Perhaps it is a typo?`; + // https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message + console.log(`::warning file=${file},line=${line},endLine=${line},col=${col},endColumn=${col + typo.length},title=${title}::${message}`); + } +} diff --git a/spec.html b/spec.html index b53a6a0c3b..0d26070290 100644 --- a/spec.html +++ b/spec.html @@ -2,7 +2,29 @@ + +

About this Specification

-

The document at https://tc39.es/ecma262/ is the most accurate and up-to-date ECMAScript specification. It contains the content of the most recent yearly snapshot plus any finished proposals (those that have reached Stage 4 in the proposal process and thus are implemented in several implementations and will be in the next practical revision) since that snapshot was taken.

+

The document at https://tc39.es/ecma262/ is the most accurate and up-to-date ECMAScript specification. It contains the content of the most recent yearly snapshot plus any finished proposals — those that have reached Stage 4 in the proposal process and thus are implemented in several implementations and will be included in the next yearly snapshot. Historical snapshots are available at https://ecma-international.org/publications-and-standards/standards/ecma-262/.

This document is available as a single page and as multiple pages.

Contributing to this Specification

This specification is developed on GitHub with the help of the ECMAScript community. There are a number of ways to contribute to the development of this specification:

@@ -49,9 +192,9 @@

Contributing to this Specification

  • Editors:
  • @@ -68,8 +211,7 @@

    Contributing to this Specification

    Introduction

    -

    This Ecma Standard defines the ECMAScript 2025 Language. It is the sixteenth edition of the ECMAScript Language Specification. Since publication of the first edition in 1997, ECMAScript has grown to be one of the world's most widely used general-purpose programming languages. It is best known as the language embedded in web browsers but has also been widely adopted for server and embedded applications.

    -

    ECMAScript is based on several originating technologies, the most well-known being JavaScript (Netscape) and JScript (Microsoft). The language was invented by Brendan Eich at Netscape and first appeared in that company's Navigator 2.0 browser. It has appeared in all subsequent browsers from Netscape and in all browsers from Microsoft starting with Internet Explorer 3.0.

    +

    This Ecma Standard defines the ECMAScript 2027 Language. It is the eighteenth 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 invented by Brendan Eich at Netscape and first appeared in that company's Navigator 2.0 browser. Though best known as the language embedded in web browsers, it has also been widely adopted for use outside the browser, including server and embedded applications, and has grown to be one of the world's most widely used general-purpose programming languages.

    The development of the ECMAScript Language Specification started in November 1996. The first edition of this Ecma Standard was adopted by the Ecma General Assembly of June 1997.

    That Ecma Standard was submitted to ISO/IEC JTC 1 for adoption under the fast-track procedure, and approved as international standard ISO/IEC 16262, in April 1998. The Ecma General Assembly of June 1998 approved the second edition of ECMA-262 to keep it fully aligned with ISO/IEC 16262. Changes between the first and the second edition are editorial in nature.

    The third edition of the Standard introduced powerful regular expressions, better string handling, new control statements, try/catch exception handling, tighter definition of errors, formatting for numeric output and minor changes in anticipation of future language growth. The third edition of the ECMAScript standard was adopted by the Ecma General Assembly of December 1999 and published as ISO/IEC 16262:2002 in June 2002.

    @@ -79,13 +221,14 @@

    Introduction

    Focused development of the sixth edition started in 2009, as the fifth edition was being prepared for publication. However, this was preceded by significant experimentation and language enhancement design efforts dating to the publication of the third edition in 1999. In a very real sense, the completion of the sixth edition is the culmination of a fifteen year effort. The goals for this edition included providing better support for large applications, library creation, and for use of ECMAScript as a compilation target for other languages. Some of its major enhancements included modules, class declarations, lexical block scoping, iterators and generators, promises for asynchronous programming, destructuring patterns, and proper tail calls. The ECMAScript library of built-ins was expanded to support additional data abstractions including maps, sets, and arrays of binary numeric values as well as additional support for Unicode supplementary characters in strings and regular expressions. The built-ins were also made extensible via subclassing. The sixth edition provides the foundation for regular, incremental language and library enhancements. The sixth edition was adopted by the General Assembly of June 2015.

    ECMAScript 2016 was the first ECMAScript edition released under Ecma TC39's new yearly release cadence and open development process. A plain-text source document was built from the ECMAScript 2015 source document to serve as the base for further development entirely on GitHub. Over the year of this standard's development, hundreds of pull requests and issues were filed representing thousands of bug fixes, editorial fixes and other improvements. Additionally, numerous software tools were developed to aid in this effort including Ecmarkup, Ecmarkdown, and Grammarkdown. ES2016 also included support for a new exponentiation operator and adds a new method to `Array.prototype` called `includes`.

    ECMAScript 2017 introduced Async Functions, Shared Memory, and Atomics along with smaller language and library enhancements, bug fixes, and editorial updates. Async functions improve the asynchronous programming experience by providing syntax for promise-returning functions. Shared Memory and Atomics introduce a new memory model that allows multi-agent programs to communicate using atomic operations that ensure a well-defined execution order even on parallel CPUs. It also included new static methods on Object: `Object.values`, `Object.entries`, and `Object.getOwnPropertyDescriptors`.

    -

    ECMAScript 2018 introduced support for asynchronous iteration via the AsyncIterator protocol and async generators. It also included four new regular expression features: the `dotAll` flag, named capture groups, Unicode property escapes, and look-behind assertions. Lastly it included object rest and spread properties.

    +

    ECMAScript 2018 introduced support for asynchronous iteration via the async iterator protocol and async generators. It also included four new regular expression features: the `dotAll` flag, named capture groups, Unicode property escapes, and look-behind assertions. Lastly it included object rest and spread properties.

    ECMAScript 2019 introduced a few new built-in functions: `flat` and `flatMap` on `Array.prototype` for flattening arrays, `Object.fromEntries` for directly turning the return value of `Object.entries` into a new Object, and `trimStart` and `trimEnd` on `String.prototype` as better-named alternatives to the widely implemented but non-standard `String.prototype.trimLeft` and `trimRight` built-ins. In addition, it included a few minor updates to syntax and semantics. Updated syntax included optional catch binding parameters and allowing U+2028 (LINE SEPARATOR) and U+2029 (PARAGRAPH SEPARATOR) in string literals to align with JSON. Other updates included requiring that `Array.prototype.sort` be a stable sort, requiring that `JSON.stringify` return well-formed UTF-8 regardless of input, and clarifying `Function.prototype.toString` by requiring that it either return the corresponding original source text or a standard placeholder.

    ECMAScript 2020, the 11th edition, introduced the `matchAll` method for Strings, to produce an iterator for all match objects generated by a global regular expression; `import()`, a syntax to asynchronously import Modules with a dynamic specifier; `BigInt`, a new number primitive for working with arbitrary precision integers; `Promise.allSettled`, a new Promise combinator that does not short-circuit; `globalThis`, a universal way to access the global `this` value; dedicated `export * as ns from 'module'` syntax for use within modules; increased standardization of `for-in` enumeration order; `import.meta`, a host-populated object available in Modules that may contain contextual information about the Module; as well as adding two new syntax features to improve working with “nullish” values (*undefined* or *null*): nullish coalescing, a value selection operator; and optional chaining, a property access and function invocation operator that short-circuits if the value to access/invoke is nullish.

    ECMAScript 2021, the 12th edition, introduced the `replaceAll` method for Strings; `Promise.any`, a Promise combinator that short-circuits when an input value is fulfilled; `AggregateError`, a new Error type to represent multiple errors at once; logical assignment operators (`??=`, `&&=`, `||=`); `WeakRef`, for referring to a target object without preserving it from garbage collection, and `FinalizationRegistry`, to manage registration and unregistration of cleanup operations performed when target objects are garbage collected; separators for numeric literals (`1_000`); and `Array.prototype.sort` was made more precise, reducing the amount of cases that result in an implementation-defined sort order.

    ECMAScript 2022, the 13th edition, introduced top-level `await`, allowing the keyword to be used at the top level of modules; new class elements: public and private instance fields, public and private static fields, private instance methods and accessors, and private static methods and accessors; static blocks inside classes, to perform per-class evaluation initialization; the `#x in obj` syntax, to test for presence of private fields on objects; regular expression match indices via the `/d` flag, which provides start and end indices for matched substrings; the `cause` property on `Error` objects, which can be used to record a causation chain in errors; the `at` method for Strings, Arrays, and TypedArrays, which allows relative indexing; and `Object.hasOwn`, a convenient alternative to `Object.prototype.hasOwnProperty`.

    ECMAScript 2023, the 14th edition, introduced the `toSorted`, `toReversed`, `with`, `findLast`, and `findLastIndex` methods on `Array.prototype` and `TypedArray.prototype`, as well as the `toSpliced` method on `Array.prototype`; added support for `#!` comments at the beginning of files to better facilitate executable ECMAScript files; and allowed the use of most Symbols as keys in weak collections.

    ECMAScript 2024, the 15th edition, added facilities for resizing and transferring ArrayBuffers and SharedArrayBuffers; added a new RegExp `/v` flag for creating RegExps with more advanced features for working with sets of strings; and introduced the `Promise.withResolvers` convenience method for constructing Promises, the `Object.groupBy` and `Map.groupBy` methods for aggregating data, the `Atomics.waitAsync` method for asynchronously waiting for a change to shared memory, and the `String.prototype.isWellFormed` and `String.prototype.toWellFormed` methods for checking and ensuring that strings contain only well-formed Unicode.

    +

    ECMAScript 2025, the 16th edition, added a new `Iterator` global with associated static and prototype methods for working with iterators; added methods to `Set.prototype` for performing common operations on Sets; added support for importing JSON modules as well as syntax for declaring attributes of imported modules; added the `RegExp.escape` method for escaping a string to be safely used in a regular expression; added syntax for enabling and disabling modifier flags inline within regular expressions; added the `Promise.try` method for calling functions which may or may not return a `Promise` and ensuring the result is always a `Promise`; and added a new `Float16Array` TypedArray kind as well as the related `DataView.prototype.getFloat16`, `DataView.prototype.setFloat16`, and `Math.f16round` methods.

    Dozens of individuals representing many organizations have made very significant contributions within Ecma TC39 to the development of this edition and to the prior editions. In addition, a vibrant community has emerged supporting TC39's ECMAScript efforts. This community has reviewed numerous drafts, filed thousands of bug reports, performed implementation experiments, contributed test suites, and educated the world-wide developer community about ECMAScript. Unfortunately, it is impossible to identify and acknowledge every person and organization who has contributed to this effort.

    Allen Wirfs-Brock
    @@ -99,23 +242,39 @@

    Introduction

    Jordan Harband
    ECMA-262, Project Editor, 10th through 12th Editions

    +

    + Kevin Gibbons
    + ECMA-262, Project Editor, 12th through 17th Editions +

    Shu-yu Guo
    - ECMA-262, Project Editor, 12th through 15th Editions + ECMA-262, Project Editor, 12th through 18th Editions

    Michael Ficarra
    - ECMA-262, Project Editor, 12th through 15th Editions + ECMA-262, Project Editor, 12th through 18th Editions

    - Kevin Gibbons
    - ECMA-262, Project Editor, 12th through 15th Editions + Richard Gibson
    + ECMA-262, Project Editor, 18th Edition +

    +

    + Ron Buckton
    + ECMA-262, Project Editor, 18th Edition +

    +

    + Nicolò Ribaudo
    + ECMA-262, Project Editor, 18th Edition +

    +

    + Linus Groh
    + ECMA-262, Project Editor, 18th Edition

    Scope

    -

    This Standard defines the ECMAScript 2025 general-purpose programming language.

    +

    This Standard defines the ECMAScript 2027 general-purpose programming language.

    @@ -127,7 +286,7 @@

    Conformance

    A conforming implementation of ECMAScript may support program and regular expression syntax not described in this specification. In particular, a conforming implementation of ECMAScript may support program syntax that makes use of any “future reserved words” noted in subclause of this specification.

    A conforming implementation of ECMAScript must not implement any extension that is listed as a Forbidden Extension in subclause .

    A conforming implementation of ECMAScript must not redefine any facilities that are not implementation-defined, implementation-approximated, or host-defined.

    -

    A conforming implementation of ECMAScript may choose to implement or not implement Normative Optional subclauses. If any Normative Optional behaviour is implemented, all of the behaviour in the containing Normative Optional clause must be implemented. A Normative Optional clause is denoted in this specification with the words "Normative Optional" in a coloured box, as shown below.

    +

    A conforming implementation of ECMAScript may choose to implement or not implement Normative Optional subclauses, unless otherwise indicated. Web browsers are generally required to implement all normative optional subclauses. (See Annex .) If any Normative Optional behaviour is implemented, all of the behaviour in the containing Normative Optional clause must be implemented. A Normative Optional clause is denoted in this specification with the words "Normative Optional" in a coloured box, as shown below.

    Example Normative Optional Clause Heading

    @@ -386,7 +545,7 @@

    Number value

    Number type

    -

    set of all possible Number values including the special “Not-a-Number” (NaN) value, positive infinity, and negative infinity

    +

    set of all possible Number values including *NaN* (“not a number”), *+∞*𝔽 (positive infinity), and *-∞*𝔽 (negative infinity)

    @@ -404,7 +563,7 @@

    Infinity

    NaN

    -

    Number value that is an IEEE 754-2019 “Not-a-Number” value

    +

    Number value that is an IEEE 754-2019 NaN (“not a number”) value

    @@ -686,7 +845,7 @@

    Grammatical Parameters

    ReturnStatement ExpressionStatement -

    Multiple parameters produce a combinatory number of productions, not all of which are necessarily referenced in a complete grammar.

    +

    Multiple parameters produce a combinatoric number of productions, not all of which are necessarily referenced in a complete grammar.

    References to nonterminals on the right-hand side of a production can also be parameterized. For example:

    StatementList : @@ -869,6 +1028,25 @@

    Algorithm Conventions

    Algorithm steps may declare named aliases for any value using the form “Let _x_ be _someValue_”. These aliases are reference-like in that both _x_ and _someValue_ refer to the same underlying data and modifications to either are visible to both. Algorithm steps that want to avoid this reference-like behaviour should explicitly make a copy of the right-hand side: “Let _x_ be a copy of _someValue_” creates a shallow copy of _someValue_.

    Once declared, an alias may be referenced in any subsequent steps and must not be referenced from steps prior to the alias's declaration. Aliases may be modified using the form “Set _x_ to _someOtherValue_”.

    + +

    Evaluation Order

    +

    When complex expressions appear in algorithm steps, these are to be understood as being evaluated in a left-to-right, inside-to-outside order. For example, the step

    + + 1. Return A(B(), C.[[D]]) + E(F()). + +

    is equivalent to

    + + 1. Let _tmp1_ be B(). + 1. Let _tmp2_ be C.[[D]]. + 1. Let _tmp3_ be A(_tmp1_, _tmp2_). + 1. Let _tmp4_ be F(). + 1. Let _tmp5_ be E(_tmp4_). + 1. Let _tmp6_ be _tmp3_ + _tmp5_. + 1. Return _tmp6_. + +

    where the various _tmpN_ aliases are ephemeral and visible only in these steps.

    +
    +

    Abstract Operations

    In order to facilitate their use in multiple parts of this specification, some algorithms, called abstract operations, are named and written in parameterized functional form so that they may be referenced by name from within other algorithms. Abstract operations are typically referenced using a functional application style such as OperationName(_arg1_, _arg2_). Some abstract operations are treated as polymorphically dispatched methods of class-like specification abstractions. Such method-like abstract operations are typically referenced using a method application style such as _someValue_.OperationName(_arg1_, _arg2_).

    @@ -911,6 +1089,8 @@

    description
    It is used to emphasize that a Completion Record is being returned.
    +
    skip return checks
    +
    true
    1. Assert: _completionRecord_ is a Completion Record. @@ -930,74 +1110,44 @@

    Throw an Exception

    - -

    ReturnIfAbrupt

    -

    Algorithms steps that say or are otherwise equivalent to:

    - - 1. ReturnIfAbrupt(_argument_). - -

    mean the same thing as:

    - - 1. Assert: _argument_ is a Completion Record. - 1. If _argument_ is an abrupt completion, return Completion(_argument_). - 1. Else, set _argument_ to _argument_.[[Value]]. - -

    Algorithms steps that say or are otherwise equivalent to:

    - - 1. ReturnIfAbrupt(AbstractOperation()). - -

    mean the same thing as:

    - - 1. Let _hygienicTemp_ be AbstractOperation(). - 1. Assert: _hygienicTemp_ is a Completion Record. - 1. If _hygienicTemp_ is an abrupt completion, return Completion(_hygienicTemp_). - 1. Else, set _hygienicTemp_ to _hygienicTemp_.[[Value]]. - -

    Where _hygienicTemp_ is ephemeral and visible only in the steps pertaining to ReturnIfAbrupt.

    -

    Algorithms steps that say or are otherwise equivalent to:

    - - 1. Let _result_ be AbstractOperation(ReturnIfAbrupt(_argument_)). - -

    mean the same thing as:

    - - 1. Assert: _argument_ is a Completion Record. - 1. If _argument_ is an abrupt completion, return Completion(_argument_). - 1. Else, set _argument_ to _argument_.[[Value]]. - 1. Let _result_ be AbstractOperation(_argument_). - -
    - - -

    ReturnIfAbrupt Shorthands

    -

    Invocations of abstract operations and syntax-directed operations that are prefixed by `?` indicate that ReturnIfAbrupt should be applied to the resulting Completion Record. For example, the step:

    + +

    Shorthands for Unwrapping Completion Records

    +

    Prefix `?` and `!` are used as shorthands which unwrap Completion Records. `?` is used to propagate an abrupt completion to the caller, or otherwise to unwrap a normal completion. `!` is used to assert that a Completion Record is normal and unwrap it. Formally, the step

    - 1. ? OperationName(). + 1. Let _result_ be ? _record_. -

    is equivalent to the following step:

    +

    is equivalent to

    - 1. ReturnIfAbrupt(OperationName()). + 1. Assert: _record_ is a Completion Record. + 1. If _record_ is an abrupt completion, return _record_. + 1. Let _result_ be _record_.[[Value]]. -

    Similarly, for method application style, the step:

    +

    Likewise, the step

    - 1. ? _someValue_.OperationName(). + 1. Let _result_ be ! _record_. -

    is equivalent to:

    +

    is equivalent to

    - 1. ReturnIfAbrupt(_someValue_.OperationName()). + 1. Assert: _record_ is a normal completion. + 1. Let _result_ be _record_.[[Value]]. -

    Similarly, prefix `!` is used to indicate that the following invocation of an abstract or syntax-directed operation will never return an abrupt completion and that the resulting Completion Record's [[Value]] field should be used in place of the return value of the operation. For example, the step:

    +

    When `?` or `!` is used in any other context, first apply the rewrite given in until this rule can be applied, then apply this rule. For example, the step

    - 1. Let _val_ be ! OperationName(). + 1. Perform AO(? Other()). -

    is equivalent to the following steps:

    +

    can be rewritten to

    - 1. Let _val_ be OperationName(). - 1. Assert: _val_ is a normal completion. - 1. Set _val_ to _val_.[[Value]]. + 1. Let _tmp1_ be Other(). + 1. Let _tmp2_ be ? _tmp1_. + 1. Perform AO(_tmp2_). -

    Syntax-directed operations for runtime semantics make use of this shorthand by placing `!` or `?` before the invocation of the operation:

    +

    which in turn expands to

    - 1. Perform ! SyntaxDirectedOperation of |NonTerminal|. + 1. Let _tmp1_ be Other(). + 1. Assert: _tmp1_ is a Completion Record. + 1. If _tmp1_ is an abrupt completion, return _tmp1_. + 1. Let _tmp2_ be _tmp1_.[[Value]]. + 1. Perform AO(_tmp2_).
    @@ -1005,7 +1155,7 @@

    ReturnIfAbrupt Shorthands

    Implicit Normal Completion

    In algorithms within abstract operations which are declared to return a Completion Record, and within all built-in functions, the returned value is first passed to NormalCompletion, and the result is used instead. This rule does not apply within the Completion algorithm or when the value being returned is clearly marked as a Completion Record in that step; these cases are:

      -
    • when the result of applying Completion, NormalCompletion, or ThrowCompletion is directly returned
    • +
    • when the result of applying Completion, NormalCompletion, ThrowCompletion, or ReturnCompletion is directly returned
    • when the result of constructing a Completion Record is directly returned

    It is an editorial error if a Completion Record is returned from such an abstract operation through any other means. For example, within these abstract operations,

    @@ -1025,7 +1175,7 @@

    Implicit Normal Completion

    1. Return Completion Record { [[Type]]: ~normal~, [[Value]]: *true*, [[Target]]: ~empty~ }. -

    Note that, through the ReturnIfAbrupt expansion, the following example is allowed, as within the expanded steps, the result of applying Completion is returned directly in the abrupt case and the implicit NormalCompletion application occurs after unwrapping in the normal case.

    +

    Note that, through the ? shorthand expansion, the following example is allowed, as within the expanded steps, the result of applying Completion is returned directly in the abrupt case and the implicit NormalCompletion application occurs after unwrapping in the normal case.

    1. Return ? _completion_. @@ -1056,10 +1206,11 @@

    Mathematical Operations

    In the language of this specification, numerical values are distinguished among different numeric kinds using subscript suffixes. The subscript 𝔽 refers to Numbers, and the subscript refers to BigInts. Numeric values without a subscript suffix refer to mathematical values. This specification denotes most numeric values in base 10; it also uses numeric values of the form 0x followed by digits 0-9 or A-F as base-16 values.

    In general, when this specification refers to a numerical value, such as in the phrase, "the length of _y_" or "the integer represented by the four hexadecimal digits ...", without explicitly specifying a numeric kind, the phrase refers to a mathematical value. Phrases which refer to a Number or a BigInt value are explicitly annotated as such; for example, "the Number value for the number of code points in …" or "the BigInt value for …".

    -

    When the term integer is used in this specification, it refers to a mathematical value which is in the set of integers, unless otherwise stated. When the term integral Number is used in this specification, it refers to a Number value whose mathematical value is in the set of integers.

    +

    When the term integer is used in this specification, it refers to a mathematical value which is in the set of integers, unless otherwise stated. When the term integral Number is used in this specification, it refers to a finite Number value whose mathematical value is in the set of integers.

    Numeric operators such as +, ×, =, and ≥ refer to those operations as determined by the type of the operands. When applied to mathematical values, the operators refer to the usual mathematical operations. When applied to extended mathematical values, the operators refer to the usual mathematical operations over the extended real numbers; indeterminate forms are not defined and their use in this specification should be considered an editorial error. When applied to Numbers, the operators refer to the relevant operations within IEEE 754-2019. When applied to BigInts, the operators refer to the usual mathematical operations applied to the mathematical value of the BigInt. Numeric operators applied to mixed-type operands (such as a Number and a mathematical value) are not defined and should be considered an editorial error in this specification.

    Conversions between mathematical values and Numbers or BigInts are always explicit in this document. A conversion from a mathematical value or extended mathematical value _x_ to a Number is denoted as "the Number value for _x_" or 𝔽(_x_), and is defined in . A conversion from an integer _x_ to a BigInt is denoted as "the BigInt value for _x_" or ℤ(_x_). A conversion from a Number or BigInt _x_ to a mathematical value is denoted as "the mathematical value of _x_", or ℝ(_x_). The mathematical value of *+0*𝔽 and *-0*𝔽 is the mathematical value 0. The mathematical value of non-finite values is not defined. The extended mathematical value of _x_ is the mathematical value of _x_ for finite values, and is +∞ and -∞ for *+∞*𝔽 and *-∞*𝔽 respectively; it is not defined for *NaN*.

    The mathematical function abs(_x_) produces the absolute value of _x_, which is -_x_ if _x_ < 0 and otherwise is _x_ itself.

    +

    The mathematical function ln(_x_) produces the natural logarithm of _x_. The mathematical function log10(_x_) produces the base 10 logarithm of _x_. The mathematical function log2(_x_) produces the base 2 logarithm of _x_.

    The mathematical function min(_x1_, _x2_, … , _xN_) produces the mathematically smallest of _x1_ through _xN_. The mathematical function max(_x1_, _x2_, ..., _xN_) produces the mathematically largest of _x1_ through _xN_. The domain and range of these mathematical functions are the extended mathematical values.

    The notation “_x_ modulo _y_” (_y_ must be finite and non-zero) computes a value _k_ of the same sign as _y_ (or zero) such that abs(_k_) < abs(_y_) and _x_ - _k_ = _q_ × _y_ for some integer _q_.

    The phrase "the result of clamping _x_ between _lower_ and _upper_" (where _x_ is an extended mathematical value and _lower_ and _upper_ are mathematical values such that _lower_ ≤ _upper_) produces _lower_ if _x_ < _lower_, produces _upper_ if _x_ > _upper_, and otherwise produces _x_.

    @@ -1095,10 +1246,9 @@

    Identity

    - +

    ECMAScript Data Types and Values

    -

    Algorithms within this specification manipulate values each of which has an associated type. The possible value types are exactly those defined in this clause. Types are further subclassified into ECMAScript language types and specification types.

    -

    Within this specification, the notation “Type(_x_)” is used as shorthand for “the type of _x_” where “type” refers to the ECMAScript language and specification types defined in this clause.

    +

    Algorithms within this specification manipulate values each of which has an associated type. The possible value types are exactly those defined in this clause. Types are further classified into ECMAScript language types and specification types.

    ECMAScript Language Types

    @@ -1201,40 +1351,43 @@

    The Symbol Type

    The Symbol type is the set of all non-String values that may be used as the key of an Object property ().

    -

    Each possible Symbol value is unique and immutable.

    -

    Each Symbol value immutably holds an associated value called [[Description]] that is either *undefined* or a String value.

    +

    Each Symbol is unique and immutable.

    +

    Each Symbol has an immutable [[Description]] internal slot whose value is either a String or *undefined*.

    Well-Known Symbols

    Well-known symbols are built-in Symbol values that are explicitly referenced by algorithms of this specification. They are typically used as the keys of properties whose values serve as extension points of a specification algorithm. Unless otherwise specified, well-known symbols values are shared by all realms ().

    -

    Within this specification a well-known symbol is referred to by using a notation of the form @@name, where “name” is one of the values listed in .

    +

    Within this specification a well-known symbol is referred to using the standard intrinsic notation where the intrinsic is one of the values listed in .

    + Previous editions of this specification used a notation of the form @@name, where the current edition would use `%Symbol.name%`. In particular, the following names were used: @@asyncIterator, @@hasInstance, @@isConcatSpreadable, @@iterator, @@match, @@matchAll, @@replace, @@search, @@species, @@split, @@toPrimitive, @@toStringTag, and @@unscopables. - - - - - + + + + + + +
    - Specification Name - - [[Description]] - - Value and Purpose -
    + Specification Name + + [[Description]] + + Value and Purpose +
    - @@asyncIterator + %Symbol.asyncIterator% *"Symbol.asyncIterator"* - A method that returns the default AsyncIterator for an object. Called by the semantics of the `for`-`await`-`of` statement. + A method that returns the default async iterator for an object. Called by the semantics of the `for`-`await`-`of` statement.
    - @@hasInstance + %Symbol.hasInstance% *"Symbol.hasInstance"* @@ -1245,7 +1398,7 @@

    Well-Known Symbols

    - @@isConcatSpreadable + %Symbol.isConcatSpreadable% *"Symbol.isConcatSpreadable"* @@ -1256,18 +1409,18 @@

    Well-Known Symbols

    - @@iterator + %Symbol.iterator% *"Symbol.iterator"* - A method that returns the default Iterator for an object. Called by the semantics of the for-of statement. + A method that returns the default iterator for an object. Called by the semantics of the for-of statement.
    - @@match + %Symbol.match% *"Symbol.match"* @@ -1278,18 +1431,18 @@

    Well-Known Symbols

    - @@matchAll + %Symbol.matchAll% *"Symbol.matchAll"* - A regular expression method that returns an iterator, that yields matches of the regular expression against a string. Called by the `String.prototype.matchAll` method. + A regular expression method that returns an iterator that yields matches of the regular expression against a string. Called by the `String.prototype.matchAll` method.
    - @@replace + %Symbol.replace% *"Symbol.replace"* @@ -1300,7 +1453,7 @@

    Well-Known Symbols

    - @@search + %Symbol.search% *"Symbol.search"* @@ -1311,7 +1464,7 @@

    Well-Known Symbols

    - @@species + %Symbol.species% *"Symbol.species"* @@ -1322,7 +1475,7 @@

    Well-Known Symbols

    - @@split + %Symbol.split% *"Symbol.split"* @@ -1333,7 +1486,7 @@

    Well-Known Symbols

    - @@toPrimitive + %Symbol.toPrimitive% *"Symbol.toPrimitive"* @@ -1344,7 +1497,7 @@

    Well-Known Symbols

    - @@toStringTag + %Symbol.toStringTag% *"Symbol.toStringTag"* @@ -1355,7 +1508,7 @@

    Well-Known Symbols

    - @@unscopables + %Symbol.unscopables% *"Symbol.unscopables"* @@ -1374,20 +1527,22 @@

    Numeric Types

    ECMAScript has two built-in numeric types: Number and BigInt. The following abstract operations are defined over these numeric types. The "Result" column shows the return type, along with an indication if it is possible for some invocations of the operation to return an abrupt completion.

    - - - - - - + + + + + + + +
    - Operation - - Example source - - Invoked by the Evaluation semantics of ... - - Result -
    + Operation + + Example source + + Invoked by the Evaluation semantics of ... + + Result +
    @@ -1728,9 +1883,8 @@

    Numeric Types

    `[x].includes(y)`
    - Array, Map, and Set methods, via , - to test value equality, ignoring the difference between *+0*𝔽 and *-0*𝔽 + to test value equality, ignoring the difference between *+0*𝔽 and *-0*𝔽, as in Array, Map, and Set methods Boolean @@ -1828,7 +1982,7 @@

    Numeric Types

    The Number Type

    -

    The Number type has exactly 18,437,736,874,454,810,627 (that is, 264 - 253 + 3) values, representing the double-precision floating point IEEE 754-2019 binary64 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic, except that the 9,007,199,254,740,990 (that is, 253 - 2) distinct “Not-a-Number” values of the IEEE Standard are represented in ECMAScript as a single special *NaN* value. (Note that the *NaN* value is produced by the program expression `NaN`.) In some implementations, external code might be able to detect a difference between various Not-a-Number values, but such behaviour is implementation-defined; to ECMAScript code, all *NaN* values are indistinguishable from each other.

    +

    The Number type has exactly 18,437,736,874,454,810,627 (that is, 264 - 253 + 3) values, representing the double-precision floating point IEEE 754-2019 binary64 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic, except that the 9,007,199,254,740,990 (that is, 253 - 2) distinct NaN values of the IEEE Standard are represented in ECMAScript as a single special *NaN* value. (Note that the *NaN* value is produced by the program expression `NaN`.) In some implementations, external code might be able to detect a difference between various NaN values, but such behaviour is implementation-defined; to ECMAScript code, all *NaN* values are indistinguishable from each other.

    The bit pattern that might be observed in an ArrayBuffer (see ) or a SharedArrayBuffer (see ) after a Number value has been stored into it is not necessarily the same as the internal representation of that Number value used by the ECMAScript implementation.

    @@ -1862,7 +2016,7 @@

    1. If _x_ is *NaN*, return *NaN*. - 1. Return the result of negating _x_; that is, compute a Number with the same magnitude but opposite sign. + 1. Return the negation of _x_; that is, compute a Number with the same magnitude but opposite sign. @@ -1876,7 +2030,7 @@

    1. Let _oldValue_ be ! ToInt32(_x_). - 1. Return the result of applying bitwise complement to _oldValue_. The mathematical value of the result is exactly representable as a 32-bit two's complement bit string. + 1. Return the bitwise complement of _oldValue_. The mathematical value of the result is exactly representable as a 32-bit two's complement bit string. @@ -1896,28 +2050,32 @@

    1. If _exponent_ is either *+0*𝔽 or *-0*𝔽, return *1*𝔽. 1. If _base_ is *NaN*, return *NaN*. 1. If _base_ is *+∞*𝔽, then - 1. If _exponent_ > *+0*𝔽, return *+∞*𝔽. Otherwise, return *+0*𝔽. + 1. If _exponent_ > *+0*𝔽, return *+∞*𝔽. + 1. Return *+0*𝔽. 1. If _base_ is *-∞*𝔽, then 1. If _exponent_ > *+0*𝔽, then - 1. If _exponent_ is an odd integral Number, return *-∞*𝔽. Otherwise, return *+∞*𝔽. - 1. Else, - 1. If _exponent_ is an odd integral Number, return *-0*𝔽. Otherwise, return *+0*𝔽. + 1. If _exponent_ is an odd integral Number, return *-∞*𝔽. + 1. Return *+∞*𝔽. + 1. If _exponent_ is an odd integral Number, return *-0*𝔽. + 1. Return *+0*𝔽. 1. If _base_ is *+0*𝔽, then - 1. If _exponent_ > *+0*𝔽, return *+0*𝔽. Otherwise, return *+∞*𝔽. + 1. If _exponent_ > *+0*𝔽, return *+0*𝔽. + 1. Return *+∞*𝔽. 1. If _base_ is *-0*𝔽, then 1. If _exponent_ > *+0*𝔽, then - 1. If _exponent_ is an odd integral Number, return *-0*𝔽. Otherwise, return *+0*𝔽. - 1. Else, - 1. If _exponent_ is an odd integral Number, return *-∞*𝔽. Otherwise, return *+∞*𝔽. + 1. If _exponent_ is an odd integral Number, return *-0*𝔽. + 1. Return *+0*𝔽. + 1. If _exponent_ is an odd integral Number, return *-∞*𝔽. + 1. Return *+∞*𝔽. 1. Assert: _base_ is finite and is neither *+0*𝔽 nor *-0*𝔽. 1. If _exponent_ is *+∞*𝔽, then 1. If abs(ℝ(_base_)) > 1, return *+∞*𝔽. 1. If abs(ℝ(_base_)) = 1, return *NaN*. - 1. If abs(ℝ(_base_)) < 1, return *+0*𝔽. + 1. Return *+0*𝔽. 1. If _exponent_ is *-∞*𝔽, then 1. If abs(ℝ(_base_)) > 1, return *+0*𝔽. 1. If abs(ℝ(_base_)) = 1, return *NaN*. - 1. If abs(ℝ(_base_)) < 1, return *+∞*𝔽. + 1. Return *+∞*𝔽. 1. Assert: _exponent_ is finite and is neither *+0*𝔽 nor *-0*𝔽. 1. If _base_ < *-0*𝔽 and _exponent_ is not an integral Number, return *NaN*. 1. Return an implementation-approximated Number value representing the result of raising ℝ(_base_) to the ℝ(_exponent_) power. @@ -1950,10 +2108,10 @@

    1. Return -_y_. 1. If _x_ is *-0*𝔽, then 1. If _y_ is *-0*𝔽 or _y_ < *-0*𝔽, return *+0*𝔽. - 1. Else, return *-0*𝔽. + 1. Return *-0*𝔽. 1. If _y_ is *-0*𝔽, then 1. If _x_ < *-0*𝔽, return *+0*𝔽. - 1. Else, return *-0*𝔽. + 1. Return *-0*𝔽. 1. Return 𝔽(ℝ(_x_) × ℝ(_y_)). @@ -1979,17 +2137,21 @@

    1. If _y_ is *+0*𝔽 or _y_ > *+0*𝔽, return _x_. 1. Return -_x_. 1. If _y_ is *+∞*𝔽, then - 1. If _x_ is *+0*𝔽 or _x_ > *+0*𝔽, return *+0*𝔽. Otherwise, return *-0*𝔽. + 1. If _x_ is *+0*𝔽 or _x_ > *+0*𝔽, return *+0*𝔽. + 1. Return *-0*𝔽. 1. If _y_ is *-∞*𝔽, then - 1. If _x_ is *+0*𝔽 or _x_ > *+0*𝔽, return *-0*𝔽. Otherwise, return *+0*𝔽. + 1. If _x_ is *+0*𝔽 or _x_ > *+0*𝔽, return *-0*𝔽. + 1. Return *+0*𝔽. 1. If _x_ is either *+0*𝔽 or *-0*𝔽, then 1. If _y_ is either *+0*𝔽 or *-0*𝔽, return *NaN*. 1. If _y_ > *+0*𝔽, return _x_. 1. Return -_x_. 1. If _y_ is *+0*𝔽, then - 1. If _x_ > *+0*𝔽, return *+∞*𝔽. Otherwise, return *-∞*𝔽. + 1. If _x_ > *+0*𝔽, return *+∞*𝔽. + 1. Return *-∞*𝔽. 1. If _y_ is *-0*𝔽, then - 1. If _x_ > *+0*𝔽, return *-∞*𝔽. Otherwise, return *+∞*𝔽. + 1. If _x_ > *+0*𝔽, return *-∞*𝔽. + 1. Return *+∞*𝔽. 1. Return 𝔽(ℝ(_x_) / ℝ(_y_)). @@ -2079,10 +2241,10 @@

    - 1. Let _lnum_ be ! ToInt32(_x_). - 1. Let _rnum_ be ! ToUint32(_y_). - 1. Let _shiftCount_ be ℝ(_rnum_) modulo 32. - 1. Return the result of left shifting _lnum_ by _shiftCount_ bits. The mathematical value of the result is exactly representable as a 32-bit two's complement bit string. + 1. Let _lNum_ be ! ToInt32(_x_). + 1. Let _rNum_ be ! ToUint32(_y_). + 1. Let _shiftCount_ be ℝ(_rNum_) modulo 32. + 1. Return the result of left shifting _lNum_ by _shiftCount_ bits. The mathematical value of the result is exactly representable as a 32-bit two's complement bit string. @@ -2096,10 +2258,10 @@

    - 1. Let _lnum_ be ! ToInt32(_x_). - 1. Let _rnum_ be ! ToUint32(_y_). - 1. Let _shiftCount_ be ℝ(_rnum_) modulo 32. - 1. Return the result of performing a sign-extending right shift of _lnum_ by _shiftCount_ bits. The most significant bit is propagated. The mathematical value of the result is exactly representable as a 32-bit two's complement bit string. + 1. Let _lNum_ be ! ToInt32(_x_). + 1. Let _rNum_ be ! ToUint32(_y_). + 1. Let _shiftCount_ be ℝ(_rNum_) modulo 32. + 1. Return the result of performing a sign-extending right shift of _lNum_ by _shiftCount_ bits. The most significant bit is propagated. The mathematical value of the result is exactly representable as a 32-bit two's complement bit string. @@ -2113,10 +2275,10 @@

    - 1. Let _lnum_ be ! ToUint32(_x_). - 1. Let _rnum_ be ! ToUint32(_y_). - 1. Let _shiftCount_ be ℝ(_rnum_) modulo 32. - 1. Return the result of performing a zero-filling right shift of _lnum_ by _shiftCount_ bits. Vacated bits are filled with zero. The mathematical value of the result is exactly representable as a 32-bit unsigned bit string. + 1. Let _lNum_ be ! ToUint32(_x_). + 1. Let _rNum_ be ! ToUint32(_y_). + 1. Let _shiftCount_ be ℝ(_rNum_) modulo 32. + 1. Return the result of performing a zero-filling right shift of _lNum_ by _shiftCount_ bits. Vacated bits are filled with zero. The mathematical value of the result is exactly representable as a 32-bit unsigned bit string. @@ -2140,7 +2302,8 @@

    1. If _y_ is *-∞*𝔽, return *false*. 1. If _x_ is *-∞*𝔽, return *true*. 1. Assert: _x_ and _y_ are finite. - 1. If ℝ(_x_) < ℝ(_y_), return *true*. Otherwise, return *false*. + 1. If ℝ(_x_) < ℝ(_y_), return *true*. + 1. Return *false*. @@ -2210,17 +2373,17 @@

    - 1. Let _lnum_ be ! ToInt32(_x_). - 1. Let _rnum_ be ! ToInt32(_y_). - 1. Let _lbits_ be the 32-bit two's complement bit string representing ℝ(_lnum_). - 1. Let _rbits_ be the 32-bit two's complement bit string representing ℝ(_rnum_). + 1. Let _lNum_ be ! ToInt32(_x_). + 1. Let _rNum_ be ! ToInt32(_y_). + 1. Let _lBits_ be the 32-bit two's complement bit string representing ℝ(_lNum_). + 1. Let _rBits_ be the 32-bit two's complement bit string representing ℝ(_rNum_). 1. If _op_ is `&`, then - 1. Let _result_ be the result of applying the bitwise AND operation to _lbits_ and _rbits_. + 1. Let _result_ be the result of applying the bitwise AND operation to _lBits_ and _rBits_. 1. Else if _op_ is `^`, then - 1. Let _result_ be the result of applying the bitwise exclusive OR (XOR) operation to _lbits_ and _rbits_. + 1. Let _result_ be the result of applying the bitwise exclusive OR (XOR) operation to _lBits_ and _rBits_. 1. Else, 1. Assert: _op_ is `|`. - 1. Let _result_ be the result of applying the bitwise inclusive OR operation to _lbits_ and _rbits_. + 1. Let _result_ be the result of applying the bitwise inclusive OR operation to _lBits_ and _rBits_. 1. Return the Number value for the integer represented by the 32-bit two's complement bit string _result_. @@ -2289,18 +2452,17 @@

    1. Return the string-concatenation of: * the code units of the _k_ digits of the representation of _s_ using radix _radix_ * _n_ - _k_ occurrences of the code unit 0x0030 (DIGIT ZERO) - 1. Else if _n_ > 0, then + 1. If _n_ > 0, then 1. Return the string-concatenation of: * the code units of the most significant _n_ digits of the representation of _s_ using radix _radix_ * the code unit 0x002E (FULL STOP) * the code units of the remaining _k_ - _n_ digits of the representation of _s_ using radix _radix_ - 1. Else, - 1. Assert: _n_ ≤ 0. - 1. Return the string-concatenation of: - * the code unit 0x0030 (DIGIT ZERO) - * the code unit 0x002E (FULL STOP) - * -_n_ occurrences of the code unit 0x0030 (DIGIT ZERO) - * the code units of the _k_ digits of the representation of _s_ using radix _radix_ + 1. Assert: _n_ ≤ 0. + 1. Return the string-concatenation of: + * the code unit 0x0030 (DIGIT ZERO) + * the code unit 0x002E (FULL STOP) + * -_n_ occurrences of the code unit 0x0030 (DIGIT ZERO) + * the code units of the _k_ digits of the representation of _s_ using radix _radix_ 1. NOTE: In this case, the input will be represented using scientific E notation, such as `1.2e+3`. 1. Assert: _radix_ is 10. 1. If _n_ < 0, then @@ -2342,7 +2504,7 @@

    Implementers of ECMAScript may find useful the paper and code written by David M. Gay for binary-to-decimal conversion of floating-point numbers:

    Gay, David M. Correctly Rounded Binary-Decimal and Decimal-Binary Conversions. Numerical Analysis, Manuscript 90-10. AT&T Bell Laboratories (Murray Hill, New Jersey). 30 November 1990. Available as
    - http://ampl.com/REFS/abstracts.html#rounding. Associated code available as
    + https://ampl.com/_archive/first-website/REFS/rounding.pdf. Associated code available as
    http://netlib.sandia.gov/fp/dtoa.c and as
    http://netlib.sandia.gov/fp/g_fmt.c and may also be found at the various `netlib` mirror sites.

    @@ -2532,7 +2694,8 @@

    - 1. If ℝ(_x_) < ℝ(_y_), return *true*; otherwise return *false*. + 1. If ℝ(_x_) < ℝ(_y_), return *true*. + 1. Return *false*. @@ -2546,7 +2709,8 @@

    - 1. If ℝ(_x_) = ℝ(_y_), return *true*; otherwise return *false*. + 1. If ℝ(_x_) = ℝ(_y_), return *true*. + 1. Return *false*. @@ -2561,7 +2725,7 @@

    1. If _x_ = 1 and _y_ = 1, return 1. - 1. Else, return 0. + 1. Return 0. @@ -2576,7 +2740,7 @@

    1. If _x_ = 1 or _y_ = 1, return 1. - 1. Else, return 0. + 1. Return 0. @@ -2591,8 +2755,8 @@

    1. If _x_ = 1 and _y_ = 0, return 1. - 1. Else if _x_ = 0 and _y_ = 1, return 1. - 1. Else, return 0. + 1. If _x_ = 0 and _y_ = 1, return 1. + 1. Return 0. @@ -2710,7 +2874,7 @@

    The Object Type

    An accessor property associates a key value with one or two accessor functions, and a set of Boolean attributes. The accessor functions are used to store or retrieve an ECMAScript language value that is associated with the property. -

    The properties of an object are uniquely identified using property keys. A property key is either a String or a Symbol. All Strings and Symbols, including the empty String, are valid as property keys. A property name is a property key that is a String.

    +

    The properties of an object are uniquely identified using property keys. A property key is either a String or a Symbol. All Strings and Symbols, including the empty String, are valid as property keys. A property name is a property key that is a String.

    An integer index is a property name _n_ such that CanonicalNumericIndexString(_n_) returns an integral Number in the inclusive interval from *+0*𝔽 to 𝔽(253 - 1). An array index is an integer index _n_ such that CanonicalNumericIndexString(_n_) returns an integral Number in the inclusive interval from *+0*𝔽 to 𝔽(232 - 2).

    Every non-negative safe integer has a corresponding integer index. Every 32-bit unsigned integer except 232 - 1 has a corresponding array index. *"-0"* is neither an integer index nor an array index.

    @@ -2724,13 +2888,15 @@

    Property Attributes

    Attributes are used in this specification to define and explain the state of Object properties as described in . Unless specified explicitly, the initial value of each attribute is its Default Value.

    - - - - - - - + + + + + + + + +
    Attribute NameTypes of property for which it is presentValue DomainDefault ValueDescription
    Attribute NameTypes of property for which it is presentValue DomainDefault ValueDescription
    [[Value]] @@ -2841,7 +3007,7 @@

    Property Attributes

    Object Internal Methods and Internal Slots

    The actual semantics of objects, in ECMAScript, are specified via algorithms called internal methods. Each object in an ECMAScript engine is associated with a set of internal methods that defines its runtime behaviour. These internal methods are not part of the ECMAScript language. They are defined by this specification purely for expository purposes. However, each object within an implementation of ECMAScript must behave as specified by the internal methods associated with it. The exact manner in which this is accomplished is determined by the implementation.

    Internal method names are polymorphic. This means that different object values may perform different algorithms when a common internal method name is invoked upon them. That actual object upon which an internal method is invoked is the “target” of the invocation. If, at runtime, the implementation of an algorithm attempts to use an internal method of an object that the object does not support, a *TypeError* exception is thrown.

    -

    Internal slots correspond to internal state that is associated with objects and used by various ECMAScript specification algorithms. Internal slots are not object properties and they are not inherited. Depending upon the specific internal slot specification, such state may consist of values of any ECMAScript language type or of specific ECMAScript specification type values. Unless explicitly specified otherwise, internal slots are allocated as part of the process of creating an object and may not be dynamically added to an object. Unless specified otherwise, the initial value of an internal slot is the value *undefined*. Various algorithms within this specification create objects that have internal slots. However, the ECMAScript language provides no direct way to associate internal slots with an object.

    +

    Internal slots correspond to internal state that is associated with objects, Symbols, or Private Names and used by various ECMAScript specification algorithms. Internal slots are not object properties and they are not inherited. Depending upon the specific internal slot specification, such state may consist of values of any ECMAScript language type or of specific ECMAScript specification type values. Unless explicitly specified otherwise, internal slots are allocated as part of the process of creating an object, Symbol, or Private Name and may not be dynamically added. Unless specified otherwise, the initial value of an internal slot is the value *undefined*. Various algorithms within this specification create values that have internal slots. However, the ECMAScript language provides no direct way to manipulate internal slots.

    All objects have an internal slot named [[PrivateElements]], which is a List of PrivateElements. This List represents the values of the private fields, methods, and accessors for the object. Initially, it is an empty List.

    Internal methods and internal slots are identified within this specification using names enclosed in double square brackets [[ ]].

    summarizes the essential internal methods used by this specification that are applicable to all objects created or manipulated by ECMAScript code. Every object must have algorithms for all of the essential internal methods. However, all objects do not necessarily use the same algorithms for those methods.

    @@ -2864,17 +3030,19 @@

    Object Internal Methods and Internal Slots

    An internal method implicitly returns a Completion Record, either a normal completion that wraps a value of the return type shown in its invocation pattern, or a throw completion.

    - - - - - + + + + + + +
    - Internal Method - - Signature - - Description -
    + Internal Method + + Signature + + Description +
    [[GetPrototypeOf]] @@ -3001,17 +3169,19 @@

    Object Internal Methods and Internal Slots

    summarizes additional essential internal methods that are supported by objects that may be called as functions. A function object is an object that supports the [[Call]] internal method. A constructor is an object that supports the [[Construct]] internal method. Every object that supports [[Construct]] must support [[Call]]; that is, every constructor must be a function object. Therefore, a constructor may also be referred to as a constructor function or constructor function object.

    - - - - - + + + + + + +
    - Internal Method - - Signature - - Description -
    + Internal Method + + Signature + + Description +
    [[Call]] @@ -3113,7 +3283,7 @@

    [[GetOwnProperty]] ( _P_ )

    The normal return type is either Property Descriptor or Undefined.
  • - If the Type of the return value is Property Descriptor, the return value must be a fully populated Property Descriptor. + If the return value is a Property Descriptor, it must be a fully populated Property Descriptor.
  • If _P_ is described as a non-configurable, non-writable own data property, all future calls to [[GetOwnProperty]] ( _P_ ) must return Property Descriptor whose [[Value]] is SameValue as _P_'s [[Value]] attribute. @@ -3202,7 +3372,7 @@

    [[OwnPropertyKeys]] ( )

    The returned List must not contain any duplicate entries.
  • - The Type of each element of the returned List is either String or Symbol. + Each element of the returned List must be a property key.
  • The returned List must contain at least the keys of all non-configurable own properties that have previously been observed. @@ -3234,17 +3404,19 @@

    Well-Known Intrinsic Objects

    Within this specification a reference such as %name% means the intrinsic object, associated with the current realm, corresponding to the name. A reference such as %name.a.b% means, as if the *"b"* property of the value of the *"a"* property of the intrinsic object %name% was accessed prior to any ECMAScript code being evaluated. Determination of the current realm and its intrinsics is described in . The well-known intrinsics are listed in .

    - - - - - + + + + + + + @@ -3295,7 +3467,7 @@

    Well-Known Intrinsic Objects

    @@ -3503,6 +3675,17 @@

    Well-Known Intrinsic Objects

    The FinalizationRegistry constructor () + + + + + @@ -3623,12 +3806,23 @@

    Well-Known Intrinsic Objects

    + + + + + @@ -3660,7 +3854,7 @@

    Well-Known Intrinsic Objects

    @@ -3812,7 +4006,7 @@

    Well-Known Intrinsic Objects

    @@ -3844,7 +4038,7 @@

    Well-Known Intrinsic Objects

    @@ -3988,6 +4182,16 @@

    Well-Known Intrinsic Objects

    The WeakSet constructor () + + + + +
    - Intrinsic Name - - Global Name - - ECMAScript Language Association -
    + Intrinsic Name + + Global Name + + ECMAScript Language Association +
    %AggregateError% @@ -3285,7 +3457,7 @@

    Well-Known Intrinsic Objects

    - The prototype of Array iterator objects () + The prototype of Array Iterator objects ()
    - The prototype of async-from-sync iterator objects () + The prototype of Async-from-Sync Iterator objects ()
    + %Float16Array% + + `Float16Array` + + The Float16Array constructor () +
    %Float32Array% @@ -3532,7 +3715,7 @@

    Well-Known Intrinsic Objects

    - The prototype of For-In iterator objects () + The prototype of For-In Iterator objects ()
    - %IteratorPrototype% + %Iterator% + `Iterator` - An object that all standard built-in iterator objects indirectly inherit from + The `Iterator` constructor () +
    + %IteratorHelperPrototype% + + + The prototype of Iterator Helper objects ()
    - The prototype of Map iterator objects () + The prototype of Map Iterator objects ()
    - The prototype of Set iterator objects () + The prototype of Set Iterator objects ()
    - The prototype of String iterator objects () + The prototype of String Iterator objects ()
    + %WrapForValidIteratorPrototype% + + + The prototype of wrapped iterator objects returned by Iterator.from () +
    @@ -3999,11 +4203,11 @@

    Well-Known Intrinsic Objects

    ECMAScript Specification Types

    -

    A specification type corresponds to meta-values that are used within algorithms to describe the semantics of ECMAScript language constructs and ECMAScript language types. The specification types include Reference, List, Completion Record, Property Descriptor, Environment Record, Abstract Closure, and Data Block. Specification type values are specification artefacts that do not necessarily correspond to any specific entity within an ECMAScript implementation. Specification type values may be used to describe intermediate results of ECMAScript expression evaluation but such values cannot be stored as properties of objects or values of ECMAScript language variables.

    +

    A specification type corresponds to meta-values that are used within algorithms to describe the semantics of ECMAScript language constructs and ECMAScript language types. The specification types include Reference Record, List, Completion Record, Property Descriptor, Environment Record, Abstract Closure, and Data Block. Specification type values are specification artefacts that do not necessarily correspond to any specific entity within an ECMAScript implementation. Specification type values may be used to describe intermediate results of ECMAScript expression evaluation but such values cannot be stored as properties of objects or values of ECMAScript language variables.

    The Enum Specification Type

    -

    Enums are values which are internal to the specification and not directly observable from ECMAScript code. Enums are denoted using a ~sans-serif~ typeface. For instance, a Completion Record's [[Type]] field takes on values like ~normal~, ~return~, or ~throw~. Enums have no characteristics other than their name. The name of an enum serves no purpose other than to distinguish it from other enums, and implies nothing about its usage or meaning in context.

    +

    Enums are values which are internal to the specification and not directly observable from ECMAScript code. Enums are denoted in upper kebab case using a ~sans-serif~ typeface. For instance, a Completion Record's [[Type]] field takes on values like ~normal~, ~return~, or ~throw~. Enums have no characteristics other than their name. The name of an enum serves no purpose other than to distinguish it from other enums, and implies nothing about its usage or meaning in context.

    @@ -4022,7 +4226,7 @@

    The List and Record Specification Types

    The Set and Relation Specification Types

    The Set type is used to explain a collection of unordered elements for use in the memory model. It is distinct from the ECMAScript collection type of the same name. To disambiguate, instances of the ECMAScript collection are consistently referred to as "Set objects" within this specification. Values of the Set type are simple collections of elements, where no element appears more than once. Elements may be added to and removed from Sets. Sets may be unioned, intersected, or subtracted from each other.

    -

    The Relation type is used to explain constraints on Sets. Values of the Relation type are Sets of ordered pairs of values from its value domain. For example, a Relation on events is a set of ordered pairs of events. For a Relation _R_ and two values _a_ and _b_ in the value domain of _R_, _a_ _R_ _b_ is shorthand for saying the ordered pair (_a_, _b_) is a member of _R_. A Relation is the least Relation with respect to some conditions when it is the smallest Relation that satisfies those conditions.

    +

    The Relation type is used to explain constraints on Sets. Values of the Relation type are Sets of ordered pairs of values from its value domain. For example, a Relation on Memory events is a set of ordered pairs of Memory events. For a Relation _R_ and two values _a_ and _b_ in the value domain of _R_, _a_ _R_ _b_ is shorthand for saying the ordered pair (_a_, _b_) is a member of _R_. A Relation is the least Relation with respect to some conditions when it is the smallest Relation that satisfies those conditions.

    A strict partial order is a Relation value _R_ that satisfies the following.

    • @@ -4058,17 +4262,19 @@

      The Completion Record Specification Type

      Completion Records have the fields defined in .

      - - - - - + + + + + + +
      - Field Name - - Value - - Meaning -
      + Field Name + + Value + + Meaning +
      [[Type]] @@ -4124,6 +4330,8 @@

      ): a normal completion

      +
      skip return checks
      +
      true
      1. Return Completion Record { [[Type]]: ~normal~, [[Value]]: _value_, [[Target]]: ~empty~ }. @@ -4143,6 +4351,19 @@

      + +

      + ReturnCompletion ( + _value_: an ECMAScript language value, + ): a return completion +

      +
      +
      + + 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. + +
      +

      UpdateEmpty ( @@ -4163,15 +4384,17 @@

      The Reference Record Specification Type

      The Reference Record type is used to explain the behaviour of such operators as `delete`, `typeof`, the assignment operators, the `super` keyword and other language features. For example, the left-hand operand of an assignment is expected to produce a Reference Record.

      -

      A Reference Record is a resolved name or property binding; its fields are defined by .

      +

      A Reference Record is a resolved name or (possibly not-yet-resolved) property binding; its fields are defined by .

      - - - - - + + + + + + + @@ -4179,8 +4402,8 @@

      The Reference Record Specification Type

      - - + + @@ -4207,7 +4430,8 @@

      1. If _V_.[[Base]] is ~unresolvable~, return *false*. - 1. If _V_.[[Base]] is an Environment Record, return *false*; otherwise return *true*. + 1. If _V_.[[Base]] is an Environment Record, return *false*. + 1. Return *true*. @@ -4220,7 +4444,8 @@

      - 1. If _V_.[[Base]] is ~unresolvable~, return *true*; otherwise return *false*. + 1. If _V_.[[Base]] is ~unresolvable~, return *true*. + 1. Return *false*. @@ -4233,7 +4458,8 @@

      - 1. If _V_.[[ThisValue]] is not ~empty~, return *true*; otherwise return *false*. + 1. If _V_.[[ThisValue]] is ~empty~, return *false*. + 1. Return *true*. @@ -4246,7 +4472,8 @@

      - 1. If _V_.[[ReferencedName]] is a Private Name, return *true*; otherwise return *false*. + 1. If _V_.[[ReferencedName]] is a Private Name, return *true*. + 1. Return *false*. @@ -4265,11 +4492,12 @@

      1. [id="step-getvalue-toobject"] Let _baseObj_ be ? ToObject(_V_.[[Base]]). 1. If IsPrivateReference(_V_) is *true*, then 1. Return ? PrivateGet(_baseObj_, _V_.[[ReferencedName]]). - 1. Return ? _baseObj_.[[Get]](_V_.[[ReferencedName]], GetThisValue(_V_)). - 1. Else, - 1. Let _base_ be _V_.[[Base]]. - 1. Assert: _base_ is an Environment Record. - 1. Return ? _base_.GetBindingValue(_V_.[[ReferencedName]], _V_.[[Strict]]) (see ). + 1. If _V_.[[ReferencedName]] is not a property key, then + 1. Set _V_.[[ReferencedName]] to ? ToPropertyKey(_V_.[[ReferencedName]]). + 1. Return ? _baseObj_.[[Get]](_V_.[[ReferencedName]], GetThisValue(_V_)). + 1. Let _base_ be _V_.[[Base]]. + 1. Assert: _base_ is an Environment Record. + 1. Return ? _base_.GetBindingValue(_V_.[[ReferencedName]], _V_.[[Strict]]) (see ).

      The object that may be created in step is not accessible outside of the above abstract operation and the ordinary object [[Get]] internal method. An implementation might choose to avoid the actual creation of the object.

      @@ -4296,13 +4524,14 @@

      1. [id="step-putvalue-toobject"] Let _baseObj_ be ? ToObject(_V_.[[Base]]). 1. If IsPrivateReference(_V_) is *true*, then 1. Return ? PrivateSet(_baseObj_, _V_.[[ReferencedName]], _W_). - 1. Let _succeeded_ be ? _baseObj_.[[Set]](_V_.[[ReferencedName]], _W_, GetThisValue(_V_)). + 1. If _V_.[[ReferencedName]] is not a property key, then + 1. Set _V_.[[ReferencedName]] to ? ToPropertyKey(_V_.[[ReferencedName]]). + 1. Let _succeeded_ be ? _baseObj_.[[Set]](_V_.[[ReferencedName]], _W_, GetThisValue(_V_)). 1. If _succeeded_ is *false* and _V_.[[Strict]] is *true*, throw a *TypeError* exception. 1. Return ~unused~. - 1. Else, - 1. Let _base_ be _V_.[[Base]]. - 1. Assert: _base_ is an Environment Record. - 1. Return ? _base_.SetMutableBinding(_V_.[[ReferencedName]], _W_, _V_.[[Strict]]) (see ). + 1. Let _base_ be _V_.[[Base]]. + 1. Assert: _base_ is an Environment Record. + 1. Return ? _base_.SetMutableBinding(_V_.[[ReferencedName]], _W_, _V_.[[Strict]]) (see ).

      The object that may be created in step is not accessible outside of the above abstract operation and the ordinary object [[Set]] internal method. An implementation might choose to avoid the actual creation of that object.

      @@ -4319,7 +4548,8 @@

      1. Assert: IsPropertyReference(_V_) is *true*. - 1. If IsSuperReference(_V_) is *true*, return _V_.[[ThisValue]]; otherwise return _V_.[[Base]]. + 1. If IsSuperReference(_V_) is *true*, return _V_.[[ThisValue]]. + 1. Return _V_.[[Base]]. @@ -4350,9 +4580,9 @@

      - 1. Let _privEnv_ be the running execution context's PrivateEnvironment. - 1. Assert: _privEnv_ is not *null*. - 1. Let _privateName_ be ResolvePrivateIdentifier(_privEnv_, _privateIdentifier_). + 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. + 1. Assert: _privateEnv_ is not *null*. + 1. Let _privateName_ be ResolvePrivateIdentifier(_privateEnv_, _privateIdentifier_). 1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _privateName_, [[Strict]]: *true*, [[ThisValue]]: ~empty~ }. @@ -4367,13 +4597,12 @@

      The Property Descriptor Specification Type

      IsAccessorDescriptor ( - _Desc_: a Property Descriptor or *undefined*, + _Desc_: a Property Descriptor, ): a Boolean

      - 1. If _Desc_ is *undefined*, return *false*. 1. If _Desc_ has a [[Get]] field, return *true*. 1. If _Desc_ has a [[Set]] field, return *true*. 1. Return *false*. @@ -4383,13 +4612,12 @@

      IsDataDescriptor ( - _Desc_: a Property Descriptor or *undefined*, + _Desc_: a Property Descriptor, ): a Boolean

      - 1. If _Desc_ is *undefined*, return *false*. 1. If _Desc_ has a [[Value]] field, return *true*. 1. If _Desc_ has a [[Writable]] field, return *true*. 1. Return *false*. @@ -4399,13 +4627,12 @@

      IsGenericDescriptor ( - _Desc_: a Property Descriptor or *undefined*, + _Desc_: a Property Descriptor, ): a Boolean

      - 1. If _Desc_ is *undefined*, return *false*. 1. If IsAccessorDescriptor(_Desc_) is *true*, return *false*. 1. If IsDataDescriptor(_Desc_) is *true*, return *false*. 1. Return *true*. @@ -4529,10 +4756,10 @@

      The Abstract Closure Specification Type

      Data Blocks

      The Data Block specification type is used to describe a distinct and mutable sequence of byte-sized (8 bit) numeric values. A byte value is an integer in the inclusive interval from 0 to 255. A Data Block value is created with a fixed number of bytes that each have the initial value 0.

      -

      For notational convenience within this specification, an array-like syntax can be used to access the individual bytes of a Data Block value. This notation presents a Data Block value as a 0-origined integer-indexed sequence of bytes. For example, if _db_ is a 5 byte Data Block value then _db_[2] can be used to access its 3rd byte.

      +

      For notational convenience within this specification, an array-like syntax can be used to access the individual bytes of a Data Block value. This notation presents a Data Block value as a 0-based integer-indexed sequence of bytes. For example, if _db_ is a 5 byte Data Block value then _db_[2] can be used to access its 3rd byte.

      A data block that resides in memory that can be referenced from multiple agents concurrently is designated a Shared Data Block. A Shared Data Block has an identity (for the purposes of equality testing Shared Data Block values) that is address-free: it is tied not to the virtual addresses the block is mapped to in any process, but to the set of locations in memory that the block represents. Two data blocks are equal only if the sets of the locations they contain are equal; otherwise, they are not equal and the intersection of the sets of locations they contain is empty. Finally, Shared Data Blocks can be distinguished from Data Blocks.

      The semantics of Shared Data Blocks is defined using Shared Data Block events by the memory model. Abstract operations below introduce Shared Data Block events and act as the interface between evaluation semantics and the event semantics of the memory model. The events form a candidate execution, on which the memory model acts as a filter. Please consult the memory model for full semantics.

      -

      Shared Data Block events are modeled by Records, defined in the memory model.

      +

      Shared Data Block events are modelled by Records, defined in the memory model.

      The following abstract operations are used in this specification to operate upon Data Block values:

      @@ -4561,7 +4788,8 @@

      1. Let _db_ be a new Shared Data Block value consisting of _size_ bytes. If it is impossible to create such a Shared Data Block, throw a *RangeError* exception. - 1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record. + 1. Let _AR_ be the Agent Record of the surrounding agent. + 1. Let _execution_ be _AR_.[[CandidateExecution]]. 1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier(). 1. Let _zero_ be « 0 ». 1. For each index _i_ of _db_, do @@ -4590,7 +4818,8 @@

      1. Assert: _toIndex_ + _count_ ≤ _toSize_. 1. Repeat, while _count_ > 0, 1. If _fromBlock_ is a Shared Data Block, then - 1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record. + 1. Let _AR_ be the Agent Record of the surrounding agent. + 1. Let _execution_ be _AR_.[[CandidateExecution]]. 1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier(). 1. Let _bytes_ be a List whose sole element is a nondeterministically chosen byte value. 1. NOTE: In implementations, _bytes_ is the result of a non-atomic read instruction on the underlying hardware. The nondeterminism is a semantic prescription of the memory model to describe observable behaviour of hardware with weak consistency. @@ -4618,20 +4847,22 @@

      The PrivateElement Specification Type

      Values of the PrivateElement type are Record values whose fields are defined by . Such values are referred to as PrivateElements.

      Field NameValueMeaning
      Field NameValueMeaning
      [[Base]] an ECMAScript language value, an Environment Record, or ~unresolvable~
      [[ReferencedName]]a String, a Symbol, or a Private NameThe name of the binding. Always a String if [[Base]] value is an Environment Record.an ECMAScript language value or a Private NameThe name of the binding. Always a String if [[Base]] value is an Environment Record. Otherwise, may be an ECMAScript language value other than a String or a Symbol until ToPropertyKey is performed.
      [[Strict]]
      - - - - - - + + + + + + + +
      - Field Name - - Values of the [[Kind]] field for which it is present - - Value - - Meaning -
      + Field Name + + Values of the [[Kind]] field for which it is present + + Value + + Meaning +
      [[Key]] @@ -4712,17 +4943,19 @@

      The ClassFieldDefinition Record Specification Type

      Values of the ClassFieldDefinition type are Record values whose fields are defined by . Such values are referred to as ClassFieldDefinition Records.

      - - - - - + + + + + + +
      - Field Name - - Value - - Meaning -
      + Field Name + + Value + + Meaning +
      [[Name]] @@ -4751,7 +4984,7 @@

      The ClassFieldDefinition Record Specification Type

      Private Names

      -

      The Private Name specification type is used to describe a globally unique value (one which differs from any other Private Name, even if they are otherwise indistinguishable) which represents the key of a private class element (field, method, or accessor). Each Private Name has an associated immutable [[Description]] which is a String value. A Private Name may be installed on any ECMAScript object with PrivateFieldAdd or PrivateMethodOrAccessorAdd, and then read or written using PrivateGet and PrivateSet.

      +

      The Private Name specification type is used to describe a globally unique value (one which differs from any other Private Name, even if they are otherwise indistinguishable) which represents the key of a private class element (field, method, or accessor). Each Private Name has an immutable [[Description]] internal slot which is a String. A Private Name may be installed on any ECMAScript object with PrivateFieldAdd or PrivateMethodOrAccessorAdd, and then read or written using PrivateGet and PrivateSet.

      @@ -4760,17 +4993,19 @@

      The ClassStaticBlockDefinition Record Specification Type

      ClassStaticBlockDefinition Records have the fields listed in .

      - - - - - + + + + + + +
      - Field Name - - Value - - Meaning -
      + Field Name + + Value + + Meaning +
      [[BodyFunction]] @@ -4810,7 +5045,7 @@

      1. If _input_ is an Object, then - 1. Let _exoticToPrim_ be ? GetMethod(_input_, @@toPrimitive). + 1. Let _exoticToPrim_ be ? GetMethod(_input_, %Symbol.toPrimitive%). 1. If _exoticToPrim_ is not *undefined*, then 1. If _preferredType_ is not present, then 1. Let _hint_ be *"default"*. @@ -4822,12 +5057,12 @@

      1. Let _result_ be ? Call(_exoticToPrim_, _input_, « _hint_ »). 1. If _result_ is not an Object, return _result_. 1. Throw a *TypeError* exception. - 1. If _preferredType_ is not present, let _preferredType_ be ~number~. + 1. If _preferredType_ is not present, set _preferredType_ to ~number~. 1. Return ? OrdinaryToPrimitive(_input_, _preferredType_). 1. Return _input_. -

      When ToPrimitive is called without a hint, then it generally behaves as if the hint were ~number~. However, objects may over-ride this behaviour by defining a @@toPrimitive method. Of the objects defined in this specification only Dates (see ) and Symbol objects (see ) over-ride the default ToPrimitive behaviour. Dates treat the absence of a hint as if the hint were ~string~.

      +

      When ToPrimitive is called without a hint, then it generally behaves as if the hint were ~number~. However, objects may over-ride this behaviour by defining a %Symbol.toPrimitive% method. Of the objects defined in this specification only Dates (see ) and Symbol objects (see ) over-ride the default ToPrimitive behaviour. Dates treat the absence of a hint as if the hint were ~string~.

      @@ -4854,7 +5089,7 @@

      - +

      ToBoolean ( _argument_: an ECMAScript language value, @@ -4867,7 +5102,8 @@

      1. If _argument_ is a Boolean, return _argument_. 1. If _argument_ is one of *undefined*, *null*, *+0*𝔽, *-0*𝔽, *NaN*, *0*, or the empty String, return *false*. - 1. [id="step-to-boolean-web-compat-insertion-point"] NOTE: This step is replaced in section . + 1. [id="step-to-boolean-web-compat-insertion-point", normative-optional] If the host is a web browser or otherwise supports , then + 1. If _argument_ is an Object and _argument_ has an [[IsHTMLDDA]] internal slot, return *false*. 1. Return *true*. @@ -5024,20 +5260,20 @@

      Runtime Semantics: StringNumericValue ( ): a Number

      1. Else, 1. Let _b_ be 0. 1. Let _n_ be 0. - 1. If |ExponentPart| is present, let _e_ be the MV of |ExponentPart|. Otherwise, let _e_ be 0. + 1. If |ExponentPart| is present, let _e_ be the MV of |ExponentPart|; else let _e_ be 0. 1. Return RoundMVResult((_a_ + (_b_ × 10-_n_)) × 10_e_). StrUnsignedDecimalLiteral ::: `.` DecimalDigits ExponentPart? 1. Let _b_ be the MV of |DecimalDigits|. - 1. If |ExponentPart| is present, let _e_ be the MV of |ExponentPart|. Otherwise, let _e_ be 0. + 1. If |ExponentPart| is present, let _e_ be the MV of |ExponentPart|; else let _e_ be 0. 1. Let _n_ be the number of code points in |DecimalDigits|. 1. Return RoundMVResult(_b_ × 10_e_ - _n_). StrUnsignedDecimalLiteral ::: DecimalDigits ExponentPart? 1. Let _a_ be the MV of |DecimalDigits|. - 1. If |ExponentPart| is present, let _e_ be the MV of |ExponentPart|. Otherwise, let _e_ be 0. + 1. If |ExponentPart| is present, let _e_ be the MV of |ExponentPart|; else let _e_ be 0. 1. Return RoundMVResult(_a_ × 10_e_).
      @@ -5100,7 +5336,8 @@

      1. If _number_ is not finite or _number_ is either *+0*𝔽 or *-0*𝔽, return *+0*𝔽. 1. Let _int_ be truncate(ℝ(_number_)). 1. Let _int32bit_ be _int_ modulo 232. - 1. If _int32bit_ ≥ 231, return 𝔽(_int32bit_ - 232); otherwise return 𝔽(_int32bit_). + 1. If _int32bit_ ≥ 231, return 𝔽(_int32bit_ - 232). + 1. Return 𝔽(_int32bit_).

      Given the above definition of ToInt32:

      @@ -5169,7 +5406,8 @@

      1. If _number_ is not finite or _number_ is either *+0*𝔽 or *-0*𝔽, return *+0*𝔽. 1. Let _int_ be truncate(ℝ(_number_)). 1. Let _int16bit_ be _int_ modulo 216. - 1. If _int16bit_ ≥ 215, return 𝔽(_int16bit_ - 216); otherwise return 𝔽(_int16bit_). + 1. If _int16bit_ ≥ 215, return 𝔽(_int16bit_ - 216). + 1. Return 𝔽(_int16bit_). @@ -5218,7 +5456,8 @@

      1. If _number_ is not finite or _number_ is either *+0*𝔽 or *-0*𝔽, return *+0*𝔽. 1. Let _int_ be truncate(ℝ(_number_)). 1. Let _int8bit_ be _int_ modulo 28. - 1. If _int8bit_ ≥ 27, return 𝔽(_int8bit_ - 28); otherwise return 𝔽(_int8bit_). + 1. If _int8bit_ ≥ 27, return 𝔽(_int8bit_ - 28). + 1. Return 𝔽(_int8bit_). @@ -5259,7 +5498,8 @@

      1. Let _f_ be floor(_clamped_). 1. If _clamped_ < _f_ + 0.5, return 𝔽(_f_). 1. If _clamped_ > _f_ + 0.5, return 𝔽(_f_ + 1). - 1. If _f_ is even, return 𝔽(_f_). Otherwise, return 𝔽(_f_ + 1). + 1. If _f_ is even, return 𝔽(_f_). + 1. Return 𝔽(_f_ + 1).

      Unlike most other ECMAScript integer conversion operations, ToUint8Clamp rounds rather than truncates non-integral values. It also uses “round half to even” tie-breaking, which differs from the “round half up” tie-breaking of `Math.round`.

      @@ -5282,14 +5522,16 @@

      - - - - + + + + + +
      - Argument Type - - Result -
      + Argument Type + + Result +
      Undefined @@ -5411,7 +5653,8 @@

      1. Let _n_ be ? ToBigInt(_argument_). 1. Let _int64bit_ be ℝ(_n_) modulo 264. - 1. If _int64bit_ ≥ 263, return ℤ(_int64bit_ - 264); otherwise return ℤ(_int64bit_). + 1. If _int64bit_ ≥ 263, return ℤ(_int64bit_ - 264). + 1. Return ℤ(_int64bit_). @@ -5458,7 +5701,7 @@

      - +

      ToObject ( _argument_: an ECMAScript language value, @@ -5466,84 +5709,18 @@

      description
      -
      It converts _argument_ to a value of type Object according to :
      +
      It converts _argument_ to a value of type Object.
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - Argument Type - - Result -
      - Undefined - - Throw a *TypeError* exception. -
      - Null - - Throw a *TypeError* exception. -
      - Boolean - - Return a new Boolean object whose [[BooleanData]] internal slot is set to _argument_. See for a description of Boolean objects. -
      - Number - - Return a new Number object whose [[NumberData]] internal slot is set to _argument_. See for a description of Number objects. -
      - String - - Return a new String object whose [[StringData]] internal slot is set to _argument_. See for a description of String objects. -
      - Symbol - - Return a new Symbol object whose [[SymbolData]] internal slot is set to _argument_. See for a description of Symbol objects. -
      - BigInt - - Return a new BigInt object whose [[BigIntData]] internal slot is set to _argument_. See for a description of BigInt objects. -
      - Object - - Return _argument_. -
      -
      + + 1. If _argument_ is either *undefined* or *null*, throw a *TypeError* exception. + 1. If _argument_ is a Boolean, return a new Boolean object whose [[BooleanData]] internal slot is set to _argument_. See for a description of Boolean objects. + 1. If _argument_ is a Number, return a new Number object whose [[NumberData]] internal slot is set to _argument_. See for a description of Number objects. + 1. If _argument_ is a String, return a new String object whose [[StringData]] internal slot is set to _argument_. See for a description of String objects. + 1. If _argument_ is a Symbol, return a new Symbol object whose [[SymbolData]] internal slot is set to _argument_. See for a description of Symbol objects. + 1. If _argument_ is a BigInt, return a new BigInt object whose [[BigIntData]] internal slot is set to _argument_. See for a description of BigInt objects. + 1. Assert: _argument_ is an Object. + 1. Return _argument_. +
      @@ -5568,11 +5745,11 @@

      ToLength ( _argument_: an ECMAScript language value, - ): either a normal completion containing an integral Number or a throw completion + ): either a normal completion containing a non-negative integral Number or a throw completion

      description
      -
      It clamps and truncates _argument_ to an integral Number suitable for use as the length of an array-like object.
      +
      It clamps and truncates _argument_ to a non-negative integral Number suitable for use as the length of an array-like object.
      1. Let _len_ be ? ToIntegerOrInfinity(_argument_). @@ -5589,7 +5766,7 @@

      description
      -
      If _argument_ is either *"-0"* or exactly matches the result of ToString(_n_) for some Number value _n_, it returns the respective Number value. Otherwise, it returns *undefined*.
      +
      If _argument_ is either *"-0"* or exactly matches ToString(_n_) for some Number value _n_, it returns the respective Number value. Otherwise, it returns *undefined*.
      1. If _argument_ is *"-0"*, return *-0*𝔽. @@ -5597,7 +5774,7 @@

      1. If ! ToString(_n_) is _argument_, return _n_. 1. Return *undefined*. -

      A canonical numeric string is any String value for which the CanonicalNumericIndexString abstract operation does not return *undefined*.

      +

      A canonical numeric string is any String for which the CanonicalNumericIndexString abstract operation does not return *undefined*.

      @@ -5621,92 +5798,20 @@

      Testing and Comparison Operations

      - +

      RequireObjectCoercible ( _argument_: an ECMAScript language value, - ): either a normal completion containing an ECMAScript language value or a throw completion + ): either a normal completion containing ~unused~ or a throw completion

      description
      -
      It throws an error if _argument_ is a value that cannot be converted to an Object using ToObject. It is defined by :
      +
      It throws an error if _argument_ is a value that cannot be converted to an Object using ToObject.
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - Argument Type - - Result -
      - Undefined - - Throw a *TypeError* exception. -
      - Null - - Throw a *TypeError* exception. -
      - Boolean - - Return _argument_. -
      - Number - - Return _argument_. -
      - String - - Return _argument_. -
      - Symbol - - Return _argument_. -
      - BigInt - - Return _argument_. -
      - Object - - Return _argument_. -
      -
      + + 1. If _argument_ is either *undefined* or *null*, throw a *TypeError* exception. + 1. Return ~unused~. +
      @@ -5773,25 +5878,7 @@

      It is used to determine whether additional properties can be added to _O_.
      - 1. Return ? _O_.[[IsExtensible]](). - - - - -

      - IsIntegralNumber ( - _argument_: an ECMAScript language value, - ): a Boolean -

      -
      -
      description
      -
      It determines if _argument_ is a finite integral Number value.
      -
      - - 1. If _argument_ is not a Number, return *false*. - 1. If _argument_ is not finite, return *false*. - 1. If truncate(ℝ(_argument_)) ≠ ℝ(_argument_), return *false*. - 1. Return *true*. + 1. Return ? _O_.[[IsExtensible]]().
      @@ -5805,7 +5892,7 @@

      1. If _argument_ is not an Object, return *false*. - 1. Let _matcher_ be ? Get(_argument_, @@match). + 1. Let _matcher_ be ? Get(_argument_, %Symbol.match%). 1. If _matcher_ is not *undefined*, return ToBoolean(_matcher_). 1. If _argument_ has a [[RegExpMatcher]] internal slot, return *true*. 1. Return *false*. @@ -5833,6 +5920,30 @@

      + +

      + SameType ( + _x_: an ECMAScript language value, + _y_: an ECMAScript language value, + ): a Boolean +

      +
      +
      description
      +
      It determines whether or not the two arguments are the same type.
      +
      + + 1. If _x_ is *undefined* and _y_ is *undefined*, return *true*. + 1. If _x_ is *null* and _y_ is *null*, return *true*. + 1. If _x_ is a Boolean and _y_ is a Boolean, return *true*. + 1. If _x_ is a Number and _y_ is a Number, return *true*. + 1. If _x_ is a BigInt and _y_ is a BigInt, return *true*. + 1. If _x_ is a Symbol and _y_ is a Symbol, return *true*. + 1. If _x_ is a String and _y_ is a String, return *true*. + 1. If _x_ is an Object and _y_ is an Object, return *true*. + 1. Return *false*. + +
      +

      SameValue ( @@ -5845,7 +5956,7 @@

      It determines whether or not the two arguments are the same value.
      - 1. If Type(_x_) is not Type(_y_), return *false*. + 1. If SameType(_x_, _y_) is *false*, return *false*. 1. If _x_ is a Number, then 1. Return Number::sameValue(_x_, _y_). 1. Return SameValueNonNumber(_x_, _y_). @@ -5867,7 +5978,7 @@

      It determines whether or not the two arguments are the same value (ignoring the difference between *+0*𝔽 and *-0*𝔽).
      - 1. If Type(_x_) is not Type(_y_), return *false*. + 1. If SameType(_x_, _y_) is *false*, return *false*. 1. If _x_ is a Number, then 1. Return Number::sameValueZero(_x_, _y_). 1. Return SameValueNonNumber(_x_, _y_). @@ -5887,16 +5998,19 @@

      - 1. Assert: Type(_x_) is Type(_y_). - 1. If _x_ is either *null* or *undefined*, return *true*. + 1. Assert: SameType(_x_, _y_) is *true*. + 1. If _x_ is either *undefined* or *null*, return *true*. 1. If _x_ is a BigInt, then 1. Return BigInt::equal(_x_, _y_). 1. If _x_ is a String, then - 1. If _x_ and _y_ have the same length and the same code units in the same positions, return *true*; otherwise, return *false*. + 1. If _x_ and _y_ have the same length and the same code units in the same positions, return *true*. + 1. Return *false*. 1. If _x_ is a Boolean, then - 1. If _x_ and _y_ are both *true* or both *false*, return *true*; otherwise, return *false*. + 1. If _x_ and _y_ are both *true* or both *false*, return *true*. + 1. Return *false*. 1. NOTE: All other ECMAScript language values are compared by identity. - 1. If _x_ is _y_, return *true*; otherwise, return *false*. + 1. If _x_ is _y_, return *true*. + 1. Return *false*. For expository purposes, some cases are handled separately within this algorithm even if it is unnecessary to do so. @@ -5934,30 +6048,29 @@

      1. Let _cy_ be the numeric value of the code unit at index _i_ within _py_. 1. If _cx_ < _cy_, return *true*. 1. If _cx_ > _cy_, return *false*. - 1. If _lx_ < _ly_, return *true*. Otherwise, return *false*. - 1. Else, - 1. If _px_ is a BigInt and _py_ is a String, then - 1. Let _ny_ be StringToBigInt(_py_). - 1. If _ny_ is *undefined*, return *undefined*. - 1. Return BigInt::lessThan(_px_, _ny_). - 1. If _px_ is a String and _py_ is a BigInt, then - 1. Let _nx_ be StringToBigInt(_px_). - 1. If _nx_ is *undefined*, return *undefined*. - 1. Return BigInt::lessThan(_nx_, _py_). - 1. NOTE: Because _px_ and _py_ are primitive values, evaluation order is not important. - 1. Let _nx_ be ? ToNumeric(_px_). - 1. Let _ny_ be ? ToNumeric(_py_). - 1. If Type(_nx_) is Type(_ny_), then - 1. If _nx_ is a Number, then - 1. Return Number::lessThan(_nx_, _ny_). - 1. Else, - 1. Assert: _nx_ is a BigInt. - 1. Return BigInt::lessThan(_nx_, _ny_). - 1. Assert: _nx_ is a BigInt and _ny_ is a Number, or _nx_ is a Number and _ny_ is a BigInt. - 1. If _nx_ or _ny_ is *NaN*, return *undefined*. - 1. If _nx_ is *-∞*𝔽 or _ny_ is *+∞*𝔽, return *true*. - 1. If _nx_ is *+∞*𝔽 or _ny_ is *-∞*𝔽, return *false*. - 1. If ℝ(_nx_) < ℝ(_ny_), return *true*; otherwise return *false*. + 1. If _lx_ < _ly_, return *true*. + 1. Return *false*. + 1. If _px_ is a BigInt and _py_ is a String, then + 1. Let _ny_ be StringToBigInt(_py_). + 1. If _ny_ is *undefined*, return *undefined*. + 1. Return BigInt::lessThan(_px_, _ny_). + 1. If _px_ is a String and _py_ is a BigInt, then + 1. Let _nx_ be StringToBigInt(_px_). + 1. If _nx_ is *undefined*, return *undefined*. + 1. Return BigInt::lessThan(_nx_, _py_). + 1. NOTE: Because _px_ and _py_ are primitive values, evaluation order is not important. + 1. Let _nx_ be ? ToNumeric(_px_). + 1. Let _ny_ be ? ToNumeric(_py_). + 1. If SameType(_nx_, _ny_) is *true*, then + 1. If _nx_ is a Number, return Number::lessThan(_nx_, _ny_). + 1. Assert: _nx_ is a BigInt. + 1. Return BigInt::lessThan(_nx_, _ny_). + 1. Assert: _nx_ is a BigInt and _ny_ is a Number, or _nx_ is a Number and _ny_ is a BigInt. + 1. If _nx_ or _ny_ is *NaN*, return *undefined*. + 1. If _nx_ is *-∞*𝔽 or _ny_ is *+∞*𝔽, return *true*. + 1. If _nx_ is *+∞*𝔽 or _ny_ is *-∞*𝔽, return *false*. + 1. If ℝ(_nx_) < ℝ(_ny_), return *true*. + 1. Return *false*.

      Step differs from step in the algorithm that handles the addition operator `+` () by using the logical-and operation instead of the logical-or operation.

      @@ -5967,7 +6080,7 @@

      - +

      IsLooselyEqual ( _x_: an ECMAScript language value, @@ -5979,11 +6092,13 @@

      It provides the semantics for the `==` operator.
      - 1. If Type(_x_) is Type(_y_), then + 1. If SameType(_x_, _y_) is *true*, then 1. Return IsStrictlyEqual(_x_, _y_). 1. If _x_ is *null* and _y_ is *undefined*, return *true*. 1. If _x_ is *undefined* and _y_ is *null*, return *true*. - 1. [id="step-abstract-equality-comparison-web-compat-insertion-point"] NOTE: This step is replaced in section . + 1. [id="step-abstract-equality-comparison-web-compat-insertion-point", normative-optional] If the host is a web browser or otherwise supports , then + 1. If _x_ is an Object, _x_ has an [[IsHTMLDDA]] internal slot, and _y_ is either *undefined* or *null*, return *true*. + 1. If _x_ is either *undefined* or *null*, _y_ is an Object, and _y_ has an [[IsHTMLDDA]] internal slot, return *true*. 1. If _x_ is a Number and _y_ is a String, return ! IsLooselyEqual(_x_, ! ToNumber(_y_)). 1. If _x_ is a String and _y_ is a Number, return ! IsLooselyEqual(! ToNumber(_x_), _y_). 1. If _x_ is a BigInt and _y_ is a String, then @@ -5997,7 +6112,8 @@

      1. If _x_ is an Object and _y_ is either a String, a Number, a BigInt, or a Symbol, return ! IsLooselyEqual(? ToPrimitive(_x_), _y_). 1. If _x_ is a BigInt and _y_ is a Number, or if _x_ is a Number and _y_ is a BigInt, then 1. If _x_ is not finite or _y_ is not finite, return *false*. - 1. If ℝ(_x_) = ℝ(_y_), return *true*; otherwise return *false*. + 1. If ℝ(_x_) = ℝ(_y_), return *true*. + 1. Return *false*. 1. Return *false*. @@ -6014,7 +6130,7 @@

      It provides the semantics for the `===` operator.
      - 1. If Type(_x_) is not Type(_y_), return *false*. + 1. If SameType(_x_, _y_) is *false*, return *false*. 1. If _x_ is a Number, then 1. Return Number::equal(_x_, _y_). 1. Return SameValueNonNumber(_x_, _y_). @@ -6040,7 +6156,10 @@

      + 1. Set _internalSlotsList_ to the list-concatenation of _internalSlotsList_ and « [[PrivateElements]] ». 1. Let _obj_ be a newly created object with an internal slot for each name in _internalSlotsList_. + 1. NOTE: As described in , the initial value of each such internal slot is *undefined* unless specified otherwise. + 1. Set _obj_.[[PrivateElements]] to a new empty List. 1. Set _obj_'s essential internal methods to the default ordinary object definitions specified in . 1. Assert: If the caller will not be overriding both _obj_'s [[GetPrototypeOf]] and [[SetPrototypeOf]] essential internal methods, then _internalSlotsList_ contains [[Prototype]]. 1. Assert: If the caller will not be overriding all of _obj_'s [[SetPrototypeOf]], [[IsExtensible]], and [[PreventExtensions]] essential internal methods, then _internalSlotsList_ contains [[Extensible]]. @@ -6065,7 +6184,7 @@

      It is used to retrieve the value of a specific property of an object.
      - 1. Return ? _O_.[[Get]](_P_, _O_). + 1. Return ? _O_.[[Get]](_P_, _O_). @@ -6082,7 +6201,7 @@

      1. Let _O_ be ? ToObject(_V_). - 1. Return ? _O_.[[Get]](_P_, _V_). + 1. Return ? _O_.[[Get]](_P_, _V_). @@ -6100,7 +6219,7 @@

      It is used to set the value of a specific property of an object. _V_ is the new value for the property.
      - 1. Let _success_ be ? _O_.[[Set]](_P_, _V_, _O_). + 1. Let _success_ be ? _O_.[[Set]](_P_, _V_, _O_). 1. If _success_ is *false* and _Throw_ is *true*, throw a *TypeError* exception. 1. Return ~unused~. @@ -6120,7 +6239,7 @@

      1. Let _newDesc_ be the PropertyDescriptor { [[Value]]: _V_, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: *true* }. - 1. Return ? _O_.[[DefineOwnProperty]](_P_, _newDesc_). + 1. Return ? _O_.[[DefineOwnProperty]](_P_, _newDesc_).

      This abstract operation creates a property whose attributes are set to the same defaults used for properties created by the ECMAScript language assignment operator. Normally, the property will not already exist. If it does exist and is not configurable or if _O_ is not extensible, [[DefineOwnProperty]] will return *false*.

      @@ -6185,7 +6304,7 @@

      It is used to call the [[DefineOwnProperty]] internal method of an object in a manner that will throw a *TypeError* exception if the requested property update cannot be performed.
      - 1. Let _success_ be ? _O_.[[DefineOwnProperty]](_P_, _desc_). + 1. Let _success_ be ? _O_.[[DefineOwnProperty]](_P_, _desc_). 1. If _success_ is *false*, throw a *TypeError* exception. 1. Return ~unused~. @@ -6203,7 +6322,7 @@

      It is used to remove a specific own property of an object. It throws an exception if the property is not configurable.
      - 1. Let _success_ be ? _O_.[[Delete]](_P_). + 1. Let _success_ be ? _O_.[[Delete]](_P_). 1. If _success_ is *false*, throw a *TypeError* exception. 1. Return ~unused~. @@ -6240,7 +6359,7 @@

      It is used to determine whether an object has a property with the specified property key. The property may be either own or inherited.
      - 1. Return ? _O_.[[HasProperty]](_P_). + 1. Return ? _O_.[[HasProperty]](_P_). @@ -6256,7 +6375,7 @@

      It is used to determine whether an object has an own property with the specified property key.
      - 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_P_). + 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_P_). 1. If _desc_ is *undefined*, return *false*. 1. Return *true*. @@ -6277,7 +6396,7 @@

      1. If _argumentsList_ is not present, set _argumentsList_ to a new empty List. 1. If IsCallable(_F_) is *false*, throw a *TypeError* exception. - 1. Return ? _F_.[[Call]](_V_, _argumentsList_). + 1. Return ? _F_.[[Call]](_V_, _argumentsList_). @@ -6296,7 +6415,7 @@

      1. If _newTarget_ is not present, set _newTarget_ to _F_. 1. If _argumentsList_ is not present, set _argumentsList_ to a new empty List. - 1. Return ? _F_.[[Construct]](_argumentsList_, _newTarget_). + 1. Return ? _F_.[[Construct]](_argumentsList_, _newTarget_).

      If _newTarget_ is not present, this operation is equivalent to: `new F(...argumentsList)`

      @@ -6324,7 +6443,7 @@

      1. Else, 1. Assert: _level_ is ~frozen~. 1. For each element _k_ of _keys_, do - 1. Let _currentDesc_ be ? _O_.[[GetOwnProperty]](_k_). + 1. Let _currentDesc_ be ? _O_.[[GetOwnProperty]](_k_). 1. If _currentDesc_ is not *undefined*, then 1. If IsAccessorDescriptor(_currentDesc_) is *true*, then 1. Let _desc_ be the PropertyDescriptor { [[Configurable]]: *false* }. @@ -6352,7 +6471,7 @@

      1. NOTE: If the object is extensible, none of its properties are examined. 1. Let _keys_ be ? _O_.[[OwnPropertyKeys]](). 1. For each element _k_ of _keys_, do - 1. Let _currentDesc_ be ? _O_.[[GetOwnProperty]](_k_). + 1. Let _currentDesc_ be ? _O_.[[GetOwnProperty]](_k_). 1. If _currentDesc_ is not *undefined*, then 1. If _currentDesc_.[[Configurable]] is *true*, return *false*. 1. If _level_ is ~frozen~ and IsDataDescriptor(_currentDesc_) is *true*, then @@ -6407,15 +6526,15 @@

      CreateListFromArrayLike ( _obj_: an ECMAScript language value, - optional _elementTypes_: a List of names of ECMAScript Language Types, + optional _validElementTypes_: ~all~ or ~property-key~, ): either a normal completion containing a List of ECMAScript language values or a throw completion

      description
      -
      It is used to create a List value whose elements are provided by the indexed properties of _obj_. _elementTypes_ contains the names of ECMAScript Language Types that are allowed for element values of the List that is created.
      +
      It is used to create a List value whose elements are provided by the indexed properties of _obj_. _validElementTypes_ indicates the types of values that are allowed as elements.
      - 1. If _elementTypes_ is not present, set _elementTypes_ to « Undefined, Null, Boolean, String, Symbol, Number, BigInt, Object ». + 1. If _validElementTypes_ is not present, set _validElementTypes_ to ~all~. 1. If _obj_ is not an Object, throw a *TypeError* exception. 1. Let _len_ be ? LengthOfArrayLike(_obj_). 1. Let _list_ be a new empty List. @@ -6423,7 +6542,7 @@

      1. Repeat, while _index_ < _len_, 1. Let _indexName_ be ! ToString(𝔽(_index_)). 1. Let _next_ be ? Get(_obj_, _indexName_). - 1. If _elementTypes_ does not contain Type(_next_), throw a *TypeError* exception. + 1. If _validElementTypes_ is ~property-key~ and _next_ is not a property key, throw a *TypeError* exception. 1. Append _next_ to _list_. 1. Set _index_ to _index_ + 1. 1. Return _list_. @@ -6470,7 +6589,7 @@

      1. Let _P_ be ? Get(_C_, *"prototype"*). 1. If _P_ is not an Object, throw a *TypeError* exception. 1. Repeat, - 1. Set _O_ to ? _O_.[[GetPrototypeOf]](). + 1. Set _O_ to ? _O_.[[GetPrototypeOf]](). 1. If _O_ is *null*, return *false*. 1. If SameValue(_P_, _O_) is *true*, return *true*. @@ -6485,13 +6604,13 @@

      description
      -
      It is used to retrieve the constructor that should be used to create new objects that are derived from _O_. _defaultConstructor_ is the constructor to use if a constructor @@species property cannot be found starting from _O_.
      +
      It is used to retrieve the constructor that should be used to create new objects that are derived from _O_. _defaultConstructor_ is the constructor to use if a constructor %Symbol.species% property cannot be found starting from _O_.
      1. Let _C_ be ? Get(_O_, *"constructor"*). 1. If _C_ is *undefined*, return _defaultConstructor_. 1. If _C_ is not an Object, throw a *TypeError* exception. - 1. Let _S_ be ? Get(_C_, @@species). + 1. Let _S_ be ? Get(_C_, %Symbol.species%). 1. If _S_ is either *undefined* or *null*, return _defaultConstructor_. 1. If IsConstructor(_S_) is *true*, return _S_. 1. Throw a *TypeError* exception. @@ -6508,11 +6627,11 @@

      - 1. Let _ownKeys_ be ? _O_.[[OwnPropertyKeys]](). + 1. Let _ownKeys_ be ? _O_.[[OwnPropertyKeys]](). 1. Let _results_ be a new empty List. 1. For each element _key_ of _ownKeys_, do 1. If _key_ is a String, then - 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_key_). + 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_key_). 1. If _desc_ is not *undefined* and _desc_.[[Enumerable]] is *true*, then 1. If _kind_ is ~key~, then 1. Append _key_ to _results_. @@ -6545,6 +6664,7 @@

      1. If _obj_ is a Proxy exotic object, then 1. Perform ? ValidateNonRevokedProxy(_obj_). 1. Let _proxyTarget_ be _obj_.[[ProxyTarget]]. + 1. Assert: _proxyTarget_ is a function object. 1. Return ? GetFunctionRealm(_proxyTarget_). 1. [id="step-getfunctionrealm-default-return"] Return the current Realm Record. @@ -6566,14 +6686,14 @@

      1. If _source_ is either *undefined* or *null*, return ~unused~. 1. Let _from_ be ! ToObject(_source_). - 1. Let _keys_ be ? _from_.[[OwnPropertyKeys]](). + 1. Let _keys_ be ? _from_.[[OwnPropertyKeys]](). 1. For each element _nextKey_ of _keys_, do 1. Let _excluded_ be *false*. 1. For each element _e_ of _excludedItems_, do 1. If SameValue(_e_, _nextKey_) is *true*, then 1. Set _excluded_ to *true*. 1. If _excluded_ is *false*, then - 1. Let _desc_ be ? _from_.[[GetOwnProperty]](_nextKey_). + 1. Let _desc_ be ? _from_.[[GetOwnProperty]](_nextKey_). 1. If _desc_ is not *undefined* and _desc_.[[Enumerable]] is *true*, then 1. Let _propValue_ be ? Get(_from_, _nextKey_). 1. Perform ! CreateDataPropertyOrThrow(_target_, _nextKey_, _propValue_). @@ -6696,10 +6816,9 @@

      1. Let _entry_ be PrivateElementFind(_O_, _P_). 1. If _entry_ is ~empty~, throw a *TypeError* exception. + 1. If _entry_.[[Kind]] is ~method~, throw a *TypeError* exception. 1. If _entry_.[[Kind]] is ~field~, then 1. Set _entry_.[[Value]] to _value_. - 1. Else if _entry_.[[Kind]] is ~method~, then - 1. Throw a *TypeError* exception. 1. Else, 1. Assert: _entry_.[[Kind]] is ~accessor~. 1. If _entry_.[[Set]] is *undefined*, throw a *TypeError* exception. @@ -6738,16 +6857,16 @@

      InitializeInstanceElements ( _O_: an Object, - _constructor_: an ECMAScript function object, + _constructor_: an ECMAScript function object or a built-in function object, ): either a normal completion containing ~unused~ or a throw completion

      - 1. Let _methods_ be the value of _constructor_.[[PrivateMethods]]. + 1. Let _methods_ be _constructor_.[[PrivateMethods]]. 1. For each PrivateElement _method_ of _methods_, do 1. Perform ? PrivateMethodOrAccessorAdd(_O_, _method_). - 1. Let _fields_ be the value of _constructor_.[[Fields]]. + 1. Let _fields_ be _constructor_.[[Fields]]. 1. For each element _fieldRecord_ of _fields_, do 1. Perform ? DefineField(_O_, _fieldRecord_). 1. Return ~unused~. @@ -6780,15 +6899,15 @@

      GroupBy ( _items_: an ECMAScript language value, - _callbackfn_: an ECMAScript language value, - _keyCoercion_: ~property~ or ~zero~, + _callback_: an ECMAScript language value, + _keyCoercion_: ~property~ or ~collection~, ): either a normal completion containing a List of Records with fields [[Key]] (an ECMAScript language value) and [[Elements]] (a List of ECMAScript language values), or a throw completion

      1. Perform ? RequireObjectCoercible(_items_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _groups_ be a new empty List. 1. Let _iteratorRecord_ be ? GetIterator(_items_, ~sync~). 1. Let _k_ be 0. @@ -6800,18 +6919,61 @@

      1. If _next_ is ~done~, then 1. Return _groups_. 1. Let _value_ be _next_. - 1. Let _key_ be Completion(Call(_callbackfn_, *undefined*, « _value_, 𝔽(_k_) »)). + 1. Let _key_ be Completion(Call(_callback_, *undefined*, « _value_, 𝔽(_k_) »)). 1. IfAbruptCloseIterator(_key_, _iteratorRecord_). 1. If _keyCoercion_ is ~property~, then 1. Set _key_ to Completion(ToPropertyKey(_key_)). 1. IfAbruptCloseIterator(_key_, _iteratorRecord_). 1. Else, - 1. Assert: _keyCoercion_ is ~zero~. - 1. If _key_ is *-0*𝔽, set _key_ to *+0*𝔽. + 1. Assert: _keyCoercion_ is ~collection~. + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). 1. Perform AddValueToKeyedGroup(_groups_, _key_, _value_). 1. Set _k_ to _k_ + 1. + + +

      + GetOptionsObject ( + _options_: an ECMAScript language value, + ): either a normal completion containing an Object or a throw completion +

      +
      +
      + + 1. If _options_ is *undefined*, then + 1. Return OrdinaryObjectCreate(*null*). + 1. If _options_ is an Object, then + 1. Return _options_. + 1. Throw a *TypeError* exception. + +
      + + +

      + SetterThatIgnoresPrototypeProperties ( + _thisValue_: an ECMAScript language value, + _home_: an Object, + _p_: a property key, + _v_: an ECMAScript language value, + ): either a normal completion containing ~unused~ or a throw completion +

      +
      +
      + + 1. If _thisValue_ is not an Object, then + 1. Throw a *TypeError* exception. + 1. If SameValue(_thisValue_, _home_) is *true*, then + 1. NOTE: Throwing here emulates assignment to a non-writable data property on the _home_ object in strict mode code. + 1. Throw a *TypeError* exception. + 1. Let _desc_ be ? _thisValue_.[[GetOwnProperty]](_p_). + 1. If _desc_ is *undefined*, then + 1. Perform ? CreateDataPropertyOrThrow(_thisValue_, _p_, _v_). + 1. Else, + 1. Perform ? Set(_thisValue_, _p_, _v_, *true*). + 1. Return ~unused~. + +
      @@ -6820,21 +6982,23 @@

      Operations on Iterator Objects

      Iterator Records

      -

      An Iterator Record is a Record value used to encapsulate an Iterator or AsyncIterator along with the `next` method.

      +

      An Iterator Record is a Record value used to encapsulate an iterator or async iterator along with the `next` method.

      Iterator Records have the fields listed in .

      - - - - - + + + + + + + @@ -6872,6 +7036,21 @@

      Iterator Records

      + +

      + GetIteratorDirect ( + _obj_: an Object, + ): either a normal completion containing an Iterator Record or a throw completion +

      +
      +
      + + 1. Let _nextMethod_ be ? Get(_obj_, *"next"*). + 1. Let _iteratorRecord_ be the Iterator Record { [[Iterator]]: _obj_, [[NextMethod]]: _nextMethod_, [[Done]]: *false* }. + 1. Return _iteratorRecord_. + +
      +

      GetIteratorFromMethod ( @@ -6884,9 +7063,7 @@

      1. Let _iterator_ be ? Call(_method_, _obj_). 1. If _iterator_ is not an Object, throw a *TypeError* exception. - 1. Let _nextMethod_ be ? Get(_iterator_, *"next"*). - 1. Let _iteratorRecord_ be the Iterator Record { [[Iterator]]: _iterator_, [[NextMethod]]: _nextMethod_, [[Done]]: *false* }. - 1. Return _iteratorRecord_. + 1. Return ? GetIteratorDirect(_iterator_). @@ -6901,19 +7078,43 @@

      1. If _kind_ is ~async~, then - 1. Let _method_ be ? GetMethod(_obj_, @@asyncIterator). + 1. Let _method_ be ? GetMethod(_obj_, %Symbol.asyncIterator%). 1. If _method_ is *undefined*, then - 1. Let _syncMethod_ be ? GetMethod(_obj_, @@iterator). + 1. Let _syncMethod_ be ? GetMethod(_obj_, %Symbol.iterator%). 1. If _syncMethod_ is *undefined*, throw a *TypeError* exception. 1. Let _syncIteratorRecord_ be ? GetIteratorFromMethod(_obj_, _syncMethod_). 1. Return CreateAsyncFromSyncIterator(_syncIteratorRecord_). 1. Else, - 1. Let _method_ be ? GetMethod(_obj_, @@iterator). + 1. Let _method_ be ? GetMethod(_obj_, %Symbol.iterator%). 1. If _method_ is *undefined*, throw a *TypeError* exception. 1. Return ? GetIteratorFromMethod(_obj_, _method_). + +

      + GetIteratorFlattenable ( + _obj_: an ECMAScript language value, + _primitiveHandling_: ~iterate-string-primitives~ or ~reject-primitives~, + ): either a normal completion containing an Iterator Record or a throw completion +

      +
      +
      + + 1. If _obj_ is not an Object, then + 1. If _primitiveHandling_ is ~reject-primitives~, throw a *TypeError* exception. + 1. Assert: _primitiveHandling_ is ~iterate-string-primitives~. + 1. If _obj_ is not a String, throw a *TypeError* exception. + 1. Let _method_ be ? GetMethod(_obj_, %Symbol.iterator%). + 1. If _method_ is *undefined*, then + 1. Let _iterator_ be _obj_. + 1. Else, + 1. Let _iterator_ be ? Call(_method_, _obj_). + 1. If _iterator_ is not an Object, throw a *TypeError* exception. + 1. Return ? GetIteratorDirect(_iterator_). + +
      +

      IteratorNext ( @@ -6942,26 +7143,26 @@

      IteratorComplete ( - _iterResult_: an Object, + _iteratorResult_: an Object, ): either a normal completion containing a Boolean or a throw completion

      - 1. Return ToBoolean(? Get(_iterResult_, *"done"*)). + 1. Return ToBoolean(? Get(_iteratorResult_, *"done"*)).

      IteratorValue ( - _iterResult_: an Object, + _iteratorResult_: an Object, ): either a normal completion containing an ECMAScript language value or a throw completion

      - 1. Return ? Get(_iterResult_, *"value"*). + 1. Return ? Get(_iteratorResult_, *"value"*).
      @@ -7036,6 +7237,24 @@

      + +

      + IteratorCloseAll ( + _iters_: a List of Iterator Records, + _completion_: a Completion Record, + ): a Completion Record +

      +
      +
      skip global checks
      +
      true
      +
      + + 1. For each element _iter_ of _iters_, in reverse List order, do + 1. Set _completion_ to Completion(IteratorClose(_iter_, _completion_)). + 1. Return ? _completion_. + +
      +

      IfAbruptCloseIterator ( _value_, _iteratorRecord_ )

      IfAbruptCloseIterator is a shorthand for a sequence of algorithm steps that use an Iterator Record. An algorithm step of the form:

      @@ -7046,7 +7265,7 @@

      IfAbruptCloseIterator ( _value_, _iteratorRecord_ )

      1. Assert: _value_ is a Completion Record. 1. If _value_ is an abrupt completion, return ? IteratorClose(_iteratorRecord_, _value_). - 1. Else, set _value_ to ! _value_. + 1. Set _value_ to ! _value_.
      @@ -7077,16 +7296,30 @@

      + +

      IfAbruptCloseAsyncIterator ( _value_, _iteratorRecord_ )

      +

      IfAbruptCloseAsyncIterator is a shorthand for a sequence of algorithm steps that use an Iterator Record. An algorithm step of the form:

      + + 1. IfAbruptCloseAsyncIterator(_value_, _iteratorRecord_). + +

      means the same thing as:

      + + 1. Assert: _value_ is a Completion Record. + 1. If _value_ is an abrupt completion, return ? AsyncIteratorClose(_iteratorRecord_, _value_). + 1. Set _value_ to ! _value_. + +
      +

      - CreateIterResultObject ( + CreateIteratorResultObject ( _value_: an ECMAScript language value, _done_: a Boolean, - ): an Object that conforms to the IteratorResult interface + ): an Object that conforms to the IteratorResult interface

      description
      -
      It creates an object that conforms to the IteratorResult interface.
      +
      It creates an object that conforms to the IteratorResult interface.
      1. Let _obj_ be OrdinaryObjectCreate(%Object.prototype%). @@ -7104,15 +7337,15 @@

      description
      -
      It creates an Iterator () object record whose `next` method returns the successive elements of _list_.
      +
      It creates an Iterator Record whose [[NextMethod]] returns the successive elements of _list_.
      1. Let _closure_ be a new Abstract Closure with no parameters that captures _list_ and performs the following steps when called: 1. For each element _E_ of _list_, do - 1. Perform ? GeneratorYield(CreateIterResultObject(_E_, *false*)). + 1. Perform ? GeneratorYield(CreateIteratorResultObject(_E_, *false*)). 1. Return NormalCompletion(*undefined*). - 1. Let _iterator_ be CreateIteratorFromClosure(_closure_, ~empty~, %IteratorPrototype%). - 1. Return the Iterator Record { [[Iterator]]: _iterator_, [[NextMethod]]: %GeneratorFunction.prototype.prototype.next%, [[Done]]: *false* }. + 1. Let _iterator_ be CreateIteratorFromClosure(_closure_, ~empty~, %Iterator.prototype%). + 1. Return the Iterator Record { [[Iterator]]: _iterator_, [[NextMethod]]: %GeneratorPrototype.next%, [[Done]]: *false* }.

      The list iterator object is never directly accessible to ECMAScript code.

      @@ -7340,11 +7573,11 @@

      Static Semantics: BoundNames ( ): a List of Strings

      1. Let _head_ be the |AsyncArrowHead| that is covered by |CoverCallExpressionAndAsyncArrowHead|. 1. Return the BoundNames of _head_.
      - ImportDeclaration : `import` ImportClause FromClause `;` + ImportDeclaration : `import` ImportClause FromClause WithClause? `;` 1. Return the BoundNames of |ImportClause|. - ImportDeclaration : `import` ModuleSpecifier `;` + ImportDeclaration : `import` ModuleSpecifier WithClause? `;` 1. Return a new empty List. @@ -7376,7 +7609,7 @@

      Static Semantics: BoundNames ( ): a List of Strings

      ExportDeclaration : - `export` ExportFromClause FromClause `;` + `export` ExportFromClause FromClause WithClause? `;` `export` NamedExports `;` @@ -7734,7 +7967,7 @@

      Static Semantics: LexicallyScopedDeclarations ( ): a List of Parse Nodes

      ExportDeclaration : - `export` ExportFromClause FromClause `;` + `export` ExportFromClause FromClause WithClause? `;` `export` NamedExports `;` `export` VariableStatement @@ -8575,8 +8808,8 @@

      BreakStatement : `break` LabelIdentifier `;` - 1. If _labelSet_ does not contain the StringValue of |LabelIdentifier|, return *true*. - 1. Return *false*. + 1. If _labelSet_ contains the StringValue of |LabelIdentifier|, return *false*. + 1. Return *true*. WithStatement : `with` `(` Expression `)` Statement @@ -8764,8 +8997,8 @@

      ContinueStatement : `continue` LabelIdentifier `;` - 1. If _iterationSet_ does not contain the StringValue of |LabelIdentifier|, return *true*. - 1. Return *false*. + 1. If _iterationSet_ contains the StringValue of |LabelIdentifier|, return *false*. + 1. Return *true*. WithStatement : `with` `(` Expression `)` Statement @@ -9175,9 +9408,8 @@

      ClassExpression : `class` ClassTail - 1. Let _value_ be ? ClassDefinitionEvaluation of |ClassTail| with arguments *undefined* and _name_. - 1. Set _value_.[[SourceText]] to the source text matched by |ClassExpression|. - 1. Return _value_. + 1. Let _sourceText_ be the source text matched by |ClassExpression|. + 1. Return ? ClassDefinitionEvaluation of |ClassTail| with arguments *undefined*, _name_, and _sourceText_. @@ -9241,7 +9473,8 @@

      1. If _symbol_ is |ClassBody|, return *true*. 1. If _symbol_ is |ClassHeritage|, then - 1. If |ClassHeritage| is present, return *true*; otherwise return *false*. + 1. If |ClassHeritage| is present, return *true*. + 1. Return *false*. 1. If |ClassHeritage| is present, then 1. If |ClassHeritage| Contains _symbol_ is *true*, return *true*. 1. Return the result of ComputedPropertyContains of |ClassBody| with argument _symbol_. @@ -9509,9 +9742,8 @@

      1. If _environment_ is not *undefined*, then 1. Perform ! _environment_.InitializeBinding(_name_, _value_). 1. Return ~unused~. - 1. Else, - 1. Let _lhs_ be ? ResolveBinding(_name_). - 1. Return ? PutValue(_lhs_, _value_). + 1. Let _lhs_ be ? ResolveBinding(_name_). + 1. Return ? PutValue(_lhs_, _value_). @@ -9664,7 +9896,7 @@

      -

      Static Semantics: AssignmentTargetType ( ): ~simple~ or ~invalid~

      +

      Static Semantics: AssignmentTargetType ( ): ~simple~, ~web-compat~, or ~invalid~

      IdentifierReference : Identifier @@ -9699,6 +9931,16 @@

      Static Semantics: AssignmentTargetType ( ): ~simple~ or ~invalid~

      1. Let _expr_ be the |ParenthesizedExpression| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|. 1. Return the AssignmentTargetType of _expr_. + + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + + + 1. [id="step-assignmenttargettype-web-compat", normative-optional] If the host is a web browser or otherwise supports and IsStrict(this |CallExpression|) is *false*, then + 1. Return ~web-compat~. + 1. Return ~invalid~. + PrimaryExpression : `this` @@ -9714,10 +9956,8 @@

      Static Semantics: AssignmentTargetType ( ): ~simple~ or ~invalid~

      TemplateLiteral CallExpression : - CoverCallExpressionAndAsyncArrowHead SuperCall ImportCall - CallExpression Arguments CallExpression TemplateLiteral NewExpression : @@ -9837,11 +10077,19 @@

      Static Semantics: PropName ( ): a String or ~empty~

      1. Return the PropName of |PropertyName|. - LiteralPropertyName : IdentifierName + + LiteralPropertyName : IdentifierName + + AttributeKey : IdentifierName + 1. Return the StringValue of |IdentifierName|. - LiteralPropertyName : StringLiteral + + LiteralPropertyName : StringLiteral + + AttributeKey : StringLiteral + 1. Return the SV of |StringLiteral|. @@ -9939,94 +10187,163 @@

      The Environment Record Type Hierarchy

      The Environment Record abstract class includes the abstract specification methods defined in . These abstract methods have distinct concrete algorithms for each of the concrete subclasses.

      - +

      - Field Name - - Value - - Meaning -
      + Field Name + + Value + + Meaning +
      [[Iterator]] @@ -6843,7 +7007,7 @@

      Iterator Records

      an Object
      - An object that conforms to the Iterator or AsyncIterator interface. + An object that conforms to the iterator interface or the async iterator interface.
      - - - + + + + + + + + + + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + +
      - Method - - Purpose -
      + Method + + Purpose + + Definitions +
      + HasBinding ( + _N_: a String, + ): either a normal completion containing a Boolean or a throw completion + + It determines if an Environment Record has a binding for _N_. + + It has concrete definitions in the following types: + +
      + CreateMutableBinding ( + _N_: a String, + _D_: a Boolean, + ): either a normal completion containing ~unused~ or a throw completion + - HasBinding(N) + It creates a new but uninitialized mutable binding in an Environment Record. _N_ is the text of the bound name. If _D_ is *true* the binding may be subsequently deleted. - Determine if an Environment Record has a binding for the String value _N_. Return *true* if it does and *false* if it does not. + It has concrete definitions in the following types: +
      + CreateImmutableBinding ( + _N_: a String, + _S_: a Boolean, + ): either a normal completion containing ~unused~ or a throw completion + - CreateMutableBinding(N, D) + It creates a new but uninitialized immutable binding in an Environment Record. _N_ is the text of the bound name. If _S_ is *true* then attempts to set it after it has been initialized will always throw an exception, regardless of the strict mode setting of operations that reference that binding. - Create a new but uninitialized mutable binding in an Environment Record. The String value _N_ is the text of the bound name. If the Boolean argument _D_ is *true* the binding may be subsequently deleted. + It has concrete definitions in the following types: +
      + InitializeBinding ( + _N_: a String, + _V_: an ECMAScript language value, + ): either a normal completion containing ~unused~ or a throw completion + - CreateImmutableBinding(N, S) + It sets the value of an already existing but uninitialized binding in an Environment Record. _N_ is the text of the bound name. _V_ is the value for the binding. - Create a new but uninitialized immutable binding in an Environment Record. The String value _N_ is the text of the bound name. If _S_ is *true* then attempts to set it after it has been initialized will always throw an exception, regardless of the strict mode setting of operations that reference that binding. + It has concrete definitions in the following types: +
      - InitializeBinding(N, V) + SetMutableBinding ( + _N_: a String, + _V_: an ECMAScript language value, + _S_: a Boolean, + ): either a normal completion containing ~unused~ or a throw completion - Set the value of an already existing but uninitialized binding in an Environment Record. The String value _N_ is the text of the bound name. _V_ is the value for the binding and is a value of any ECMAScript language type. + It sets the value of an already existing mutable binding in an Environment Record. _N_ is the text of the bound name. _V_ is the value for the binding. If _S_ is *true* and the binding cannot be set, this will throw a *TypeError* exception. + + It has concrete definitions in the following types: +
      - SetMutableBinding(N, V, S) + GetBindingValue ( + _N_: a String, + _S_: a Boolean, + ): either a normal completion containing an ECMAScript language value or a throw completion - Set the value of an already existing mutable binding in an Environment Record. The String value _N_ is the text of the bound name. _V_ is the value for the binding and may be a value of any ECMAScript language type. _S_ is a Boolean flag. If _S_ is *true* and the binding cannot be set throw a *TypeError* exception. + It returns the value of an already existing binding from an Environment Record. _N_ is the text of the bound name. _S_ is used to identify references originating in strict mode code or that otherwise require strict mode reference semantics. If _S_ is *true* and the binding does not exist, this will throw a *ReferenceError* exception. If the binding exists but is uninitialized a *ReferenceError* is thrown, regardless of the value of _S_. + + It has concrete definitions in the following types: +
      + DeleteBinding ( + _N_: a String, + ): either a normal completion containing a Boolean or a throw completion + - GetBindingValue(N, S) + It deletes a binding from an Environment Record. _N_ is the text of the bound name. If a binding for _N_ exists, this removes the binding and returns *true*. If the binding exists but cannot be removed, this returns *false*. If the binding does not exist, this returns *true*. - Returns the value of an already existing binding from an Environment Record. The String value _N_ is the text of the bound name. _S_ is used to identify references originating in strict mode code or that otherwise require strict mode reference semantics. If _S_ is *true* and the binding does not exist throw a *ReferenceError* exception. If the binding exists but is uninitialized a *ReferenceError* is thrown, regardless of the value of _S_. + It has concrete definitions in the following types: +
      HasThisBinding ( ): a Boolean - DeleteBinding(N) + It determines if an Environment Record establishes a `this` binding. This returns *true* if it does and *false* if it does not. - Delete a binding from an Environment Record. The String value _N_ is the text of the bound name. If a binding for _N_ exists, remove the binding and return *true*. If the binding exists but cannot be removed return *false*. If the binding does not exist return *true*. + It has concrete definitions in the following types: +
      GetThisBinding ( ): either a normal completion containing an ECMAScript language value or a throw completion - HasThisBinding() + It returns the value of this Environment Record's `this` binding. It throws a *ReferenceError* if the `this` binding has not been initialized. - Determine if an Environment Record establishes a `this` binding. Return *true* if it does and *false* if it does not. + It has concrete definitions in the following types: +
      HasSuperBinding ( ): a Boolean - HasSuperBinding() + It determines if an Environment Record establishes a `super` method binding. This returns *true* if it does and *false* if it does not. If it returns *true* it implies that the Environment Record is a Function Environment Record, although the reverse implication does not hold. - Determine if an Environment Record establishes a `super` method binding. Return *true* if it does and *false* if it does not. + It has concrete definitions in the following types: +
      WithBaseObject ( ): an Object or *undefined* - WithBaseObject() + If this Environment Record is associated with a `with` statement, it returns the with object. Otherwise, it returns *undefined*. - If this Environment Record is associated with a `with` statement, return the with object. Otherwise, return *undefined*. + It has concrete definitions in the following types: +
      @@ -10035,7 +10352,6 @@

      The Environment Record Type Hierarchy

      Declarative Environment Records

      Each Declarative Environment Record is associated with an ECMAScript program scope containing variable, constant, let, class, module, import, and/or function declarations. A Declarative Environment Record binds the set of identifiers defined by the declarations contained within its scope.

      -

      The behaviour of the concrete specification methods for Declarative Environment Records is defined by the following algorithms.

      @@ -10213,6 +10529,11 @@

      HasThisBinding ( ): *false*

      + +

      GetThisBinding ( )

      +

      The GetThisBinding concrete method of a Declarative Environment Record is never used within this specification.

      +
      +

      HasSuperBinding ( ): *false*

      @@ -10246,17 +10567,19 @@

      Object Environment Records

      Object Environment Records have the additional state fields listed in .

      - - - - - + + + + + + +
      - Field Name - - Value - - Meaning -
      + Field Name + + Value + + Meaning +
      [[BindingObject]] @@ -10281,7 +10604,6 @@

      Object Environment Records

      -

      The behaviour of the concrete specification methods for Object Environment Records is defined by the following algorithms.

      @@ -10301,7 +10623,7 @@

      1. Let _foundBinding_ be ? HasProperty(_bindingObject_, _N_). 1. If _foundBinding_ is *false*, return *false*. 1. If _envRec_.[[IsWithEnvironment]] is *false*, return *true*. - 1. Let _unscopables_ be ? Get(_bindingObject_, @@unscopables). + 1. Let _unscopables_ be ? Get(_bindingObject_, %Symbol.unscopables%). 1. If _unscopables_ is an Object, then 1. Let _blocked_ be ToBoolean(? Get(_unscopables_, _N_)). 1. If _blocked_ is *true*, return *false*. @@ -10353,7 +10675,7 @@

      It is used to set the bound value of the current binding of the identifier whose name is _N_ to the value _V_.

      - 1. Perform ? _envRec_.SetMutableBinding(_N_, _V_, *false*). + 1. Perform ? _envRec_.SetMutableBinding(_N_, _V_, *false*). 1. Return ~unused~. @@ -10403,7 +10725,8 @@

      1. Let _bindingObject_ be _envRec_.[[BindingObject]]. 1. Let _value_ be ? HasProperty(_bindingObject_, _N_). 1. If _value_ is *false*, then - 1. If _S_ is *false*, return *undefined*; otherwise throw a *ReferenceError* exception. + 1. If _S_ is *false*, return *undefined*. + 1. Throw a *ReferenceError* exception. 1. Return ? Get(_bindingObject_, _N_). @@ -10423,7 +10746,7 @@

      1. Let _bindingObject_ be _envRec_.[[BindingObject]]. - 1. Return ? _bindingObject_.[[Delete]](_N_). + 1. Return ? _bindingObject_.[[Delete]](_N_). @@ -10441,6 +10764,11 @@

      HasThisBinding ( ): *false*

      + +

      GetThisBinding ( )

      +

      The GetThisBinding concrete method of an Object Environment Record is never used within this specification.

      +
      +

      HasSuperBinding ( ): *false*

      @@ -10463,7 +10791,7 @@

      WithBaseObject ( ): an Object or *undefined*

      1. If _envRec_.[[IsWithEnvironment]] is *true*, return _envRec_.[[BindingObject]]. - 1. Otherwise, return *undefined*. + 1. Return *undefined*.
      @@ -10474,17 +10802,19 @@

      Function Environment Records

      Function Environment Records have the additional state fields listed in .

      - - - - - + + + + + + +
      - Field Name - - Value - - Meaning -
      + Field Name + + Value + + Meaning +
      [[ThisValue]] @@ -10523,7 +10853,7 @@

      Function Environment Records

      [[NewTarget]]
      - an Object or *undefined* + a constructor or *undefined* If this Environment Record was created by the [[Construct]] internal method, [[NewTarget]] is the value of the [[Construct]] _newTarget_ parameter. Otherwise, its value is *undefined*. @@ -10531,61 +10861,25 @@

      Function Environment Records

      -

      Function Environment Records support all of the Declarative Environment Record methods listed in and share the same specifications for all of those methods except for HasThisBinding and HasSuperBinding. In addition, Function Environment Records support the methods listed in :

      - - - - - - - - - - - - - - - - - - -
      - Method - - Purpose -
      - BindThisValue(V) - - Set the [[ThisValue]] and record that it has been initialized. -
      - GetThisBinding() - - Return the value of this Environment Record's `this` binding. Throws a *ReferenceError* if the `this` binding has not been initialized. -
      - GetSuperBase() - - Return the object that is the base for `super` property accesses bound in this Environment Record. The value *undefined* indicates that such accesses will produce runtime errors. -
      -
      -

      The behaviour of the additional concrete specification methods for Function Environment Records is defined by the following algorithms:

      +

      Function Environment Records support all of the Declarative Environment Record methods listed in and share the same specifications for all of those methods except for HasThisBinding, GetThisBinding, and HasSuperBinding.

      - +

      BindThisValue ( + _envRec_: a Function Environment Record, _V_: an ECMAScript language value, - ): either a normal completion containing an ECMAScript language value or a throw completion + ): either a normal completion containing ~unused~ or a throw completion

      -
      for
      -
      a Function Environment Record _envRec_
      +
      description
      +
      It sets the _envRec_.[[ThisValue]] and records that it has been initialized.
      1. Assert: _envRec_.[[ThisBindingStatus]] is not ~lexical~. 1. If _envRec_.[[ThisBindingStatus]] is ~initialized~, throw a *ReferenceError* exception. 1. Set _envRec_.[[ThisValue]] to _V_. 1. Set _envRec_.[[ThisBindingStatus]] to ~initialized~. - 1. Return _V_. + 1. Return ~unused~.
      @@ -10595,20 +10889,9 @@

      HasThisBinding ( ): a Boolean

      for
      a Function Environment Record _envRec_
      - - 1. If _envRec_.[[ThisBindingStatus]] is ~lexical~, return *false*; otherwise, return *true*. - -
      - - -

      HasSuperBinding ( ): a Boolean

      -
      -
      for
      -
      a Function Environment Record _envRec_
      -
      1. If _envRec_.[[ThisBindingStatus]] is ~lexical~, return *false*. - 1. If _envRec_.[[FunctionObject]].[[HomeObject]] is *undefined*, return *false*; otherwise, return *true*. + 1. Return *true*.
      @@ -10625,17 +10908,34 @@

      GetThisBinding ( ): either a normal completion containing an ECMAScript lang - -

      GetSuperBase ( ): either a normal completion containing either an Object, *null*, or *undefined*, or a throw completion

      + +

      HasSuperBinding ( ): a Boolean

      for
      a Function Environment Record _envRec_
      + + 1. If _envRec_.[[ThisBindingStatus]] is ~lexical~, return *false*. + 1. If _envRec_.[[FunctionObject]].[[HomeObject]] is *undefined*, return *false*. + 1. Return *true*. + +
      + + +

      + GetSuperBase ( + _envRec_: a Function Environment Record, + ): an Object, *null*, or *undefined* +

      +
      +
      description
      +
      It returns the object that is the base for `super` property accesses bound in _envRec_. The value *undefined* indicates that such accesses will produce runtime errors.
      +
      1. Let _home_ be _envRec_.[[FunctionObject]].[[HomeObject]]. 1. If _home_ is *undefined*, return *undefined*. - 1. Assert: _home_ is an Object. - 1. Return ? _home_.[[GetPrototypeOf]](). + 1. Assert: _home_ is an ordinary object. + 1. Return ! _home_.[[GetPrototypeOf]]().
      @@ -10644,21 +10944,23 @@

      GetSuperBase ( ): either a normal completion containing either an Object, *n

      Global Environment Records

      A Global Environment Record is used to represent the outer most scope that is shared by all of the ECMAScript |Script| elements that are processed in a common realm. A Global Environment Record provides the bindings for built-in globals (clause ), properties of the global object, and for all top-level declarations (, ) that occur within a |Script|.

      A Global Environment Record is logically a single record but it is specified as a composite encapsulating an Object Environment Record and a Declarative Environment Record. The Object Environment Record has as its base object the global object of the associated Realm Record. This global object is the value returned by the Global Environment Record's GetThisBinding concrete method. The Object Environment Record component of a Global Environment Record contains the bindings for all built-in globals (clause ) and all bindings introduced by a |FunctionDeclaration|, |GeneratorDeclaration|, |AsyncFunctionDeclaration|, |AsyncGeneratorDeclaration|, or |VariableStatement| contained in global code. The bindings for all other ECMAScript declarations in global code are contained in the Declarative Environment Record component of the Global Environment Record.

      -

      Properties may be created directly on a global object. Hence, the Object Environment Record component of a Global Environment Record may contain both bindings created explicitly by |FunctionDeclaration|, |GeneratorDeclaration|, |AsyncFunctionDeclaration|, |AsyncGeneratorDeclaration|, or |VariableDeclaration| declarations and bindings created implicitly as properties of the global object. In order to identify which bindings were explicitly created using declarations, a Global Environment Record maintains a list of the names bound using its CreateGlobalVarBinding and CreateGlobalFunctionBinding concrete methods.

      -

      Global Environment Records have the additional fields listed in and the additional methods listed in .

      +

      Properties may be created directly on a global object. Hence, the Object Environment Record component of a Global Environment Record may contain both bindings created explicitly by |FunctionDeclaration|, |GeneratorDeclaration|, |AsyncFunctionDeclaration|, |AsyncGeneratorDeclaration|, or |VariableDeclaration| declarations and bindings created implicitly as properties of the global object. In order to identify which bindings were explicitly created using declarations, a Global Environment Record maintains a list of the names bound using the CreateGlobalVarBinding and CreateGlobalFunctionBinding abstract operations.

      +

      Global Environment Records have the additional fields listed in .

      - - - - - + + + + + + + - - - - -
      - Field Name - - Value - - Meaning -
      + Field Name + + Value + + Meaning +
      [[ObjectRecord]] @@ -10692,96 +10994,8 @@

      Global Environment Records

      Contains bindings for all declarations in global code for the associated realm code except for |FunctionDeclaration|, |GeneratorDeclaration|, |AsyncFunctionDeclaration|, |AsyncGeneratorDeclaration|, and |VariableDeclaration| bindings.
      - [[VarNames]] - - a List of Strings - - The string names bound by |FunctionDeclaration|, |GeneratorDeclaration|, |AsyncFunctionDeclaration|, |AsyncGeneratorDeclaration|, and |VariableDeclaration| declarations in global code for the associated realm. -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - Method - - Purpose -
      - GetThisBinding() - - Return the value of this Environment Record's `this` binding. -
      - HasVarDeclaration (N) - - Determines if the argument identifier has a binding in this Environment Record that was created using a |VariableDeclaration|, |FunctionDeclaration|, |GeneratorDeclaration|, |AsyncFunctionDeclaration|, or |AsyncGeneratorDeclaration|. -
      - HasLexicalDeclaration (N) - - Determines if the argument identifier has a binding in this Environment Record that was created using a lexical declaration such as a |LexicalDeclaration| or a |ClassDeclaration|. -
      - HasRestrictedGlobalProperty (N) - - Determines if the argument is the name of a global object property that may not be shadowed by a global lexical binding. -
      - CanDeclareGlobalVar (N) - - Determines if a corresponding CreateGlobalVarBinding call would succeed if called for the same argument _N_. -
      - CanDeclareGlobalFunction (N) - - Determines if a corresponding CreateGlobalFunctionBinding call would succeed if called for the same argument _N_. -
      - CreateGlobalVarBinding(N, D) - - Used to create and initialize to *undefined* a global `var` binding in the [[ObjectRecord]] component of a Global Environment Record. The binding will be a mutable binding. The corresponding global object property will have attribute values appropriate for a `var`. The String value _N_ is the bound name. If _D_ is *true*, the binding may be deleted. Logically equivalent to CreateMutableBinding followed by a SetMutableBinding but it allows var declarations to receive special treatment. -
      - CreateGlobalFunctionBinding(N, V, D) - - Create and initialize a global `function` binding in the [[ObjectRecord]] component of a Global Environment Record. The binding will be a mutable binding. The corresponding global object property will have attribute values appropriate for a `function`. The String value _N_ is the bound name. _V_ is the initialization value. If the Boolean argument _D_ is *true*, the binding may be deleted. Logically equivalent to CreateMutableBinding followed by a SetMutableBinding but it allows function declarations to receive special treatment. -
      -
      -

      The behaviour of the concrete specification methods for Global Environment Records is defined by the following algorithms.

      @@ -10800,7 +11014,7 @@

      1. Let _DclRec_ be _envRec_.[[DeclarativeRecord]]. 1. If ! _DclRec_.HasBinding(_N_) is *true*, return *true*. 1. Let _ObjRec_ be _envRec_.[[ObjectRecord]]. - 1. Return ? _ObjRec_.HasBinding(_N_). + 1. Return ? _ObjRec_.HasBinding(_N_). @@ -10866,7 +11080,7 @@

      1. Return ! _DclRec_.InitializeBinding(_N_, _V_). 1. Assert: If the binding exists, it must be in the Object Environment Record. 1. Let _ObjRec_ be _envRec_.[[ObjectRecord]]. - 1. Return ? _ObjRec_.InitializeBinding(_N_, _V_). + 1. Return ? _ObjRec_.InitializeBinding(_N_, _V_). @@ -10890,7 +11104,7 @@

      1. If ! _DclRec_.HasBinding(_N_) is *true*, then 1. Return ? _DclRec_.SetMutableBinding(_N_, _V_, _S_). 1. Let _ObjRec_ be _envRec_.[[ObjectRecord]]. - 1. Return ? _ObjRec_.SetMutableBinding(_N_, _V_, _S_). + 1. Return ? _ObjRec_.SetMutableBinding(_N_, _V_, _S_). @@ -10913,7 +11127,7 @@

      1. If ! _DclRec_.HasBinding(_N_) is *true*, then 1. Return ? _DclRec_.GetBindingValue(_N_, _S_). 1. Let _ObjRec_ be _envRec_.[[ObjectRecord]]. - 1. Return ? _ObjRec_.GetBindingValue(_N_, _S_). + 1. Return ? _ObjRec_.GetBindingValue(_N_, _S_). @@ -10938,10 +11152,7 @@

      1. Let _globalObject_ be _ObjRec_.[[BindingObject]]. 1. Let _existingProp_ be ? HasOwnProperty(_globalObject_, _N_). 1. If _existingProp_ is *true*, then - 1. Let _status_ be ? _ObjRec_.DeleteBinding(_N_). - 1. If _status_ is *true* and _envRec_.[[VarNames]] contains _N_, then - 1. Remove _N_ from _envRec_.[[VarNames]]. - 1. Return _status_. + 1. Return ? _ObjRec_.DeleteBinding(_N_). 1. Return *true*. @@ -10960,6 +11171,17 @@

      HasThisBinding ( ): *true*

      + +

      GetThisBinding ( ): a normal completion containing an Object

      +
      +
      for
      +
      a Global Environment Record _envRec_
      +
      + + 1. Return _envRec_.[[GlobalThisValue]]. + +
      +

      HasSuperBinding ( ): *false*

      @@ -10985,49 +11207,16 @@

      WithBaseObject ( ): *undefined*

      - -

      GetThisBinding ( ): a normal completion containing an Object

      -
      -
      for
      -
      a Global Environment Record _envRec_
      -
      - - 1. Return _envRec_.[[GlobalThisValue]]. - -
      - - -

      - HasVarDeclaration ( - _N_: a String, - ): a Boolean -

      -
      -
      for
      -
      a Global Environment Record _envRec_
      - -
      description
      -
      It determines if the argument identifier has a binding in this record that was created using a |VariableStatement| or a |FunctionDeclaration|.
      -
      - - 1. Let _varDeclaredNames_ be _envRec_.[[VarNames]]. - 1. If _varDeclaredNames_ contains _N_, return *true*. - 1. Return *false*. - -
      - - +

      HasLexicalDeclaration ( + _envRec_: a Global Environment Record, _N_: a String, ): a Boolean

      -
      for
      -
      a Global Environment Record _envRec_
      -
      description
      -
      It determines if the argument identifier has a binding in this record that was created using a lexical declaration such as a |LexicalDeclaration| or a |ClassDeclaration|.
      +
      It determines if the argument identifier has a binding in _envRec_ that was created using a lexical declaration such as a |LexicalDeclaration| or a |ClassDeclaration|.
      1. Let _DclRec_ be _envRec_.[[DeclarativeRecord]]. @@ -11035,23 +11224,21 @@

      - +

      HasRestrictedGlobalProperty ( + _envRec_: a Global Environment Record, _N_: a String, ): either a normal completion containing a Boolean or a throw completion

      -
      for
      -
      a Global Environment Record _envRec_
      -
      description
      It determines if the argument identifier is the name of a property of the global object that must not be shadowed by a global lexical binding.
      1. Let _ObjRec_ be _envRec_.[[ObjectRecord]]. 1. Let _globalObject_ be _ObjRec_.[[BindingObject]]. - 1. Let _existingProp_ be ? _globalObject_.[[GetOwnProperty]](_N_). + 1. Let _existingProp_ be ? _globalObject_.[[GetOwnProperty]](_N_). 1. If _existingProp_ is *undefined*, return *false*. 1. If _existingProp_.[[Configurable]] is *true*, return *false*. 1. Return *true*. @@ -11061,16 +11248,14 @@

      - +

      CanDeclareGlobalVar ( + _envRec_: a Global Environment Record, _N_: a String, ): either a normal completion containing a Boolean or a throw completion

      -
      for
      -
      a Global Environment Record _envRec_
      -
      description
      It determines if a corresponding CreateGlobalVarBinding call would succeed if called for the same argument _N_. Redundant var declarations and var declarations for pre-existing global object properties are allowed.
      @@ -11083,23 +11268,21 @@

      - +

      CanDeclareGlobalFunction ( + _envRec_: a Global Environment Record, _N_: a String, ): either a normal completion containing a Boolean or a throw completion

      -
      for
      -
      a Global Environment Record _envRec_
      -
      description
      It determines if a corresponding CreateGlobalFunctionBinding call would succeed if called for the same argument _N_.
      1. Let _ObjRec_ be _envRec_.[[ObjectRecord]]. 1. Let _globalObject_ be _ObjRec_.[[BindingObject]]. - 1. Let _existingProp_ be ? _globalObject_.[[GetOwnProperty]](_N_). + 1. Let _existingProp_ be ? _globalObject_.[[GetOwnProperty]](_N_). 1. If _existingProp_ is *undefined*, return ? IsExtensible(_globalObject_). 1. If _existingProp_.[[Configurable]] is *true*, return *true*. 1. If IsDataDescriptor(_existingProp_) is *true* and _existingProp_ has attribute values { [[Writable]]: *true*, [[Enumerable]]: *true* }, return *true*. @@ -11107,19 +11290,17 @@

      - +

      CreateGlobalVarBinding ( + _envRec_: a Global Environment Record, _N_: a String, _D_: a Boolean, ): either a normal completion containing ~unused~ or a throw completion

      -
      for
      -
      a Global Environment Record _envRec_
      -
      description
      -
      It creates and initializes a mutable binding in the associated Object Environment Record and records the bound name in the associated [[VarNames]] List. If a binding already exists, it is reused and assumed to be initialized.
      +
      It creates and initializes a mutable binding in the associated Object Environment Record. If a binding already exists, it is reused and assumed to be initialized.
      1. Let _ObjRec_ be _envRec_.[[ObjectRecord]]. @@ -11127,41 +11308,35 @@

      1. Let _hasProperty_ be ? HasOwnProperty(_globalObject_, _N_). 1. Let _extensible_ be ? IsExtensible(_globalObject_). 1. If _hasProperty_ is *false* and _extensible_ is *true*, then - 1. Perform ? _ObjRec_.CreateMutableBinding(_N_, _D_). - 1. Perform ? _ObjRec_.InitializeBinding(_N_, *undefined*). - 1. If _envRec_.[[VarNames]] does not contain _N_, then - 1. Append _N_ to _envRec_.[[VarNames]]. + 1. Perform ? _ObjRec_.CreateMutableBinding(_N_, _D_). + 1. Perform ? _ObjRec_.InitializeBinding(_N_, *undefined*). 1. Return ~unused~. - +

      CreateGlobalFunctionBinding ( + _envRec_: a Global Environment Record, _N_: a String, _V_: an ECMAScript language value, _D_: a Boolean, ): either a normal completion containing ~unused~ or a throw completion

      -
      for
      -
      a Global Environment Record _envRec_
      -
      description
      -
      It creates and initializes a mutable binding in the associated Object Environment Record and records the bound name in the associated [[VarNames]] List. If a binding already exists, it is replaced.
      +
      It creates and initializes a mutable binding in the associated Object Environment Record. If a binding already exists, it is replaced.
      1. Let _ObjRec_ be _envRec_.[[ObjectRecord]]. 1. Let _globalObject_ be _ObjRec_.[[BindingObject]]. - 1. Let _existingProp_ be ? _globalObject_.[[GetOwnProperty]](_N_). + 1. Let _existingProp_ be ? _globalObject_.[[GetOwnProperty]](_N_). 1. If _existingProp_ is *undefined* or _existingProp_.[[Configurable]] is *true*, then 1. Let _desc_ be the PropertyDescriptor { [[Value]]: _V_, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: _D_ }. 1. Else, 1. Let _desc_ be the PropertyDescriptor { [[Value]]: _V_ }. 1. Perform ? DefinePropertyOrThrow(_globalObject_, _N_, _desc_). 1. [id="step-createglobalfunctionbinding-set"] Perform ? Set(_globalObject_, _N_, _V_, *false*). - 1. If _envRec_.[[VarNames]] does not contain _N_, then - 1. Append _N_ to _envRec_.[[VarNames]]. 1. Return ~unused~. @@ -11173,36 +11348,7 @@

      Module Environment Records

      A Module Environment Record is a Declarative Environment Record that is used to represent the outer scope of an ECMAScript |Module|. In additional to normal mutable and immutable bindings, Module Environment Records also provide immutable import bindings which are bindings that provide indirect access to a target binding that exists in another Environment Record.

      -

      Module Environment Records support all of the Declarative Environment Record methods listed in and share the same specifications for all of those methods except for GetBindingValue, DeleteBinding, HasThisBinding and GetThisBinding. In addition, Module Environment Records support the methods listed in :

      - - - - - - - - - - - - - - -
      - Method - - Purpose -
      - CreateImportBinding(N, M, N2) - - Create an immutable indirect binding in a Module Environment Record. The String value _N_ is the text of the bound name. _M_ is a Module Record, and _N2_ is a binding that exists in _M_'s Module Environment Record. -
      - GetThisBinding() - - Return the value of this Environment Record's `this` binding. -
      -
      -

      The behaviour of the additional concrete specification methods for Module Environment Records are defined by the following algorithms:

      +

      Module Environment Records support all of the Declarative Environment Record methods listed in and share the same specifications for all of those methods except for GetBindingValue, DeleteBinding, HasThisBinding, and GetThisBinding.

      @@ -11225,7 +11371,7 @@

      1. Let _M_ and _N2_ be the indirection values provided when this binding for _N_ was created. 1. Let _targetEnv_ be _M_.[[Environment]]. 1. If _targetEnv_ is ~empty~, throw a *ReferenceError* exception. - 1. Return ? _targetEnv_.GetBindingValue(_N2_, *true*). + 1. Return ? _targetEnv_.GetBindingValue(_N2_, *true*). 1. If the binding for _N_ in _envRec_ is an uninitialized binding, throw a *ReferenceError* exception. 1. Return the value currently bound to _N_ in _envRec_. @@ -11267,20 +11413,18 @@

      GetThisBinding ( ): a normal completion containing *undefined*

      - +

      CreateImportBinding ( + _envRec_: a Module Environment Record, _N_: a String, _M_: a Module Record, _N2_: a String, ): ~unused~

      -
      for
      -
      a Module Environment Record _envRec_
      -
      description
      -
      It creates a new initialized immutable indirect binding for the name _N_. A binding must not already exist in this Environment Record for _N_. _N2_ is the name of a binding that exists in _M_'s Module Environment Record. Accesses to the value of the new binding will indirectly access the bound value of the target binding.
      +
      It creates a new initialized immutable indirect binding for the name _N_. A binding must not already exist in _envRec_ for _N_. _N2_ is the name of a binding that exists in _M_'s Module Environment Record. Accesses to the value of the new binding will indirectly access the bound value of the target binding.
      1. Assert: _envRec_ does not already have a binding for _N_. @@ -11309,12 +11453,11 @@

      1. If _env_ is *null*, then 1. Return the Reference Record { [[Base]]: ~unresolvable~, [[ReferencedName]]: _name_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }. - 1. Let _exists_ be ? _env_.HasBinding(_name_). + 1. Let _exists_ be ? _env_.HasBinding(_name_). 1. If _exists_ is *true*, then 1. Return the Reference Record { [[Base]]: _env_, [[ReferencedName]]: _name_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }. - 1. Else, - 1. Let _outer_ be _env_.[[OuterEnv]]. - 1. Return ? GetIdentifierReference(_outer_, _name_, _strict_). + 1. Let _outer_ be _env_.[[OuterEnv]]. + 1. Return ? GetIdentifierReference(_outer_, _name_, _strict_). @@ -11388,7 +11531,6 @@

      1. Set _env_.[[ObjectRecord]] to _objRec_. 1. Set _env_.[[GlobalThisValue]] to _thisValue_. 1. Set _env_.[[DeclarativeRecord]] to _dclRec_. - 1. Set _env_.[[VarNames]] to a new empty List. 1. Set _env_.[[OuterEnv]] to *null*. 1. Return _env_. @@ -11462,34 +11604,34 @@

      PrivateEnvironment Record Operations

      NewPrivateEnvironment ( - _outerPrivEnv_: a PrivateEnvironment Record or *null*, + _outerPrivateEnv_: a PrivateEnvironment Record or *null*, ): a PrivateEnvironment Record

      1. Let _names_ be a new empty List. - 1. Return the PrivateEnvironment Record { [[OuterPrivateEnvironment]]: _outerPrivEnv_, [[Names]]: _names_ }. + 1. Return the PrivateEnvironment Record { [[OuterPrivateEnvironment]]: _outerPrivateEnv_, [[Names]]: _names_ }.

      ResolvePrivateIdentifier ( - _privEnv_: a PrivateEnvironment Record, + _privateEnv_: a PrivateEnvironment Record, _identifier_: a String, ): a Private Name

      - 1. Let _names_ be _privEnv_.[[Names]]. + 1. Let _names_ be _privateEnv_.[[Names]]. 1. For each Private Name _pn_ of _names_, do 1. If _pn_.[[Description]] is _identifier_, then 1. Return _pn_. - 1. Let _outerPrivEnv_ be _privEnv_.[[OuterPrivateEnvironment]]. - 1. Assert: _outerPrivEnv_ is not *null*. - 1. Return ResolvePrivateIdentifier(_outerPrivEnv_, _identifier_). + 1. Let _outerPrivateEnv_ be _privateEnv_.[[OuterPrivateEnvironment]]. + 1. Assert: _outerPrivateEnv_ is not *null*. + 1. Return ResolvePrivateIdentifier(_outerPrivateEnv_, _identifier_).
      @@ -11501,17 +11643,19 @@

      Realms

      A realm is represented in this specification as a Realm Record with the fields specified in :

      - - - - - + + + + + + +
      - Field Name - - Value - - Meaning -
      + Field Name + + Value + + Meaning +
      [[AgentSignifier]] @@ -11539,7 +11683,7 @@

      Realms

      [[GlobalObject]]
      - an Object or *undefined* + an Object The global object for this realm @@ -11573,10 +11717,10 @@

      Realms

      [[LoadedModules]]
      - a List of Records with fields [[Specifier]] (a String) and [[Module]] (a Module Record) + a List of LoadedModuleRequest Records -

      A map from the specifier strings imported by this realm to the resolved Module Record. The list does not contain two different Records with the same [[Specifier]].

      +

      A map from the specifier strings imported by this realm to the resolved Module Record. The list does not contain two different Records _r1_ and _r2_ such that ModuleRequestsEqual(_r1_, _r2_) is *true*.

      As mentioned in HostLoadImportedModule (), [[LoadedModules]] in Realm Records is only used when running an `import()` expression in a context where there is no active script or module. @@ -11604,15 +11748,13 @@

      InitializeHostDefinedRealm ( ): either a normal completion containing ~unuse 1. Let _realm_ be a new Realm Record. 1. Perform CreateIntrinsics(_realm_). 1. Set _realm_.[[AgentSignifier]] to AgentSignifier(). - 1. Set _realm_.[[GlobalObject]] to *undefined*. - 1. Set _realm_.[[GlobalEnv]] to *undefined*. 1. Set _realm_.[[TemplateMap]] to a new empty List. 1. Let _newContext_ be a new execution context. 1. Set the Function of _newContext_ to *null*. 1. Set the Realm of _newContext_ to _realm_. 1. Set the ScriptOrModule of _newContext_ to *null*. 1. Push _newContext_ onto the execution context stack; _newContext_ is now the running execution context. - 1. If the host requires use of an exotic object to serve as _realm_'s global object, then + 1. If the host requires use of a specific object to serve as _realm_'s global object, then 1. Let _global_ be such an object created in a host-defined manner. 1. Else, 1. Let _global_ be OrdinaryObjectCreate(_realm_.[[Intrinsics]].[[%Object.prototype%]]). @@ -11638,7 +11780,7 @@

      1. Set _realmRec_.[[Intrinsics]] to a new Record. - 1. [declared="steps,name,length,slots,prototype"] Set fields of _realmRec_.[[Intrinsics]] with the values listed in . The field names are the names listed in column one of the table. The value of each field is a new object value fully and recursively populated with property values as defined by the specification of each object in clauses through . All object property values are newly created object values. All values that are built-in function objects are created by performing CreateBuiltinFunction(_steps_, _length_, _name_, _slots_, _realmRec_, _prototype_) where _steps_ is the definition of that function provided by this specification, _name_ is the initial value of the function's *"name"* property, _length_ is the initial value of the function's *"length"* property, _slots_ is a list of the names, if any, of the function's specified internal slots, and _prototype_ is the specified value of the function's [[Prototype]] internal slot. The creation of the intrinsics and their properties must be ordered to avoid any dependencies upon objects that have not yet been created. + 1. [declared="steps,name,length,slots,prototype,async"] Set fields of _realmRec_.[[Intrinsics]] with the values listed in . The field names are the names listed in the “Intrinsic Name” column of the table. The value of each field is a new object value fully and recursively populated with property values as defined by the specification of each object in clauses through . All object property values are newly created object values. All values that are built-in function objects are created by performing CreateBuiltinFunction(_steps_, _length_, _name_, _slots_, _realmRec_, _prototype_, _async_) where _steps_ is the definition of that function provided by this specification, _name_ is the initial value of the function's *"name"* property, _length_ is the initial value of the function's *"length"* property, _slots_ is a list of the names, if any, of the function's specified internal slots, _prototype_ is the specified value of the function's [[Prototype]] internal slot, and _async_ is *true* if the function is described as “async” and *false* otherwise. The creation of the intrinsics and their properties must be ordered to avoid any dependencies upon objects that have not yet been created. 1. Perform AddRestrictedFunctionProperties(_realmRec_.[[Intrinsics]].[[%Function.prototype%]], _realmRec_). 1. Return ~unused~. @@ -11670,14 +11812,16 @@

      Execution Contexts

      An execution context contains whatever implementation specific state is necessary to track the execution progress of its associated code. Each execution context has at least the state components listed in .

      - - - - + + + + + +
      - Component - - Purpose -
      + Component + + Purpose +
      code evaluation state @@ -11717,14 +11861,16 @@

      Execution Contexts

      ECMAScript code execution contexts have the additional state components listed in .

      - - - - + + + + + +
      - Component - - Purpose -
      + Component + + Purpose +
      LexicalEnvironment @@ -11755,14 +11901,16 @@

      Execution Contexts

      Execution contexts representing the evaluation of Generators have the additional state components listed in .

      - - - - + + + + + +
      - Component - - Purpose -
      + Component + + Purpose +
      Generator @@ -11786,7 +11934,8 @@

      GetActiveScriptOrModule ( ): a Script Record, a Module Record, or *null*

      1. If the execution context stack is empty, return *null*. 1. Let _ec_ be the topmost execution context on the execution context stack whose ScriptOrModule component is not *null*. - 1. If no such execution context exists, return *null*. Otherwise, return _ec_'s ScriptOrModule. + 1. If no such execution context exists, return *null*. + 1. Return _ec_'s ScriptOrModule. @@ -11880,7 +12029,7 @@

      Jobs and Host Operations to Enqueue Jobs

    • At some future point in time, when there is no running context in the agent for which the job is scheduled and that agent's execution context stack is empty, the implementation must:
      1. Perform any host-defined preparation steps.
      2. -
      3. Invoke the Job Abstract Closure.
      4. +
      5. Invoke the Job Abstract Closure.
      6. Perform any host-defined cleanup steps, after which the execution context stack must be empty.
    • @@ -11921,17 +12070,19 @@

      JobCallback Records

      JobCallback Records have the fields listed in .

      - - - - - + + + + + + +
      - Field Name - - Value - - Meaning -
      + Field Name + + Value + + Meaning +
      [[Callback]] @@ -12071,15 +12222,17 @@

      Agents

      An agent signifier is a globally-unique opaque value used to identify an Agent.

      - - - - - + + + + + + + - + @@ -12116,13 +12269,18 @@

      Agents

      + + + + +
      Field NameValueMeaning
      Field NameValueMeaning
      [[LittleEndian]] a BooleanThe default value computed for the isLittleEndian parameter when it is needed by the algorithms GetValueFromBuffer and SetValueInBuffer. The choice is implementation-defined and should be the alternative that is most efficient for the implementation. Once the value has been observed it cannot change.The default value computed for the isLittleEndian parameter when it is needed by the algorithms GetValueFromBuffer and SetValueInBuffer. The choice is implementation-defined and should be the alternative that is most efficient for the implementation.
      [[CanBlock]] a List of either Objects or Symbols Initially a new empty List, representing the list of objects and/or symbols to be kept alive until the end of the current Job
      [[ModuleAsyncEvaluationCount]]an integerInitially 0, used to assign unique incrementing values to the [[AsyncEvaluationOrder]] field of modules that are asynchronous or have asynchronous dependencies.
      -

      Once the values of [[Signifier]], [[IsLockFree1]], and [[IsLockFree2]] have been observed by any agent in the agent cluster they cannot change.

      +

      The values of [[LittleEndian]], [[Signifier]], [[IsLockFree1]], [[IsLockFree2]], and [[IsLockFree8]] cannot change.

      -

      The values of [[IsLockFree1]] and [[IsLockFree2]] are not necessarily determined by the hardware, but may also reflect implementation choices that can vary over time and between ECMAScript implementations.

      +

      The values of [[IsLockFree1]], [[IsLockFree2]], and [[IsLockFree8]] are not necessarily determined by the hardware, but may also reflect implementation choices that can vary over time and between ECMAScript implementations.

      There is no [[IsLockFree4]] field: 4-byte atomic operations are always lock-free.

      @@ -12157,6 +12315,21 @@

      AgentCanSuspend ( ): a Boolean

      In some environments it may not be reasonable for a given agent to suspend. For example, in a web browser environment, it may be reasonable to disallow suspending a document's main event handling thread, while still allowing workers' event handling threads to suspend.

      + + +

      IncrementModuleAsyncEvaluationCount ( ): an integer

      +
      +
      + + 1. Let _AR_ be the Agent Record of the surrounding agent. + 1. Let _count_ be _AR_.[[ModuleAsyncEvaluationCount]]. + 1. Set _AR_.[[ModuleAsyncEvaluationCount]] to _count_ + 1. + 1. Return _count_. + + +

      This value is only used to keep track of the relative evaluation order between pending modules. An implementation may unobservably reset [[ModuleAsyncEvaluationCount]] to 0 whenever there are no pending modules.

      +
      +
      @@ -12182,7 +12355,7 @@

      Agent Clusters

      If different agents within an agent cluster have different values of [[LittleEndian]] it becomes hard to use shared memory for multi-byte data.

      -

      All agents within a cluster must have the same values for the [[IsLockFree1]] field in their respective Agent Records; similarly for the [[IsLockFree2]] field.

      +

      All agents within a cluster must have the same values for the [[IsLockFree1]] field in their respective Agent Records; similarly for the [[IsLockFree2]] and [[IsLockFree8]] fields.

      All agents within a cluster must have different values for the [[Signifier]] field in their respective Agent Records.

      @@ -12503,7 +12676,7 @@

      1. Return *true*. -

      The loop in step guarantees that there will be no circularities in any prototype chain that only includes objects that use the ordinary object definitions for [[GetPrototypeOf]] and [[SetPrototypeOf]].

      +

      The loop in step guarantees that there will be no cycles in any prototype chain that only includes objects that use the ordinary object definitions for [[GetPrototypeOf]] and [[SetPrototypeOf]].

      @@ -12624,7 +12797,7 @@

      - 1. Let _current_ be ? _O_.[[GetOwnProperty]](_P_). + 1. Let _current_ be ? _O_.[[GetOwnProperty]](_P_). 1. Let _extensible_ be ? IsExtensible(_O_). 1. Return ValidateAndApplyPropertyDescriptor(_O_, _P_, _extensible_, _Desc_, _current_). @@ -12680,18 +12853,19 @@

      1. If _Desc_ has a [[Set]] field and SameValue(_Desc_.[[Set]], _current_.[[Set]]) is *false*, return *false*. 1. Else if _current_.[[Writable]] is *false*, then 1. If _Desc_ has a [[Writable]] field and _Desc_.[[Writable]] is *true*, return *false*. - 1. If _Desc_ has a [[Value]] field and SameValue(_Desc_.[[Value]], _current_.[[Value]]) is *false*, return *false*. + 1. NOTE: SameValue returns *true* for *NaN* values which may be distinguishable by other means. Returning here ensures that any existing property of _O_ remains unmodified. + 1. If _Desc_ has a [[Value]] field, return SameValue(_Desc_.[[Value]], _current_.[[Value]]). 1. If _O_ is not *undefined*, then 1. If IsDataDescriptor(_current_) is *true* and IsAccessorDescriptor(_Desc_) is *true*, then 1. If _Desc_ has a [[Configurable]] field, let _configurable_ be _Desc_.[[Configurable]]; else let _configurable_ be _current_.[[Configurable]]. - 1. If _Desc_ has a [[Enumerable]] field, let _enumerable_ be _Desc_.[[Enumerable]]; else let _enumerable_ be _current_.[[Enumerable]]. + 1. If _Desc_ has an [[Enumerable]] field, let _enumerable_ be _Desc_.[[Enumerable]]; else let _enumerable_ be _current_.[[Enumerable]]. 1. Replace the property named _P_ of object _O_ with an accessor property whose [[Configurable]] and [[Enumerable]] attributes are set to _configurable_ and _enumerable_, respectively, and whose [[Get]] and [[Set]] attributes are set to the value of the corresponding field in _Desc_ if _Desc_ has that field, or to the attribute's default value otherwise. 1. Else if IsAccessorDescriptor(_current_) is *true* and IsDataDescriptor(_Desc_) is *true*, then 1. If _Desc_ has a [[Configurable]] field, let _configurable_ be _Desc_.[[Configurable]]; else let _configurable_ be _current_.[[Configurable]]. - 1. If _Desc_ has a [[Enumerable]] field, let _enumerable_ be _Desc_.[[Enumerable]]; else let _enumerable_ be _current_.[[Enumerable]]. + 1. If _Desc_ has an [[Enumerable]] field, let _enumerable_ be _Desc_.[[Enumerable]]; else let _enumerable_ be _current_.[[Enumerable]]. 1. Replace the property named _P_ of object _O_ with a data property whose [[Configurable]] and [[Enumerable]] attributes are set to _configurable_ and _enumerable_, respectively, and whose [[Value]] and [[Writable]] attributes are set to the value of the corresponding field in _Desc_ if _Desc_ has that field, or to the attribute's default value otherwise. 1. Else, - 1. For each field of _Desc_, set the corresponding attribute of the property named _P_ of object _O_ to the value of the field. + 1. For each field name _F_ of _Desc_, set the attribute named _F_ of the property named _P_ of object _O_ to the value of _Desc_'s _F_ field. 1. Return *true*. @@ -12721,11 +12895,11 @@

      - 1. Let _hasOwn_ be ? _O_.[[GetOwnProperty]](_P_). + 1. Let _hasOwn_ be ? _O_.[[GetOwnProperty]](_P_). 1. If _hasOwn_ is not *undefined*, return *true*. - 1. Let _parent_ be ? _O_.[[GetPrototypeOf]](). + 1. Let _parent_ be ? _O_.[[GetPrototypeOf]](). 1. If _parent_ is not *null*, then - 1. Return ? _parent_.[[HasProperty]](_P_). + 1. Return ? _parent_.[[HasProperty]](_P_). 1. Return *false*. @@ -12759,11 +12933,11 @@

      - 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_P_). + 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_P_). 1. If _desc_ is *undefined*, then - 1. Let _parent_ be ? _O_.[[GetPrototypeOf]](). + 1. Let _parent_ be ? _O_.[[GetPrototypeOf]](). 1. If _parent_ is *null*, return *undefined*. - 1. Return ? _parent_.[[Get]](_P_, _Receiver_). + 1. Return ? _parent_.[[Get]](_P_, _Receiver_). 1. If IsDataDescriptor(_desc_) is *true*, return _desc_.[[Value]]. 1. Assert: IsAccessorDescriptor(_desc_) is *true*. 1. Let _getter_ be _desc_.[[Get]]. @@ -12802,7 +12976,7 @@

      - 1. Let _ownDesc_ be ? _O_.[[GetOwnProperty]](_P_). + 1. Let _ownDesc_ be ? _O_.[[GetOwnProperty]](_P_). 1. Return ? OrdinarySetWithOwnDescriptor(_O_, _P_, _V_, _Receiver_, _ownDesc_). @@ -12822,23 +12996,20 @@

      1. If _ownDesc_ is *undefined*, then - 1. Let _parent_ be ? _O_.[[GetPrototypeOf]](). - 1. If _parent_ is not *null*, then - 1. Return ? _parent_.[[Set]](_P_, _V_, _Receiver_). - 1. Else, - 1. Set _ownDesc_ to the PropertyDescriptor { [[Value]]: *undefined*, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: *true* }. + 1. Let _parent_ be ? _O_.[[GetPrototypeOf]](). + 1. If _parent_ is not *null*, return ? _parent_.[[Set]](_P_, _V_, _Receiver_). + 1. Set _ownDesc_ to the PropertyDescriptor { [[Value]]: *undefined*, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: *true* }. 1. If IsDataDescriptor(_ownDesc_) is *true*, then 1. If _ownDesc_.[[Writable]] is *false*, return *false*. 1. If _Receiver_ is not an Object, return *false*. - 1. Let _existingDescriptor_ be ? _Receiver_.[[GetOwnProperty]](_P_). - 1. If _existingDescriptor_ is not *undefined*, then - 1. If IsAccessorDescriptor(_existingDescriptor_) is *true*, return *false*. - 1. If _existingDescriptor_.[[Writable]] is *false*, return *false*. - 1. Let _valueDesc_ be the PropertyDescriptor { [[Value]]: _V_ }. - 1. Return ? _Receiver_.[[DefineOwnProperty]](_P_, _valueDesc_). - 1. Else, + 1. Let _existingDescriptor_ be ? _Receiver_.[[GetOwnProperty]](_P_). + 1. If _existingDescriptor_ is *undefined*, then 1. Assert: _Receiver_ does not currently have a property _P_. 1. Return ? CreateDataProperty(_Receiver_, _P_, _V_). + 1. If IsAccessorDescriptor(_existingDescriptor_) is *true*, return *false*. + 1. If _existingDescriptor_.[[Writable]] is *false*, return *false*. + 1. Let _valueDesc_ be the PropertyDescriptor { [[Value]]: _V_ }. + 1. Return ? _Receiver_.[[DefineOwnProperty]](_P_, _valueDesc_). 1. Assert: IsAccessorDescriptor(_ownDesc_) is *true*. 1. Let _setter_ be _ownDesc_.[[Set]]. 1. If _setter_ is *undefined*, return *false*. @@ -12872,7 +13043,7 @@

      - 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_P_). + 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_P_). 1. If _desc_ is *undefined*, return *true*. 1. If _desc_.[[Configurable]] is *true*, then 1. Remove the own property with name _P_ from _O_. @@ -12941,7 +13112,7 @@

      OrdinaryCreateFromConstructor ( - _constructor_: a constructor, + _constructor_: a function object, _intrinsicDefaultProto_: a String, optional _internalSlotsList_: a List of names of internal slots, ): either a normal completion containing an Object or a throw completion @@ -13008,17 +13179,19 @@

      ECMAScript Function Objects

      In addition to [[Extensible]] and [[Prototype]], ECMAScript function objects also have the internal slots listed in .

      - - - - - + + + + + + +
      - Internal Slot - - Type - - Description -
      + Internal Slot + + Type + + Description +
      [[Environment]] @@ -13212,8 +13385,8 @@

      1. Let _result_ be Completion(OrdinaryCallEvaluateBody(_F_, _argumentsList_)). 1. [id="step-call-pop-context-stack"] Remove _calleeContext_ from the execution context stack and restore _callerContext_ as the running execution context. 1. If _result_ is a return completion, return _result_.[[Value]]. - 1. ReturnIfAbrupt(_result_). - 1. Return *undefined*. + 1. Assert: _result_ is a throw completion. + 1. Return ? _result_.

      When _calleeContext_ is removed from the execution context stack in step it must not be destroyed if it is suspended and retained for later resumption by an accessible Generator.

      @@ -13273,7 +13446,7 @@

      1. NOTE: ToObject produces wrapper objects using _calleeRealm_. 1. Assert: _localEnv_ is a Function Environment Record. 1. Assert: The next step never returns an abrupt completion because _localEnv_.[[ThisBindingStatus]] is not ~initialized~. - 1. Perform ! _localEnv_.BindThisValue(_thisValue_). + 1. Perform ! BindThisValue(_localEnv_, _thisValue_). 1. Return ~unused~. @@ -13283,7 +13456,7 @@

      Runtime Semantics: EvaluateBody ( _functionObject_: an ECMAScript function object, _argumentsList_: a List of ECMAScript language values, - ): either a normal completion containing an ECMAScript language value or an abrupt completion + ): a return completion or a throw completion

      @@ -13329,7 +13502,7 @@

      1. Else, 1. Let _rhs_ be ? Evaluation of |AssignmentExpression|. 1. Let _value_ be ? GetValue(_rhs_). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_value_).

      Even though field initializers constitute a function boundary, calling FunctionDeclarationInstantiation does not have any observable effect and so is omitted.

      @@ -13348,7 +13521,7 @@

      OrdinaryCallEvaluateBody ( _F_: an ECMAScript function object, _argumentsList_: a List of ECMAScript language values, - ): either a normal completion containing an ECMAScript language value or an abrupt completion + ): a return completion or a throw completion

      @@ -13385,12 +13558,12 @@

      1. Let _constructorEnv_ be the LexicalEnvironment of _calleeContext_. 1. Let _result_ be Completion(OrdinaryCallEvaluateBody(_F_, _argumentsList_)). 1. Remove _calleeContext_ from the execution context stack and restore _callerContext_ as the running execution context. - 1. If _result_ is a return completion, then - 1. If _result_.[[Value]] is an Object, return _result_.[[Value]]. - 1. If _kind_ is ~base~, return _thisArgument_. - 1. If _result_.[[Value]] is not *undefined*, throw a *TypeError* exception. - 1. Else, - 1. ReturnIfAbrupt(_result_). + 1. If _result_ is a throw completion, then + 1. Return ? _result_. + 1. Assert: _result_ is a return completion. + 1. If _result_.[[Value]] is an Object, return _result_.[[Value]]. + 1. If _kind_ is ~base~, return _thisArgument_. + 1. If _result_.[[Value]] is not *undefined*, throw a *TypeError* exception. 1. Let _thisBinding_ be ? _constructorEnv_.GetThisBinding(). 1. Assert: _thisBinding_ is an Object. 1. Return _thisBinding_. @@ -13457,7 +13630,7 @@

      1. Return ~unused~. - +

      %ThrowTypeError% ( )

      This function is the %ThrowTypeError% intrinsic object.

      It is an anonymous built-in function object that is defined once for each realm.

      @@ -13527,6 +13700,7 @@

      It configures _F_ as a method.
      + 1. Assert: _homeObject_ is an ordinary object. 1. Set _F_.[[HomeObject]] to _homeObject_. 1. Return ~unused~. @@ -13545,13 +13719,11 @@

      1. Assert: _homeObject_ is an ordinary, extensible object. - 1. If _key_ is a Private Name, then - 1. Return PrivateElement { [[Key]]: _key_, [[Kind]]: ~method~, [[Value]]: _closure_ }. - 1. Else, - 1. Let _desc_ be the PropertyDescriptor { [[Value]]: _closure_, [[Writable]]: *true*, [[Enumerable]]: _enumerable_, [[Configurable]]: *true* }. - 1. Perform ? DefinePropertyOrThrow(_homeObject_, _key_, _desc_). - 1. NOTE: DefinePropertyOrThrow only returns an abrupt completion when attempting to define a class static method whose _key_ is *"prototype"*. - 1. Return ~unused~. + 1. If _key_ is a Private Name, return PrivateElement { [[Key]]: _key_, [[Kind]]: ~method~, [[Value]]: _closure_ }. + 1. Let _desc_ be the PropertyDescriptor { [[Value]]: _closure_, [[Writable]]: *true*, [[Enumerable]]: _enumerable_, [[Configurable]]: *true* }. + 1. Perform ? DefinePropertyOrThrow(_homeObject_, _key_, _desc_). + 1. NOTE: DefinePropertyOrThrow only returns an abrupt completion when attempting to define a class static method whose _key_ is *"prototype"*. + 1. Return ~unused~. @@ -13570,7 +13742,7 @@

      1. Assert: _F_ is an extensible object that does not have a *"name"* own property. 1. If _name_ is a Symbol, then - 1. Let _description_ be _name_'s [[Description]] value. + 1. Let _description_ be _name_.[[Description]]. 1. If _description_ is *undefined*, set _name_ to the empty String. 1. Else, set _name_ to the string-concatenation of *"["*, _description_, and *"]"*. 1. Else if _name_ is a Private Name, then @@ -13580,6 +13752,7 @@

      1. If _prefix_ is present, then 1. Set _name_ to the string-concatenation of _prefix_, the code unit 0x0020 (SPACE), and _name_. 1. If _F_ has an [[InitialName]] internal slot, then + 1. NOTE: The choice in the following step is made independently each time this Abstract Operation is invoked. 1. Optionally, set _F_.[[InitialName]] to _name_. 1. Perform ! DefinePropertyOrThrow(_F_, *"name"*, PropertyDescriptor { [[Value]]: _name_, [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 1. Return ~unused~. @@ -13604,12 +13777,12 @@

      - +

      FunctionDeclarationInstantiation ( _func_: an ECMAScript function object, _argumentsList_: a List of ECMAScript language values, - ): either a normal completion containing ~unused~ or an abrupt completion + ): either a normal completion containing ~unused~ or a throw completion

      description
      @@ -13619,18 +13792,13 @@

      When an execution context is established for evaluating an ECMAScript function a new Function Environment Record is created and bindings for each formal parameter are instantiated in that Environment Record. Each declaration in the function body is also instantiated. If the function's formal parameters do not include any default value initializers then the body declarations are instantiated in the same Environment Record as the parameters. If default value parameter initializers exist, a second Environment Record is created for the body declarations. Formal parameters and functions are initialized as part of FunctionDeclarationInstantiation. All other bindings are initialized during evaluation of the function body.

      It performs the following steps when called:

      - 1. Let _calleeContext_ be the running execution context. 1. Let _code_ be _func_.[[ECMAScriptCode]]. 1. Let _strict_ be _func_.[[Strict]]. 1. Let _formals_ be _func_.[[FormalParameters]]. 1. Let _parameterNames_ be the BoundNames of _formals_. - 1. If _parameterNames_ has any duplicate entries, let _hasDuplicates_ be *true*. Otherwise, let _hasDuplicates_ be *false*. + 1. If _parameterNames_ has any duplicate entries, let _hasDuplicates_ be *true*; else let _hasDuplicates_ be *false*. 1. Let _simpleParameterList_ be IsSimpleParameterList of _formals_. 1. Let _hasParameterExpressions_ be ContainsExpression of _formals_. 1. Let _varNames_ be the VarDeclaredNames of _code_. @@ -13688,9 +13856,11 @@

      1. Let _parameterBindings_ be _parameterNames_. 1. Let _iteratorRecord_ be CreateListIteratorRecord(_argumentsList_). 1. If _hasDuplicates_ is *true*, then - 1. Perform ? IteratorBindingInitialization of _formals_ with arguments _iteratorRecord_ and *undefined*. + 1. Let _usedEnv_ be *undefined*. 1. Else, - 1. Perform ? IteratorBindingInitialization of _formals_ with arguments _iteratorRecord_ and _env_. + 1. Let _usedEnv_ be _env_. + 1. NOTE: The following step cannot return a ReturnCompletion because the only way such a completion can arise in expression position is by use of |YieldExpression|, which is forbidden in parameter lists by Early Error rules in and . + 1. Perform ? IteratorBindingInitialization of _formals_ with arguments _iteratorRecord_ and _usedEnv_. 1. If _hasParameterExpressions_ is *false*, then 1. NOTE: Only a single Environment Record is needed for the parameters and top-level vars. 1. Let _instantiatedVarNames_ be a copy of the List _parameterBindings_. @@ -13715,12 +13885,26 @@

      1. Let _initialValue_ be ! _env_.GetBindingValue(_n_, *false*). 1. Perform ! _varEnv_.InitializeBinding(_n_, _initialValue_). 1. NOTE: A var with the same name as a formal parameter initially has the same value as the corresponding initialized parameter. - 1. [id="step-functiondeclarationinstantiation-web-compat-insertion-point"] NOTE: Annex adds additional steps at this point. - 1. If _strict_ is *false*, then + 1. If _strict_ is *true*, then + 1. Let _lexEnv_ be _varEnv_. + 1. Else, + 1. [id="step-functiondeclarationinstantiation-web-compat-insertion-point", normative-optional] If the host is a web browser or otherwise supports , then + 1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of any |Block|, |CaseClause|, or |DefaultClause| _x_ such that _code_ Contains _x_ is *true*, do + 1. Let _F_ be the StringValue of the |BindingIdentifier| of _f_. + 1. If replacing the |FunctionDeclaration| _f_ with a |VariableStatement| that has _F_ as a |BindingIdentifier| would not produce any Early Errors for _func_ and _parameterNames_ does not contain _F_, then + 1. NOTE: A var binding for _F_ is only instantiated here if it is neither a VarDeclaredName, the name of a formal parameter, or another |FunctionDeclaration|. + 1. If _instantiatedVarNames_ does not contain _F_ and _F_ is not *"arguments"*, then + 1. Perform ! _varEnv_.CreateMutableBinding(_F_, *false*). + 1. Perform ! _varEnv_.InitializeBinding(_F_, *undefined*). + 1. Append _F_ to _instantiatedVarNames_. + 1. [id="step-functiondeclarationinstantiation-alt-funcdecl-eval"] When the |FunctionDeclaration| _f_ is evaluated, perform the following steps in place of the |FunctionDeclaration| Evaluation algorithm provided in : + 1. Let _fEnv_ be the running execution context's VariableEnvironment. + 1. Let _bEnv_ be the running execution context's LexicalEnvironment. + 1. Let _fObj_ be ! _bEnv_.GetBindingValue(_F_, *false*). + 1. Perform ! _fEnv_.SetMutableBinding(_F_, _fObj_, *false*). + 1. Return ~unused~. 1. Let _lexEnv_ be NewDeclarativeEnvironment(_varEnv_). 1. NOTE: Non-strict functions use a separate Environment Record for top-level lexical declarations so that a direct eval can determine whether any var scoped declarations introduced by the eval code conflict with pre-existing top-level lexically scoped declarations. This is not needed for strict functions because a strict direct eval always places all declarations into a new Environment Record. - 1. Else, - 1. Let _lexEnv_ be _varEnv_. 1. Set the LexicalEnvironment of _calleeContext_ to _lexEnv_. 1. Let _lexDeclarations_ be the LexicallyScopedDeclarations of _code_. 1. For each element _d_ of _lexDeclarations_, do @@ -13737,9 +13921,6 @@

      1. Perform ! _varEnv_.SetMutableBinding(_fn_, _fo_, *false*). 1. Return ~unused~. - -

      provides an extension to the above algorithm that is necessary for backwards compatibility with web browser implementations of ECMAScript that predate ECMAScript 2015.

      -
      @@ -13750,6 +13931,7 @@

      Built-in Function Objects

      • [[Realm]], a Realm Record that represents the realm in which the function was created.
      • [[InitialName]], a String that is the initial name of the function. It is used by .
      • +
      • [[Async]], a Boolean that indicates whether the function has async function call and construct behaviour in BuiltinCallOrConstruct.

      The initial value of a built-in function object's [[Prototype]] internal slot is %Function.prototype%, unless otherwise specified.

      A built-in function object must have a [[Call]] internal method that conforms to the definition in .

      @@ -13784,7 +13966,9 @@

      a built-in function object _F_ (when the method is present)

      - 1. Return ? BuiltinCallOrConstruct(_F_, ~uninitialized~, _argumentsList_, _newTarget_). + 1. Let _result_ be ? BuiltinCallOrConstruct(_F_, ~uninitialized~, _argumentsList_, _newTarget_). + 1. Assert: _result_ is an Object. + 1. Return _result_.
      @@ -13809,7 +13993,16 @@

      1. Set the ScriptOrModule of _calleeContext_ to *null*. 1. Perform any necessary implementation-defined initialization of _calleeContext_. 1. Push _calleeContext_ onto the execution context stack; _calleeContext_ is now the running execution context. - 1. [id="step-call-builtin-function-result"] Let _result_ be the Completion Record that is the result of evaluating _F_ in a manner that conforms to the specification of _F_. If _thisArgument_ is ~uninitialized~, the *this* value is uninitialized; otherwise, _thisArgument_ provides the *this* value. _argumentsList_ provides the named parameters. _newTarget_ provides the NewTarget value. + 1. If _F_.[[Async]] is *true*, then + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _resultsClosure_ be a new Abstract Closure with no parameters that captures _F_, _thisArgument_, _argumentsList_, and _newTarget_ and performs the following steps when called: + 1. Let _result_ be the Completion Record that is the result of evaluating _F_ in a manner that conforms to the specification of _F_. If _thisArgument_ is ~uninitialized~, the *this* value is uninitialized; else _thisArgument_ provides the *this* value. _argumentsList_ provides the named parameters. _newTarget_ provides the NewTarget value. + 1. NOTE: If _F_ is defined in this document, “the specification of _F_” is the behaviour specified for it via algorithm steps or other means. + 1. Return Completion(_result_). + 1. Perform AsyncFunctionStart(_promiseCapability_, _resultsClosure_). + 1. Remove _calleeContext_ from the execution context stack and restore _callerContext_ as the running execution context. + 1. Return _promiseCapability_.[[Promise]]. + 1. [id="step-call-builtin-function-result"] Let _result_ be the Completion Record that is the result of evaluating _F_ in a manner that conforms to the specification of _F_. If _thisArgument_ is ~uninitialized~, the *this* value is uninitialized; else _thisArgument_ provides the *this* value. _argumentsList_ provides the named parameters. _newTarget_ provides the NewTarget value. 1. NOTE: If _F_ is defined in this document, “the specification of _F_” is the behaviour specified for it via algorithm steps or other means. 1. Remove _calleeContext_ from the execution context stack and restore _callerContext_ as the running execution context. 1. Return ? _result_. @@ -13829,7 +14022,8 @@

      optional _realm_: a Realm Record, optional _prototype_: an Object or *null*, optional _prefix_: a String, - ): a function object + optional _async_: a Boolean, + ): a built-in function object

      description
      @@ -13838,9 +14032,11 @@

      1. If _realm_ is not present, set _realm_ to the current Realm Record. 1. If _prototype_ is not present, set _prototype_ to _realm_.[[Intrinsics]].[[%Function.prototype%]]. + 1. If _async_ is not present, set _async_ to *false*. 1. Let _internalSlotsList_ be a List containing the names of all the internal slots that requires for the built-in function object that is about to be created. 1. Append to _internalSlotsList_ the elements of _additionalInternalSlotsList_. 1. Let _func_ be a new built-in function object that, when called, performs the action described by _behaviour_ using the provided arguments as the values of the corresponding parameters specified by _behaviour_. The new function object has internal slots whose names are the elements of _internalSlotsList_, and an [[InitialName]] internal slot. + 1. Set _func_.[[Async]] to _async_. 1. Set _func_.[[Prototype]] to _prototype_. 1. Set _func_.[[Extensible]] to *true*. 1. Set _func_.[[Realm]] to _realm_. @@ -13869,17 +14065,19 @@

      Bound Function Exotic Objects

      Bound function exotic objects do not have the internal slots of ECMAScript function objects listed in . Instead they have the internal slots listed in , in addition to [[Prototype]] and [[Extensible]].

      - - - - - + + + + + + +
      - Internal Slot - - Type - - Description -
      + Internal Slot + + Type + + Description +
      [[BoundTargetFunction]] @@ -13970,13 +14168,13 @@

      It is used to specify the creation of new bound function exotic objects.
      - 1. Let _proto_ be ? _targetFunction_.[[GetPrototypeOf]](). + 1. Let _proto_ be ? _targetFunction_.[[GetPrototypeOf]](). 1. Let _internalSlotsList_ be the list-concatenation of « [[Prototype]], [[Extensible]] » and the internal slots listed in . 1. Let _obj_ be MakeBasicObject(_internalSlotsList_). 1. Set _obj_.[[Prototype]] to _proto_. - 1. Set _obj_.[[Call]] as described in . + 1. Set _obj_.[[Call]] as specified in . 1. If IsConstructor(_targetFunction_) is *true*, then - 1. Set _obj_.[[Construct]] as described in . + 1. Set _obj_.[[Construct]] as specified in . 1. Set _obj_.[[BoundTargetFunction]] to _targetFunction_. 1. Set _obj_.[[BoundThis]] to _boundThis_. 1. Set _obj_.[[BoundArguments]] to _boundArgs_. @@ -14003,10 +14201,10 @@

      an Array exotic object _A_
      - 1. If _P_ is *"length"*, then - 1. Return ? ArraySetLength(_A_, _Desc_). - 1. Else if _P_ is an array index, then + 1. If _P_ is *"length"*, return ? ArraySetLength(_A_, _Desc_). + 1. If _P_ is an array index, then 1. Let _lengthDesc_ be OrdinaryGetOwnProperty(_A_, *"length"*). + 1. Assert: _lengthDesc_ is not *undefined*. 1. Assert: IsDataDescriptor(_lengthDesc_) is *true*. 1. Assert: _lengthDesc_.[[Configurable]] is *false*. 1. Let _length_ be _lengthDesc_.[[Value]]. @@ -14067,7 +14265,7 @@

      1. If _thisRealm_ and _realmC_ are not the same Realm Record, then 1. If SameValue(_C_, _realmC_.[[Intrinsics]].[[%Array%]]) is *true*, set _C_ to *undefined*. 1. If _C_ is an Object, then - 1. Set _C_ to ? Get(_C_, @@species). + 1. Set _C_ to ? Get(_C_, %Symbol.species%). 1. If _C_ is *null*, set _C_ to *undefined*. 1. If _C_ is *undefined*, return ? ArrayCreate(_length_). 1. If IsConstructor(_C_) is *false*, throw a *TypeError* exception. @@ -14096,6 +14294,7 @@

      1. If SameValueZero(_newLen_, _numberLen_) is *false*, throw a *RangeError* exception. 1. Set _newLenDesc_.[[Value]] to _newLen_. 1. Let _oldLenDesc_ be OrdinaryGetOwnProperty(_A_, *"length"*). + 1. Assert: _oldLenDesc_ is not *undefined*. 1. Assert: IsDataDescriptor(_oldLenDesc_) is *true*. 1. Assert: _oldLenDesc_.[[Configurable]] is *false*. 1. Let _oldLen_ be _oldLenDesc_.[[Value]]. @@ -14232,13 +14431,12 @@

      1. If _P_ is not a String, return *undefined*. 1. Let _index_ be CanonicalNumericIndexString(_P_). - 1. If _index_ is *undefined*, return *undefined*. - 1. If IsIntegralNumber(_index_) is *false*, return *undefined*. - 1. If _index_ is *-0*𝔽, return *undefined*. + 1. If _index_ is not an integral Number, return *undefined*. + 1. If _index_ is *-0*𝔽 or _index_ < *-0*𝔽, return *undefined*. 1. Let _str_ be _S_.[[StringData]]. 1. Assert: _str_ is a String. 1. Let _len_ be the length of _str_. - 1. If ℝ(_index_) < 0 or _len_ ≤ ℝ(_index_), return *undefined*. + 1. If ℝ(_index_) ≥ _len_, return *undefined*. 1. Let _resultStr_ be the substring of _str_ from ℝ(_index_) to ℝ(_index_) + 1. 1. Return the PropertyDescriptor { [[Value]]: _resultStr_, [[Writable]]: *false*, [[Enumerable]]: *true*, [[Configurable]]: *false* }. @@ -14256,7 +14454,7 @@

      Arguments Exotic Objects

      While CreateUnmappedArgumentsObject is grouped into this clause, it creates an ordinary object, not an arguments exotic object.

      -

      Arguments exotic objects have the same internal slots as ordinary objects. They also have a [[ParameterMap]] internal slot. Ordinary arguments objects also have a [[ParameterMap]] internal slot whose value is always undefined. For ordinary argument objects the [[ParameterMap]] internal slot is only used by `Object.prototype.toString` () to identify them as such.

      +

      Arguments exotic objects have the same internal slots as ordinary objects. They also have a [[ParameterMap]] internal slot. Ordinary arguments objects also have a [[ParameterMap]] internal slot whose value is always *undefined*. For ordinary argument objects the [[ParameterMap]] internal slot is only used by `Object.prototype.toString` () to identify them as such.

      The integer-indexed data properties of an arguments exotic object whose numeric name values are less than the number of formal parameters of the corresponding function object initially share their values with the corresponding argument bindings in the function's execution context. This means that changing the property changes the corresponding value of the argument binding and vice-versa. This correspondence is broken if such a property is deleted and then redefined or if the property is changed into an accessor property. If the arguments object is an ordinary object, the values of its properties are simply a copy of the arguments passed to the function and there is no dynamic linkage between the property values and the formal parameter values.

      @@ -14340,11 +14538,9 @@

      1. Let _map_ be _args_.[[ParameterMap]]. 1. Let _isMapped_ be ! HasOwnProperty(_map_, _P_). - 1. If _isMapped_ is *false*, then - 1. Return ? OrdinaryGet(_args_, _P_, _Receiver_). - 1. Else, - 1. Assert: _map_ contains a formal parameter mapping for _P_. - 1. Return ! Get(_map_, _P_). + 1. If _isMapped_ is *false*, return ? OrdinaryGet(_args_, _P_, _Receiver_). + 1. Assert: _map_ contains a formal parameter mapping for _P_. + 1. Return ! Get(_map_, _P_). @@ -14411,7 +14607,7 @@

      1. Let _val_ be _argumentsList_[_index_]. 1. Perform ! CreateDataPropertyOrThrow(_obj_, ! ToString(𝔽(_index_)), _val_). 1. Set _index_ to _index_ + 1. - 1. Perform ! DefinePropertyOrThrow(_obj_, @@iterator, PropertyDescriptor { [[Value]]: %Array.prototype.values%, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). + 1. Perform ! DefinePropertyOrThrow(_obj_, %Symbol.iterator%, PropertyDescriptor { [[Value]]: %Array.prototype.values%, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 1. Perform ! DefinePropertyOrThrow(_obj_, *"callee"*, PropertyDescriptor { [[Get]]: %ThrowTypeError%, [[Set]]: %ThrowTypeError%, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Return _obj_. @@ -14459,7 +14655,7 @@

      1. Let _p_ be MakeArgSetter(_name_, _env_). 1. Perform ! _map_.[[DefineOwnProperty]](! ToString(𝔽(_index_)), PropertyDescriptor { [[Set]]: _p_, [[Get]]: _g_, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 1. Set _index_ to _index_ - 1. - 1. Perform ! DefinePropertyOrThrow(_obj_, @@iterator, PropertyDescriptor { [[Value]]: %Array.prototype.values%, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). + 1. Perform ! DefinePropertyOrThrow(_obj_, %Symbol.iterator%, PropertyDescriptor { [[Value]]: %Array.prototype.values%, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 1. Perform ! DefinePropertyOrThrow(_obj_, *"callee"*, PropertyDescriptor { [[Value]]: _func_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 1. Return _obj_. @@ -14477,7 +14673,7 @@

      1. Let _getterClosure_ be a new Abstract Closure with no parameters that captures _name_ and _env_ and performs the following steps when called: - 1. Return _env_.GetBindingValue(_name_, *false*). + 1. Return NormalCompletion(! _env_.GetBindingValue(_name_, *false*)). 1. Let _getter_ be CreateBuiltinFunction(_getterClosure_, 0, *""*, « »). 1. NOTE: _getter_ is never directly accessible to ECMAScript code. 1. Return _getter_. @@ -14497,7 +14693,7 @@

      1. Let _setterClosure_ be a new Abstract Closure with parameters (_value_) that captures _name_ and _env_ and performs the following steps when called: - 1. Return ! _env_.SetMutableBinding(_name_, _value_, *false*). + 1. Return NormalCompletion(! _env_.SetMutableBinding(_name_, _value_, *false*)). 1. Let _setter_ be CreateBuiltinFunction(_setterClosure_, 1, *""*, « »). 1. NOTE: _setter_ is never directly accessible to ECMAScript code. 1. Return _setter_. @@ -14508,9 +14704,25 @@

      TypedArray Exotic Objects

      -

      A TypedArray is an exotic object that performs special handling of integer index property keys.

      -

      TypedArrays have the same internal slots as ordinary objects and additionally [[ViewedArrayBuffer]], [[ArrayLength]], [[ByteOffset]], [[ContentType]], and [[TypedArrayName]] internal slots.

      -

      An object is a TypedArray if its [[GetOwnProperty]], [[HasProperty]], [[DefineOwnProperty]], [[Get]], [[Set]], [[Delete]], and [[OwnPropertyKeys]] internal methods use the definitions in this section, and its other essential internal methods use the definitions found in . These methods are installed by TypedArrayCreate.

      +

      A TypedArray is an exotic object that performs special handling of property keys that are canonical numeric strings, using the subset that are in-bounds integer indices to index elements of uniform type and enforcing the invariant that the remainder are absent without incurring prototype chain traversal.

      + +

      Because ToString(_n_) for any Number _n_ is a canonical numeric string, an implementation may treat Numbers as property keys for TypedArrays without actually performing the string conversion.

      +
      +

      TypedArrays have the same internal slots as ordinary objects and additionally [[ViewedArrayBuffer]], [[TypedArrayName]], [[ContentType]], [[ByteLength]], [[ByteOffset]], and [[ArrayLength]] internal slots.

      +

      An object is a TypedArray if its [[PreventExtensions]], [[GetOwnProperty]], [[HasProperty]], [[DefineOwnProperty]], [[Get]], [[Set]], [[Delete]], and [[OwnPropertyKeys]], internal methods use the definitions in this section, and its other essential internal methods use the definitions found in . These methods are installed by TypedArrayCreate.

      + + +

      [[PreventExtensions]] ( ): a normal completion containing a Boolean

      +
      +
      for
      +
      a TypedArray _O_
      +
      + + 1. NOTE: The extensibility-related invariants specified in do not allow this method to return *true* when _O_ can gain (or lose and then regain) properties, which might occur for properties with integer index names when its underlying buffer is resized. + 1. If IsTypedArrayFixedLength(_O_) is *false*, return *false*. + 1. Return OrdinaryPreventExtensions(_O_). + +

      @@ -14635,7 +14847,8 @@

      1. If _P_ is a String, then 1. Let _numericIndex_ be CanonicalNumericIndexString(_P_). 1. If _numericIndex_ is not *undefined*, then - 1. If IsValidIntegerIndex(_O_, _numericIndex_) is *false*, return *true*; else return *false*. + 1. If IsValidIntegerIndex(_O_, _numericIndex_) is *false*, return *true*. + 1. Return *false*. 1. Return ! OrdinaryDelete(_O_, _P_). @@ -14663,21 +14876,23 @@

      [[OwnPropertyKeys]] ( ): a normal completion containing a List of property k

      TypedArray With Buffer Witness Records

      -

      An TypedArray With Buffer Witness Record is a Record value used to encapsulate a TypedArray along with a cached byte length of the viewed buffer. It is used to help ensure there is a single shared memory read event of the byte length data block when the viewed buffer is a growable SharedArrayBuffer.

      +

      An TypedArray With Buffer Witness Record is a Record value used to encapsulate a TypedArray along with a cached byte length of the viewed buffer. It is used to help ensure there is a single ReadSharedMemory event of the byte length data block when the viewed buffer is a growable SharedArrayBuffer.

      TypedArray With Buffer Witness Records have the fields listed in .

      - - - - - + + + + + + +
      - Field Name - - Value - - Meaning -
      + Field Name + + Value + + Meaning +
      [[Object]] @@ -14736,6 +14951,7 @@

      1. Let _internalSlotsList_ be « [[Prototype]], [[Extensible]], [[ViewedArrayBuffer]], [[TypedArrayName]], [[ContentType]], [[ByteLength]], [[ByteOffset]], [[ArrayLength]] ». 1. Let _A_ be MakeBasicObject(_internalSlotsList_). + 1. Set _A_.[[PreventExtensions]] as specified in . 1. Set _A_.[[GetOwnProperty]] as specified in . 1. Set _A_.[[HasProperty]] as specified in . 1. Set _A_.[[DefineOwnProperty]] as specified in . @@ -14757,12 +14973,12 @@

      - 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, return 0. - 1. Let _length_ be TypedArrayLength(_taRecord_). - 1. If _length_ = 0, return 0. + 1. Assert: IsTypedArrayOutOfBounds(_taRecord_) is *false*. 1. Let _O_ be _taRecord_.[[Object]]. 1. If _O_.[[ByteLength]] is not ~auto~, return _O_.[[ByteLength]]. + 1. Let _length_ be TypedArrayLength(_taRecord_). 1. Let _elementSize_ be TypedArrayElementSize(_O_). + 1. NOTE: The returned byte length is always an integer multiple of _elementSize_, even when the underlying buffer has been resized to a non-integer multiple. 1. Return _length_ × _elementSize_. @@ -14801,20 +15017,39 @@

      1. Let _O_ be _taRecord_.[[Object]]. 1. Let _bufferByteLength_ be _taRecord_.[[CachedBufferByteLength]]. - 1. Assert: IsDetachedBuffer(_O_.[[ViewedArrayBuffer]]) is *true* if and only if _bufferByteLength_ is ~detached~. - 1. If _bufferByteLength_ is ~detached~, return *true*. + 1. If IsDetachedBuffer(_O_.[[ViewedArrayBuffer]]) is *true*, then + 1. Assert: _bufferByteLength_ is ~detached~. + 1. Return *true*. + 1. Assert: _bufferByteLength_ is a non-negative integer. 1. Let _byteOffsetStart_ be _O_.[[ByteOffset]]. 1. If _O_.[[ArrayLength]] is ~auto~, then 1. Let _byteOffsetEnd_ be _bufferByteLength_. 1. Else, 1. Let _elementSize_ be TypedArrayElementSize(_O_). - 1. Let _byteOffsetEnd_ be _byteOffsetStart_ + _O_.[[ArrayLength]] × _elementSize_. + 1. Let _arrayByteLength_ be _O_.[[ArrayLength]] × _elementSize_. + 1. Let _byteOffsetEnd_ be _byteOffsetStart_ + _arrayByteLength_. + 1. NOTE: A 0-length TypedArray whose [[ByteOffset]] is _bufferByteLength_ is not considered out-of-bounds. 1. If _byteOffsetStart_ > _bufferByteLength_ or _byteOffsetEnd_ > _bufferByteLength_, return *true*. - 1. NOTE: 0-length TypedArrays are not considered out-of-bounds. 1. Return *false*. + +

      + IsTypedArrayFixedLength ( + _O_: a TypedArray, + ): a Boolean +

      +
      +
      + + 1. If _O_.[[ArrayLength]] is ~auto~, return *false*. + 1. Let _buffer_ be _O_.[[ViewedArrayBuffer]]. + 1. If IsFixedLengthArrayBuffer(_buffer_) is *false* and IsSharedArrayBuffer(_buffer_) is *false*, return *false*. + 1. Return *true*. + +
      +

      IsValidIntegerIndex ( @@ -14826,13 +15061,13 @@

      1. If IsDetachedBuffer(_O_.[[ViewedArrayBuffer]]) is *true*, return *false*. - 1. If IsIntegralNumber(_index_) is *false*, return *false*. - 1. If _index_ is *-0*𝔽, return *false*. + 1. If _index_ is not an integral Number, return *false*. + 1. If _index_ is *-0*𝔽 or _index_ < *-0*𝔽, return *false*. 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, ~unordered~). 1. NOTE: Bounds checking is not a synchronizing operation when _O_'s backing buffer is a growable SharedArrayBuffer. 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, return *false*. 1. Let _length_ be TypedArrayLength(_taRecord_). - 1. If ℝ(_index_) < 0 or ℝ(_index_) ≥ _length_, return *false*. + 1. If ℝ(_index_) ≥ _length_, return *false*. 1. Return *true*. @@ -14868,7 +15103,7 @@

      1. If _O_.[[ContentType]] is ~bigint~, let _numValue_ be ? ToBigInt(_value_). - 1. Otherwise, let _numValue_ be ? ToNumber(_value_). + 1. Else, let _numValue_ be ? ToNumber(_value_). 1. If IsValidIntegerIndex(_O_, _index_) is *true*, then 1. Let _offset_ be _O_.[[ByteOffset]]. 1. Let _elementSize_ be TypedArrayElementSize(_O_). @@ -14909,17 +15144,19 @@

      Module Namespace Exotic Objects

      Module namespace exotic objects have the internal slots defined in .

      - - - - - + + + + + + +
      - Internal Slot - - Type - - Description -
      + Internal Slot + + Type + + Description +
      [[Module]] @@ -15196,7 +15433,7 @@

      - 1. Let _current_ be ? _O_.[[GetPrototypeOf]](). + 1. Let _current_ be ? _O_.[[GetPrototypeOf]](). 1. If SameValue(_V_, _current_) is *true*, return *true*. 1. Return *false*. @@ -15206,20 +15443,22 @@

      Proxy Object Internal Methods and Internal Slots

      -

      A Proxy object is an exotic object whose essential internal methods are partially implemented using ECMAScript code. Every Proxy object has an internal slot called [[ProxyHandler]]. The value of [[ProxyHandler]] is an object, called the proxy's handler object, or *null*. Methods (see ) of a handler object may be used to augment the implementation for one or more of the Proxy object's internal methods. Every Proxy object also has an internal slot called [[ProxyTarget]] whose value is either an object or the *null* value. This object is called the proxy's target object.

      +

      A Proxy object is an exotic object whose essential internal methods are partially implemented using ECMAScript code. Every Proxy object has an internal slot called [[ProxyHandler]]. The value of [[ProxyHandler]] is an object, called the proxy's handler object, or *null*. Methods (see ) of a handler object may be used to augment the implementation for one or more of the Proxy object's internal methods. Every Proxy object also has an internal slot called [[ProxyTarget]] whose value is either an object or *null*. This object is called the proxy's target object.

      An object is a Proxy exotic object if its essential internal methods (including [[Call]] and [[Construct]], if applicable) use the definitions in this section. These internal methods are installed in ProxyCreate.

      - - - - + + + + + +
      - Internal Method - - Handler Method -
      + Internal Method + + Handler Method +
      [[GetPrototypeOf]] @@ -15344,12 +15583,12 @@

      [[GetPrototypeOf]] ( ): either a normal completion containing either an Obje 1. Assert: _handler_ is an Object. 1. Let _trap_ be ? GetMethod(_handler_, *"getPrototypeOf"*). 1. If _trap_ is *undefined*, then - 1. Return ? _target_.[[GetPrototypeOf]](). + 1. Return ? _target_.[[GetPrototypeOf]](). 1. Let _handlerProto_ be ? Call(_trap_, _handler_, « _target_ »). 1. If _handlerProto_ is not an Object and _handlerProto_ is not *null*, throw a *TypeError* exception. 1. Let _extensibleTarget_ be ? IsExtensible(_target_). 1. If _extensibleTarget_ is *true*, return _handlerProto_. - 1. Let _targetProto_ be ? _target_.[[GetPrototypeOf]](). + 1. Let _targetProto_ be ? _target_.[[GetPrototypeOf]](). 1. If SameValue(_handlerProto_, _targetProto_) is *false*, throw a *TypeError* exception. 1. Return _handlerProto_. @@ -15383,12 +15622,12 @@

      1. Assert: _handler_ is an Object. 1. Let _trap_ be ? GetMethod(_handler_, *"setPrototypeOf"*). 1. If _trap_ is *undefined*, then - 1. Return ? _target_.[[SetPrototypeOf]](_V_). + 1. Return ? _target_.[[SetPrototypeOf]](_V_). 1. Let _booleanTrapResult_ be ToBoolean(? Call(_trap_, _handler_, « _target_, _V_ »)). 1. If _booleanTrapResult_ is *false*, return *false*. 1. Let _extensibleTarget_ be ? IsExtensible(_target_). 1. If _extensibleTarget_ is *true*, return *true*. - 1. Let _targetProto_ be ? _target_.[[GetPrototypeOf]](). + 1. Let _targetProto_ be ? _target_.[[GetPrototypeOf]](). 1. If SameValue(_V_, _targetProto_) is *false*, throw a *TypeError* exception. 1. Return *true*. @@ -15487,10 +15726,10 @@

      1. Assert: _handler_ is an Object. 1. Let _trap_ be ? GetMethod(_handler_, *"getOwnPropertyDescriptor"*). 1. If _trap_ is *undefined*, then - 1. Return ? _target_.[[GetOwnProperty]](_P_). + 1. Return ? _target_.[[GetOwnProperty]](_P_). 1. Let _trapResultObj_ be ? Call(_trap_, _handler_, « _target_, _P_ »). 1. If _trapResultObj_ is not an Object and _trapResultObj_ is not *undefined*, throw a *TypeError* exception. - 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_P_). + 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_P_). 1. If _trapResultObj_ is *undefined*, then 1. If _targetDesc_ is *undefined*, return *undefined*. 1. If _targetDesc_.[[Configurable]] is *false*, throw a *TypeError* exception. @@ -15553,11 +15792,11 @@

      1. Assert: _handler_ is an Object. 1. Let _trap_ be ? GetMethod(_handler_, *"defineProperty"*). 1. If _trap_ is *undefined*, then - 1. Return ? _target_.[[DefineOwnProperty]](_P_, _Desc_). + 1. Return ? _target_.[[DefineOwnProperty]](_P_, _Desc_). 1. Let _descObj_ be FromPropertyDescriptor(_Desc_). 1. Let _booleanTrapResult_ be ToBoolean(? Call(_trap_, _handler_, « _target_, _P_, _descObj_ »)). 1. If _booleanTrapResult_ is *false*, return *false*. - 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_P_). + 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_P_). 1. Let _extensibleTarget_ be ? IsExtensible(_target_). 1. If _Desc_ has a [[Configurable]] field and _Desc_.[[Configurable]] is *false*, then 1. Let _settingConfigFalse_ be *true*. @@ -15612,10 +15851,10 @@

      1. Assert: _handler_ is an Object. 1. Let _trap_ be ? GetMethod(_handler_, *"has"*). 1. If _trap_ is *undefined*, then - 1. Return ? _target_.[[HasProperty]](_P_). + 1. Return ? _target_.[[HasProperty]](_P_). 1. Let _booleanTrapResult_ be ToBoolean(? Call(_trap_, _handler_, « _target_, _P_ »)). 1. If _booleanTrapResult_ is *false*, then - 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_P_). + 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_P_). 1. If _targetDesc_ is not *undefined*, then 1. If _targetDesc_.[[Configurable]] is *false*, throw a *TypeError* exception. 1. Let _extensibleTarget_ be ? IsExtensible(_target_). @@ -15656,9 +15895,9 @@

      1. Assert: _handler_ is an Object. 1. Let _trap_ be ? GetMethod(_handler_, *"get"*). 1. If _trap_ is *undefined*, then - 1. Return ? _target_.[[Get]](_P_, _Receiver_). + 1. Return ? _target_.[[Get]](_P_, _Receiver_). 1. Let _trapResult_ be ? Call(_trap_, _handler_, « _target_, _P_, _Receiver_ »). - 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_P_). + 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_P_). 1. If _targetDesc_ is not *undefined* and _targetDesc_.[[Configurable]] is *false*, then 1. If IsDataDescriptor(_targetDesc_) is *true* and _targetDesc_.[[Writable]] is *false*, then 1. If SameValue(_trapResult_, _targetDesc_.[[Value]]) is *false*, throw a *TypeError* exception. @@ -15698,10 +15937,10 @@

      1. Assert: _handler_ is an Object. 1. Let _trap_ be ? GetMethod(_handler_, *"set"*). 1. If _trap_ is *undefined*, then - 1. Return ? _target_.[[Set]](_P_, _V_, _Receiver_). + 1. Return ? _target_.[[Set]](_P_, _V_, _Receiver_). 1. Let _booleanTrapResult_ be ToBoolean(? Call(_trap_, _handler_, « _target_, _P_, _V_, _Receiver_ »)). 1. If _booleanTrapResult_ is *false*, return *false*. - 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_P_). + 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_P_). 1. If _targetDesc_ is not *undefined* and _targetDesc_.[[Configurable]] is *false*, then 1. If IsDataDescriptor(_targetDesc_) is *true* and _targetDesc_.[[Writable]] is *false*, then 1. If SameValue(_V_, _targetDesc_.[[Value]]) is *false*, throw a *TypeError* exception. @@ -15742,10 +15981,10 @@

      1. Assert: _handler_ is an Object. 1. Let _trap_ be ? GetMethod(_handler_, *"deleteProperty"*). 1. If _trap_ is *undefined*, then - 1. Return ? _target_.[[Delete]](_P_). + 1. Return ? _target_.[[Delete]](_P_). 1. Let _booleanTrapResult_ be ToBoolean(? Call(_trap_, _handler_, « _target_, _P_ »)). 1. If _booleanTrapResult_ is *false*, return *false*. - 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_P_). + 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_P_). 1. If _targetDesc_ is *undefined*, return *true*. 1. If _targetDesc_.[[Configurable]] is *false*, throw a *TypeError* exception. 1. Let _extensibleTarget_ be ? IsExtensible(_target_). @@ -15783,7 +16022,7 @@

      [[OwnPropertyKeys]] ( ): either a normal completion containing a List of pro 1. If _trap_ is *undefined*, then 1. Return ? _target_.[[OwnPropertyKeys]](). 1. Let _trapResultArray_ be ? Call(_trap_, _handler_, « _target_ »). - 1. Let _trapResult_ be ? CreateListFromArrayLike(_trapResultArray_, « String, Symbol »). + 1. Let _trapResult_ be ? CreateListFromArrayLike(_trapResultArray_, ~property-key~). 1. If _trapResult_ contains any duplicate entries, throw a *TypeError* exception. 1. Let _extensibleTarget_ be ? IsExtensible(_target_). 1. Let _targetKeys_ be ? _target_.[[OwnPropertyKeys]](). @@ -15792,7 +16031,7 @@

      [[OwnPropertyKeys]] ( ): either a normal completion containing a List of pro 1. Let _targetConfigurableKeys_ be a new empty List. 1. Let _targetNonconfigurableKeys_ be a new empty List. 1. For each element _key_ of _targetKeys_, do - 1. Let _desc_ be ? _target_.[[GetOwnProperty]](_key_). + 1. Let _desc_ be ? _target_.[[GetOwnProperty]](_key_). 1. If _desc_ is not *undefined* and _desc_.[[Configurable]] is *false*, then 1. Append _key_ to _targetNonconfigurableKeys_. 1. Else, @@ -15820,7 +16059,7 @@

      [[OwnPropertyKeys]] ( ): either a normal completion containing a List of pro The returned List contains no duplicate entries.
    • - The Type of each result List element is either String or Symbol. + Each element of the returned List is a property key.
    • The result List must contain the keys of all non-configurable own properties of the target object. @@ -15956,7 +16195,7 @@

      Syntax

      The components of a combining character sequence are treated as individual Unicode code points even though a user might think of the whole sequence as a single character.

      In string literals, regular expression literals, template literals and identifiers, any Unicode code point may also be expressed using Unicode escape sequences that explicitly express a code point's numeric value. Within a comment, such an escape sequence is effectively ignored as part of the comment.

      -

      ECMAScript differs from the Java programming language in the behaviour of Unicode escape sequences. In a Java program, if the Unicode escape sequence `\\u000A`, for example, occurs within a single-line comment, it is interpreted as a line terminator (Unicode code point U+000A is LINE FEED (LF)) and therefore the next code point is not part of the comment. Similarly, if the Unicode escape sequence `\\u000A` occurs within a string literal in a Java program, it is likewise interpreted as a line terminator, which is not allowed within a string literal—one must write `\\n` instead of `\\u000A` to cause a LINE FEED (LF) to be part of the String value of a string literal. In an ECMAScript program, a Unicode escape sequence occurring within a comment is never interpreted and therefore cannot contribute to termination of the comment. Similarly, a Unicode escape sequence occurring within a string literal in an ECMAScript program always contributes to the literal and is never interpreted as a line terminator or as a code point that might terminate the string literal.

      +

      ECMAScript differs from the Java programming language in the behaviour of Unicode escape sequences. In a Java program, if the Unicode escape sequence `\\u000A`, for example, occurs within a single-line comment, it is interpreted as a line terminator (Unicode code point U+000A is LINE FEED (LF)) and therefore the next code point is not part of the comment. Similarly, if the Unicode escape sequence `\\u000A` occurs within a string literal in a Java program, it is likewise interpreted as a line terminator, which is not allowed within a string literal—one must write `\\n` instead of `\\u000A` to cause a LINE FEED (LF) to be part of the value of a string literal. In an ECMAScript program, a Unicode escape sequence occurring within a comment is never interpreted and therefore cannot contribute to termination of the comment. Similarly, a Unicode escape sequence occurring within a string literal in an ECMAScript program always contributes to the literal and is never interpreted as a line terminator or as a code point that might terminate the string literal.

      @@ -16075,7 +16314,7 @@

      1. If _sourceText_ is a String, set _sourceText_ to StringToCodePoints(_sourceText_). 1. Attempt to parse _sourceText_ using _goalSymbol_ as the goal symbol, and analyse the parse result for any early error conditions. Parsing and early error detection may be interleaved in an implementation-defined manner. 1. If the parse succeeded and no early errors were found, return the Parse Node (an instance of _goalSymbol_) at the root of the parse tree resulting from the parse. - 1. Otherwise, return a List of one or more *SyntaxError* objects representing the parsing errors and/or early errors. If more than one parsing error or early error is present, the number and ordering of error objects in the list is implementation-defined, but at least one must be present. + 1. Return a List of one or more *SyntaxError* objects representing the parsing errors and/or early errors. If more than one parsing error or early error is present, the number and ordering of error objects in the list is implementation-defined, but at least one must be present.

      Consider a text that has an early error at a particular point, and also a syntax error at a later point. An implementation that does a parse pass followed by an early errors pass might report the syntax error and not proceed to the early errors pass. An implementation that interleaves the two activities might report the early error and not proceed to find the syntax error. A third implementation might report both errors. All of these behaviours are conformant.

      @@ -16112,7 +16351,7 @@

      Types of Source Code

    • -

      Function code is generally provided as the bodies of Function Definitions (), Arrow Function Definitions (), Method Definitions (), Generator Function Definitions (), Async Function Definitions (), Async Generator Function Definitions (), and Async Arrow Functions (). Function code is also derived from the arguments to the Function constructor (), the GeneratorFunction constructor (), and the AsyncFunction constructor ().

      +

      Function code is generally provided as the bodies of Function Definitions (), Arrow Function Definitions (), Method Definitions (), Generator Function Definitions (), Async Function Definitions (), Async Generator Function Definitions (), and Async Arrow Functions (). Function code is also derived from the arguments to the Function constructor (), the GeneratorFunction constructor (), the AsyncFunction constructor (), and the AsyncGeneratorFunction constructor ().

      The practical effect of including the |BindingIdentifier| in function code is that the Early Errors for strict mode code are applied to a |BindingIdentifier| that is the name of a function whose body contains a "use strict" directive, even if the surrounding code is not strict mode code.

      @@ -16162,7 +16401,8 @@

      - 1. If the source text matched by _node_ is strict mode code, return *true*; else return *false*. + 1. If the source text matched by _node_ is strict mode code, return *true*. + 1. Return *false*. @@ -16245,17 +16485,19 @@

      White Space

      The ECMAScript white space code points are listed in .

      - - - - - + + + + + + +
      - Code Points - - Name - - Abbreviation -
      + Code Points + + Name + + Abbreviation +
      `U+0009` @@ -16337,17 +16579,19 @@

      Line Terminators

      The ECMAScript line terminator code points are listed in .

      - - - - - + + + + + + +
      - Code Point - - Unicode Name - - Abbreviation -
      + Code Point + + Unicode Name + + Abbreviation +
      `U+000A` @@ -17166,20 +17410,22 @@

      Static Semantics: SV ( ): a String

      - - - - - - + + + + + + + +
      - Escape Sequence - - Code Unit Value - - Unicode Character Name - - Symbol -
      + Escape Sequence + + Code Unit Value + + Unicode Character Name + + Symbol +
      `\\b` @@ -18261,7 +18507,7 @@

      ElementList : ElementList `,` Elision? AssignmentExpression - 1. Set _nextIndex_ to ? ArrayAccumulation of |ElementList| with arguments _array_ and _nextIndex_. + 1. Set _nextIndex_ to ? ArrayAccumulation of the derived |ElementList| with arguments _array_ and _nextIndex_. 1. If |Elision| is present, then 1. Set _nextIndex_ to ? ArrayAccumulation of |Elision| with arguments _array_ and _nextIndex_. 1. Let _initResult_ be ? Evaluation of |AssignmentExpression|. @@ -18271,7 +18517,7 @@

      ElementList : ElementList `,` Elision? SpreadElement - 1. Set _nextIndex_ to ? ArrayAccumulation of |ElementList| with arguments _array_ and _nextIndex_. + 1. Set _nextIndex_ to ? ArrayAccumulation of the derived |ElementList| with arguments _array_ and _nextIndex_. 1. If |Elision| is present, then 1. Set _nextIndex_ to ? ArrayAccumulation of |Elision| with arguments _array_ and _nextIndex_. 1. Return ? ArrayAccumulation of |SpreadElement| with arguments _array_ and _nextIndex_. @@ -18394,7 +18640,7 @@

      Static Semantics: Early Errors

      • - It is a Syntax Error if the PropertyNameList of |PropertyDefinitionList| contains any duplicate entries for *"__proto__"* and at least two of those entries were obtained from productions of the form PropertyDefinition : PropertyName `:` AssignmentExpression. This rule is not applied if this |ObjectLiteral| is contained within a |Script| that is being parsed for JSON.parse (see step of JSON.parse). + It is a Syntax Error if the PropertyNameList of |PropertyDefinitionList| contains any duplicate entries for *"__proto__"* and at least two of those entries were obtained from productions of the form PropertyDefinition : PropertyName `:` AssignmentExpression. This rule is not applied if this |ObjectLiteral| is contained within a |Script| that is being parsed for ParseJSON (see step of ParseJSON).
      @@ -18416,6 +18662,28 @@

      Static Semantics: IsComputedPropertyKey ( ): a Boolean

      + +

      Static Semantics: PropertyDefinitionNodes ( ): a List of Parse Nodes

      +
      +
      + + ObjectLiteral : `{` `}` + + 1. Return a new empty List. + + + PropertyDefinitionList : PropertyDefinition + + 1. Return « |PropertyDefinition| ». + + + PropertyDefinitionList : PropertyDefinitionList `,` PropertyDefinition + + 1. Let _head_ be the PropertyDefinitionNodes of the derived |PropertyDefinitionList|. + 1. Return the list-concatenation of _head_ and « |PropertyDefinition| ». + +
      +

      Static Semantics: PropertyNameList ( ): a List of Strings

      @@ -18506,7 +18774,7 @@

      PropertyDefinition : PropertyName `:` AssignmentExpression 1. Let _propKey_ be ? Evaluation of |PropertyName|. - 1. If this |PropertyDefinition| is contained within a |Script| that is being evaluated for JSON.parse (see step of JSON.parse), then + 1. If this |PropertyDefinition| is contained within a |Script| that is being evaluated for ParseJSON (see step of ParseJSON), then 1. Let _isProtoSetter_ be *false*. 1. Else if _propKey_ is *"__proto__"* and IsComputedPropertyKey of |PropertyName| is *false*, then 1. Let _isProtoSetter_ be *true*. @@ -18519,7 +18787,7 @@

      1. Let _propValue_ be ? GetValue(_exprValueRef_). 1. If _isProtoSetter_ is *true*, then 1. If _propValue_ is an Object or _propValue_ is *null*, then - 1. Perform ! _object_.[[SetPrototypeOf]](_propValue_). + 1. Perform ! _object_.[[SetPrototypeOf]](_propValue_). 1. Return ~unused~. 1. Assert: _object_ is an ordinary, extensible object with no non-configurable properties. 1. Perform ! CreateDataPropertyOrThrow(_object_, _propKey_, _propValue_). @@ -18577,7 +18845,8 @@

      1. Let _stringValue_ be CodePointsToString(_patternText_). 1. Set _patternText_ to the sequence of code points resulting from interpreting each of the 16-bit elements of _stringValue_ as a Unicode BMP code point. UTF-16 decoding is not applied to the elements. 1. Let _parseResult_ be ParsePattern(_patternText_, _u_, _v_). - 1. If _parseResult_ is a Parse Node, return *true*; else return *false*. + 1. If _parseResult_ is a Parse Node, return *true*. + 1. Return *false*. @@ -18927,7 +19196,8 @@

      Syntax

      `super` Arguments[?Yield, ?Await] ImportCall[Yield, Await] : - `import` `(` AssignmentExpression[+In, ?Yield, ?Await] `)` + `import` `(` AssignmentExpression[+In, ?Yield, ?Await] `,`? `)` + `import` `(` AssignmentExpression[+In, ?Yield, ?Await] `,` AssignmentExpression[+In, ?Yield, ?Await] `,`? `)` Arguments[Yield, Await] : `(` `)` @@ -19106,8 +19376,8 @@

      1. Let _propertyNameReference_ be ? Evaluation of _expression_. 1. Let _propertyNameValue_ be ? GetValue(_propertyNameReference_). - 1. Let _propertyKey_ be ? ToPropertyKey(_propertyNameValue_). - 1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyKey_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }. + 1. NOTE: In most cases, ToPropertyKey will be performed on _propertyNameValue_ immediately after this step. However, in the case of `a[b] = c`, it will not be performed until after evaluation of `c`. + 1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyNameValue_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }. @@ -19181,7 +19451,7 @@

      Runtime Semantics: Evaluation

      1. Let _argList_ be ? ArgumentListEvaluation of _arguments_. 1. If _argList_ has no elements, return *undefined*. 1. Let _evalArg_ be the first element of _argList_. - 1. If IsStrict(this |CallExpression|) is *true*, let _strictCaller_ be *true*. Otherwise let _strictCaller_ be *false*. + 1. If IsStrict(this |CallExpression|) is *true*, let _strictCaller_ be *true*; else let _strictCaller_ be *false*. 1. [id="step-callexpression-evaluation-direct-eval"] Return ? PerformEval(_evalArg_, _strictCaller_, *true*). 1. Let _thisCall_ be this |CallExpression|. 1. Let _tailCall_ be IsInTailPosition(_thisCall_). @@ -19239,9 +19509,9 @@

      Runtime Semantics: Evaluation

      1. Let _actualThis_ be ? _env_.GetThisBinding(). 1. Let _propertyNameReference_ be ? Evaluation of |Expression|. 1. Let _propertyNameValue_ be ? GetValue(_propertyNameReference_). - 1. Let _propertyKey_ be ? ToPropertyKey(_propertyNameValue_). 1. Let _strict_ be IsStrict(this |SuperProperty|). - 1. Return ? MakeSuperPropertyReference(_actualThis_, _propertyKey_, _strict_). + 1. NOTE: In most cases, ToPropertyKey will be performed on _propertyNameValue_ immediately after this step. However, in the case of `super[b] = c`, it will not be performed until after evaluation of `c`. + 1. Return MakeSuperPropertyReference(_actualThis_, _propertyNameValue_, _strict_).
      SuperProperty : `super` `.` IdentifierName @@ -19249,18 +19519,19 @@

      Runtime Semantics: Evaluation

      1. Let _actualThis_ be ? _env_.GetThisBinding(). 1. Let _propertyKey_ be the StringValue of |IdentifierName|. 1. Let _strict_ be IsStrict(this |SuperProperty|). - 1. Return ? MakeSuperPropertyReference(_actualThis_, _propertyKey_, _strict_). + 1. Return MakeSuperPropertyReference(_actualThis_, _propertyKey_, _strict_).
      SuperCall : `super` Arguments 1. Let _newTarget_ be GetNewTarget(). - 1. Assert: _newTarget_ is an Object. + 1. Assert: _newTarget_ is a constructor. 1. Let _func_ be GetSuperConstructor(). 1. Let _argList_ be ? ArgumentListEvaluation of |Arguments|. 1. If IsConstructor(_func_) is *false*, throw a *TypeError* exception. 1. Let _result_ be ? Construct(_func_, _argList_, _newTarget_). 1. Let _thisER_ be GetThisEnvironment(). - 1. Perform ? _thisER_.BindThisValue(_result_). + 1. Assert: _thisER_ is a Function Environment Record. + 1. Perform ? BindThisValue(_thisER_, _result_). 1. Let _F_ be _thisER_.[[FunctionObject]]. 1. Assert: _F_ is an ECMAScript function object. 1. Perform ? InitializeInstanceElements(_result_, _F_). @@ -19286,16 +19557,17 @@

      GetSuperConstructor ( ): an ECMAScript language value

      MakeSuperPropertyReference ( _actualThis_: an ECMAScript language value, - _propertyKey_: a property key, + _propertyKey_: an ECMAScript language value, _strict_: a Boolean, - ): either a normal completion containing a Super Reference Record or a throw completion + ): a Super Reference Record

      1. Let _env_ be GetThisEnvironment(). 1. Assert: _env_.HasSuperBinding() is *true*. - 1. Let _baseValue_ be ? _env_.GetSuperBase(). + 1. Assert: _env_ is a Function Environment Record. + 1. Let _baseValue_ be GetSuperBase(_env_). 1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyKey_, [[Strict]]: _strict_, [[ThisValue]]: _actualThis_ }. @@ -19486,58 +19758,108 @@

      Import Calls

      Runtime Semantics: Evaluation

      - ImportCall : `import` `(` AssignmentExpression `)` + ImportCall : `import` `(` AssignmentExpression `,`? `)` + + 1. Return ? EvaluateImportCall(|AssignmentExpression|). + + + ImportCall : `import` `(` AssignmentExpression `,` AssignmentExpression `,`? `)` + + 1. Return ? EvaluateImportCall(the first |AssignmentExpression|, the second |AssignmentExpression|). + +
      + + +

      + EvaluateImportCall ( + _specifierExpression_: a Parse Node, + optional _optionsExpression_: a Parse Node, + ): either a normal completion containing a Promise or an abrupt completion +

      +
      +
      1. Let _referrer_ be GetActiveScriptOrModule(). 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. - 1. Let _argRef_ be ? Evaluation of |AssignmentExpression|. - 1. Let _specifier_ be ? GetValue(_argRef_). + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. If _optionsExpression_ is present, then + 1. Let _optionsRef_ be ? Evaluation of _optionsExpression_. + 1. Let _options_ be ? GetValue(_optionsRef_). + 1. Else, + 1. Let _options_ be *undefined*. 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). 1. Let _specifierString_ be Completion(ToString(_specifier_)). 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). - 1. Perform HostLoadImportedModule(_referrer_, _specifierString_, ~empty~, _promiseCapability_). + 1. Let _attributes_ be a new empty List. + 1. If _options_ is not *undefined*, then + 1. If _options_ is not an Object, then + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « a newly created *TypeError* object »). + 1. Return _promiseCapability_.[[Promise]]. + 1. Let _attributesObj_ be Completion(Get(_options_, *"with"*)). + 1. IfAbruptRejectPromise(_attributesObj_, _promiseCapability_). + 1. If _attributesObj_ is not *undefined*, then + 1. If _attributesObj_ is not an Object, then + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « a newly created *TypeError* object »). + 1. Return _promiseCapability_.[[Promise]]. + 1. Let _entries_ be Completion(EnumerableOwnProperties(_attributesObj_, ~key+value~)). + 1. IfAbruptRejectPromise(_entries_, _promiseCapability_). + 1. For each element _entry_ of _entries_, do + 1. Let _key_ be ! Get(_entry_, *"0"*). + 1. Let _value_ be ! Get(_entry_, *"1"*). + 1. If _key_ is a String, then + 1. If _value_ is not a String, then + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « a newly created *TypeError* object »). + 1. Return _promiseCapability_.[[Promise]]. + 1. Append the ImportAttribute Record { [[Key]]: _key_, [[Value]]: _value_ } to _attributes_. + 1. If AllImportAttributesSupported(_attributes_) is *false*, then + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « a newly created *TypeError* object »). + 1. Return _promiseCapability_.[[Promise]]. + 1. Sort _attributes_ according to the lexicographic order of their [[Key]] field, treating the value of each such field as a sequence of UTF-16 code unit values. NOTE: This sorting is observable only in that hosts are prohibited from changing behaviour based on the order in which attributes are enumerated. + 1. Let _moduleRequest_ be a new ModuleRequest Record { [[Specifier]]: _specifierString_, [[Attributes]]: _attributes_ }. + 1. Perform HostLoadImportedModule(_referrer_, _moduleRequest_, ~empty~, _promiseCapability_). 1. Return _promiseCapability_.[[Promise]]. +
      - -

      - ContinueDynamicImport ( - _promiseCapability_: a PromiseCapability Record, - _moduleCompletion_: either a normal completion containing a Module Record or a throw completion, - ): ~unused~ -

      -
      -
      description
      -
      It completes the process of a dynamic import originally started by an `import()` call, resolving or rejecting the promise returned by that call as appropriate.
      -
      - - 1. If _moduleCompletion_ is an abrupt completion, then - 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _moduleCompletion_.[[Value]] »). - 1. Return ~unused~. - 1. Let _module_ be _moduleCompletion_.[[Value]]. - 1. Let _loadPromise_ be _module_.LoadRequestedModules(). - 1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _promiseCapability_ and performs the following steps when called: - 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _reason_ »). - 1. Return ~unused~. - 1. Let _onRejected_ be CreateBuiltinFunction(_rejectedClosure_, 1, *""*, « »). - 1. Let _linkAndEvaluateClosure_ be a new Abstract Closure with no parameters that captures _module_, _promiseCapability_, and _onRejected_ and performs the following steps when called: - 1. Let _link_ be Completion(_module_.Link()). - 1. If _link_ is an abrupt completion, then - 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _link_.[[Value]] »). - 1. Return ~unused~. - 1. Let _evaluatePromise_ be _module_.Evaluate(). - 1. Let _fulfilledClosure_ be a new Abstract Closure with no parameters that captures _module_ and _promiseCapability_ and performs the following steps when called: - 1. Let _namespace_ be GetModuleNamespace(_module_). - 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _namespace_ »). - 1. Return ~unused~. - 1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 0, *""*, « »). - 1. Perform PerformPromiseThen(_evaluatePromise_, _onFulfilled_, _onRejected_). - 1. Return ~unused~. - 1. Let _linkAndEvaluate_ be CreateBuiltinFunction(_linkAndEvaluateClosure_, 0, *""*, « »). - 1. Perform PerformPromiseThen(_loadPromise_, _linkAndEvaluate_, _onRejected_). + +

      + ContinueDynamicImport ( + _promiseCapability_: a PromiseCapability Record, + _moduleCompletion_: either a normal completion containing a Module Record or a throw completion, + ): ~unused~ +

      +
      +
      description
      +
      It completes the process of a dynamic import originally started by an `import()` call, resolving or rejecting the promise returned by that call as appropriate.
      +
      + + 1. If _moduleCompletion_ is an abrupt completion, then + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _moduleCompletion_.[[Value]] »). 1. Return ~unused~. - -
      + 1. Let _module_ be _moduleCompletion_.[[Value]]. + 1. Let _loadPromise_ be _module_.LoadRequestedModules(). + 1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _promiseCapability_ and performs the following steps when called: + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _reason_ »). + 1. Return NormalCompletion(*undefined*). + 1. Let _onRejected_ be CreateBuiltinFunction(_rejectedClosure_, 1, *""*, « »). + 1. Let _linkAndEvaluateClosure_ be a new Abstract Closure with no parameters that captures _module_, _promiseCapability_, and _onRejected_ and performs the following steps when called: + 1. Let _link_ be Completion(_module_.Link()). + 1. If _link_ is an abrupt completion, then + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _link_.[[Value]] »). + 1. Return NormalCompletion(*undefined*). + 1. Let _evaluatePromise_ be _module_.Evaluate(). + 1. Let _fulfilledClosure_ be a new Abstract Closure with no parameters that captures _module_ and _promiseCapability_ and performs the following steps when called: + 1. Let _namespace_ be GetModuleNamespace(_module_). + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _namespace_ »). + 1. Return NormalCompletion(*undefined*). + 1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 0, *""*, « »). + 1. Perform PerformPromiseThen(_evaluatePromise_, _onFulfilled_, _onRejected_). + 1. Return ~unused~. + 1. Let _linkAndEvaluate_ be CreateBuiltinFunction(_linkAndEvaluateClosure_, 0, *""*, « »). + 1. Perform PerformPromiseThen(_loadPromise_, _linkAndEvaluate_, _onRejected_). + 1. Return ~unused~. +
      @@ -19591,9 +19913,8 @@

      Runtime Semantics: Evaluation

      1. Perform HostFinalizeImportMeta(_importMeta_, _module_). 1. Set _module_.[[ImportMeta]] to _importMeta_. 1. Return _importMeta_. - 1. Else, - 1. Assert: _importMeta_ is an Object. - 1. Return _importMeta_. + 1. Assert: _importMeta_ is an Object. + 1. Return _importMeta_.
      @@ -19651,7 +19972,7 @@

      Static Semantics: Early Errors

      • - It is an early Syntax Error if the AssignmentTargetType of |LeftHandSideExpression| is not ~simple~. + It is an early Syntax Error if the AssignmentTargetType of |LeftHandSideExpression| is ~invalid~.
      @@ -19662,7 +19983,7 @@

      Static Semantics: Early Errors

      • - It is an early Syntax Error if the AssignmentTargetType of |UnaryExpression| is not ~simple~. + It is an early Syntax Error if the AssignmentTargetType of |UnaryExpression| is ~invalid~.
      @@ -19675,6 +19996,7 @@

      Runtime Semantics: Evaluation

      UpdateExpression : LeftHandSideExpression `++` 1. Let _lhs_ be ? Evaluation of |LeftHandSideExpression|. + 1. If the AssignmentTargetType of |LeftHandSideExpression| is ~web-compat~, throw a *ReferenceError* exception. 1. Let _oldValue_ be ? ToNumeric(? GetValue(_lhs_)). 1. If _oldValue_ is a Number, then 1. Let _newValue_ be Number::add(_oldValue_, *1*𝔽). @@ -19695,6 +20017,7 @@

      Runtime Semantics: Evaluation

      UpdateExpression : LeftHandSideExpression `--` 1. Let _lhs_ be ? Evaluation of |LeftHandSideExpression|. + 1. If the AssignmentTargetType of |LeftHandSideExpression| is ~web-compat~, throw a *ReferenceError* exception. 1. Let _oldValue_ be ? ToNumeric(? GetValue(_lhs_)). 1. If _oldValue_ is a Number, then 1. Let _newValue_ be Number::subtract(_oldValue_, *1*𝔽). @@ -19715,6 +20038,7 @@

      Runtime Semantics: Evaluation

      UpdateExpression : `++` UnaryExpression 1. Let _expr_ be ? Evaluation of |UnaryExpression|. + 1. If the AssignmentTargetType of |UnaryExpression| is ~web-compat~, throw a *ReferenceError* exception. 1. Let _oldValue_ be ? ToNumeric(? GetValue(_expr_)). 1. If _oldValue_ is a Number, then 1. Let _newValue_ be Number::add(_oldValue_, *1*𝔽). @@ -19735,6 +20059,7 @@

      Runtime Semantics: Evaluation

      UpdateExpression : `--` UnaryExpression 1. Let _expr_ be ? Evaluation of |UnaryExpression|. + 1. If the AssignmentTargetType of |UnaryExpression| is ~web-compat~, throw a *ReferenceError* exception. 1. Let _oldValue_ be ? ToNumeric(? GetValue(_expr_)). 1. If _oldValue_ is a Number, then 1. Let _newValue_ be Number::subtract(_oldValue_, *1*𝔽). @@ -19800,13 +20125,14 @@

      Runtime Semantics: Evaluation

      1. Assert: IsPrivateReference(_ref_) is *false*. 1. If IsSuperReference(_ref_) is *true*, throw a *ReferenceError* exception. 1. [id="step-delete-operator-toobject"] Let _baseObj_ be ? ToObject(_ref_.[[Base]]). - 1. Let _deleteStatus_ be ? _baseObj_.[[Delete]](_ref_.[[ReferencedName]]). + 1. If _ref_.[[ReferencedName]] is not a property key, then + 1. Set _ref_.[[ReferencedName]] to ? ToPropertyKey(_ref_.[[ReferencedName]]). + 1. Let _deleteStatus_ be ? _baseObj_.[[Delete]](_ref_.[[ReferencedName]]). 1. If _deleteStatus_ is *false* and _ref_.[[Strict]] is *true*, throw a *TypeError* exception. 1. Return _deleteStatus_. - 1. Else, - 1. Let _base_ be _ref_.[[Base]]. - 1. Assert: _base_ is an Environment Record. - 1. Return ? _base_.DeleteBinding(_ref_.[[ReferencedName]]). + 1. Let _base_ be _ref_.[[Base]]. + 1. Assert: _base_ is an Environment Record. + 1. Return ? _base_.DeleteBinding(_ref_.[[ReferencedName]]).

      When a `delete` operator occurs within strict mode code, a *SyntaxError* exception is thrown if its |UnaryExpression| is a direct reference to a variable, function argument, or function name. In addition, if a `delete` operator occurs within strict mode code and the property to be deleted has the attribute { [[Configurable]]: *false* } (or otherwise cannot be deleted), a *TypeError* exception is thrown.

      @@ -19837,7 +20163,7 @@

      Runtime Semantics: Evaluation

      The `typeof` Operator

      - +

      Runtime Semantics: Evaluation

      UnaryExpression : `typeof` UnaryExpression @@ -19853,8 +20179,9 @@

      Runtime Semantics: Evaluation

      1. If _val_ is a Number, return *"number"*. 1. If _val_ is a BigInt, return *"bigint"*. 1. Assert: _val_ is an Object. - 1. [id="step-typeof-web-compat-insertion-point"] NOTE: This step is replaced in section . - 1. If _val_ has a [[Call]] internal slot, return *"function"*. + 1. [id="step-typeof-web-compat-insertion-point", normative-optional] If the host is a web browser or otherwise supports , then + 1. If _val_ has an [[IsHTMLDDA]] internal slot, return *"undefined"*. + 1. If _val_ has a [[Call]] internal method, return *"function"*. 1. Return *"object"*.
      @@ -19888,11 +20215,9 @@

      Runtime Semantics: Evaluation

      1. Let _expr_ be ? Evaluation of |UnaryExpression|. 1. Let _oldValue_ be ? ToNumeric(? GetValue(_expr_)). - 1. If _oldValue_ is a Number, then - 1. Return Number::unaryMinus(_oldValue_). - 1. Else, - 1. Assert: _oldValue_ is a BigInt. - 1. Return BigInt::unaryMinus(_oldValue_). + 1. If _oldValue_ is a Number, return Number::unaryMinus(_oldValue_). + 1. Assert: _oldValue_ is a BigInt. + 1. Return BigInt::unaryMinus(_oldValue_).
      @@ -19906,11 +20231,9 @@

      Runtime Semantics: Evaluation

      1. Let _expr_ be ? Evaluation of |UnaryExpression|. 1. Let _oldValue_ be ? ToNumeric(? GetValue(_expr_)). - 1. If _oldValue_ is a Number, then - 1. Return Number::bitwiseNOT(_oldValue_). - 1. Else, - 1. Assert: _oldValue_ is a BigInt. - 1. Return BigInt::bitwiseNOT(_oldValue_). + 1. If _oldValue_ is a Number, return Number::bitwiseNOT(_oldValue_). + 1. Assert: _oldValue_ is a BigInt. + 1. Return BigInt::bitwiseNOT(_oldValue_). @@ -20104,67 +20427,72 @@

      Syntax

      Runtime Semantics: Evaluation

      RelationalExpression : RelationalExpression `<` ShiftExpression - 1. Let _lref_ be ? Evaluation of |RelationalExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |ShiftExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Let _r_ be ? IsLessThan(_lval_, _rval_, *true*). - 1. If _r_ is *undefined*, return *false*. Otherwise, return _r_. + 1. Let _lRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Let _r_ be ? IsLessThan(_lVal_, _rVal_, *true*). + 1. If _r_ is *undefined*, return *false*. + 1. Return _r_. RelationalExpression : RelationalExpression `>` ShiftExpression - 1. Let _lref_ be ? Evaluation of |RelationalExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |ShiftExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Let _r_ be ? IsLessThan(_rval_, _lval_, *false*). - 1. If _r_ is *undefined*, return *false*. Otherwise, return _r_. + 1. Let _lRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Let _r_ be ? IsLessThan(_rVal_, _lVal_, *false*). + 1. If _r_ is *undefined*, return *false*. + 1. Return _r_. RelationalExpression : RelationalExpression `<=` ShiftExpression - 1. Let _lref_ be ? Evaluation of |RelationalExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |ShiftExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Let _r_ be ? IsLessThan(_rval_, _lval_, *false*). - 1. If _r_ is either *true* or *undefined*, return *false*. Otherwise, return *true*. + 1. Let _lRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Let _r_ be ? IsLessThan(_rVal_, _lVal_, *false*). + 1. If _r_ is either *true* or *undefined*, return *false*. + 1. Return *true*. RelationalExpression : RelationalExpression `>=` ShiftExpression - 1. Let _lref_ be ? Evaluation of |RelationalExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |ShiftExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Let _r_ be ? IsLessThan(_lval_, _rval_, *true*). - 1. If _r_ is either *true* or *undefined*, return *false*. Otherwise, return *true*. + 1. Let _lRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Let _r_ be ? IsLessThan(_lVal_, _rVal_, *true*). + 1. If _r_ is either *true* or *undefined*, return *false*. + 1. Return *true*. RelationalExpression : RelationalExpression `instanceof` ShiftExpression - 1. Let _lref_ be ? Evaluation of |RelationalExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |ShiftExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Return ? InstanceofOperator(_lval_, _rval_). + 1. Let _lRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Return ? InstanceofOperator(_lVal_, _rVal_). RelationalExpression : RelationalExpression `in` ShiftExpression - 1. Let _lref_ be ? Evaluation of |RelationalExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |ShiftExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. If _rval_ is not an Object, throw a *TypeError* exception. - 1. Return ? HasProperty(_rval_, ? ToPropertyKey(_lval_)). + 1. Let _lRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. If _rVal_ is not an Object, throw a *TypeError* exception. + 1. Return ? HasProperty(_rVal_, ? ToPropertyKey(_lVal_)). RelationalExpression : PrivateIdentifier `in` ShiftExpression 1. Let _privateIdentifier_ be the StringValue of |PrivateIdentifier|. - 1. Let _rref_ be ? Evaluation of |ShiftExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. If _rval_ is not an Object, throw a *TypeError* exception. + 1. Let _rRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. If _rVal_ is not an Object, throw a *TypeError* exception. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. + 1. Assert: _privateEnv_ is not *null*. 1. Let _privateName_ be ResolvePrivateIdentifier(_privateEnv_, _privateIdentifier_). - 1. If PrivateElementFind(_rval_, _privateName_) is not ~empty~, return *true*. - 1. Return *false*. + 1. If PrivateElementFind(_rVal_, _privateName_) is ~empty~, return *false*. + 1. Return *true*. @@ -20177,18 +20505,18 @@

      description
      -
      It implements the generic algorithm for determining if _V_ is an instance of _target_ either by consulting _target_'s @@hasInstance method or, if absent, determining whether the value of _target_'s *"prototype"* property is present in _V_'s prototype chain.
      +
      It implements the generic algorithm for determining if _V_ is an instance of _target_ either by consulting _target_'s %Symbol.hasInstance% method or, if absent, determining whether the value of _target_'s *"prototype"* property is present in _V_'s prototype chain.
      1. If _target_ is not an Object, throw a *TypeError* exception. - 1. Let _instOfHandler_ be ? GetMethod(_target_, @@hasInstance). + 1. Let _instOfHandler_ be ? GetMethod(_target_, %Symbol.hasInstance%). 1. If _instOfHandler_ is not *undefined*, then 1. Return ToBoolean(? Call(_instOfHandler_, _target_, « _V_ »)). 1. [id="step-instanceof-check-function"] If IsCallable(_target_) is *false*, throw a *TypeError* exception. 1. [id="step-instanceof-fallback"] Return ? OrdinaryHasInstance(_target_, _V_). -

      Steps and provide compatibility with previous editions of ECMAScript that did not use a @@hasInstance method to define the `instanceof` operator semantics. If an object does not define or inherit @@hasInstance it uses the default `instanceof` semantics.

      +

      Steps and provide compatibility with previous editions of ECMAScript that did not use a %Symbol.hasInstance% method to define the `instanceof` operator semantics. If an object does not define or inherit %Symbol.hasInstance% it uses the default `instanceof` semantics.

      @@ -20212,52 +20540,40 @@

      Syntax

      Runtime Semantics: Evaluation

      EqualityExpression : EqualityExpression `==` RelationalExpression - 1. Let _lref_ be ? Evaluation of |EqualityExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |RelationalExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Return ? IsLooselyEqual(_rval_, _lval_). + 1. Let _lRef_ be ? Evaluation of |EqualityExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Return ? IsLooselyEqual(_rVal_, _lVal_). EqualityExpression : EqualityExpression `!=` RelationalExpression - 1. Let _lref_ be ? Evaluation of |EqualityExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |RelationalExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Let _r_ be ? IsLooselyEqual(_rval_, _lval_). - 1. If _r_ is *true*, return *false*. Otherwise, return *true*. + 1. Let _lRef_ be ? Evaluation of |EqualityExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Let _r_ be ? IsLooselyEqual(_rVal_, _lVal_). + 1. If _r_ is *true*, return *false*. + 1. Return *true*. EqualityExpression : EqualityExpression `===` RelationalExpression - 1. Let _lref_ be ? Evaluation of |EqualityExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |RelationalExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Return IsStrictlyEqual(_rval_, _lval_). + 1. Let _lRef_ be ? Evaluation of |EqualityExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Return IsStrictlyEqual(_rVal_, _lVal_). EqualityExpression : EqualityExpression `!==` RelationalExpression - 1. Let _lref_ be ? Evaluation of |EqualityExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |RelationalExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Let _r_ be IsStrictlyEqual(_rval_, _lval_). - 1. If _r_ is *true*, return *false*. Otherwise, return *true*. + 1. Let _lRef_ be ? Evaluation of |EqualityExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Let _r_ be IsStrictlyEqual(_rVal_, _lVal_). + 1. If _r_ is *true*, return *false*. + 1. Return *true*. - -

      Given the above definition of equality:

      -
        -
      • - String comparison can be forced by: `\`${a}\` == \`${b}\``. -
      • -
      • - Numeric comparison can be forced by: `+a == +b`. -
      • -
      • - Boolean comparison can be forced by: `!a == !b`. -
      • -
      -

      The equality operators maintain the following invariants:

        @@ -20351,31 +20667,27 @@

        Syntax

        Runtime Semantics: Evaluation

        LogicalANDExpression : LogicalANDExpression `&&` BitwiseORExpression - 1. Let _lref_ be ? Evaluation of |LogicalANDExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _lbool_ be ToBoolean(_lval_). - 1. If _lbool_ is *false*, return _lval_. - 1. Let _rref_ be ? Evaluation of |BitwiseORExpression|. - 1. Return ? GetValue(_rref_). + 1. Let _lRef_ be ? Evaluation of |LogicalANDExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. If ToBoolean(_lVal_) is *false*, return _lVal_. + 1. Let _rRef_ be ? Evaluation of |BitwiseORExpression|. + 1. Return ? GetValue(_rRef_). LogicalORExpression : LogicalORExpression `||` LogicalANDExpression - 1. Let _lref_ be ? Evaluation of |LogicalORExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _lbool_ be ToBoolean(_lval_). - 1. If _lbool_ is *true*, return _lval_. - 1. Let _rref_ be ? Evaluation of |LogicalANDExpression|. - 1. Return ? GetValue(_rref_). + 1. Let _lRef_ be ? Evaluation of |LogicalORExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. If ToBoolean(_lVal_) is *true*, return _lVal_. + 1. Let _rRef_ be ? Evaluation of |LogicalANDExpression|. + 1. Return ? GetValue(_rRef_). CoalesceExpression : CoalesceExpressionHead `??` BitwiseORExpression - 1. Let _lref_ be ? Evaluation of |CoalesceExpressionHead|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. If _lval_ is either *undefined* or *null*, then - 1. Let _rref_ be ? Evaluation of |BitwiseORExpression|. - 1. Return ? GetValue(_rref_). - 1. Else, - 1. Return _lval_. + 1. Let _lRef_ be ? Evaluation of |CoalesceExpressionHead|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. If _lVal_ is neither *undefined* nor *null*, return _lVal_. + 1. Let _rRef_ be ? Evaluation of |BitwiseORExpression|. + 1. Return ? GetValue(_rRef_). @@ -20396,14 +20708,13 @@

        Syntax

        Runtime Semantics: Evaluation

        ConditionalExpression : ShortCircuitExpression `?` AssignmentExpression `:` AssignmentExpression - 1. Let _lref_ be ? Evaluation of |ShortCircuitExpression|. - 1. Let _lval_ be ToBoolean(? GetValue(_lref_)). - 1. If _lval_ is *true*, then + 1. Let _lRef_ be ? Evaluation of |ShortCircuitExpression|. + 1. Let _lVal_ be ToBoolean(? GetValue(_lRef_)). + 1. If _lVal_ is *true*, then 1. Let _trueRef_ be ? Evaluation of the first |AssignmentExpression|. 1. Return ? GetValue(_trueRef_). - 1. Else, - 1. Let _falseRef_ be ? Evaluation of the second |AssignmentExpression|. - 1. Return ? GetValue(_falseRef_). + 1. Let _falseRef_ be ? Evaluation of the second |AssignmentExpression|. + 1. Return ? GetValue(_falseRef_). @@ -20436,12 +20747,20 @@

        Static Semantics: Early Errors

        If |LeftHandSideExpression| is either an |ObjectLiteral| or an |ArrayLiteral|, |LeftHandSideExpression| must cover an |AssignmentPattern|.
      • - If |LeftHandSideExpression| is neither an |ObjectLiteral| nor an |ArrayLiteral|, it is a Syntax Error if the AssignmentTargetType of |LeftHandSideExpression| is not ~simple~. + If |LeftHandSideExpression| is neither an |ObjectLiteral| nor an |ArrayLiteral|, it is a Syntax Error if the AssignmentTargetType of |LeftHandSideExpression| is ~invalid~.
      AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression + +
        +
      • + It is a Syntax Error if the AssignmentTargetType of |LeftHandSideExpression| is ~invalid~. +
      • +
      + + AssignmentExpression : LeftHandSideExpression `&&=` AssignmentExpression LeftHandSideExpression `||=` AssignmentExpression LeftHandSideExpression `??=` AssignmentExpression @@ -20458,32 +20777,37 @@

      Runtime Semantics: Evaluation

      AssignmentExpression : LeftHandSideExpression `=` AssignmentExpression 1. If |LeftHandSideExpression| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then - 1. Let _lref_ be ? Evaluation of |LeftHandSideExpression|. - 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) and IsIdentifierRef of |LeftHandSideExpression| are both *true*, then - 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lref_.[[ReferencedName]]. + 1. Let _lRef_ be ? Evaluation of |LeftHandSideExpression|. + 1. If the AssignmentTargetType of |LeftHandSideExpression| is ~web-compat~, throw a *ReferenceError* exception. + 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true* and IsIdentifierRef of |LeftHandSideExpression| is *true*, then + 1. Let _lhs_ be the StringValue of |LeftHandSideExpression|. + 1. Let _rVal_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. 1. Else, - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. [id="step-assignmentexpression-evaluation-simple-putvalue"] Perform ? PutValue(_lref_, _rval_). - 1. Return _rval_. + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. [id="step-assignmentexpression-evaluation-simple-putvalue"] Perform ? PutValue(_lRef_, _rVal_). + 1. Return _rVal_. 1. Let _assignmentPattern_ be the |AssignmentPattern| that is covered by |LeftHandSideExpression|. - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Perform ? DestructuringAssignmentEvaluation of _assignmentPattern_ with argument _rval_. - 1. Return _rval_. + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Perform ? DestructuringAssignmentEvaluation of _assignmentPattern_ with argument _rVal_. + 1. Return _rVal_. AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression - 1. Let _lref_ be ? Evaluation of |LeftHandSideExpression|. - 1. [id="step-assignmentexpression-evaluation-compound-getvalue"] Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Let _rval_ be ? GetValue(_rref_). + 1. Let _lRef_ be ? Evaluation of |LeftHandSideExpression|. + 1. If the AssignmentTargetType of |LeftHandSideExpression| is ~web-compat~, throw a *ReferenceError* exception. + 1. [id="step-assignmentexpression-evaluation-compound-getvalue"] Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). 1. Let _assignmentOpText_ be the source text matched by |AssignmentOperator|. 1. Let _opText_ be the sequence of Unicode code points associated with _assignmentOpText_ in the following table:
      - + + + @@ -20498,113 +20822,131 @@

      Runtime Semantics: Evaluation

      _assignmentOpText_ _opText_
      _assignmentOpText_ _opText_
      `**=` `**`
      `*=` `*`
      `/=` `/`
      `|=` `|`
      - 1. Let _r_ be ? ApplyStringOrNumericBinaryOperator(_lval_, _opText_, _rval_). - 1. [id="step-assignmentexpression-evaluation-compound-putvalue"] Perform ? PutValue(_lref_, _r_). + 1. Let _r_ be ? ApplyStringOrNumericBinaryOperator(_lVal_, _opText_, _rVal_). + 1. [id="step-assignmentexpression-evaluation-compound-putvalue"] Perform ? PutValue(_lRef_, _r_). 1. Return _r_.
      AssignmentExpression : LeftHandSideExpression `&&=` AssignmentExpression - 1. Let _lref_ be ? Evaluation of |LeftHandSideExpression|. - 1. [id="step-assignmentexpression-evaluation-lgcl-and-getvalue"] Let _lval_ be ? GetValue(_lref_). - 1. Let _lbool_ be ToBoolean(_lval_). - 1. If _lbool_ is *false*, return _lval_. + 1. Let _lRef_ be ? Evaluation of |LeftHandSideExpression|. + 1. [id="step-assignmentexpression-evaluation-lgcl-and-getvalue"] Let _lVal_ be ? GetValue(_lRef_). + 1. If ToBoolean(_lVal_) is *false*, return _lVal_. 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true* and IsIdentifierRef of |LeftHandSideExpression| is *true*, then - 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lref_.[[ReferencedName]]. + 1. Let _lhs_ be the StringValue of |LeftHandSideExpression|. + 1. Let _rVal_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. 1. Else, - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. [id="step-assignmentexpression-evaluation-lgcl-and-putvalue"] Perform ? PutValue(_lref_, _rval_). - 1. Return _rval_. + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. [id="step-assignmentexpression-evaluation-lgcl-and-putvalue"] Perform ? PutValue(_lRef_, _rVal_). + 1. Return _rVal_. AssignmentExpression : LeftHandSideExpression `||=` AssignmentExpression - 1. Let _lref_ be ? Evaluation of |LeftHandSideExpression|. - 1. [id="step-assignmentexpression-evaluation-lgcl-or-getvalue"] Let _lval_ be ? GetValue(_lref_). - 1. Let _lbool_ be ToBoolean(_lval_). - 1. If _lbool_ is *true*, return _lval_. + 1. Let _lRef_ be ? Evaluation of |LeftHandSideExpression|. + 1. [id="step-assignmentexpression-evaluation-lgcl-or-getvalue"] Let _lVal_ be ? GetValue(_lRef_). + 1. If ToBoolean(_lVal_) is *true*, return _lVal_. 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true* and IsIdentifierRef of |LeftHandSideExpression| is *true*, then - 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lref_.[[ReferencedName]]. + 1. Let _lhs_ be the StringValue of |LeftHandSideExpression|. + 1. Let _rVal_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. 1. Else, - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. [id="step-assignmentexpression-evaluation-lgcl-or-putvalue"] Perform ? PutValue(_lref_, _rval_). - 1. Return _rval_. + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. [id="step-assignmentexpression-evaluation-lgcl-or-putvalue"] Perform ? PutValue(_lRef_, _rVal_). + 1. Return _rVal_. AssignmentExpression : LeftHandSideExpression `??=` AssignmentExpression - 1. Let _lref_ be ? Evaluation of |LeftHandSideExpression|. - 1. [id="step-assignmentexpression-evaluation-lgcl-nullish-getvalue"] Let _lval_ be ? GetValue(_lref_). - 1. If _lval_ is neither *undefined* nor *null*, return _lval_. + 1. Let _lRef_ be ? Evaluation of |LeftHandSideExpression|. + 1. [id="step-assignmentexpression-evaluation-lgcl-nullish-getvalue"] Let _lVal_ be ? GetValue(_lRef_). + 1. If _lVal_ is neither *undefined* nor *null*, return _lVal_. 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true* and IsIdentifierRef of |LeftHandSideExpression| is *true*, then - 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lref_.[[ReferencedName]]. + 1. Let _lhs_ be the StringValue of |LeftHandSideExpression|. + 1. Let _rVal_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. 1. Else, - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. [id="step-assignmentexpression-evaluation-lgcl-nullish-putvalue"] Perform ? PutValue(_lref_, _rval_). - 1. Return _rval_. + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. [id="step-assignmentexpression-evaluation-lgcl-nullish-putvalue"] Perform ? PutValue(_lRef_, _rVal_). + 1. Return _rVal_. -

      When this expression occurs within strict mode code, it is a runtime error if _lref_ in step , , , , is an unresolvable reference. If it is, a *ReferenceError* exception is thrown. Additionally, it is a runtime error if the _lref_ in step , , , is a reference to a data property with the attribute value { [[Writable]]: *false* }, to an accessor property with the attribute value { [[Set]]: *undefined* }, or to a non-existent property of an object for which the IsExtensible predicate returns the value *false*. In these cases a *TypeError* exception is thrown.

      +

      When this expression occurs within strict mode code, it is a runtime error if _lRef_ in step , , , , is an unresolvable reference. If it is, a *ReferenceError* exception is thrown. Additionally, it is a runtime error if the _lRef_ in step , , , is a reference to a data property with the attribute value { [[Writable]]: *false* }, to an accessor property with the attribute value { [[Set]]: *undefined* }, or to a non-existent property of an object for which the IsExtensible predicate returns the value *false*. In these cases a *TypeError* exception is thrown.

      ApplyStringOrNumericBinaryOperator ( - _lval_: an ECMAScript language value, + _lVal_: an ECMAScript language value, _opText_: `**`, `*`, `/`, `%`, `+`, `-`, `<<`, `>>`, `>>>`, `&`, `^`, or `|`, - _rval_: an ECMAScript language value, + _rVal_: an ECMAScript language value, ): either a normal completion containing either a String, a BigInt, or a Number, or a throw completion

      1. If _opText_ is `+`, then - 1. [id="step-binary-op-toprimitive-lval"] Let _lprim_ be ? ToPrimitive(_lval_). - 1. [id="step-binary-op-toprimitive-rval"] Let _rprim_ be ? ToPrimitive(_rval_). - 1. [id="step-binary-op-string-check"] If _lprim_ is a String or _rprim_ is a String, then - 1. Let _lstr_ be ? ToString(_lprim_). - 1. Let _rstr_ be ? ToString(_rprim_). - 1. Return the string-concatenation of _lstr_ and _rstr_. - 1. Set _lval_ to _lprim_. - 1. Set _rval_ to _rprim_. + 1. [id="step-binary-op-toprimitive-lval"] Let _lPrim_ be ? ToPrimitive(_lVal_). + 1. [id="step-binary-op-toprimitive-rval"] Let _rPrim_ be ? ToPrimitive(_rVal_). + 1. [id="step-binary-op-string-check"] If _lPrim_ is a String or _rPrim_ is a String, then + 1. Let _lStr_ be ? ToString(_lPrim_). + 1. Let _rStr_ be ? ToString(_rPrim_). + 1. Return the string-concatenation of _lStr_ and _rStr_. + 1. Set _lVal_ to _lPrim_. + 1. Set _rVal_ to _rPrim_. 1. NOTE: At this point, it must be a numeric operation. - 1. Let _lnum_ be ? ToNumeric(_lval_). - 1. Let _rnum_ be ? ToNumeric(_rval_). - 1. If Type(_lnum_) is not Type(_rnum_), throw a *TypeError* exception. - 1. If _lnum_ is a BigInt, then - 1. If _opText_ is `**`, return ? BigInt::exponentiate(_lnum_, _rnum_). - 1. If _opText_ is `/`, return ? BigInt::divide(_lnum_, _rnum_). - 1. If _opText_ is `%`, return ? BigInt::remainder(_lnum_, _rnum_). - 1. If _opText_ is `>>>`, return ? BigInt::unsignedRightShift(_lnum_, _rnum_). - 1. Let _operation_ be the abstract operation associated with _opText_ and Type(_lnum_) in the following table: -
      - - - - - - - - - - - - - - - - - - - - - - - -
      _opText_ Type(_lnum_) _operation_
      `**` Number Number::exponentiate
      `*` Number Number::multiply
      `*` BigInt BigInt::multiply
      `/` Number Number::divide
      `%` Number Number::remainder
      `+` Number Number::add
      `+` BigInt BigInt::add
      `-` Number Number::subtract
      `-` BigInt BigInt::subtract
      `<<` Number Number::leftShift
      `<<` BigInt BigInt::leftShift
      `>>` Number Number::signedRightShift
      `>>` BigInt BigInt::signedRightShift
      `>>>` Number Number::unsignedRightShift
      `&` Number Number::bitwiseAND
      `&` BigInt BigInt::bitwiseAND
      `^` Number Number::bitwiseXOR
      `^` BigInt BigInt::bitwiseXOR
      `|` Number Number::bitwiseOR
      `|` BigInt BigInt::bitwiseOR
      -
      - 1. Return _operation_(_lnum_, _rnum_). + 1. Let _lNum_ be ? ToNumeric(_lVal_). + 1. Let _rNum_ be ? ToNumeric(_rVal_). + 1. If SameType(_lNum_, _rNum_) is *false*, throw a *TypeError* exception. + 1. If _lNum_ is a BigInt, then + 1. If _opText_ is `**`, return ? BigInt::exponentiate(_lNum_, _rNum_). + 1. If _opText_ is `/`, return ? BigInt::divide(_lNum_, _rNum_). + 1. If _opText_ is `%`, return ? BigInt::remainder(_lNum_, _rNum_). + 1. If _opText_ is `>>>`, return ? BigInt::unsignedRightShift(_lNum_, _rNum_). + 1. Let _operation_ be the abstract operation associated with _opText_ in the following table: +
      + + + + + + + + + + + + + + + +
      _opText_ _operation_
      `*` BigInt::multiply
      `+` BigInt::add
      `-` BigInt::subtract
      `<<` BigInt::leftShift
      `>>` BigInt::signedRightShift
      `&` BigInt::bitwiseAND
      `^` BigInt::bitwiseXOR
      `|` BigInt::bitwiseOR
      +
      + 1. Else, + 1. Assert: _lNum_ is a Number. + 1. Let _operation_ be the abstract operation associated with _opText_ in the following table: +
      + + + + + + + + + + + + + + + + + + + +
      _opText_ _operation_
      `**` Number::exponentiate
      `*` Number::multiply
      `/` Number::divide
      `%` Number::remainder
      `+` Number::add
      `-` Number::subtract
      `<<` Number::leftShift
      `>>` Number::signedRightShift
      `>>>` Number::unsignedRightShift
      `&` Number::bitwiseAND
      `^` Number::bitwiseXOR
      `|` Number::bitwiseOR
      +
      + 1. Return _operation_(_lNum_, _rNum_).

      No hint is provided in the calls to ToPrimitive in steps and . All standard objects except Dates handle the absence of a hint as if ~number~ were given; Dates handle the absence of a hint as if ~string~ were given. Exotic objects may handle the absence of a hint in some other manner.

      @@ -20625,11 +20967,11 @@

      - 1. Let _lref_ be ? Evaluation of _leftOperand_. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of _rightOperand_. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Return ? ApplyStringOrNumericBinaryOperator(_lval_, _opText_, _rval_). + 1. Let _lRef_ be ? Evaluation of _leftOperand_. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of _rightOperand_. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Return ? ApplyStringOrNumericBinaryOperator(_lVal_, _opText_, _rVal_). @@ -20815,7 +21157,7 @@

      AssignmentProperty : IdentifierReference Initializer? 1. Let _P_ be the StringValue of |IdentifierReference|. - 1. Let _lref_ be ? ResolveBinding(_P_). + 1. Let _lRef_ be ? ResolveBinding(_P_). 1. Let _v_ be ? GetV(_value_, _P_). 1. If |Initializer| is present and _v_ is *undefined*, then 1. If IsAnonymousFunctionDefinition(|Initializer|) is *true*, then @@ -20823,7 +21165,7 @@

      1. Else, 1. Let _defaultValue_ be ? Evaluation of |Initializer|. 1. Set _v_ to ? GetValue(_defaultValue_). - 1. Perform ? PutValue(_lref_, _v_). + 1. Perform ? PutValue(_lRef_, _v_). 1. Return « _P_ ». @@ -20846,10 +21188,10 @@

      AssignmentRestProperty : `...` DestructuringAssignmentTarget - 1. Let _lref_ be ? Evaluation of |DestructuringAssignmentTarget|. + 1. Let _lRef_ be ? Evaluation of |DestructuringAssignmentTarget|. 1. Let _restObj_ be OrdinaryObjectCreate(%Object.prototype%). 1. Perform ? CopyDataProperties(_restObj_, _value_, _excludedNames_). - 1. Return ? PutValue(_lref_, _restObj_). + 1. Return ? PutValue(_lRef_, _restObj_).
      @@ -20895,7 +21237,7 @@

      AssignmentElement : DestructuringAssignmentTarget Initializer? 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then - 1. Let _lref_ be ? Evaluation of |DestructuringAssignmentTarget|. + 1. Let _lRef_ be ? Evaluation of |DestructuringAssignmentTarget|. 1. Let _value_ be *undefined*. 1. If _iteratorRecord_.[[Done]] is *false*, then 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_). @@ -20903,7 +21245,8 @@

      1. Set _value_ to _next_. 1. If |Initializer| is present and _value_ is *undefined*, then 1. If IsAnonymousFunctionDefinition(|Initializer|) is *true* and IsIdentifierRef of |DestructuringAssignmentTarget| is *true*, then - 1. Let _v_ be ? NamedEvaluation of |Initializer| with argument _lref_.[[ReferencedName]]. + 1. Let _target_ be the StringValue of |DestructuringAssignmentTarget|. + 1. Let _v_ be ? NamedEvaluation of |Initializer| with argument _target_. 1. Else, 1. Let _defaultValue_ be ? Evaluation of |Initializer|. 1. Let _v_ be ? GetValue(_defaultValue_). @@ -20912,7 +21255,7 @@

      1. If |DestructuringAssignmentTarget| is either an |ObjectLiteral| or an |ArrayLiteral|, then 1. Let _nestedAssignmentPattern_ be the |AssignmentPattern| that is covered by |DestructuringAssignmentTarget|. 1. Return ? DestructuringAssignmentEvaluation of _nestedAssignmentPattern_ with argument _v_. - 1. Return ? PutValue(_lref_, _v_). + 1. Return ? PutValue(_lRef_, _v_).

      Left to right evaluation order is maintained by evaluating a |DestructuringAssignmentTarget| that is not a destructuring pattern prior to accessing the iterator or evaluating the |Initializer|.

      @@ -20920,7 +21263,7 @@

      AssignmentRestElement : `...` DestructuringAssignmentTarget 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then - 1. Let _lref_ be ? Evaluation of |DestructuringAssignmentTarget|. + 1. Let _lRef_ be ? Evaluation of |DestructuringAssignmentTarget|. 1. Let _A_ be ! ArrayCreate(0). 1. Let _n_ be 0. 1. Repeat, while _iteratorRecord_.[[Done]] is *false*, @@ -20929,7 +21272,7 @@

      1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_n_)), _next_). 1. Set _n_ to _n_ + 1. 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then - 1. Return ? PutValue(_lref_, _A_). + 1. Return ? PutValue(_lRef_, _A_). 1. Let _nestedAssignmentPattern_ be the |AssignmentPattern| that is covered by |DestructuringAssignmentTarget|. 1. Return ? DestructuringAssignmentEvaluation of _nestedAssignmentPattern_ with argument _A_. @@ -20947,11 +21290,12 @@

      AssignmentElement : DestructuringAssignmentTarget Initializer? 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then - 1. Let _lref_ be ? Evaluation of |DestructuringAssignmentTarget|. + 1. Let _lRef_ be ? Evaluation of |DestructuringAssignmentTarget|. 1. Let _v_ be ? GetV(_value_, _propertyName_). 1. If |Initializer| is present and _v_ is *undefined*, then - 1. If IsAnonymousFunctionDefinition(|Initializer|) and IsIdentifierRef of |DestructuringAssignmentTarget| are both *true*, then - 1. Let _rhsValue_ be ? NamedEvaluation of |Initializer| with argument _lref_.[[ReferencedName]]. + 1. If IsAnonymousFunctionDefinition(|Initializer|) is *true* and IsIdentifierRef of |DestructuringAssignmentTarget| is *true*, then + 1. Let _target_ be the StringValue of |DestructuringAssignmentTarget|. + 1. Let _rhsValue_ be ? NamedEvaluation of |Initializer| with argument _target_. 1. Else, 1. Let _defaultValue_ be ? Evaluation of |Initializer|. 1. Let _rhsValue_ be ? GetValue(_defaultValue_). @@ -20960,7 +21304,7 @@

      1. If |DestructuringAssignmentTarget| is either an |ObjectLiteral| or an |ArrayLiteral|, then 1. Let _assignmentPattern_ be the |AssignmentPattern| that is covered by |DestructuringAssignmentTarget|. 1. Return ? DestructuringAssignmentEvaluation of _assignmentPattern_ with argument _rhsValue_. - 1. Return ? PutValue(_lref_, _rhsValue_). + 1. Return ? PutValue(_lRef_, _rhsValue_). @@ -20979,10 +21323,10 @@

      Syntax

      Runtime Semantics: Evaluation

      Expression : Expression `,` AssignmentExpression - 1. Let _lref_ be ? Evaluation of |Expression|. - 1. Perform ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Return ? GetValue(_rref_). + 1. Let _lRef_ be ? Evaluation of |Expression|. + 1. Perform ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Return ? GetValue(_rRef_).

      GetValue must be called even though its value is not used because it may have observable side-effects.

      @@ -21078,12 +21422,16 @@

      Syntax

      Declaration[?Yield, ?Await] - +

      Static Semantics: Early Errors

      Block : `{` StatementList `}`
      • - It is a Syntax Error if the LexicallyDeclaredNames of |StatementList| contains any duplicate entries. +

        It is a Syntax Error if the LexicallyDeclaredNames of |StatementList| contains any duplicate entries, unless the host is a web browser or otherwise supports , and both of the following conditions are true:

        +
          +
        • IsStrict(this production) is *false*.
        • +
        • The duplicate entries are only bound by FunctionDeclarations.
        • +
      • It is a Syntax Error if any element of the LexicallyDeclaredNames of |StatementList| also occurs in the VarDeclaredNames of |StatementList|. @@ -21126,7 +21474,7 @@

        Runtime Semantics: Evaluation

        - +

        BlockDeclarationInstantiation ( _code_: a Parse Node, @@ -21141,11 +21489,6 @@

        When a |Block| or |CaseBlock| is evaluated a new Declarative Environment Record is created and bindings for each block scoped variable, constant, function, or class declared in the block are instantiated in the Environment Record.

        It performs the following steps when called:

        - 1. Let _declarations_ be the LexicallyScopedDeclarations of _code_. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. @@ -21154,11 +21497,22 @@

        1. If IsConstantDeclaration of _d_ is *true*, then 1. Perform ! _env_.CreateImmutableBinding(_dn_, *true*). 1. Else, - 1. [id="step-blockdeclarationinstantiation-createmutablebinding"] Perform ! _env_.CreateMutableBinding(_dn_, *false*). NOTE: This step is replaced in section . + 1. [id="step-blockdeclarationinstantiation-createmutablebinding", normative-optional] If the host is a web browser or otherwise supports , then + 1. If ! _env_.HasBinding(_dn_) is *false*, then + 1. Perform ! _env_.CreateMutableBinding(_dn_, *false*). + 1. Else, + 1. Perform ! _env_.CreateMutableBinding(_dn_, *false*). 1. If _d_ is either a |FunctionDeclaration|, a |GeneratorDeclaration|, an |AsyncFunctionDeclaration|, or an |AsyncGeneratorDeclaration|, then 1. Let _fn_ be the sole element of the BoundNames of _d_. 1. Let _fo_ be InstantiateFunctionObject of _d_ with arguments _env_ and _privateEnv_. - 1. [id="step-blockdeclarationinstantiation-initializebinding"] Perform ! _env_.InitializeBinding(_fn_, _fo_). NOTE: This step is replaced in section . + 1. [id="step-blockdeclarationinstantiation-initializebinding", normative-optional] If the host is a web browser or otherwise supports , then + 1. If the binding for _fn_ in _env_ is an uninitialized binding, then + 1. Perform ! _env_.InitializeBinding(_fn_, _fo_). + 1. Else, + 1. Assert: _d_ is a |FunctionDeclaration|. + 1. Perform ! _env_.SetMutableBinding(_fn_, _fo_, *false*). + 1. Else, + 1. Perform ! _env_.InitializeBinding(_fn_, _fo_). 1. Return ~unused~. @@ -21305,8 +21659,8 @@

        Runtime Semantics: Evaluation

        VariableDeclaration : BindingPattern Initializer 1. Let _rhs_ be ? Evaluation of |Initializer|. - 1. Let _rval_ be ? GetValue(_rhs_). - 1. Return ? BindingInitialization of |BindingPattern| with arguments _rval_ and *undefined*. + 1. Let _rVal_ be ? GetValue(_rhs_). + 1. Return ? BindingInitialization of |BindingPattern| with arguments _rVal_ and *undefined*. @@ -21538,11 +21892,9 @@

        Runtime Semantics: Evaluation

        1. Let _exprRef_ be ? Evaluation of |Expression|. 1. Let _exprValue_ be ToBoolean(? GetValue(_exprRef_)). - 1. If _exprValue_ is *false*, then - 1. Return *undefined*. - 1. Else, - 1. Let _stmtCompletion_ be Completion(Evaluation of |Statement|). - 1. Return ? UpdateEmpty(_stmtCompletion_, *undefined*). + 1. If _exprValue_ is *false*, return *undefined*. + 1. Let _stmtCompletion_ be Completion(Evaluation of |Statement|). + 1. Return ? UpdateEmpty(_stmtCompletion_, *undefined*). @@ -21742,15 +22094,15 @@

        1. If the first |Expression| is present, then 1. Let _exprRef_ be ? Evaluation of the first |Expression|. 1. Perform ? GetValue(_exprRef_). - 1. If the second |Expression| is present, let _test_ be the second |Expression|; otherwise, let _test_ be ~empty~. - 1. If the third |Expression| is present, let _increment_ be the third |Expression|; otherwise, let _increment_ be ~empty~. + 1. If the second |Expression| is present, let _test_ be the second |Expression|; else let _test_ be ~empty~. + 1. If the third |Expression| is present, let _increment_ be the third |Expression|; else let _increment_ be ~empty~. 1. Return ? ForBodyEvaluation(_test_, _increment_, |Statement|, « », _labelSet_). ForStatement : `for` `(` `var` VariableDeclarationList `;` Expression? `;` Expression? `)` Statement 1. Perform ? Evaluation of |VariableDeclarationList|. - 1. If the first |Expression| is present, let _test_ be the first |Expression|; otherwise, let _test_ be ~empty~. - 1. If the second |Expression| is present, let _increment_ be the second |Expression|; otherwise, let _increment_ be ~empty~. + 1. If the first |Expression| is present, let _test_ be the first |Expression|; else let _test_ be ~empty~. + 1. If the second |Expression| is present, let _increment_ be the second |Expression|; else let _increment_ be ~empty~. 1. Return ? ForBodyEvaluation(_test_, _increment_, |Statement|, « », _labelSet_). ForStatement : `for` `(` LexicalDeclaration Expression? `;` Expression? `)` Statement @@ -21769,9 +22121,9 @@

        1. If _forDcl_ is an abrupt completion, then 1. Set the running execution context's LexicalEnvironment to _oldEnv_. 1. Return ? _forDcl_. - 1. If _isConst_ is *false*, let _perIterationLets_ be _boundNames_; otherwise let _perIterationLets_ be a new empty List. - 1. If the first |Expression| is present, let _test_ be the first |Expression|; otherwise, let _test_ be ~empty~. - 1. If the second |Expression| is present, let _increment_ be the second |Expression|; otherwise, let _increment_ be ~empty~. + 1. If _isConst_ is *false*, let _perIterationLets_ be _boundNames_; else let _perIterationLets_ be a new empty List. + 1. If the first |Expression| is present, let _test_ be the first |Expression|; else let _test_ be ~empty~. + 1. If the second |Expression| is present, let _increment_ be the second |Expression|; else let _increment_ be ~empty~. 1. Let _bodyResult_ be Completion(ForBodyEvaluation(_test_, _increment_, |Statement|, _perIterationLets_, _labelSet_)). 1. Set the running execution context's LexicalEnvironment to _oldEnv_. 1. Return ? _bodyResult_. @@ -21891,7 +22243,7 @@

        Static Semantics: Early Errors

        If |LeftHandSideExpression| is either an |ObjectLiteral| or an |ArrayLiteral|, |LeftHandSideExpression| must cover an |AssignmentPattern|.

      • - If |LeftHandSideExpression| is neither an |ObjectLiteral| nor an |ArrayLiteral|, it is a Syntax Error if the AssignmentTargetType of |LeftHandSideExpression| is not ~simple~. + If |LeftHandSideExpression| is neither an |ObjectLiteral| nor an |ArrayLiteral|, it is a Syntax Error if the AssignmentTargetType of |LeftHandSideExpression| is ~invalid~.
      @@ -22088,11 +22440,10 @@

      1. Let _iterator_ be EnumerateObjectProperties(_obj_). 1. Let _nextMethod_ be ! GetV(_iterator_, *"next"*). 1. Return the Iterator Record { [[Iterator]]: _iterator_, [[NextMethod]]: _nextMethod_, [[Done]]: *false* }. - 1. Else, - 1. Assert: _iterationKind_ is either ~iterate~ or ~async-iterate~. - 1. If _iterationKind_ is ~async-iterate~, let _iteratorKind_ be ~async~. - 1. Else, let _iteratorKind_ be ~sync~. - 1. Return ? GetIterator(_exprValue_, _iteratorKind_). + 1. Assert: _iterationKind_ is either ~iterate~ or ~async-iterate~. + 1. If _iterationKind_ is ~async-iterate~, let _iteratorKind_ be ~async~. + 1. Else, let _iteratorKind_ be ~sync~. + 1. Return ? GetIterator(_exprValue_, _iteratorKind_). @@ -22135,6 +22486,7 @@

      1. Let _status_ be Completion(BindingInitialization of _lhs_ with arguments _nextValue_ and *undefined*). 1. Else, 1. Let _lhsRef_ be Completion(Evaluation of _lhs_). (It may be evaluated repeatedly.) + 1. If _lhsKind_ is ~assignment~ and the AssignmentTargetType of _lhs_ is ~web-compat~, throw a *ReferenceError* exception. 1. If _lhsRef_ is an abrupt completion, then 1. Let _status_ be _lhsRef_. 1. Else, @@ -22154,22 +22506,18 @@

      1. Let _status_ be Completion(InitializeReferencedBinding(_lhsRef_, _nextValue_)). 1. If _status_ is an abrupt completion, then 1. Set the running execution context's LexicalEnvironment to _oldEnv_. + 1. If _iterationKind_ is ~enumerate~, return ? _status_. + 1. Assert: _iterationKind_ is ~iterate~. 1. If _iteratorKind_ is ~async~, return ? AsyncIteratorClose(_iteratorRecord_, _status_). - 1. If _iterationKind_ is ~enumerate~, then - 1. Return ? _status_. - 1. Else, - 1. Assert: _iterationKind_ is ~iterate~. - 1. Return ? IteratorClose(_iteratorRecord_, _status_). + 1. Return ? IteratorClose(_iteratorRecord_, _status_). 1. Let _result_ be Completion(Evaluation of _stmt_). 1. Set the running execution context's LexicalEnvironment to _oldEnv_. 1. If LoopContinues(_result_, _labelSet_) is *false*, then - 1. If _iterationKind_ is ~enumerate~, then - 1. Return ? UpdateEmpty(_result_, _V_). - 1. Else, - 1. Assert: _iterationKind_ is ~iterate~. - 1. Set _status_ to Completion(UpdateEmpty(_result_, _V_)). - 1. If _iteratorKind_ is ~async~, return ? AsyncIteratorClose(_iteratorRecord_, _status_). - 1. Return ? IteratorClose(_iteratorRecord_, _status_). + 1. Set _status_ to Completion(UpdateEmpty(_result_, _V_)). + 1. If _iterationKind_ is ~enumerate~, return ? _status_. + 1. Assert: _iterationKind_ is ~iterate~. + 1. If _iteratorKind_ is ~async~, return ? AsyncIteratorClose(_iteratorRecord_, _status_). + 1. Return ? IteratorClose(_iteratorRecord_, _status_). 1. If _result_.[[Value]] is not ~empty~, set _V_ to _result_.[[Value]]. @@ -22192,12 +22540,12 @@

      Runtime Semantics: Evaluation

      EnumerateObjectProperties ( _O_: an Object, - ): an Iterator + ): an iterator object

      - 1. Return an Iterator object () whose `next` method iterates over all the String-valued keys of enumerable properties of _O_. The iterator object is never directly accessible to ECMAScript code. The mechanics and order of enumerating the properties is not specified but must conform to the rules specified below. + 1. Return an iterator object whose `next` method iterates over all the String-valued keys of enumerable properties of _O_. The iterator object is never directly accessible to ECMAScript code. The mechanics and order of enumerating the properties is not specified but must conform to the rules specified below.

      The iterator's `throw` and `return` methods are *null* and are never invoked. The iterator's `next` method processes object properties to determine whether the property key should be returned as an iterator value. Returned property keys do not include keys that are Symbols. Properties of the target object may be deleted during enumeration. A property that is deleted before it is processed by the iterator's `next` method is ignored. If new properties are added to the target object during enumeration, the newly added properties are not guaranteed to be processed in the active enumeration. A property name will be returned by the iterator's `next` method at most once in any enumeration.

      Enumerating the properties of the target object includes enumerating properties of its prototype, and the prototype of the prototype, and so on, recursively; but a property of a prototype is not processed if it has the same name as a property that has already been processed by the iterator's `next` method. The values of [[Enumerable]] attributes are not considered when determining if a property of a prototype object has already been processed. The enumerable property names of prototype objects must be obtained by invoking EnumerateObjectProperties passing the prototype object as the argument. EnumerateObjectProperties must obtain the own property keys of the target object by calling its [[OwnPropertyKeys]] internal method. Property attributes of the target object must be obtained by calling its [[GetOwnProperty]] internal method.

      @@ -22238,7 +22586,7 @@

      For-In Iterator Objects

      -

      A For-In Iterator is an object that represents a specific iteration over some specific object. For-In Iterator objects are never directly accessible to ECMAScript code; they exist solely to illustrate the behaviour of EnumerateObjectProperties.

      +

      A For-In Iterator is an object that represents a specific iteration over some specific object. For-In Iterator objects are never directly accessible to ECMAScript code; they exist solely to illustrate the behaviour of EnumerateObjectProperties.

      @@ -22264,19 +22612,19 @@

      The %ForInIteratorPrototype% Object

      The %ForInIteratorPrototype% object:

        -
      • has properties that are inherited by all For-In Iterator Objects.
      • +
      • has properties that are inherited by all For-In Iterator objects.
      • is an ordinary object.
      • -
      • has a [[Prototype]] internal slot whose value is %IteratorPrototype%.
      • +
      • has a [[Prototype]] internal slot whose value is %Iterator.prototype%.
      • is never directly accessible to ECMAScript code.
      • has the following properties:
      - +

      %ForInIteratorPrototype%.next ( )

      1. Let _O_ be the *this* value. 1. Assert: _O_ is an Object. - 1. Assert: _O_ has all of the internal slots of a For-In Iterator Instance (). + 1. Assert: _O_ has all of the internal slots of a For-In Iterator instance (). 1. Let _object_ be _O_.[[Object]]. 1. Repeat, 1. If _O_.[[ObjectWasVisited]] is *false*, then @@ -22289,14 +22637,14 @@

      %ForInIteratorPrototype%.next ( )

      1. Let _r_ be the first element of _O_.[[RemainingKeys]]. 1. Remove the first element from _O_.[[RemainingKeys]]. 1. If _O_.[[VisitedKeys]] does not contain _r_, then - 1. Let _desc_ be ? _object_.[[GetOwnProperty]](_r_). + 1. Let _desc_ be ? _object_.[[GetOwnProperty]](_r_). 1. If _desc_ is not *undefined*, then 1. Append _r_ to _O_.[[VisitedKeys]]. - 1. If _desc_.[[Enumerable]] is *true*, return CreateIterResultObject(_r_, *false*). + 1. If _desc_.[[Enumerable]] is *true*, return CreateIteratorResultObject(_r_, *false*). 1. Set _object_ to ? _object_.[[GetPrototypeOf]](). 1. Set _O_.[[Object]] to _object_. 1. Set _O_.[[ObjectWasVisited]] to *false*. - 1. If _object_ is *null*, return CreateIterResultObject(*undefined*, *true*). + 1. If _object_ is *null*, return CreateIteratorResultObject(*undefined*, *true*).
      @@ -22306,17 +22654,19 @@

      Properties of For-In Iterator Instances

      For-In Iterator instances are ordinary objects that inherit properties from the %ForInIteratorPrototype% intrinsic object. For-In Iterator instances are initially created with the internal slots listed in .

      - - - - - + + + + + + + @@ -25859,7 +26211,7 @@

      - +

      GlobalDeclarationInstantiation ( _script_: a |Script| Parse Node, @@ -25874,21 +26226,16 @@

      When an execution context is established for evaluating scripts, declarations are instantiated in the current global environment. Each global binding declared in the code is instantiated.

      It performs the following steps when called:

      - 1. Let _lexNames_ be the LexicallyDeclaredNames of _script_. 1. Let _varNames_ be the VarDeclaredNames of _script_. 1. For each element _name_ of _lexNames_, do - 1. If _env_.HasVarDeclaration(_name_) is *true*, throw a *SyntaxError* exception. - 1. If _env_.HasLexicalDeclaration(_name_) is *true*, throw a *SyntaxError* exception. - 1. Let _hasRestrictedGlobal_ be ? _env_.HasRestrictedGlobalProperty(_name_). + 1. If HasLexicalDeclaration(_env_, _name_) is *true*, throw a *SyntaxError* exception. + 1. Let _hasRestrictedGlobal_ be ? HasRestrictedGlobalProperty(_env_, _name_). + 1. NOTE: Global `var` and `function` bindings (except those that are introduced by non-strict direct eval) are non-configurable and are therefore restricted global properties. 1. If _hasRestrictedGlobal_ is *true*, throw a *SyntaxError* exception. 1. For each element _name_ of _varNames_, do - 1. If _env_.HasLexicalDeclaration(_name_) is *true*, throw a *SyntaxError* exception. + 1. If HasLexicalDeclaration(_env_, _name_) is *true*, throw a *SyntaxError* exception. 1. Let _varDeclarations_ be the VarScopedDeclarations of _script_. 1. Let _functionsToInitialize_ be a new empty List. 1. Let _declaredFunctionNames_ be a new empty List. @@ -25898,7 +26245,7 @@

      1. NOTE: If there are multiple function declarations for the same name, the last declaration is used. 1. Let _fn_ be the sole element of the BoundNames of _d_. 1. If _declaredFunctionNames_ does not contain _fn_, then - 1. Let _fnDefinable_ be ? _env_.CanDeclareGlobalFunction(_fn_). + 1. Let _fnDefinable_ be ? CanDeclareGlobalFunction(_env_, _fn_). 1. If _fnDefinable_ is *false*, throw a *TypeError* exception. 1. Append _fn_ to _declaredFunctionNames_. 1. Insert _d_ as the first element of _functionsToInitialize_. @@ -25907,27 +26254,46 @@

      1. If _d_ is either a |VariableDeclaration|, a |ForBinding|, or a |BindingIdentifier|, then 1. For each String _vn_ of the BoundNames of _d_, do 1. If _declaredFunctionNames_ does not contain _vn_, then - 1. Let _vnDefinable_ be ? _env_.CanDeclareGlobalVar(_vn_). + 1. Let _vnDefinable_ be ? CanDeclareGlobalVar(_env_, _vn_). 1. If _vnDefinable_ is *false*, throw a *TypeError* exception. 1. If _declaredVarNames_ does not contain _vn_, then 1. Append _vn_ to _declaredVarNames_. 1. NOTE: No abnormal terminations occur after this algorithm step if the global object is an ordinary object. However, if the global object is a Proxy exotic object it may exhibit behaviours that cause abnormal terminations in some of the following steps. - 1. [id="step-globaldeclarationinstantiation-web-compat-insertion-point"] NOTE: Annex adds additional steps at this point. + 1. [id="step-globaldeclarationinstantiation-web-compat-insertion-point", normative-optional] If the host is a web browser or otherwise supports , then + 1. Let _strict_ be ScriptIsStrict of _script_. + 1. If _strict_ is *false*, then + 1. Let _declaredFunctionOrVarNames_ be the list-concatenation of _declaredFunctionNames_ and _declaredVarNames_. + 1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of any |Block|, |CaseClause|, or |DefaultClause| _x_ such that _script_ Contains _x_ is *true*, do + 1. Let _F_ be the StringValue of the |BindingIdentifier| of _f_. + 1. If replacing the |FunctionDeclaration| _f_ with a |VariableStatement| that has _F_ as a |BindingIdentifier| would not produce any Early Errors for _script_, then + 1. If HasLexicalDeclaration(_env_, _F_) is *false*, then + 1. Let _fnDefinable_ be ? CanDeclareGlobalVar(_env_, _F_). + 1. If _fnDefinable_ is *true*, then + 1. NOTE: A var binding for _F_ is only instantiated here if it is neither a VarDeclaredName nor the name of another |FunctionDeclaration|. + 1. If _declaredFunctionOrVarNames_ does not contain _F_, then + 1. Perform ? CreateGlobalVarBinding(_env_, _F_, *false*). + 1. Append _F_ to _declaredFunctionOrVarNames_. + 1. [id="step-globaldeclarationinstantiation-alt-funcdecl-eval"] When the |FunctionDeclaration| _f_ is evaluated, perform the following steps in place of the |FunctionDeclaration| Evaluation algorithm provided in : + 1. Let _gEnv_ be the running execution context's VariableEnvironment. + 1. Let _bEnv_ be the running execution context's LexicalEnvironment. + 1. Let _fObj_ be ! _bEnv_.GetBindingValue(_F_, *false*). + 1. Perform ? _gEnv_.SetMutableBinding(_F_, _fObj_, *false*). + 1. Return ~unused~. 1. Let _lexDeclarations_ be the LexicallyScopedDeclarations of _script_. 1. Let _privateEnv_ be *null*. 1. For each element _d_ of _lexDeclarations_, do 1. NOTE: Lexically declared names are only instantiated here but not initialized. 1. For each element _dn_ of the BoundNames of _d_, do 1. If IsConstantDeclaration of _d_ is *true*, then - 1. Perform ? _env_.CreateImmutableBinding(_dn_, *true*). + 1. Perform ? _env_.CreateImmutableBinding(_dn_, *true*). 1. Else, - 1. Perform ? _env_.CreateMutableBinding(_dn_, *false*). + 1. Perform ? _env_.CreateMutableBinding(_dn_, *false*). 1. For each Parse Node _f_ of _functionsToInitialize_, do 1. Let _fn_ be the sole element of the BoundNames of _f_. 1. Let _fo_ be InstantiateFunctionObject of _f_ with arguments _env_ and _privateEnv_. - 1. Perform ? _env_.CreateGlobalFunctionBinding(_fn_, _fo_, *false*). + 1. Perform ? CreateGlobalFunctionBinding(_env_, _fn_, _fo_, *false*). 1. For each String _vn_ of _declaredVarNames_, do - 1. Perform ? _env_.CreateGlobalVarBinding(_vn_, *false*). + 1. Perform ? CreateGlobalVarBinding(_env_, _vn_, *false*). 1. Return ~unused~. @@ -26026,8 +26392,165 @@

      + +

      ModuleRequest Records

      + +

      A ModuleRequest Record represents the request to import a module with given import attributes. It consists of the following fields:

      + +

      - Internal Slot - - Type - - Description -
      + Internal Slot + + Type + + Description +
      [[Object]] @@ -22454,14 +22804,14 @@

      Syntax

      Runtime Semantics: Evaluation

      ReturnStatement : `return` `;` - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: *undefined*, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(*undefined*). ReturnStatement : `return` Expression `;` 1. Let _exprRef_ be ? Evaluation of |Expression|. 1. Let _exprValue_ be ? GetValue(_exprRef_). 1. If GetGeneratorKind() is ~async~, set _exprValue_ to ? Await(_exprValue_). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _exprValue_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_exprValue_). @@ -22538,12 +22888,16 @@

      Syntax

      `default` `:` StatementList[?Yield, ?Await, ?Return]? - +

      Static Semantics: Early Errors

      SwitchStatement : `switch` `(` Expression `)` CaseBlock
      • - It is a Syntax Error if the LexicallyDeclaredNames of |CaseBlock| contains any duplicate entries. +

        It is a Syntax Error if the LexicallyDeclaredNames of |CaseBlock| contains any duplicate entries, unless the host is a web browser or otherwise supports , and both of the following conditions are true:

        +
          +
        • IsStrict(this production) is *false*.
        • +
        • The duplicate entries are only bound by FunctionDeclarations.
        • +
      • It is a Syntax Error if any element of the LexicallyDeclaredNames of |CaseBlock| also occurs in the VarDeclaredNames of |CaseBlock|. @@ -22696,12 +23050,9 @@

        Static Semantics: Early Errors

        LabelledItem : FunctionDeclaration
        • - It is a Syntax Error if any source text is matched by this production. + It is a Syntax Error if any source text is matched by this production, unless that source text is non-strict code and the host is a web browser or otherwise supports .
        - -

        An alternative definition for this rule is provided in .

        -
        @@ -22733,7 +23084,7 @@

        Runtime Semantics: Evaluation

        Runtime Semantics: LabelledEvaluation ( _labelSet_: a List of Strings, - ): either a normal completion containing an ECMAScript language value or an abrupt completion + ): either a normal completion containing either an ECMAScript language value or ~empty~, or an abrupt completion

        @@ -22849,19 +23200,16 @@

        Static Semantics: Early Errors

        It is a Syntax Error if any element of the BoundNames of |CatchParameter| also occurs in the LexicallyDeclaredNames of |Block|.
      • - It is a Syntax Error if any element of the BoundNames of |CatchParameter| also occurs in the VarDeclaredNames of |Block|. + It is a Syntax Error if any element of the BoundNames of |CatchParameter| also occurs in the VarDeclaredNames of |Block|, unless |CatchParameter| is CatchParameter : BindingIdentifier and the host is a web browser or otherwise supports .
      - -

      An alternative static semantics for this production is given in .

      -

      Runtime Semantics: CatchClauseEvaluation ( _thrownValue_: an ECMAScript language value, - ): either a normal completion containing an ECMAScript language value or an abrupt completion + ): either a normal completion containing either an ECMAScript language value or ~empty~, or an abrupt completion

      @@ -22935,8 +23283,7 @@

      Runtime Semantics: Evaluation

      1. If an implementation-defined debugging facility is available and enabled, then 1. Perform an implementation-defined debugging action. 1. Return a new implementation-defined Completion Record. - 1. Else, - 1. Return ~empty~. + 1. Return ~empty~.
      @@ -23192,7 +23539,7 @@

      Static Semantics: HasInitializer ( ): a Boolean

      -

      Static Semantics: ExpectedArgumentCount ( ): an integer

      +

      Static Semantics: ExpectedArgumentCount ( ): a non-negative integer

      @@ -23327,7 +23674,8 @@

      Static Semantics: FunctionBodyContainsUseStrict ( ): a Boolean

      FunctionBody : FunctionStatementList - 1. If the Directive Prologue of |FunctionBody| contains a Use Strict Directive, return *true*; otherwise, return *false*. + 1. If the Directive Prologue of |FunctionBody| contains a Use Strict Directive, return *true*. + 1. Return *false*.
      @@ -23336,14 +23684,16 @@

      Runtime Semantics: EvaluateFunctionBody ( _functionObject_: an ECMAScript function object, _argumentsList_: a List of ECMAScript language values, - ): either a normal completion containing an ECMAScript language value or an abrupt completion + ): a return completion or a throw completion

      FunctionBody : FunctionStatementList 1. Perform ? FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). - 1. Return ? Evaluation of |FunctionStatementList|. + 1. Perform ? Evaluation of |FunctionStatementList|. + 1. NOTE: If the previous step resulted in a normal completion, then evaluation finished by proceeding past the end of the |FunctionStatementList|. + 1. Return ReturnCompletion(*undefined*). @@ -23424,7 +23774,7 @@

      Runtime Semantics: Evaluation

      1. Return ~empty~. -

      An alternative semantics is provided in .

      +

      An alternative semantics is provided by at step of FunctionDeclarationInstantiation, step of GlobalDeclarationInstantiation, and step of EvalDeclarationInstantiation.

      FunctionDeclaration : `function` `(` FormalParameters `)` `{` FunctionBody `}` @@ -23519,7 +23869,7 @@

      Runtime Semantics: EvaluateConciseBody ( _functionObject_: an ECMAScript function object, _argumentsList_: a List of ECMAScript language values, - ): either a normal completion containing an ECMAScript language value or an abrupt completion + ): a return completion or a throw completion

      @@ -23563,7 +23913,7 @@

      Runtime Semantics: Evaluation

      1. Let _exprRef_ be ? Evaluation of |AssignmentExpression|. 1. Let _exprValue_ be ? GetValue(_exprRef_). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _exprValue_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_exprValue_). @@ -23719,10 +24069,9 @@

      1. Perform SetFunctionName(_closure_, _propKey_, *"get"*). 1. If _propKey_ is a Private Name, then 1. Return PrivateElement { [[Key]]: _propKey_, [[Kind]]: ~accessor~, [[Get]]: _closure_, [[Set]]: *undefined* }. - 1. Else, - 1. Let _desc_ be the PropertyDescriptor { [[Get]]: _closure_, [[Enumerable]]: _enumerable_, [[Configurable]]: *true* }. - 1. Perform ? DefinePropertyOrThrow(_object_, _propKey_, _desc_). - 1. Return ~unused~. + 1. Let _desc_ be the PropertyDescriptor { [[Get]]: _closure_, [[Enumerable]]: _enumerable_, [[Configurable]]: *true* }. + 1. Perform ? DefinePropertyOrThrow(_object_, _propKey_, _desc_). + 1. Return ~unused~. MethodDefinition : `set` ClassElementName `(` PropertySetParameterList `)` `{` FunctionBody `}` @@ -23735,10 +24084,9 @@

      1. Perform SetFunctionName(_closure_, _propKey_, *"set"*). 1. If _propKey_ is a Private Name, then 1. Return PrivateElement { [[Key]]: _propKey_, [[Kind]]: ~accessor~, [[Get]]: *undefined*, [[Set]]: _closure_ }. - 1. Else, - 1. Let _desc_ be the PropertyDescriptor { [[Set]]: _closure_, [[Enumerable]]: _enumerable_, [[Configurable]]: *true* }. - 1. Perform ? DefinePropertyOrThrow(_object_, _propKey_, _desc_). - 1. Return ~unused~. + 1. Let _desc_ be the PropertyDescriptor { [[Set]]: _closure_, [[Enumerable]]: _enumerable_, [[Configurable]]: *true* }. + 1. Perform ? DefinePropertyOrThrow(_object_, _propKey_, _desc_). + 1. Return ~unused~. GeneratorMethod : `*` ClassElementName `(` UniqueFormalParameters `)` `{` GeneratorBody `}` @@ -23749,7 +24097,7 @@

      1. Let _closure_ be OrdinaryFunctionCreate(%GeneratorFunction.prototype%, _sourceText_, |UniqueFormalParameters|, |GeneratorBody|, ~non-lexical-this~, _env_, _privateEnv_). 1. Perform MakeMethod(_closure_, _object_). 1. Perform SetFunctionName(_closure_, _propKey_). - 1. Let _prototype_ be OrdinaryObjectCreate(%GeneratorFunction.prototype.prototype%). + 1. Let _prototype_ be OrdinaryObjectCreate(%GeneratorPrototype%). 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Return ? DefineMethodProperty(_object_, _propKey_, _closure_, _enumerable_). @@ -23764,7 +24112,7 @@

      1. Let _closure_ be OrdinaryFunctionCreate(%AsyncGeneratorFunction.prototype%, _sourceText_, |UniqueFormalParameters|, |AsyncGeneratorBody|, ~non-lexical-this~, _env_, _privateEnv_). 1. Perform MakeMethod(_closure_, _object_). 1. Perform SetFunctionName(_closure_, _propKey_). - 1. Let _prototype_ be OrdinaryObjectCreate(%AsyncGeneratorFunction.prototype.prototype%). + 1. Let _prototype_ be OrdinaryObjectCreate(%AsyncGeneratorPrototype%). 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Return ? DefineMethodProperty(_object_, _propKey_, _closure_, _enumerable_). @@ -23884,10 +24232,11 @@

      GeneratorBody : FunctionBody 1. Perform ? FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). - 1. Let _G_ be ? OrdinaryCreateFromConstructor(_functionObject_, *"%GeneratorFunction.prototype.prototype%"*, « [[GeneratorState]], [[GeneratorContext]], [[GeneratorBrand]] »). + 1. Let _G_ be ? OrdinaryCreateFromConstructor(_functionObject_, *"%GeneratorPrototype%"*, « [[GeneratorState]], [[GeneratorContext]], [[GeneratorBrand]] »). 1. Set _G_.[[GeneratorBrand]] to ~empty~. + 1. Set _G_.[[GeneratorState]] to ~suspended-start~. 1. Perform GeneratorStart(_G_, |FunctionBody|). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _G_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_G_). @@ -23906,7 +24255,7 @@

      1. Let _sourceText_ be the source text matched by |GeneratorDeclaration|. 1. Let _F_ be OrdinaryFunctionCreate(%GeneratorFunction.prototype%, _sourceText_, |FormalParameters|, |GeneratorBody|, ~non-lexical-this~, _env_, _privateEnv_). 1. Perform SetFunctionName(_F_, _name_). - 1. Let _prototype_ be OrdinaryObjectCreate(%GeneratorFunction.prototype.prototype%). + 1. Let _prototype_ be OrdinaryObjectCreate(%GeneratorPrototype%). 1. Perform ! DefinePropertyOrThrow(_F_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Return _F_. @@ -23915,7 +24264,7 @@

      1. Let _sourceText_ be the source text matched by |GeneratorDeclaration|. 1. Let _F_ be OrdinaryFunctionCreate(%GeneratorFunction.prototype%, _sourceText_, |FormalParameters|, |GeneratorBody|, ~non-lexical-this~, _env_, _privateEnv_). 1. Perform SetFunctionName(_F_, *"default"*). - 1. Let _prototype_ be OrdinaryObjectCreate(%GeneratorFunction.prototype.prototype%). + 1. Let _prototype_ be OrdinaryObjectCreate(%GeneratorPrototype%). 1. Perform ! DefinePropertyOrThrow(_F_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Return _F_. @@ -23940,7 +24289,7 @@

      1. Let _sourceText_ be the source text matched by |GeneratorExpression|. 1. Let _closure_ be OrdinaryFunctionCreate(%GeneratorFunction.prototype%, _sourceText_, |FormalParameters|, |GeneratorBody|, ~non-lexical-this~, _env_, _privateEnv_). 1. Perform SetFunctionName(_closure_, _name_). - 1. Let _prototype_ be OrdinaryObjectCreate(%GeneratorFunction.prototype.prototype%). + 1. Let _prototype_ be OrdinaryObjectCreate(%GeneratorPrototype%). 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Return _closure_. @@ -23955,7 +24304,7 @@

      1. Let _sourceText_ be the source text matched by |GeneratorExpression|. 1. Let _closure_ be OrdinaryFunctionCreate(%GeneratorFunction.prototype%, _sourceText_, |FormalParameters|, |GeneratorBody|, ~non-lexical-this~, _funcEnv_, _privateEnv_). 1. Perform SetFunctionName(_closure_, _name_). - 1. Let _prototype_ be OrdinaryObjectCreate(%GeneratorFunction.prototype.prototype%). + 1. Let _prototype_ be OrdinaryObjectCreate(%GeneratorPrototype%). 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Perform ! _funcEnv_.InitializeBinding(_name_, _closure_). 1. Return _closure_. @@ -23986,6 +24335,7 @@

      Runtime Semantics: Evaluation

      YieldExpression : `yield` `*` AssignmentExpression 1. Let _generatorKind_ be GetGeneratorKind(). + 1. Assert: _generatorKind_ is either ~sync~ or ~async~. 1. Let _exprRef_ be ? Evaluation of |AssignmentExpression|. 1. Let _value_ be ? GetValue(_exprRef_). 1. Let _iteratorRecord_ be ? GetIterator(_value_, _generatorKind_). @@ -24015,7 +24365,7 @@

      Runtime Semantics: Evaluation

      1. Else, set _received_ to Completion(GeneratorYield(_innerResult_)). 1. Else, 1. NOTE: If _iterator_ does not have a `throw` method, this throw is going to terminate the `yield*` loop. But first we need to give _iterator_ a chance to clean up. - 1. Let _closeCompletion_ be Completion Record { [[Type]]: ~normal~, [[Value]]: ~empty~, [[Target]]: ~empty~ }. + 1. Let _closeCompletion_ be NormalCompletion(~empty~). 1. If _generatorKind_ is ~async~, perform ? AsyncIteratorClose(_iteratorRecord_, _closeCompletion_). 1. Else, perform ? IteratorClose(_iteratorRecord_, _closeCompletion_). 1. NOTE: The next step throws a *TypeError* to indicate that there was a `yield*` protocol violation: _iterator_ does not have a `throw` method. @@ -24024,17 +24374,17 @@

      Runtime Semantics: Evaluation

      1. Assert: _received_ is a return completion. 1. Let _return_ be ? GetMethod(_iterator_, *"return"*). 1. If _return_ is *undefined*, then - 1. Set _value_ to _received_.[[Value]]. + 1. Let _receivedValue_ be _received_.[[Value]]. 1. If _generatorKind_ is ~async~, then - 1. Set _value_ to ? Await(_value_). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. + 1. Set _receivedValue_ to ? Await(_receivedValue_). + 1. Return ReturnCompletion(_receivedValue_). 1. Let _innerReturnResult_ be ? Call(_return_, _iterator_, « _received_.[[Value]] »). 1. If _generatorKind_ is ~async~, set _innerReturnResult_ to ? Await(_innerReturnResult_). 1. If _innerReturnResult_ is not an Object, throw a *TypeError* exception. 1. Let _done_ be ? IteratorComplete(_innerReturnResult_). 1. If _done_ is *true*, then - 1. Set _value_ to ? IteratorValue(_innerReturnResult_). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. + 1. Let _returnedValue_ be ? IteratorValue(_innerReturnResult_). + 1. Return ReturnCompletion(_returnedValue_). 1. If _generatorKind_ is ~async~, set _received_ to Completion(AsyncGeneratorYield(? IteratorValue(_innerReturnResult_))). 1. Else, set _received_ to Completion(GeneratorYield(_innerReturnResult_)).
      @@ -24111,10 +24461,11 @@

      1. Perform ? FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). - 1. Let _generator_ be ? OrdinaryCreateFromConstructor(_functionObject_, *"%AsyncGeneratorFunction.prototype.prototype%"*, « [[AsyncGeneratorState]], [[AsyncGeneratorContext]], [[AsyncGeneratorQueue]], [[GeneratorBrand]] »). + 1. Let _generator_ be ? OrdinaryCreateFromConstructor(_functionObject_, *"%AsyncGeneratorPrototype%"*, « [[AsyncGeneratorState]], [[AsyncGeneratorContext]], [[AsyncGeneratorQueue]], [[GeneratorBrand]] »). 1. Set _generator_.[[GeneratorBrand]] to ~empty~. + 1. Set _generator_.[[AsyncGeneratorState]] to ~suspended-start~. 1. Perform AsyncGeneratorStart(_generator_, |FunctionBody|). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _generator_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_generator_). @@ -24135,7 +24486,7 @@

      1. Let _sourceText_ be the source text matched by |AsyncGeneratorDeclaration|. 1. Let _F_ be OrdinaryFunctionCreate(%AsyncGeneratorFunction.prototype%, _sourceText_, |FormalParameters|, |AsyncGeneratorBody|, ~non-lexical-this~, _env_, _privateEnv_). 1. Perform SetFunctionName(_F_, _name_). - 1. Let _prototype_ be OrdinaryObjectCreate(%AsyncGeneratorFunction.prototype.prototype%). + 1. Let _prototype_ be OrdinaryObjectCreate(%AsyncGeneratorPrototype%). 1. Perform ! DefinePropertyOrThrow(_F_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Return _F_. @@ -24146,7 +24497,7 @@

      1. Let _sourceText_ be the source text matched by |AsyncGeneratorDeclaration|. 1. Let _F_ be OrdinaryFunctionCreate(%AsyncGeneratorFunction.prototype%, _sourceText_, |FormalParameters|, |AsyncGeneratorBody|, ~non-lexical-this~, _env_, _privateEnv_). 1. Perform SetFunctionName(_F_, *"default"*). - 1. Let _prototype_ be OrdinaryObjectCreate(%AsyncGeneratorFunction.prototype.prototype%). + 1. Let _prototype_ be OrdinaryObjectCreate(%AsyncGeneratorPrototype%). 1. Perform ! DefinePropertyOrThrow(_F_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Return _F_. @@ -24173,7 +24524,7 @@

      1. Let _sourceText_ be the source text matched by |AsyncGeneratorExpression|. 1. Let _closure_ be OrdinaryFunctionCreate(%AsyncGeneratorFunction.prototype%, _sourceText_, |FormalParameters|, |AsyncGeneratorBody|, ~non-lexical-this~, _env_, _privateEnv_). 1. Perform SetFunctionName(_closure_, _name_). - 1. Let _prototype_ be OrdinaryObjectCreate(%AsyncGeneratorFunction.prototype.prototype%). + 1. Let _prototype_ be OrdinaryObjectCreate(%AsyncGeneratorPrototype%). 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Return _closure_. @@ -24190,7 +24541,7 @@

      1. Let _sourceText_ be the source text matched by |AsyncGeneratorExpression|. 1. Let _closure_ be OrdinaryFunctionCreate(%AsyncGeneratorFunction.prototype%, _sourceText_, |FormalParameters|, |AsyncGeneratorBody|, ~non-lexical-this~, _funcEnv_, _privateEnv_). 1. Perform SetFunctionName(_closure_, _name_). - 1. Let _prototype_ be OrdinaryObjectCreate(%AsyncGeneratorFunction.prototype.prototype%). + 1. Let _prototype_ be OrdinaryObjectCreate(%AsyncGeneratorPrototype%). 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Perform ! _funcEnv_.InitializeBinding(_name_, _closure_). 1. Return _closure_. @@ -24452,7 +24803,7 @@

      Static Semantics: NonConstructorElements ( ): a List of |ClassElement| Parse 1. Let _list_ be the NonConstructorElements of |ClassElementList|. 1. If the ClassElementKind of |ClassElement| is ~non-constructor-method~, then - 1. Append |ClassElement| to the end of _list_. + 1. Append |ClassElement| to _list_. 1. Return _list_. @@ -24723,7 +25074,7 @@

      Runtime Semantics: EvaluateClassStaticBlockBody ( _functionObject_: an ECMAScript function object, - ): either a normal completion containing an ECMAScript language value or an abrupt completion + ): a return completion or a throw completion

      @@ -24731,7 +25082,8 @@

      1. Assert: _functionObject_ is a synthetic function created by ClassStaticBlockDefinitionEvaluation step . 1. Perform ! FunctionDeclarationInstantiation(_functionObject_, « »). - 1. Return ? Evaluation of |ClassStaticBlockStatementList|. + 1. Perform ? Evaluation of |ClassStaticBlockStatementList|. + 1. Return ReturnCompletion(*undefined*). @@ -24780,6 +25132,7 @@

      Runtime Semantics: ClassDefinitionEvaluation ( _classBinding_: a String or *undefined*, _className_: a property key or a Private Name, + _sourceText_: ECMAScript source text, ): either a normal completion containing a function object or an abrupt completion

      @@ -24833,7 +25186,7 @@

      1. If NewTarget is *undefined*, throw a *TypeError* exception. 1. Let _F_ be the active function object. 1. If _F_.[[ConstructorKind]] is ~derived~, then - 1. NOTE: This branch behaves similarly to `constructor(...args) { super(...args); }`. The most notable distinction is that while the aforementioned ECMAScript source text observably calls the @@iterator method on `%Array.prototype%`, this function does not. + 1. NOTE: This branch behaves similarly to `constructor(...args) { super(...args); }`. The most notable distinction is that while the aforementioned ECMAScript source text observably calls the %Symbol.iterator% method on `%Array.prototype%`, this function does not. 1. Let _func_ be ! _F_.[[GetPrototypeOf]](). 1. If IsConstructor(_func_) is *false*, throw a *TypeError* exception. 1. Let _result_ be ? Construct(_func_, _args_, NewTarget). @@ -24841,13 +25194,14 @@

      1. NOTE: This branch behaves similarly to `constructor() {}`. 1. Let _result_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%Object.prototype%"*). 1. Perform ? InitializeInstanceElements(_result_, _F_). - 1. Return _result_. - 1. Let _F_ be CreateBuiltinFunction(_defaultConstructor_, 0, _className_, « [[ConstructorKind]], [[SourceText]] », the current Realm Record, _constructorParent_). + 1. Return NormalCompletion(_result_). + 1. Let _F_ be CreateBuiltinFunction(_defaultConstructor_, 0, _className_, « [[ConstructorKind]], [[SourceText]], [[PrivateMethods]], [[Fields]] », the current Realm Record, _constructorParent_). 1. Else, 1. Let _constructorInfo_ be ! DefineMethod of _constructor_ with arguments _proto_ and _constructorParent_. 1. Let _F_ be _constructorInfo_.[[Closure]]. 1. Perform MakeClassConstructor(_F_). 1. Perform SetFunctionName(_F_, _className_). + 1. Set _F_.[[SourceText]] to _sourceText_. 1. Perform MakeConstructor(_F_, *false*, _proto_). 1. If |ClassHeritage| is present, set _F_.[[ConstructorKind]] to ~derived~. 1. Perform ! DefineMethodProperty(_proto_, *"constructor"*, _F_, *false*). @@ -24913,17 +25267,16 @@

      Runtime Semantics: BindingClassDeclarationEvaluation ( ): either a normal co ClassDeclaration : `class` BindingIdentifier ClassTail 1. Let _className_ be the StringValue of |BindingIdentifier|. - 1. Let _value_ be ? ClassDefinitionEvaluation of |ClassTail| with arguments _className_ and _className_. - 1. Set _value_.[[SourceText]] to the source text matched by |ClassDeclaration|. + 1. Let _sourceText_ be the source text matched by |ClassDeclaration|. + 1. Let _value_ be ? ClassDefinitionEvaluation of |ClassTail| with arguments _className_, _className_, and _sourceText_. 1. Let _env_ be the running execution context's LexicalEnvironment. 1. Perform ? InitializeBoundName(_className_, _value_, _env_). 1. Return _value_. ClassDeclaration : `class` ClassTail - 1. Let _value_ be ? ClassDefinitionEvaluation of |ClassTail| with arguments *undefined* and *"default"*. - 1. Set _value_.[[SourceText]] to the source text matched by |ClassDeclaration|. - 1. Return _value_. + 1. Let _sourceText_ be the source text matched by |ClassDeclaration|. + 1. Return ? ClassDefinitionEvaluation of |ClassTail| with arguments *undefined*, *"default"*, and _sourceText_.

      ClassDeclaration : `class` ClassTail only occurs as part of an |ExportDeclaration| and establishing its binding is handled as part of the evaluation action for that production. See .

      @@ -24942,16 +25295,14 @@

      Runtime Semantics: Evaluation

      ClassExpression : `class` ClassTail - 1. Let _value_ be ? ClassDefinitionEvaluation of |ClassTail| with arguments *undefined* and *""*. - 1. Set _value_.[[SourceText]] to the source text matched by |ClassExpression|. - 1. Return _value_. + 1. Let _sourceText_ be the source text matched by |ClassExpression|. + 1. Return ? ClassDefinitionEvaluation of |ClassTail| with arguments *undefined*, *""*, and _sourceText_. ClassExpression : `class` BindingIdentifier ClassTail 1. Let _className_ be the StringValue of |BindingIdentifier|. - 1. Let _value_ be ? ClassDefinitionEvaluation of |ClassTail| with arguments _className_ and _className_. - 1. Set _value_.[[SourceText]] to the source text matched by |ClassExpression|. - 1. Return _value_. + 1. Let _sourceText_ be the source text matched by |ClassExpression|. + 1. Return ? ClassDefinitionEvaluation of |ClassTail| with arguments _className_, _className_, and _sourceText_. ClassElementName : PrivateIdentifier @@ -25125,12 +25476,12 @@

      1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). - 1. Let _declResult_ be Completion(FunctionDeclarationInstantiation(_functionObject_, _argumentsList_)). - 1. If _declResult_ is an abrupt completion, then - 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _declResult_.[[Value]] »). + 1. Let _completion_ be Completion(FunctionDeclarationInstantiation(_functionObject_, _argumentsList_)). + 1. If _completion_ is an abrupt completion, then + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _completion_.[[Value]] »). 1. Else, 1. Perform AsyncFunctionStart(_promiseCapability_, |FunctionBody|). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _promiseCapability_.[[Promise]], [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_promiseCapability_.[[Promise]]). @@ -25232,12 +25583,12 @@

      1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). - 1. Let _declResult_ be Completion(FunctionDeclarationInstantiation(_functionObject_, _argumentsList_)). - 1. If _declResult_ is an abrupt completion, then - 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _declResult_.[[Value]] »). + 1. Let _completion_ be Completion(FunctionDeclarationInstantiation(_functionObject_, _argumentsList_)). + 1. If _completion_ is an abrupt completion, then + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _completion_.[[Value]] »). 1. Else, 1. Perform AsyncFunctionStart(_promiseCapability_, |ExpressionBody|). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _promiseCapability_.[[Promise]], [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_promiseCapability_.[[Promise]]). @@ -25723,7 +26074,8 @@

      Static Semantics: ScriptIsStrict ( ): a Boolean

      Script : ScriptBody? - 1. If |ScriptBody| is present and the Directive Prologue of |ScriptBody| contains a Use Strict Directive, return *true*; otherwise, return *false*. + 1. If |ScriptBody| is present and the Directive Prologue of |ScriptBody| contains a Use Strict Directive, return *true*. + 1. Return *false*. @@ -25782,10 +26134,10 @@

      Script Records

      [[LoadedModules]]

      - a List of Records with fields [[Specifier]] (a String) and [[Module]] (a Module Record) + a List of LoadedModuleRequest Records - A map from the specifier strings imported by this script to the resolved Module Record. The list does not contain two different Records with the same [[Specifier]]. + A map from the specifier strings imported by this script to the resolved Module Record. The list does not contain two different Records _r1_ and _r2_ such that ModuleRequestsEqual(_r1_, _r2_) is *true*.
      + + + + + + + + + + + + + + + +
      + Field Name + + Value Type + + Meaning +
      + [[Specifier]] + + a String + + The module specifier +
      + [[Attributes]] + + a List of ImportAttribute Records + + The import attributes +
      +
      + +

      A LoadedModuleRequest Record represents the request to import a module together with the resulting Module Record. It consists of the same fields defined in table , with the addition of [[Module]]:

      + + + + + + + + + + + + + + + + + + + + + + +
      + Field Name + + Value Type + + Meaning +
      + [[Specifier]] + + a String + + The module specifier +
      + [[Attributes]] + + a List of ImportAttribute Records + + The import attributes +
      + [[Module]] + + a Module Record + + The loaded module corresponding to this module request +
      +
      + +

      An ImportAttribute Record consists of the following fields:

      + + + + + + + + + + + + + + + + + +
      + Field Name + + Value Type + + Meaning +
      + [[Key]] + + a String + + The attribute key +
      + [[Value]] + + a String + + The attribute value +
      +
      + + +

      + ModuleRequestsEqual ( + _left_: a ModuleRequest Record or a LoadedModuleRequest Record, + _right_: a ModuleRequest Record or a LoadedModuleRequest Record, + ): a Boolean +

      +
      +
      description
      +
      +
      + + + 1. If _left_.[[Specifier]] is not _right_.[[Specifier]], return *false*. + 1. Let _leftAttrs_ be _left_.[[Attributes]]. + 1. Let _rightAttrs_ be _right_.[[Attributes]]. + 1. Let _leftAttrsCount_ be the number of elements in _leftAttrs_. + 1. Let _rightAttrsCount_ be the number of elements in _rightAttrs_. + 1. If _leftAttrsCount_ ≠ _rightAttrsCount_, return *false*. + 1. For each ImportAttribute Record _l_ of _leftAttrs_, do + 1. If _rightAttrs_ does not contain an ImportAttribute Record _r_ such that _l_.[[Key]] is _r_.[[Key]] and _l_.[[Value]] is _r_.[[Value]], return *false*. + 1. Return *true*. + +
      +
      + -

      Static Semantics: ModuleRequests ( ): a List of Strings

      +

      Static Semantics: ModuleRequests ( ): a List of ModuleRequest Records

      Module : [empty] @@ -26040,12 +26563,12 @@

      Static Semantics: ModuleRequests ( ): a List of Strings

      ModuleItemList : ModuleItemList ModuleItem - 1. Let _moduleNames_ be the ModuleRequests of |ModuleItemList|. - 1. Let _additionalNames_ be the ModuleRequests of |ModuleItem|. - 1. For each String _name_ of _additionalNames_, do - 1. If _moduleNames_ does not contain _name_, then - 1. Append _name_ to _moduleNames_. - 1. Return _moduleNames_. + 1. Let _requests_ be the ModuleRequests of |ModuleItemList|. + 1. Let _additionalRequests_ be the ModuleRequests of |ModuleItem|. + 1. For each ModuleRequest Record _mr_ of _additionalRequests_, do + 1. If _requests_ does not contain a ModuleRequest Record _mr2_ such that ModuleRequestsEqual(_mr_, _mr2_) is *true*, then + 1. Append _mr_ to _requests_. + 1. Return _requests_. ModuleItem : StatementListItem @@ -26053,17 +26576,40 @@

      Static Semantics: ModuleRequests ( ): a List of Strings

      ImportDeclaration : `import` ImportClause FromClause `;` - 1. Return the ModuleRequests of |FromClause|. + 1. Let _specifier_ be the SV of |FromClause|. + 1. Return a List whose sole element is the ModuleRequest Record { [[Specifier]]: _specifier_, [[Attributes]]: « » }. + + ImportDeclaration : `import` ImportClause FromClause WithClause `;` + + 1. Let _specifier_ be the SV of |FromClause|. + 1. Let _attributes_ be WithClauseToAttributes of |WithClause|. + 1. Return a List whose sole element is the ModuleRequest Record { [[Specifier]]: _specifier_, [[Attributes]]: _attributes_ }. + + ImportDeclaration : `import` ModuleSpecifier `;` + + 1. Let _specifier_ be the SV of |ModuleSpecifier|. + 1. Return a List whose sole element is the ModuleRequest Record { [[Specifier]]: _specifier_, [[Attributes]]: « » }. - ModuleSpecifier : StringLiteral + ImportDeclaration : `import` ModuleSpecifier WithClause `;` - 1. Return a List whose sole element is the SV of |StringLiteral|. + 1. Let _specifier_ be the SV of |ModuleSpecifier|. + 1. Let _attributes_ be WithClauseToAttributes of |WithClause|. + 1. Return a List whose sole element is the ModuleRequest Record { [[Specifier]]: _specifier_, [[Attributes]]: _attributes_ }. ExportDeclaration : `export` ExportFromClause FromClause `;` - 1. Return the ModuleRequests of |FromClause|. + 1. Let _specifier_ be the SV of |FromClause|. + 1. Return a List whose sole element is the ModuleRequest Record { [[Specifier]]: _specifier_, [[Attributes]]: « » }. + + + ExportDeclaration : `export` ExportFromClause FromClause WithClause `;` + + + 1. Let _specifier_ be the SV of |FromClause|. + 1. Let _attributes_ be WithClauseToAttributes of |WithClause|. + 1. Return a List whose sole element is the ModuleRequest Record { [[Specifier]]: _specifier_, [[Attributes]]: _attributes_ }. ExportDeclaration : @@ -26145,63 +26691,114 @@

      Abstract Module Records

      - + - - - - - + + + + + + + + + - + + - + - - + + + - - + + + +
      - Method - - Purpose -
      + Method + + Purpose + + Definitions +
      - LoadRequestedModules( [ _hostDefined_ ] ) + LoadRequestedModules ( + optional _hostDefined_: anything, + ): a Promise -

      Prepares the module for linking by recursively loading all its dependencies, and returns a promise.

      +

      It prepares the module for linking by recursively loading all its dependencies.

      +
      + Within this specification it has definitions in the following types; hosts may provide additional types with their own definitions: +
      - GetExportedNames([_exportStarSet_]) + GetExportedNames ( + optional _exportStarSet_: a List of Source Text Module Records, + ): a List of Strings -

      Return a list of all names that are either directly or indirectly exported from this module.

      +

      It returns a list of all names that are either directly or indirectly exported from this module.

      LoadRequestedModules must have completed successfully prior to invoking this method.

      + Within this specification it has definitions in the following types; hosts may provide additional types with their own definitions: + +
      - ResolveExport(_exportName_ [, _resolveSet_]) + ResolveExport ( + _exportName_: a String, + optional _resolveSet_: a List of Records with fields [[Module]] (a Module Record) and [[ExportName]] (a String), + ): a ResolvedBinding Record, *null*, or ~ambiguous~ -

      Return the binding of a name exported by this module. Bindings are represented by a ResolvedBinding Record, of the form { [[Module]]: Module Record, [[BindingName]]: String | ~namespace~ }. If the export is a Module Namespace Object without a direct binding in any module, [[BindingName]] will be set to ~namespace~. Return *null* if the name cannot be resolved, or ~ambiguous~ if multiple bindings were found.

      +

      It returns the binding of a name exported by this module. Bindings are represented by a ResolvedBinding Record, of the form { [[Module]]: Module Record, [[BindingName]]: String | ~namespace~ }. If the export is a Module Namespace Object without a direct binding in any module, [[BindingName]] will be set to ~namespace~. It returns *null* if the name cannot be resolved, or ~ambiguous~ if multiple bindings were found.

      Each time this operation is called with a specific _exportName_, _resolveSet_ pair as arguments it must return the same result.

      LoadRequestedModules must have completed successfully prior to invoking this method.

      - Link() + Within this specification it has definitions in the following types; hosts may provide additional types with their own definitions: +
      - Evaluate() + Within this specification it has definitions in the following types; hosts may provide additional types with their own definitions: +
      Evaluate ( ): a Promise -

      Returns a promise for the evaluation of this module and its dependencies, resolving on successful evaluation or if it has already been evaluated successfully, and rejecting for an evaluation error or if it has already been evaluated unsuccessfully. If the promise is rejected, hosts are expected to handle the promise rejection and rethrow the evaluation error.

      +

      It returns a promise for the evaluation of this module and its dependencies, resolving on successful evaluation or if it has already been evaluated successfully, and rejecting for an evaluation error or if it has already been evaluated unsuccessfully. If the promise is rejected, hosts are expected to handle the promise rejection and rethrow the evaluation error. Unless this module is a Cyclic Module Record, the returned promise must be already settled.

      Link must have completed successfully prior to invoking this method.

      + Within this specification it has definitions in the following types; hosts may provide additional types with their own definitions: + +
      + + +

      + EvaluateModuleSync ( + _module_: a Module Record, + ): either a normal completion containing ~unused~ or a throw completion +

      +
      +
      description
      +
      It synchronously evaluates _module_, provided that the caller guarantees that _module_'s evaluation will return an already settled promise.
      +
      + + + 1. Assert: _module_ is not a Cyclic Module Record. + 1. Let _promise_ be _module_.Evaluate(). + 1. Assert: _promise_.[[PromiseState]] is either ~fulfilled~ or ~rejected~. + 1. If _promise_.[[PromiseState]] is ~rejected~, then + 1. If _promise_.[[PromiseIsHandled]] is *false*, perform HostPromiseRejectionTracker(_promise_, *"handle"*). + 1. Set _promise_.[[PromiseIsHandled]] to *true*. + 1. Return ThrowCompletion(_promise_.[[PromiseResult]]). + 1. Return ~unused~. + +
      @@ -26210,17 +26807,19 @@

      Cyclic Module Records

      In addition to the fields defined in Cyclic Module Records have the additional fields listed in

      - - - - - + + + + + + + - - - - - @@ -26270,10 +26858,10 @@

      Cyclic Module Records

      [[RequestedModules]] @@ -26281,10 +26869,10 @@

      Cyclic Module Records

      [[LoadedModules]] @@ -26295,7 +26883,7 @@

      Cyclic Module Records

      a Cyclic Module Record or ~empty~ @@ -26311,13 +26899,13 @@

      Cyclic Module Records

      @@ -26355,31 +26943,44 @@

      Cyclic Module Records

      - Field Name - - Value Type - - Meaning -
      + Field Name + + Value Type + + Meaning +
      [[Status]] @@ -26243,17 +26842,6 @@

      Cyclic Module Records

      A throw completion representing the exception that occurred during evaluation. *undefined* if no exception occurred or if [[Status]] is not ~evaluated~.
      - [[DFSIndex]] - - an integer or ~empty~ - - Auxiliary field used during Link and Evaluate only. If [[Status]] is either ~linking~ or ~evaluating~, this non-negative number records the point at which the module was first visited during the depth-first traversal of the dependency graph. -
      [[DFSAncestorIndex]] @@ -26262,7 +26850,7 @@

      Cyclic Module Records

      an integer or ~empty~
      - Auxiliary field used during Link and Evaluate only. If [[Status]] is either ~linking~ or ~evaluating~, this is either the module's own [[DFSIndex]] or that of an "earlier" module in the same strongly connected component. + Auxiliary field used during Link and Evaluate only. If [[Status]] is either ~linking~ or ~evaluating~, this is either the module's depth-first traversal index or that of an "earlier" module in the same strongly connected component.
      - a List of Strings + a List of ModuleRequest Records - A List of all the |ModuleSpecifier| strings used by the module represented by this record to request the importation of a module. The List is in source text occurrence order. + A List of the ModuleRequest Records associated with the imports in this module. The List is in source text occurrence order of the imports.
      - a List of Records with fields [[Specifier]] (a String) and [[Module]] (a Module Record) + a List of LoadedModuleRequest Records - A map from the specifier strings used by the module represented by this record to request the importation of a module to the resolved Module Record. The list does not contain two different Records with the same [[Specifier]]. + A map from the specifier strings used by the module represented by this record to request the importation of a module with the relative import attributes to the resolved Module Record. The list does not contain two different Records _r1_ and _r2_ such that ModuleRequestsEqual(_r1_, _r2_) is *true*.
      - The first visited module of the cycle, the root DFS ancestor of the strongly connected component. For a module not in a cycle, this would be the module itself. Once Evaluate has completed, a module's [[DFSAncestorIndex]] is the [[DFSIndex]] of its [[CycleRoot]]. + The first visited module of the cycle, the root DFS ancestor of the strongly connected component. For a module not in a cycle, this would be the module itself. Once Evaluate has completed, a module's [[DFSAncestorIndex]] is the depth-first traversal index of its [[CycleRoot]].
      - [[AsyncEvaluation]] + [[AsyncEvaluationOrder]] - a Boolean + ~unset~, an integer, or ~done~ - Whether this module is either itself asynchronous or has an asynchronous dependency. Note: The order in which this field is set is used to order queued executions, see . + This field is initially set to ~unset~, and remains ~unset~ for fully synchronous modules. For modules that are either themselves asynchronous or have an asynchronous dependency, it is set to an integer that determines the order in which execution of pending modules is queued by . Once the pending module is successfully executed, the field is set to ~done~.
      -

      In addition to the methods defined in Cyclic Module Records have the additional methods listed in

      - +

      In addition to the methods defined in Cyclic Module Records have the additional methods listed in :

      + - - - - - + + + + + + + + + - + +
      - Method - - Purpose -
      + Method + + Purpose + + Definitions +
      InitializeEnvironment ( ): either a normal completion containing ~unused~ or a throw completion - InitializeEnvironment() + It initializes the Environment Record of the module, including resolving all imported bindings, and creates the module's execution context. - Initialize the Environment Record of the module, including resolving all imported bindings, and create the module's execution context. + Within this specification it has definitions in the following types; hosts may provide additional types with their own definitions: +
      + ExecuteModule ( + optional _capability_: a PromiseCapability Record, + ): either a normal completion containing ~unused~ or a throw completion + - ExecuteModule( [ _promiseCapability_ ] ) + It evaluates the module's code within its execution context. If this module has *true* in [[HasTLA]], then a PromiseCapability Record is passed as an argument, and the method is expected to resolve or reject the given capability. In this case, the method must not throw an exception, but instead reject the PromiseCapability Record if necessary. - Evaluate the module's code within its execution context. If this module has *true* in [[HasTLA]], then a PromiseCapability Record is passed as an argument, and the method is expected to resolve or reject the given capability. In this case, the method must not throw an exception, but instead reject the PromiseCapability Record if necessary. + Within this specification it has definitions in the following types; hosts may provide additional types with their own definitions: +
      @@ -26388,17 +26989,19 @@

      Cyclic Module Records

      A GraphLoadingState Record is a Record that contains information about the loading process of a module graph. It's used to continue loading after a call to HostLoadImportedModule. Each GraphLoadingState Record has the fields defined in :

      - - - - - + + + + + + +
      - Field Name - - Value Type - - Meaning -
      + Field Name + + Value Type + + Meaning +
      [[PromiseCapability]] @@ -26457,402 +27060,415 @@

      Cyclic Module Records

      - -

      - LoadRequestedModules ( - optional _hostDefined_: anything, - ): a Promise -

      -
      -
      for
      -
      a Cyclic Module Record _module_
      + +

      Implementation of Module Record Abstract Methods

      -
      description
      -
      It populates the [[LoadedModules]] of all the Module Records in the dependency graph of _module_ (most of the work is done by the auxiliary function InnerModuleLoading). It takes an optional _hostDefined_ parameter that is passed to the HostLoadImportedModule hook.
      -
      +

      The following are the concrete methods for Cyclic Module Record that implement the corresponding Module Record abstract methods defined in .

      - - 1. If _hostDefined_ is not present, let _hostDefined_ be ~empty~. - 1. Let _pc_ be ! NewPromiseCapability(%Promise%). - 1. Let _state_ be the GraphLoadingState Record { [[IsLoading]]: *true*, [[PendingModulesCount]]: 1, [[Visited]]: « », [[PromiseCapability]]: _pc_, [[HostDefined]]: _hostDefined_ }. - 1. Perform InnerModuleLoading(_state_, _module_). - 1. Return _pc_.[[Promise]]. - - - - The _hostDefined_ parameter can be used to pass additional information necessary to fetch the imported modules. It is used, for example, by HTML to set the correct fetch destination for <link rel="preload" as="..."> tags. - import() expressions never set the _hostDefined_ parameter. - - - +

      - InnerModuleLoading ( - _state_: a GraphLoadingState Record, - _module_: a Module Record, - ): ~unused~ + LoadRequestedModules ( + optional _hostDefined_: anything, + ): a Promise

      -
      description
      -
      It is used by LoadRequestedModules to recursively perform the actual loading process for _module_'s dependency graph.
      -
      +
      for
      +
      a Cyclic Module Record _module_
      - - 1. Assert: _state_.[[IsLoading]] is *true*. - 1. If _module_ is a Cyclic Module Record, _module_.[[Status]] is ~new~, and _state_.[[Visited]] does not contain _module_, then - 1. Append _module_ to _state_.[[Visited]]. - 1. Let _requestedModulesCount_ be the number of elements in _module_.[[RequestedModules]]. - 1. Set _state_.[[PendingModulesCount]] to _state_.[[PendingModulesCount]] + _requestedModulesCount_. - 1. For each String _required_ of _module_.[[RequestedModules]], do - 1. If _module_.[[LoadedModules]] contains a Record whose [[Specifier]] is _required_, then - 1. Let _record_ be that Record. - 1. Perform InnerModuleLoading(_state_, _record_.[[Module]]). - 1. Else, - 1. Perform HostLoadImportedModule(_module_, _required_, _state_.[[HostDefined]], _state_). - 1. NOTE: HostLoadImportedModule will call FinishLoadingImportedModule, which re-enters the graph loading process through ContinueModuleLoading. - 1. If _state_.[[IsLoading]] is *false*, return ~unused~. - 1. Assert: _state_.[[PendingModulesCount]] ≥ 1. - 1. Set _state_.[[PendingModulesCount]] to _state_.[[PendingModulesCount]] - 1. - 1. If _state_.[[PendingModulesCount]] = 0, then - 1. Set _state_.[[IsLoading]] to *false*. - 1. For each Cyclic Module Record _loaded_ of _state_.[[Visited]], do - 1. If _loaded_.[[Status]] is ~new~, set _loaded_.[[Status]] to ~unlinked~. - 1. Perform ! Call(_state_.[[PromiseCapability]].[[Resolve]], *undefined*, « *undefined* »). - 1. Return ~unused~. - -
      - - -

      - ContinueModuleLoading ( - _state_: a GraphLoadingState Record, - _moduleCompletion_: either a normal completion containing a Module Record or a throw completion, - ): ~unused~ -

      -
      description
      -
      It is used to re-enter the loading process after a call to HostLoadImportedModule.
      +
      It populates the [[LoadedModules]] of all the Module Records in the dependency graph of _module_ (most of the work is done by the auxiliary function InnerModuleLoading). It takes an optional _hostDefined_ parameter that is passed to the HostLoadImportedModule hook.
      - 1. If _state_.[[IsLoading]] is *false*, return ~unused~. - 1. If _moduleCompletion_ is a normal completion, then - 1. Perform InnerModuleLoading(_state_, _moduleCompletion_.[[Value]]). - 1. Else, - 1. Set _state_.[[IsLoading]] to *false*. - 1. Perform ! Call(_state_.[[PromiseCapability]].[[Reject]], *undefined*, « _moduleCompletion_.[[Value]] »). - 1. Return ~unused~. + 1. If _hostDefined_ is not present, set _hostDefined_ to ~empty~. + 1. Let _pc_ be ! NewPromiseCapability(%Promise%). + 1. Let _state_ be the GraphLoadingState Record { [[IsLoading]]: *true*, [[PendingModulesCount]]: 1, [[Visited]]: « », [[PromiseCapability]]: _pc_, [[HostDefined]]: _hostDefined_ }. + 1. Perform InnerModuleLoading(_state_, _module_). + 1. Return _pc_.[[Promise]]. -
      -
      - -

      Link ( ): either a normal completion containing ~unused~ or a throw completion

      -
      -
      for
      -
      a Cyclic Module Record _module_
      + + The _hostDefined_ parameter can be used to pass additional information necessary to fetch the imported modules. It is used, for example, by HTML to set the correct fetch destination for <link rel="preload" as="..."> tags. + import() expressions never set the _hostDefined_ parameter. + -
      description
      -
      On success, Link transitions this module's [[Status]] from ~unlinked~ to ~linked~. On failure, an exception is thrown and this module's [[Status]] remains ~unlinked~. (Most of the work is done by the auxiliary function InnerModuleLinking.)
      -
      + +

      + InnerModuleLoading ( + _state_: a GraphLoadingState Record, + _module_: a Module Record, + ): ~unused~ +

      +
      +
      description
      +
      It is used by LoadRequestedModules to recursively perform the actual loading process for _module_'s dependency graph.
      +
      - - 1. Assert: _module_.[[Status]] is one of ~unlinked~, ~linked~, ~evaluating-async~, or ~evaluated~. - 1. Let _stack_ be a new empty List. - 1. Let _result_ be Completion(InnerModuleLinking(_module_, _stack_, 0)). - 1. If _result_ is an abrupt completion, then - 1. For each Cyclic Module Record _m_ of _stack_, do - 1. Assert: _m_.[[Status]] is ~linking~. - 1. Set _m_.[[Status]] to ~unlinked~. - 1. Assert: _module_.[[Status]] is ~unlinked~. - 1. Return ? _result_. - 1. Assert: _module_.[[Status]] is one of ~linked~, ~evaluating-async~, or ~evaluated~. - 1. Assert: _stack_ is empty. - 1. Return ~unused~. - + + 1. Assert: _state_.[[IsLoading]] is *true*. + 1. If _module_ is a Cyclic Module Record, _module_.[[Status]] is ~new~, and _state_.[[Visited]] does not contain _module_, then + 1. Append _module_ to _state_.[[Visited]]. + 1. Let _requestedModulesCount_ be the number of elements in _module_.[[RequestedModules]]. + 1. Set _state_.[[PendingModulesCount]] to _state_.[[PendingModulesCount]] + _requestedModulesCount_. + 1. For each ModuleRequest Record _request_ of _module_.[[RequestedModules]], do + 1. If AllImportAttributesSupported(_request_.[[Attributes]]) is *false*, then + 1. Let _error_ be ThrowCompletion(a newly created *SyntaxError* object). + 1. Perform ContinueModuleLoading(_state_, _error_). + 1. Else if _module_.[[LoadedModules]] contains a LoadedModuleRequest Record _record_ such that ModuleRequestsEqual(_record_, _request_) is *true*, then + 1. Perform InnerModuleLoading(_state_, _record_.[[Module]]). + 1. Else, + 1. Perform HostLoadImportedModule(_module_, _request_, _state_.[[HostDefined]], _state_). + 1. NOTE: HostLoadImportedModule will call FinishLoadingImportedModule, which re-enters the graph loading process through ContinueModuleLoading. + 1. If _state_.[[IsLoading]] is *false*, return ~unused~. + 1. Assert: _state_.[[PendingModulesCount]] ≥ 1. + 1. Set _state_.[[PendingModulesCount]] to _state_.[[PendingModulesCount]] - 1. + 1. If _state_.[[PendingModulesCount]] = 0, then + 1. Set _state_.[[IsLoading]] to *false*. + 1. For each Cyclic Module Record _loaded_ of _state_.[[Visited]], do + 1. If _loaded_.[[Status]] is ~new~, set _loaded_.[[Status]] to ~unlinked~. + 1. Perform ! Call(_state_.[[PromiseCapability]].[[Resolve]], *undefined*, « *undefined* »). + 1. Return ~unused~. + +
      + + +

      + ContinueModuleLoading ( + _state_: a GraphLoadingState Record, + _moduleCompletion_: either a normal completion containing a Module Record or a throw completion, + ): ~unused~ +

      +
      +
      description
      +
      It is used to re-enter the loading process after a call to HostLoadImportedModule.
      +
      - -

      - InnerModuleLinking ( - _module_: a Module Record, - _stack_: a List of Cyclic Module Records, - _index_: a non-negative integer, - ): either a normal completion containing a non-negative integer or a throw completion -

      + + 1. If _state_.[[IsLoading]] is *false*, return ~unused~. + 1. If _moduleCompletion_ is a normal completion, then + 1. Perform InnerModuleLoading(_state_, _moduleCompletion_.[[Value]]). + 1. Else, + 1. Set _state_.[[IsLoading]] to *false*. + 1. Perform ! Call(_state_.[[PromiseCapability]].[[Reject]], *undefined*, « _moduleCompletion_.[[Value]] »). + 1. Return ~unused~. + +
      +
      + + +

      Link ( ): either a normal completion containing ~unused~ or a throw completion

      +
      for
      +
      a Cyclic Module Record _module_
      +
      description
      -
      It is used by Link to perform the actual linking process for _module_, as well as recursively on all other modules in the dependency graph. The _stack_ and _index_ parameters, as well as a module's [[DFSIndex]] and [[DFSAncestorIndex]] fields, keep track of the depth-first search (DFS) traversal. In particular, [[DFSAncestorIndex]] is used to discover strongly connected components (SCCs), such that all modules in an SCC transition to ~linked~ together.
      +
      On success, Link transitions this module's [[Status]] from ~unlinked~ to ~linked~. On failure, an exception is thrown and this module's [[Status]] remains ~unlinked~. (Most of the work is done by the auxiliary function InnerModuleLinking.)
      - 1. If _module_ is not a Cyclic Module Record, then - 1. Perform ? _module_.Link(). - 1. Return _index_. - 1. If _module_.[[Status]] is one of ~linking~, ~linked~, ~evaluating-async~, or ~evaluated~, then - 1. Return _index_. - 1. Assert: _module_.[[Status]] is ~unlinked~. - 1. Set _module_.[[Status]] to ~linking~. - 1. Set _module_.[[DFSIndex]] to _index_. - 1. Set _module_.[[DFSAncestorIndex]] to _index_. - 1. Set _index_ to _index_ + 1. - 1. Append _module_ to _stack_. - 1. For each String _required_ of _module_.[[RequestedModules]], do - 1. Let _requiredModule_ be GetImportedModule(_module_, _required_). - 1. Set _index_ to ? InnerModuleLinking(_requiredModule_, _stack_, _index_). - 1. If _requiredModule_ is a Cyclic Module Record, then - 1. Assert: _requiredModule_.[[Status]] is one of ~linking~, ~linked~, ~evaluating-async~, or ~evaluated~. - 1. Assert: _requiredModule_.[[Status]] is ~linking~ if and only if _stack_ contains _requiredModule_. - 1. If _requiredModule_.[[Status]] is ~linking~, then - 1. Set _module_.[[DFSAncestorIndex]] to min(_module_.[[DFSAncestorIndex]], _requiredModule_.[[DFSAncestorIndex]]). - 1. Perform ? _module_.InitializeEnvironment(). - 1. Assert: _module_ occurs exactly once in _stack_. - 1. Assert: _module_.[[DFSAncestorIndex]] ≤ _module_.[[DFSIndex]]. - 1. If _module_.[[DFSAncestorIndex]] = _module_.[[DFSIndex]], then - 1. Let _done_ be *false*. - 1. Repeat, while _done_ is *false*, - 1. Let _requiredModule_ be the last element of _stack_. - 1. Remove the last element of _stack_. - 1. Assert: _requiredModule_ is a Cyclic Module Record. - 1. Set _requiredModule_.[[Status]] to ~linked~. - 1. If _requiredModule_ and _module_ are the same Module Record, set _done_ to *true*. - 1. Return _index_. + 1. Assert: _module_.[[Status]] is one of ~unlinked~, ~linked~, ~evaluating-async~, or ~evaluated~. + 1. Let _stack_ be a new empty List. + 1. Let _result_ be Completion(InnerModuleLinking(_module_, _stack_, 0)). + 1. If _result_ is an abrupt completion, then + 1. For each Cyclic Module Record _m_ of _stack_, do + 1. Assert: _m_.[[Status]] is ~linking~. + 1. Set _m_.[[Status]] to ~unlinked~. + 1. Assert: _module_.[[Status]] is ~unlinked~. + 1. Return ? _result_. + 1. Assert: _module_.[[Status]] is one of ~linked~, ~evaluating-async~, or ~evaluated~. + 1. Assert: _stack_ is empty. + 1. Return ~unused~. -
      -
      - - -

      Evaluate ( ): a Promise

      -
      -
      for
      -
      a Cyclic Module Record _module_
      -
      description
      -
      Evaluate transitions this module's [[Status]] from ~linked~ to either ~evaluating-async~ or ~evaluated~. The first time it is called on a module in a given strongly connected component, Evaluate creates and returns a Promise which resolves when the module has finished evaluating. This Promise is stored in the [[TopLevelCapability]] field of the [[CycleRoot]] for the component. Future invocations of Evaluate on any module in the component return the same Promise. (Most of the work is done by the auxiliary function InnerModuleEvaluation.)
      -
      + +

      + InnerModuleLinking ( + _module_: a Module Record, + _stack_: a List of Cyclic Module Records, + _index_: a non-negative integer, + ): either a normal completion containing a non-negative integer or a throw completion +

      +
      +
      description
      +
      It is used by Link to perform the actual linking process for _module_, as well as recursively on all other modules in the dependency graph. The _stack_ and _index_ parameters, as well as a module's [[DFSAncestorIndex]] field, keep track of the depth-first search (DFS) traversal. In particular, [[DFSAncestorIndex]] is used to discover strongly connected components (SCCs), such that all modules in an SCC transition to ~linked~ together.
      +
      - - 1. Assert: This call to Evaluate is not happening at the same time as another call to Evaluate within the surrounding agent. - 1. Assert: _module_.[[Status]] is one of ~linked~, ~evaluating-async~, or ~evaluated~. - 1. If _module_.[[Status]] is either ~evaluating-async~ or ~evaluated~, set _module_ to _module_.[[CycleRoot]]. - 1. If _module_.[[TopLevelCapability]] is not ~empty~, then - 1. Return _module_.[[TopLevelCapability]].[[Promise]]. - 1. Let _stack_ be a new empty List. - 1. Let _capability_ be ! NewPromiseCapability(%Promise%). - 1. Set _module_.[[TopLevelCapability]] to _capability_. - 1. Let _result_ be Completion(InnerModuleEvaluation(_module_, _stack_, 0)). - 1. If _result_ is an abrupt completion, then - 1. For each Cyclic Module Record _m_ of _stack_, do - 1. Assert: _m_.[[Status]] is ~evaluating~. - 1. Set _m_.[[Status]] to ~evaluated~. - 1. Set _m_.[[EvaluationError]] to _result_. - 1. Assert: _module_.[[Status]] is ~evaluated~. - 1. Assert: _module_.[[EvaluationError]] and _result_ are the same Completion Record. - 1. Perform ! Call(_capability_.[[Reject]], *undefined*, « _result_.[[Value]] »). - 1. Else, - 1. Assert: _module_.[[Status]] is either ~evaluating-async~ or ~evaluated~. - 1. Assert: _module_.[[EvaluationError]] is ~empty~. - 1. If _module_.[[AsyncEvaluation]] is *false*, then - 1. Assert: _module_.[[Status]] is ~evaluated~. - 1. Perform ! Call(_capability_.[[Resolve]], *undefined*, « *undefined* »). - 1. Assert: _stack_ is empty. - 1. Return _capability_.[[Promise]]. - + + 1. If _module_ is not a Cyclic Module Record, then + 1. Perform ? _module_.Link(). + 1. Return _index_. + 1. If _module_.[[Status]] is one of ~linking~, ~linked~, ~evaluating-async~, or ~evaluated~, then + 1. Return _index_. + 1. Assert: _module_.[[Status]] is ~unlinked~. + 1. Set _module_.[[Status]] to ~linking~. + 1. Let _moduleIndex_ be _index_. + 1. Set _module_.[[DFSAncestorIndex]] to _index_. + 1. Set _index_ to _index_ + 1. + 1. Append _module_ to _stack_. + 1. For each ModuleRequest Record _request_ of _module_.[[RequestedModules]], do + 1. Let _requiredModule_ be GetImportedModule(_module_, _request_). + 1. Set _index_ to ? InnerModuleLinking(_requiredModule_, _stack_, _index_). + 1. If _requiredModule_ is a Cyclic Module Record, then + 1. Assert: _requiredModule_.[[Status]] is one of ~linking~, ~linked~, ~evaluating-async~, or ~evaluated~. + 1. Assert: _requiredModule_.[[Status]] is ~linking~ if and only if _stack_ contains _requiredModule_. + 1. If _requiredModule_.[[Status]] is ~linking~, then + 1. Set _module_.[[DFSAncestorIndex]] to min(_module_.[[DFSAncestorIndex]], _requiredModule_.[[DFSAncestorIndex]]). + 1. Perform ? _module_.InitializeEnvironment(). + 1. Assert: _module_ occurs exactly once in _stack_. + 1. Assert: _module_.[[DFSAncestorIndex]] ≤ _moduleIndex_. + 1. If _module_.[[DFSAncestorIndex]] = _moduleIndex_, then + 1. Let _done_ be *false*. + 1. Repeat, while _done_ is *false*, + 1. Let _requiredModule_ be the last element of _stack_. + 1. Remove the last element of _stack_. + 1. Assert: _requiredModule_ is a Cyclic Module Record. + 1. Set _requiredModule_.[[Status]] to ~linked~. + 1. If _requiredModule_ and _module_ are the same Module Record, set _done_ to *true*. + 1. Return _index_. + +
      +
      - -

      - InnerModuleEvaluation ( - _module_: a Module Record, - _stack_: a List of Cyclic Module Records, - _index_: a non-negative integer, - ): either a normal completion containing a non-negative integer or a throw completion -

      + +

      Evaluate ( ): a Promise

      +
      for
      +
      a Cyclic Module Record _module_
      +
      description
      -
      It is used by Evaluate to perform the actual evaluation process for _module_, as well as recursively on all other modules in the dependency graph. The _stack_ and _index_ parameters, as well as _module_'s [[DFSIndex]] and [[DFSAncestorIndex]] fields, are used the same way as in InnerModuleLinking.
      +
      Evaluate transitions this module's [[Status]] from ~linked~ to either ~evaluating-async~ or ~evaluated~. The first time it is called on a module in a given strongly connected component, Evaluate creates and returns a Promise which resolves when the module has finished evaluating. This Promise is stored in the [[TopLevelCapability]] field of the [[CycleRoot]] for the component. Future invocations of Evaluate on any module in the component return the same Promise. (Most of the work is done by the auxiliary function InnerModuleEvaluation.)
      - 1. If _module_ is not a Cyclic Module Record, then - 1. Let _promise_ be ! _module_.Evaluate(). - 1. Assert: _promise_.[[PromiseState]] is not ~pending~. - 1. If _promise_.[[PromiseState]] is ~rejected~, then - 1. Return ThrowCompletion(_promise_.[[PromiseResult]]). - 1. Return _index_. + 1. Assert: This call to Evaluate is not happening at the same time as another call to Evaluate within the surrounding agent. + 1. Assert: _module_.[[Status]] is one of ~linked~, ~evaluating-async~, or ~evaluated~. 1. If _module_.[[Status]] is either ~evaluating-async~ or ~evaluated~, then - 1. If _module_.[[EvaluationError]] is ~empty~, return _index_. - 1. Otherwise, return ? _module_.[[EvaluationError]]. - 1. If _module_.[[Status]] is ~evaluating~, return _index_. - 1. Assert: _module_.[[Status]] is ~linked~. - 1. Set _module_.[[Status]] to ~evaluating~. - 1. Set _module_.[[DFSIndex]] to _index_. - 1. Set _module_.[[DFSAncestorIndex]] to _index_. - 1. Set _module_.[[PendingAsyncDependencies]] to 0. - 1. Set _index_ to _index_ + 1. - 1. Append _module_ to _stack_. - 1. For each String _required_ of _module_.[[RequestedModules]], do - 1. Let _requiredModule_ be GetImportedModule(_module_, _required_). - 1. Set _index_ to ? InnerModuleEvaluation(_requiredModule_, _stack_, _index_). - 1. If _requiredModule_ is a Cyclic Module Record, then - 1. Assert: _requiredModule_.[[Status]] is one of ~evaluating~, ~evaluating-async~, or ~evaluated~. - 1. Assert: _requiredModule_.[[Status]] is ~evaluating~ if and only if _stack_ contains _requiredModule_. - 1. If _requiredModule_.[[Status]] is ~evaluating~, then - 1. Set _module_.[[DFSAncestorIndex]] to min(_module_.[[DFSAncestorIndex]], _requiredModule_.[[DFSAncestorIndex]]). - 1. Else, - 1. Set _requiredModule_ to _requiredModule_.[[CycleRoot]]. - 1. Assert: _requiredModule_.[[Status]] is either ~evaluating-async~ or ~evaluated~. - 1. If _requiredModule_.[[EvaluationError]] is not ~empty~, return ? _requiredModule_.[[EvaluationError]]. - 1. If _requiredModule_.[[AsyncEvaluation]] is *true*, then - 1. Set _module_.[[PendingAsyncDependencies]] to _module_.[[PendingAsyncDependencies]] + 1. - 1. Append _module_ to _requiredModule_.[[AsyncParentModules]]. - 1. If _module_.[[PendingAsyncDependencies]] > 0 or _module_.[[HasTLA]] is *true*, then - 1. Assert: _module_.[[AsyncEvaluation]] is *false* and was never previously set to *true*. - 1. Set _module_.[[AsyncEvaluation]] to *true*. - 1. NOTE: The order in which module records have their [[AsyncEvaluation]] fields transition to *true* is significant. (See .) - 1. If _module_.[[PendingAsyncDependencies]] = 0, perform ExecuteAsyncModule(_module_). + 1. If _module_.[[CycleRoot]] is not ~empty~, then + 1. Set _module_ to _module_.[[CycleRoot]]. + 1. Else, + 1. Assert: _module_.[[Status]] is ~evaluated~ and _module_.[[EvaluationError]] is a throw completion. + 1. If _module_.[[TopLevelCapability]] is not ~empty~, then + 1. Return _module_.[[TopLevelCapability]].[[Promise]]. + 1. Let _stack_ be a new empty List. + 1. Let _capability_ be ! NewPromiseCapability(%Promise%). + 1. Set _module_.[[TopLevelCapability]] to _capability_. + 1. Let _result_ be Completion(InnerModuleEvaluation(_module_, _stack_, 0)). + 1. If _result_ is an abrupt completion, then + 1. For each Cyclic Module Record _m_ of _stack_, do + 1. Assert: _m_.[[Status]] is ~evaluating~. + 1. Set _m_.[[Status]] to ~evaluated~. + 1. Set _m_.[[EvaluationError]] to _result_. + 1. Assert: _module_.[[Status]] is ~evaluated~. + 1. Assert: _module_.[[EvaluationError]] and _result_ are the same Completion Record. + 1. Perform ! Call(_capability_.[[Reject]], *undefined*, « _result_.[[Value]] »). 1. Else, - 1. Perform ? _module_.ExecuteModule(). - 1. Assert: _module_ occurs exactly once in _stack_. - 1. Assert: _module_.[[DFSAncestorIndex]] ≤ _module_.[[DFSIndex]]. - 1. If _module_.[[DFSAncestorIndex]] = _module_.[[DFSIndex]], then - 1. Let _done_ be *false*. - 1. Repeat, while _done_ is *false*, - 1. Let _requiredModule_ be the last element of _stack_. - 1. Remove the last element of _stack_. - 1. Assert: _requiredModule_ is a Cyclic Module Record. - 1. If _requiredModule_.[[AsyncEvaluation]] is *false*, set _requiredModule_.[[Status]] to ~evaluated~. - 1. Otherwise, set _requiredModule_.[[Status]] to ~evaluating-async~. - 1. If _requiredModule_ and _module_ are the same Module Record, set _done_ to *true*. - 1. Set _requiredModule_.[[CycleRoot]] to _module_. - 1. Return _index_. + 1. Assert: _module_.[[Status]] is either ~evaluating-async~ or ~evaluated~. + 1. Assert: _module_.[[EvaluationError]] is ~empty~. + 1. If _module_.[[Status]] is ~evaluated~, then + 1. Assert: _module_.[[AsyncEvaluationOrder]] is either ~unset~ or ~done~. + 1. NOTE: _module_.[[AsyncEvaluationOrder]] is ~done~ if and only if _module_ had already been evaluated and that evaluation was asynchronous. + 1. Perform ! Call(_capability_.[[Resolve]], *undefined*, « *undefined* »). + 1. Assert: _stack_ is empty. + 1. Return _capability_.[[Promise]]. - -

      A module is ~evaluating~ while it is being traversed by InnerModuleEvaluation. A module is ~evaluated~ on execution completion or ~evaluating-async~ during execution if its [[HasTLA]] field is *true* or if it has asynchronous dependencies.

      -
      - -

      Any modules depending on a module of an asynchronous cycle when that cycle is not ~evaluating~ will instead depend on the execution of the root of the cycle via [[CycleRoot]]. This ensures that the cycle state can be treated as a single strongly connected component through its root module state.

      -
      -
      - - -

      - ExecuteAsyncModule ( - _module_: a Cyclic Module Record, - ): ~unused~ -

      -
      -
      - - 1. Assert: _module_.[[Status]] is either ~evaluating~ or ~evaluating-async~. - 1. Assert: _module_.[[HasTLA]] is *true*. - 1. Let _capability_ be ! NewPromiseCapability(%Promise%). - 1. Let _fulfilledClosure_ be a new Abstract Closure with no parameters that captures _module_ and performs the following steps when called: - 1. Perform AsyncModuleExecutionFulfilled(_module_). - 1. Return *undefined*. - 1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 0, *""*, « »). - 1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_error_) that captures _module_ and performs the following steps when called: - 1. Perform AsyncModuleExecutionRejected(_module_, _error_). - 1. Return *undefined*. - 1. Let _onRejected_ be CreateBuiltinFunction(_rejectedClosure_, 0, *""*, « »). - 1. Perform PerformPromiseThen(_capability_.[[Promise]], _onFulfilled_, _onRejected_). - 1. Perform ! _module_.ExecuteModule(_capability_). - 1. Return ~unused~. - -
      + +

      + InnerModuleEvaluation ( + _module_: a Module Record, + _stack_: a List of Cyclic Module Records, + _index_: a non-negative integer, + ): either a normal completion containing a non-negative integer or a throw completion +

      +
      +
      description
      +
      It is used by Evaluate to perform the actual evaluation process for _module_, as well as recursively on all other modules in the dependency graph. The _stack_ and _index_ parameters, as well as _module_'s [[DFSAncestorIndex]] field, are used the same way as in InnerModuleLinking.
      +
      - -

      - GatherAvailableAncestors ( - _module_: a Cyclic Module Record, - _execList_: a List of Cyclic Module Records, - ): ~unused~ -

      -
      -
      - - 1. For each Cyclic Module Record _m_ of _module_.[[AsyncParentModules]], do - 1. If _execList_ does not contain _m_ and _m_.[[CycleRoot]].[[EvaluationError]] is ~empty~, then - 1. Assert: _m_.[[Status]] is ~evaluating-async~. - 1. Assert: _m_.[[EvaluationError]] is ~empty~. - 1. Assert: _m_.[[AsyncEvaluation]] is *true*. - 1. Assert: _m_.[[PendingAsyncDependencies]] > 0. - 1. Set _m_.[[PendingAsyncDependencies]] to _m_.[[PendingAsyncDependencies]] - 1. - 1. If _m_.[[PendingAsyncDependencies]] = 0, then - 1. Append _m_ to _execList_. - 1. If _m_.[[HasTLA]] is *false*, perform GatherAvailableAncestors(_m_, _execList_). - 1. Return ~unused~. - - -

      When an asynchronous execution for a root _module_ is fulfilled, this function determines the list of modules which are able to synchronously execute together on this completion, populating them in _execList_.

      -
      -
      + + 1. If _module_ is not a Cyclic Module Record, then + 1. Perform ? EvaluateModuleSync(_module_). + 1. Return _index_. + 1. If _module_.[[Status]] is either ~evaluating-async~ or ~evaluated~, then + 1. If _module_.[[EvaluationError]] is ~empty~, return _index_. + 1. Return ? _module_.[[EvaluationError]]. + 1. If _module_.[[Status]] is ~evaluating~, return _index_. + 1. Assert: _module_.[[Status]] is ~linked~. + 1. Set _module_.[[Status]] to ~evaluating~. + 1. Let _moduleIndex_ be _index_. + 1. Set _module_.[[DFSAncestorIndex]] to _index_. + 1. Set _module_.[[PendingAsyncDependencies]] to 0. + 1. Set _index_ to _index_ + 1. + 1. Append _module_ to _stack_. + 1. For each ModuleRequest Record _request_ of _module_.[[RequestedModules]], do + 1. Let _requiredModule_ be GetImportedModule(_module_, _request_). + 1. Set _index_ to ? InnerModuleEvaluation(_requiredModule_, _stack_, _index_). + 1. If _requiredModule_ is a Cyclic Module Record, then + 1. Assert: _requiredModule_.[[Status]] is one of ~evaluating~, ~evaluating-async~, or ~evaluated~. + 1. Assert: _requiredModule_.[[Status]] is ~evaluating~ if and only if _stack_ contains _requiredModule_. + 1. If _requiredModule_.[[Status]] is ~evaluating~, then + 1. Set _module_.[[DFSAncestorIndex]] to min(_module_.[[DFSAncestorIndex]], _requiredModule_.[[DFSAncestorIndex]]). + 1. Else, + 1. Set _requiredModule_ to _requiredModule_.[[CycleRoot]]. + 1. Assert: _requiredModule_.[[Status]] is either ~evaluating-async~ or ~evaluated~. + 1. If _requiredModule_.[[EvaluationError]] is not ~empty~, return ? _requiredModule_.[[EvaluationError]]. + 1. If _requiredModule_.[[AsyncEvaluationOrder]] is an integer, then + 1. Set _module_.[[PendingAsyncDependencies]] to _module_.[[PendingAsyncDependencies]] + 1. + 1. Append _module_ to _requiredModule_.[[AsyncParentModules]]. + 1. If _module_.[[PendingAsyncDependencies]] > 0 or _module_.[[HasTLA]] is *true*, then + 1. Assert: _module_.[[AsyncEvaluationOrder]] is ~unset~. + 1. Set _module_.[[AsyncEvaluationOrder]] to IncrementModuleAsyncEvaluationCount(). + 1. If _module_.[[PendingAsyncDependencies]] = 0, perform ExecuteAsyncModule(_module_). + 1. Else, + 1. Perform ? _module_.ExecuteModule(). + 1. Assert: _module_ occurs exactly once in _stack_. + 1. Assert: _module_.[[DFSAncestorIndex]] ≤ _moduleIndex_. + 1. If _module_.[[DFSAncestorIndex]] = _moduleIndex_, then + 1. Let _done_ be *false*. + 1. Repeat, while _done_ is *false*, + 1. Let _requiredModule_ be the last element of _stack_. + 1. Remove the last element of _stack_. + 1. Assert: _requiredModule_ is a Cyclic Module Record. + 1. Assert: _requiredModule_.[[AsyncEvaluationOrder]] is either an integer or ~unset~. + 1. If _requiredModule_.[[AsyncEvaluationOrder]] is ~unset~, set _requiredModule_.[[Status]] to ~evaluated~. + 1. Else, set _requiredModule_.[[Status]] to ~evaluating-async~. + 1. If _requiredModule_ and _module_ are the same Module Record, set _done_ to *true*. + 1. Set _requiredModule_.[[CycleRoot]] to _module_. + 1. Return _index_. + + +

      A module is ~evaluating~ while it is being traversed by InnerModuleEvaluation. A module is ~evaluated~ on execution completion or ~evaluating-async~ during execution if its [[HasTLA]] field is *true* or if it has asynchronous dependencies.

      +
      + +

      Any modules depending on a module of an asynchronous cycle when that cycle is not ~evaluating~ will instead depend on the execution of the root of the cycle via [[CycleRoot]]. This ensures that the cycle state can be treated as a single strongly connected component through its root module state.

      +
      +
      + + +

      + ExecuteAsyncModule ( + _module_: a Cyclic Module Record, + ): ~unused~ +

      +
      +
      - -

      - AsyncModuleExecutionFulfilled ( - _module_: a Cyclic Module Record, - ): ~unused~ -

      -
      -
      - - 1. If _module_.[[Status]] is ~evaluated~, then - 1. Assert: _module_.[[EvaluationError]] is not ~empty~. + + 1. Assert: _module_.[[Status]] is either ~evaluating~ or ~evaluating-async~. + 1. Assert: _module_.[[HasTLA]] is *true*. + 1. Let _capability_ be ! NewPromiseCapability(%Promise%). + 1. Let _fulfilledClosure_ be a new Abstract Closure with no parameters that captures _module_ and performs the following steps when called: + 1. Perform AsyncModuleExecutionFulfilled(_module_). + 1. Return NormalCompletion(*undefined*). + 1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 0, *""*, « »). + 1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_error_) that captures _module_ and performs the following steps when called: + 1. Perform AsyncModuleExecutionRejected(_module_, _error_). + 1. Return NormalCompletion(*undefined*). + 1. Let _onRejected_ be CreateBuiltinFunction(_rejectedClosure_, 0, *""*, « »). + 1. Perform PerformPromiseThen(_capability_.[[Promise]], _onFulfilled_, _onRejected_). + 1. Perform ! _module_.ExecuteModule(_capability_). 1. Return ~unused~. - 1. Assert: _module_.[[Status]] is ~evaluating-async~. - 1. Assert: _module_.[[AsyncEvaluation]] is *true*. - 1. Assert: _module_.[[EvaluationError]] is ~empty~. - 1. Set _module_.[[AsyncEvaluation]] to *false*. - 1. Set _module_.[[Status]] to ~evaluated~. - 1. If _module_.[[TopLevelCapability]] is not ~empty~, then - 1. Assert: _module_.[[CycleRoot]] and _module_ are the same Module Record. - 1. Perform ! Call(_module_.[[TopLevelCapability]].[[Resolve]], *undefined*, « *undefined* »). - 1. Let _execList_ be a new empty List. - 1. Perform GatherAvailableAncestors(_module_, _execList_). - 1. Let _sortedExecList_ be a List whose elements are the elements of _execList_, in the order in which they had their [[AsyncEvaluation]] fields set to *true* in InnerModuleEvaluation. - 1. Assert: All elements of _sortedExecList_ have their [[AsyncEvaluation]] field set to *true*, [[PendingAsyncDependencies]] field set to 0, and [[EvaluationError]] field set to ~empty~. - 1. For each Cyclic Module Record _m_ of _sortedExecList_, do - 1. If _m_.[[Status]] is ~evaluated~, then - 1. Assert: _m_.[[EvaluationError]] is not ~empty~. - 1. Else if _m_.[[HasTLA]] is *true*, then - 1. Perform ExecuteAsyncModule(_m_). - 1. Else, - 1. Let _result_ be _m_.ExecuteModule(). - 1. If _result_ is an abrupt completion, then - 1. Perform AsyncModuleExecutionRejected(_m_, _result_.[[Value]]). + +
      + + +

      + GatherAvailableAncestors ( + _module_: a Cyclic Module Record, + _execList_: a List of Cyclic Module Records, + ): ~unused~ +

      +
      +
      + + 1. For each Cyclic Module Record _m_ of _module_.[[AsyncParentModules]], do + 1. If _execList_ does not contain _m_ and _m_.[[CycleRoot]].[[EvaluationError]] is ~empty~, then + 1. Assert: _m_.[[Status]] is ~evaluating-async~. + 1. Assert: _m_.[[EvaluationError]] is ~empty~. + 1. Assert: _m_.[[AsyncEvaluationOrder]] is an integer. + 1. Assert: _m_.[[PendingAsyncDependencies]] > 0. + 1. Set _m_.[[PendingAsyncDependencies]] to _m_.[[PendingAsyncDependencies]] - 1. + 1. If _m_.[[PendingAsyncDependencies]] = 0, then + 1. Append _m_ to _execList_. + 1. If _m_.[[HasTLA]] is *false*, perform GatherAvailableAncestors(_m_, _execList_). + 1. Return ~unused~. + + +

      When an asynchronous execution for a root _module_ is fulfilled, this function determines the list of modules which are able to synchronously execute together on this completion, populating them in _execList_.

      +
      +
      + + +

      + AsyncModuleExecutionFulfilled ( + _module_: a Cyclic Module Record, + ): ~unused~ +

      +
      +
      + + 1. If _module_.[[Status]] is ~evaluated~, then + 1. Assert: _module_.[[EvaluationError]] is not ~empty~. + 1. Return ~unused~. + 1. Assert: _module_.[[Status]] is ~evaluating-async~. + 1. Assert: _module_.[[AsyncEvaluationOrder]] is an integer. + 1. Assert: _module_.[[EvaluationError]] is ~empty~. + 1. Set _module_.[[AsyncEvaluationOrder]] to ~done~. + 1. Set _module_.[[Status]] to ~evaluated~. + 1. If _module_.[[TopLevelCapability]] is not ~empty~, then + 1. Assert: _module_.[[CycleRoot]] and _module_ are the same Module Record. + 1. Perform ! Call(_module_.[[TopLevelCapability]].[[Resolve]], *undefined*, « *undefined* »). + 1. Let _execList_ be a new empty List. + 1. Perform GatherAvailableAncestors(_module_, _execList_). + 1. Assert: All elements of _execList_ have their [[AsyncEvaluationOrder]] field set to an integer, [[PendingAsyncDependencies]] field set to 0, and [[EvaluationError]] field set to ~empty~. + 1. Let _sortedExecList_ be a List whose elements are the elements of _execList_, sorted by their [[AsyncEvaluationOrder]] field in ascending order. + 1. For each Cyclic Module Record _m_ of _sortedExecList_, do + 1. If _m_.[[Status]] is ~evaluated~, then + 1. Assert: _m_.[[EvaluationError]] is not ~empty~. + 1. Else if _m_.[[HasTLA]] is *true*, then + 1. Perform ExecuteAsyncModule(_m_). 1. Else, - 1. Set _m_.[[Status]] to ~evaluated~. - 1. If _m_.[[TopLevelCapability]] is not ~empty~, then - 1. Assert: _m_.[[CycleRoot]] and _m_ are the same Module Record. - 1. Perform ! Call(_m_.[[TopLevelCapability]].[[Resolve]], *undefined*, « *undefined* »). - 1. Return ~unused~. - -
      - - -

      - AsyncModuleExecutionRejected ( - _module_: a Cyclic Module Record, - _error_: an ECMAScript language value, - ): ~unused~ -

      -
      -
      - - 1. If _module_.[[Status]] is ~evaluated~, then - 1. Assert: _module_.[[EvaluationError]] is not ~empty~. + 1. Let _result_ be Completion(_m_.ExecuteModule()). + 1. If _result_ is an abrupt completion, then + 1. Perform AsyncModuleExecutionRejected(_m_, _result_.[[Value]]). + 1. Else, + 1. Set _m_.[[AsyncEvaluationOrder]] to ~done~. + 1. Set _m_.[[Status]] to ~evaluated~. + 1. If _m_.[[TopLevelCapability]] is not ~empty~, then + 1. Assert: _m_.[[CycleRoot]] and _m_ are the same Module Record. + 1. Perform ! Call(_m_.[[TopLevelCapability]].[[Resolve]], *undefined*, « *undefined* »). 1. Return ~unused~. - 1. Assert: _module_.[[Status]] is ~evaluating-async~. - 1. Assert: _module_.[[AsyncEvaluation]] is *true*. - 1. Assert: _module_.[[EvaluationError]] is ~empty~. - 1. Set _module_.[[EvaluationError]] to ThrowCompletion(_error_). - 1. Set _module_.[[Status]] to ~evaluated~. - 1. For each Cyclic Module Record _m_ of _module_.[[AsyncParentModules]], do - 1. Perform AsyncModuleExecutionRejected(_m_, _error_). - 1. If _module_.[[TopLevelCapability]] is not ~empty~, then - 1. Assert: _module_.[[CycleRoot]] and _module_ are the same Module Record. - 1. Perform ! Call(_module_.[[TopLevelCapability]].[[Reject]], *undefined*, « _error_ »). - 1. Return ~unused~. - + +
      + + +

      + AsyncModuleExecutionRejected ( + _module_: a Cyclic Module Record, + _error_: an ECMAScript language value, + ): ~unused~ +

      +
      +
      + + 1. If _module_.[[Status]] is ~evaluated~, then + 1. Assert: _module_.[[EvaluationError]] is not ~empty~. + 1. Return ~unused~. + 1. Assert: _module_.[[Status]] is ~evaluating-async~. + 1. Assert: _module_.[[AsyncEvaluationOrder]] is an integer. + 1. Assert: _module_.[[EvaluationError]] is ~empty~. + 1. Set _module_.[[EvaluationError]] to ThrowCompletion(_error_). + 1. Set _module_.[[Status]] to ~evaluated~. + 1. Set _module_.[[AsyncEvaluationOrder]] to ~done~. + 1. NOTE: _module_.[[AsyncEvaluationOrder]] is set to ~done~ for symmetry with AsyncModuleExecutionFulfilled. In InnerModuleEvaluation, the value of a module's [[AsyncEvaluationOrder]] internal slot is unused when its [[EvaluationError]] internal slot is not ~empty~. + 1. If _module_.[[TopLevelCapability]] is not ~empty~, then + 1. Assert: _module_.[[CycleRoot]] and _module_ are the same Module Record. + 1. Perform ! Call(_module_.[[TopLevelCapability]].[[Reject]], *undefined*, « _error_ »). + 1. For each Cyclic Module Record _m_ of _module_.[[AsyncParentModules]], do + 1. Perform AsyncModuleExecutionRejected(_m_, _error_). + 1. Return ~unused~. + +
      @@ -26864,10 +27480,10 @@

      Example Cyclic Module Record Graphs

      First consider the following simple module graph:

      - A module graph in which module A depends on module B, and module B depends on module C + A module graph in which module A depends on module B, and module B depends on module C -

      Let's first assume that there are no error conditions. When a host first calls _A_.LoadRequestedModules(), this will complete successfully by assumption, and recursively load the dependencies of _B_ and _C_ as well (respectively, _C_ and none), and then set _A_.[[Status]] = _B_.[[Status]] = _C_.[[Status]] = ~unlinked~. Then, when the host calls _A_.Link(), it will complete successfully (again by assumption) such that _A_.[[Status]] = _B_.[[Status]] = _C_.[[Status]] = linked. These preparatory steps can be performed at any time. Later, when the host is ready to incur any possible side effects of the modules, it can call _A_.Evaluate(), which will complete successfully, returning a Promise resolving to *undefined* (again by assumption), recursively having evaluated first _C_ and then _B_. Each module's [[Status]] at this point will be ~evaluated~.

      +

      Let's first assume that there are no error conditions. When a host first calls _A_.LoadRequestedModules(), this will complete successfully by assumption, and recursively load the dependencies of _B_ and _C_ as well (respectively, _C_ and none), and then set _A_.[[Status]] = _B_.[[Status]] = _C_.[[Status]] = ~unlinked~. Then, when the host calls _A_.Link(), it will complete successfully (again by assumption) such that _A_.[[Status]] = _B_.[[Status]] = _C_.[[Status]] = ~linked~. These preparatory steps can be performed at any time. Later, when the host is ready to incur any possible side effects of the modules, it can call _A_.Evaluate(), which will complete successfully, returning a Promise resolving to *undefined* (again by assumption), recursively having evaluated first _C_ and then _B_. Each module's [[Status]] at this point will be ~evaluated~.

      Consider then cases involving linking errors, after a successful call to _A_.LoadRequestedModules(). If InnerModuleLinking of _C_ succeeds but, thereafter, fails for _B_, for example because it imports something that _C_ does not provide, then the original _A_.Link() will fail, and both _A_ and _B_'s [[Status]] remain ~unlinked~. _C_'s [[Status]] has become ~linked~, though.

      @@ -26876,7 +27492,7 @@

      Example Cyclic Module Record Graphs

      Now consider a different type of error condition:

      - A module graph in which module A depends on a missing (unresolvable) module, represented by ??? + A module graph in which module A depends on a missing (unresolvable) module, represented by ???

      In this scenario, module _A_ declares a dependency on some other module, but no Module Record exists for that module, i.e. HostLoadImportedModule calls FinishLoadingImportedModule with an exception when asked for it. This could occur for a variety of reasons, such as the corresponding resource not existing, or the resource existing but ParseModule returning some errors when trying to parse the resulting source text. Hosts can choose to expose the cause of failure via the completion they pass to FinishLoadingImportedModule. In any case, this exception causes a loading failure, which results in _A_'s [[Status]] remaining ~new~.

      @@ -26885,7 +27501,7 @@

      Example Cyclic Module Record Graphs

      • Evaluation must be only performed once, as it can cause side effects; it is thus important to remember whether evaluation has already been performed, even if unsuccessfully. (In the error case, it makes sense to also remember the exception because otherwise subsequent Evaluate() calls would have to synthesize a new one.)
      • Linking, on the other hand, is side-effect-free, and thus even if it fails, it can be retried at a later time with no issues.
      • -
      • Loading closely interacts with the host, and it may be desiderable for some of them to allow users to retry failed loads (for example, if the failure is caused by temporarily bad network conditions).
      • +
      • Loading closely interacts with the host, and it may be desirable for some of them to allow users to retry failed loads (for example, if the failure is caused by temporarily bad network conditions).

      Now, consider a module graph with a cycle:

      @@ -26902,7 +27518,7 @@

      Example Cyclic Module Record Graphs

      Now consider a case where _A_ has a linking error; for example, it tries to import a binding from _C_ that does not exist. In that case, the above steps still occur, including the early return from the second call to InnerModuleLinking on _A_. However, once we unwind back to the original InnerModuleLinking on _A_, it fails during InitializeEnvironment, namely right after _C_.ResolveExport(). The thrown *SyntaxError* exception propagates up to _A_.Link, which resets all modules that are currently on its _stack_ (these are always exactly the modules that are still ~linking~). Hence both _A_ and _B_ become ~unlinked~. Note that _C_ is left as ~linked~.

      -

      Alternatively, consider a case where _A_ has an evaluation error; for example, its source code throws an exception. In that case, the evaluation-time analog of the above steps still occurs, including the early return from the second call to InnerModuleEvaluation on _A_. However, once we unwind back to the original InnerModuleEvaluation on _A_, it fails by assumption. The exception thrown propagates up to _A_.Evaluate(), which records the error in all modules that are currently on its _stack_ (i.e., the modules that are still ~evaluating~) as well as via [[AsyncParentModules]], which form a chain for modules which contain or depend on top-level `await` through the whole dependency graph through the AsyncModuleExecutionRejected algorithm. Hence both _A_ and _B_ become ~evaluated~ and the exception is recorded in both _A_ and _B_'s [[EvaluationError]] fields, while _C_ is left as ~evaluated~ with no [[EvaluationError]].

      +

      Alternatively, consider a case where _A_ has an evaluation error; for example, its source code throws an exception. In that case, the evaluation-time analogue of the above steps still occurs, including the early return from the second call to InnerModuleEvaluation on _A_. However, once we unwind back to the original InnerModuleEvaluation on _A_, it fails by assumption. The exception thrown propagates up to _A_.Evaluate(), which records the error in all modules that are currently on its _stack_ (i.e., the modules that are still ~evaluating~) as well as via [[AsyncParentModules]], which form a chain for modules which contain or depend on top-level `await` through the whole dependency graph through the AsyncModuleExecutionRejected algorithm. Hence both _A_ and _B_ become ~evaluated~ and the exception is recorded in both _A_ and _B_'s [[EvaluationError]] fields, while _C_ is left as ~evaluated~ with no [[EvaluationError]].

      Lastly, consider a module graph with a cycle, where all modules complete asynchronously:

      @@ -26910,64 +27526,63 @@

      Example Cyclic Module Record Graphs

      Loading and linking happen as before, and all modules end up with [[Status]] set to ~linked~.

      -

      Calling _A_.Evaluate() calls InnerModuleEvaluation on _A_, _B_, and _D_, which all transition to ~evaluating~. Then InnerModuleEvaluation is called on _A_ again, which is a no-op because it is already ~evaluating~. At this point, _D_.[[PendingAsyncDependencies]] is 0, so ExecuteAsyncModule(_D_) is called and we call _D_.ExecuteModule with a new PromiseCapability tracking the asynchronous execution of _D_. We unwind back to the InnerModuleEvaluation on _B_, setting _B_.[[PendingAsyncDependencies]] to 1 and _B_.[[AsyncEvaluation]] to *true*. We unwind back to the original InnerModuleEvaluation on _A_, setting _A_.[[PendingAsyncDependencies]] to 1. In the next iteration of the loop over _A_'s dependencies, we call InnerModuleEvaluation on _C_ and thus on _D_ (again a no-op) and _E_. As _E_ has no dependencies and is not part of a cycle, we call ExecuteAsyncModule(_E_) in the same manner as _D_ and _E_ is immediately removed from the stack. We unwind once more to the original InnerModuleEvaluation on _A_, setting _C_.[[AsyncEvaluation]] to *true*. Now we finish the loop over _A_'s dependencies, set _A_.[[AsyncEvaluation]] to *true*, and remove the entire strongly connected component from the stack, transitioning all of the modules to ~evaluating-async~ at once. At this point, the fields of the modules are as given in .

      +

      Calling _A_.Evaluate() calls InnerModuleEvaluation on _A_, _B_, and _D_, which all transition to ~evaluating~. Then InnerModuleEvaluation is called on _A_ again, which is a no-op because it is already ~evaluating~. At this point, _D_.[[PendingAsyncDependencies]] is 0, so ExecuteAsyncModule(_D_) is called and we call _D_.ExecuteModule with a new PromiseCapability tracking the asynchronous execution of _D_. We unwind back to the InnerModuleEvaluation on _B_, setting _B_.[[PendingAsyncDependencies]] to 1 and _B_.[[AsyncEvaluationOrder]] to 1. We unwind back to the original InnerModuleEvaluation on _A_, setting _A_.[[PendingAsyncDependencies]] to 1. In the next iteration of the loop over _A_'s dependencies, we call InnerModuleEvaluation on _C_ and thus on _D_ (again a no-op) and _E_. As _E_ has no dependencies and is not part of a cycle, we call ExecuteAsyncModule(_E_) in the same manner as _D_ and _E_ is immediately removed from the stack. We unwind once more to the InnerModuleEvaluation on _C_, setting _C_.[[AsyncEvaluationOrder]] to 3. Now we finish the loop over _A_'s dependencies, set _A_.[[AsyncEvaluationOrder]] to 4, and remove the entire strongly connected component from the stack, transitioning all of the modules to ~evaluating-async~ at once. At this point, the fields of the modules are as given in .

      - - - - - - - + + + + + + - + - - - - + + + - - - + + + + + - - - - + + + - - - - + - - - - - + + + + - + - - - - - - + + + + +
      Module[[DFSIndex]][[DFSAncestorIndex]][[Status]][[AsyncEvaluation]][[AsyncParentModules]][[PendingAsyncDependencies]] + Field +
      +
      + Module +
      _A__B__C__D__E_
      _A_[[DFSAncestorIndex]] 0 0~evaluating-async~*true*« »2 (_B_ and _C_)004
      _B_10[[Status]]~evaluating-async~~evaluating-async~~evaluating-async~~evaluating-async~ ~evaluating-async~*true*« _A_ »1 (_D_)
      _C_[[AsyncEvaluationOrder]]41 3 0~evaluating-async~*true*« _A_ »2 (_D_ and _E_)2
      _D_20~evaluating-async~*true*[[AsyncParentModules]]« »« _A_ »« _A_ » « _B_, _C_ »0« _C_ »
      _E_44~evaluating-async~*true*« _C_ »[[PendingAsyncDependencies]]2 (_B_ and _C_)1 (_D_)2 (_D_ and _E_)0 0
      @@ -26979,76 +27594,89 @@

      Example Cyclic Module Record Graphs

      - - - - - - - + + + - - + - - - - + - - - + + - + + + + + + + + + + + + +
      Module[[DFSIndex]][[DFSAncestorIndex]][[Status]][[AsyncEvaluation]][[AsyncParentModules]][[PendingAsyncDependencies]] + Field +
      +
      + Module +
      _C__E_
      _C_3[[DFSAncestorIndex]] 0~evaluating-async~*true*« _A_ »1 (_D_)4
      _E_44[[Status]]~evaluating-async~ ~evaluated~*true*
      [[AsyncEvaluationOrder]]3~done~
      [[AsyncParentModules]]« _A_ » « _C_ »
      [[PendingAsyncDependencies]]1 (_D_) 0
      -

      _D_ is next to finish (as it was the only module that was still executing). When that happens, AsyncModuleExecutionFulfilled is called again and _D_.[[Status]] is set to ~evaluated~. Then _B_.[[PendingAsyncDependencies]] is decremented to become 0, ExecuteAsyncModule is called on _B_, and it starts executing. _C_.[[PendingAsyncDependencies]] is also decremented to become 0, and _C_ starts executing (potentially in parallel to _B_ if _B_ contains an `await`). The fields of the updated modules are as given in .

      +

      _D_ is next to finish (as it was the only module that was still executing). When that happens, AsyncModuleExecutionFulfilled is called again and _D_.[[Status]] is set to ~evaluated~. Its ancestors available for execution are _B_ (whose [[AsyncEvaluationOrder]] is 1) and _C_ (whose [[AsyncEvaluationOrder]] is 3), thus _B_ will be handled first: _B_.[[PendingAsyncDependencies]] is decremented to become 0, ExecuteAsyncModule is called on _B_, and it starts executing. _C_.[[PendingAsyncDependencies]] is also decremented to become 0, and _C_ starts executing (potentially in parallel to _B_ if _B_ contains an `await`). The fields of the updated modules are as given in .

      - - - - - - - + + + + - - + + - - - - - - + + - + + + + + + + + + + - + + - - + + - - -
      Module[[DFSIndex]][[DFSAncestorIndex]][[Status]][[AsyncEvaluation]][[AsyncParentModules]][[PendingAsyncDependencies]] + Field +
      +
      + Module +
      _B__C__D_
      _B_1[[DFSAncestorIndex]]0 0~evaluating-async~*true*« _A_ » 0
      _C_30[[Status]]~evaluating-async~ ~evaluating-async~*true*~evaluated~
      [[AsyncEvaluationOrder]]13~done~
      [[AsyncParentModules]] « _A_ »0« _A_ »« _B_, _C_ »
      _D_2[[PendingAsyncDependencies]]0 0~evaluated~*true*« _B_, _C_ » 0
      @@ -27060,31 +27688,39 @@

      Example Cyclic Module Record Graphs

      - - - - - - - + + + - + - - - - - - - + + - + + + + + + + + + + + + +
      Module[[DFSIndex]][[DFSAncestorIndex]][[Status]][[AsyncEvaluation]][[AsyncParentModules]][[PendingAsyncDependencies]] + Field +
      +
      + Module +
      _A__C_
      _A_[[DFSAncestorIndex]] 0 0~evaluating-async~*true*« »1 (_B_)
      _C_30[[Status]]~evaluating-async~ ~evaluated~*true*
      [[AsyncEvaluationOrder]]4~done~
      [[AsyncParentModules]]« » « _A_ »
      [[PendingAsyncDependencies]]1 (_B_) 0
      @@ -27096,31 +27732,39 @@

      Example Cyclic Module Record Graphs

      - - - - - - - + + + - + + + + - + + + + + + + + + - + - - + - - -
      Module[[DFSIndex]][[DFSAncestorIndex]][[Status]][[AsyncEvaluation]][[AsyncParentModules]][[PendingAsyncDependencies]] + Field +
      +
      + Module +
      _A__B_
      _A_[[DFSAncestorIndex]] 0 0
      [[Status]] ~evaluating-async~*true*~evaluated~
      [[AsyncEvaluationOrder]]4~done~
      [[AsyncParentModules]] « »0« _A_ »
      _B_1[[PendingAsyncDependencies]] 0~evaluated~*true*« _A_ » 0
      @@ -27132,22 +27776,33 @@

      Example Cyclic Module Record Graphs

      - - - - - - - + + - - + + + + - + + + + + + + + + +
      Module[[DFSIndex]][[DFSAncestorIndex]][[Status]][[AsyncEvaluation]][[AsyncParentModules]][[PendingAsyncDependencies]] + Field +
      +
      + Module +
      _A_
      _A_0[[DFSAncestorIndex]] 0
      [[Status]] ~evaluated~*true*
      [[AsyncEvaluationOrder]]~done~
      [[AsyncParentModules]] « »
      [[PendingAsyncDependencies]] 0
      @@ -27159,34 +27814,44 @@

      Example Cyclic Module Record Graphs

      - - - - - - - - + + + - + + + + - + + + + + + + + + - - + - - + + - - - - + + + +
      Module[[DFSIndex]][[DFSAncestorIndex]][[Status]][[AsyncEvaluation]][[AsyncParentModules]][[PendingAsyncDependencies]][[EvaluationError]] + Field +
      +
      + Module +
      _A__C_
      _A_[[DFSAncestorIndex]] 0 0
      [[Status]] ~evaluated~*true*~evaluated~
      [[AsyncEvaluationOrder]]~done~~done~
      [[AsyncParentModules]] « »1 (_B_)~empty~« _A_ »
      _C_3[[PendingAsyncDependencies]]1 (_B_) 0~evaluated~*true*« _A_ »0
      [[EvaluationError]]~empty~ _C_'s evaluation error
      @@ -27198,24 +27863,38 @@

      Example Cyclic Module Record Graphs

      - - - - - - - - + + - - + + + + - + + + + + + + + + + + + + +
      Module[[DFSIndex]][[DFSAncestorIndex]][[Status]][[AsyncEvaluation]][[AsyncParentModules]][[PendingAsyncDependencies]][[EvaluationError]] + Field +
      +
      + Module +
      _A_
      _A_0[[DFSAncestorIndex]] 0
      [[Status]] ~evaluated~*true*
      [[AsyncEvaluationOrder]]~done~
      [[AsyncParentModules]] « »
      [[PendingAsyncDependencies]] 0
      [[EvaluationError]]_C_'s Evaluation Error
      @@ -27227,34 +27906,44 @@

      Example Cyclic Module Record Graphs

      - - - - - - - - + + + - + + + + + - - - - - + + - - - + + + + + + + + + + + +
      Module[[DFSIndex]][[DFSAncestorIndex]][[Status]][[AsyncEvaluation]][[AsyncParentModules]][[PendingAsyncDependencies]][[EvaluationError]] + Field +
      +
      + Module +
      _A__B_
      _A_[[DFSAncestorIndex]] 0 0
      [[Status]]~evaluated~ ~evaluated~*true*« »0_C_'s Evaluation Error
      _B_[[AsyncEvaluationOrder]]4 10~evaluated~*true*
      [[AsyncParentModules]]« » « _A_ »
      [[PendingAsyncDependencies]]0 0
      [[EvaluationError]]_C_'s Evaluation Error ~empty~
      @@ -27272,17 +27961,19 @@

      Source Text Module Records

      In addition to the fields defined in , Source Text Module Records have the additional fields listed in . Each of these fields is initially set in ParseModule.

      - - - - - + + + + + + +
      - Field Name - - Value Type - - Meaning -
      + Field Name + + Value Type + + Meaning +
      [[ECMAScriptCode]] @@ -27365,26 +28056,28 @@

      Source Text Module Records

      An ImportEntry Record is a Record that digests information about a single declarative import. Each ImportEntry Record has the fields defined in :

      - - - - - + + + + + + + @@ -27415,20 +28108,22 @@

      Source Text Module Records

      gives examples of ImportEntry records fields used to represent the syntactic import forms:

      - Field Name - - Value Type - - Meaning -
      + Field Name + + Value Type + + Meaning +
      [[ModuleRequest]] - a String + a ModuleRequest Record - String value of the |ModuleSpecifier| of the |ImportDeclaration|. + ModuleRequest Record representing the |ModuleSpecifier| and import attributes of the |ImportDeclaration|.
      - - - - - - + + + + + + + +
      - Import Statement Form - - [[ModuleRequest]] - - [[ImportName]] - - [[LocalName]] -
      + Import Statement Form + + [[ModuleRequest]] + + [[ImportName]] + + [[LocalName]] +
      `import v from "mod";` @@ -27499,17 +28194,19 @@

      Source Text Module Records

      An ExportEntry Record is a Record that digests information about a single declarative export. Each ExportEntry Record has the fields defined in :

      - - - - - + + + + + + + @@ -27560,23 +28257,25 @@

      Source Text Module Records

      gives examples of the ExportEntry record fields used to represent the syntactic export forms:

      - Field Name - - Value Type - - Meaning -
      + Field Name + + Value Type + + Meaning +
      [[ExportName]] @@ -27526,10 +28223,10 @@

      Source Text Module Records

      [[ModuleRequest]]
      - a String or *null* + a ModuleRequest Record or *null* - The String value of the |ModuleSpecifier| of the |ExportDeclaration|. *null* if the |ExportDeclaration| does not have a |ModuleSpecifier|. + The ModuleRequest Record representing the |ModuleSpecifier| and import attributes of the |ExportDeclaration|. *null* if the |ExportDeclaration| does not have a |ModuleSpecifier|.
      - - - - - - - + + + + + + + + +
      - Export Statement Form - - [[ExportName]] - - [[ModuleRequest]] - - [[ImportName]] - - [[LocalName]] -
      + Export Statement Form + + [[ExportName]] + + [[ModuleRequest]] + + [[ImportName]] + + [[LocalName]] +
      `export var v;` @@ -27779,10 +28478,11 @@

      1. If _importedBoundNames_ does not contain _ee_.[[LocalName]], then 1. Append _ee_ to _localExportEntries_. 1. Else, + 1. NOTE: When exporting a binding or namespace object which was originally imported from another module, the ExportEntry Record is rewritten to match the form it would have if the binding or namespace object had been re-exported directly from the original module rather than imported then exported. This allows conflicts which arise from exporting the same binding or namespace twice under the same name through `export * from` to be ignored rather than being treated as ambiguous in step of the ResolveExport concrete method of Source Text Module Records. 1. Let _ie_ be the element of _importEntries_ whose [[LocalName]] is _ee_.[[LocalName]]. 1. If _ie_.[[ImportName]] is ~namespace-object~, then 1. NOTE: This is a re-export of an imported module namespace object. - 1. Append _ee_ to _localExportEntries_. + 1. Append the ExportEntry Record { [[ModuleRequest]]: _ie_.[[ModuleRequest]], [[ImportName]]: ~all~, [[LocalName]]: *null*, [[ExportName]]: _ee_.[[ExportName]] } to _indirectExportEntries_. 1. Else, 1. NOTE: This is a re-export of a single name. 1. Append the ExportEntry Record { [[ModuleRequest]]: _ie_.[[ModuleRequest]], [[ImportName]]: _ie_.[[ImportName]], [[LocalName]]: *null*, [[ExportName]]: _ee_.[[ExportName]] } to _indirectExportEntries_. @@ -27792,218 +28492,427 @@

      1. Else, 1. Append _ee_ to _indirectExportEntries_. 1. Let _async_ be _body_ Contains `await`. - 1. Return Source Text Module Record { [[Realm]]: _realm_, [[Environment]]: ~empty~, [[Namespace]]: ~empty~, [[CycleRoot]]: ~empty~, [[HasTLA]]: _async_, [[AsyncEvaluation]]: *false*, [[TopLevelCapability]]: ~empty~, [[AsyncParentModules]]: « », [[PendingAsyncDependencies]]: ~empty~, [[Status]]: ~new~, [[EvaluationError]]: ~empty~, [[HostDefined]]: _hostDefined_, [[ECMAScriptCode]]: _body_, [[Context]]: ~empty~, [[ImportMeta]]: ~empty~, [[RequestedModules]]: _requestedModules_, [[LoadedModules]]: « », [[ImportEntries]]: _importEntries_, [[LocalExportEntries]]: _localExportEntries_, [[IndirectExportEntries]]: _indirectExportEntries_, [[StarExportEntries]]: _starExportEntries_, [[DFSIndex]]: ~empty~, [[DFSAncestorIndex]]: ~empty~ }. + 1. Return Source Text Module Record { [[Realm]]: _realm_, [[Environment]]: ~empty~, [[Namespace]]: ~empty~, [[CycleRoot]]: ~empty~, [[HasTLA]]: _async_, [[AsyncEvaluationOrder]]: ~unset~, [[TopLevelCapability]]: ~empty~, [[AsyncParentModules]]: « », [[PendingAsyncDependencies]]: ~empty~, [[Status]]: ~new~, [[EvaluationError]]: ~empty~, [[HostDefined]]: _hostDefined_, [[ECMAScriptCode]]: _body_, [[Context]]: ~empty~, [[ImportMeta]]: ~empty~, [[RequestedModules]]: _requestedModules_, [[LoadedModules]]: « », [[ImportEntries]]: _importEntries_, [[LocalExportEntries]]: _localExportEntries_, [[IndirectExportEntries]]: _indirectExportEntries_, [[StarExportEntries]]: _starExportEntries_, [[DFSAncestorIndex]]: ~empty~ }.

      An implementation may parse module source text and analyse it for Early Error conditions prior to the evaluation of ParseModule for that module source text. However, the reporting of any errors must be deferred until the point where this specification actually performs ParseModule upon that source text.

      - + +

      Implementation of Module Record Abstract Methods

      + +

      The following are the concrete methods for Source Text Module Record that implement the corresponding Module Record abstract methods defined in .

      + + +

      + GetExportedNames ( + optional _exportStarSet_: a List of Source Text Module Records, + ): a List of Strings +

      +
      +
      for
      +
      a Source Text Module Record _module_
      +
      + + 1. Assert: _module_.[[Status]] is not ~new~. + 1. If _exportStarSet_ is not present, set _exportStarSet_ to a new empty List. + 1. If _exportStarSet_ contains _module_, then + 1. Assert: We've reached the starting point of an `export *` circularity. + 1. Return a new empty List. + 1. Append _module_ to _exportStarSet_. + 1. Let _exportedNames_ be a new empty List. + 1. For each ExportEntry Record _e_ of _module_.[[LocalExportEntries]], do + 1. Assert: _module_ provides the direct binding for this export. + 1. Assert: _e_.[[ExportName]] is not *null*. + 1. Append _e_.[[ExportName]] to _exportedNames_. + 1. For each ExportEntry Record _e_ of _module_.[[IndirectExportEntries]], do + 1. Assert: _module_ imports a specific binding for this export. + 1. Assert: _e_.[[ExportName]] is not *null*. + 1. Append _e_.[[ExportName]] to _exportedNames_. + 1. For each ExportEntry Record _e_ of _module_.[[StarExportEntries]], do + 1. Assert: _e_.[[ModuleRequest]] is not *null*. + 1. Let _requestedModule_ be GetImportedModule(_module_, _e_.[[ModuleRequest]]). + 1. Let _starNames_ be _requestedModule_.GetExportedNames(_exportStarSet_). + 1. For each element _n_ of _starNames_, do + 1. If _n_ is not *"default"*, then + 1. If _exportedNames_ does not contain _n_, then + 1. Append _n_ to _exportedNames_. + 1. Return _exportedNames_. + + +

      GetExportedNames does not filter out or throw an exception for names that have ambiguous star export bindings.

      +
      +
      + + +

      + ResolveExport ( + _exportName_: a String, + optional _resolveSet_: a List of Records with fields [[Module]] (a Module Record) and [[ExportName]] (a String), + ): a ResolvedBinding Record, *null*, or ~ambiguous~ +

      +
      +
      for
      +
      a Source Text Module Record _module_
      + +
      description
      +
      +

      ResolveExport attempts to resolve an imported binding to the actual defining module and local binding name. The defining module may be the module represented by the Module Record this method was invoked on or some other module that is imported by that module. The parameter _resolveSet_ is used to detect unresolved circular import/export paths. If a pair consisting of specific Module Record and _exportName_ is reached that is already in _resolveSet_, an import circularity has been encountered. Before recursively calling ResolveExport, a pair consisting of _module_ and _exportName_ is added to _resolveSet_.

      +

      If a defining module is found, a ResolvedBinding Record { [[Module]], [[BindingName]] } is returned. This record identifies the resolved binding of the originally requested export, unless this is the export of a namespace with no local binding. In this case, [[BindingName]] will be set to ~namespace~. If no definition was found or the request is found to be circular, *null* is returned. If the request is found to be ambiguous, ~ambiguous~ is returned.

      +
      +
      + + + 1. Assert: _module_.[[Status]] is not ~new~. + 1. If _resolveSet_ is not present, set _resolveSet_ to a new empty List. + 1. For each Record { [[Module]], [[ExportName]] } _r_ of _resolveSet_, do + 1. If _module_ and _r_.[[Module]] are the same Module Record and _exportName_ is _r_.[[ExportName]], then + 1. Assert: This is a circular import request. + 1. Return *null*. + 1. Append the Record { [[Module]]: _module_, [[ExportName]]: _exportName_ } to _resolveSet_. + 1. For each ExportEntry Record _e_ of _module_.[[LocalExportEntries]], do + 1. If _e_.[[ExportName]] is _exportName_, then + 1. Assert: _module_ provides the direct binding for this export. + 1. Return ResolvedBinding Record { [[Module]]: _module_, [[BindingName]]: _e_.[[LocalName]] }. + 1. For each ExportEntry Record _e_ of _module_.[[IndirectExportEntries]], do + 1. If _e_.[[ExportName]] is _exportName_, then + 1. Assert: _e_.[[ModuleRequest]] is not *null*. + 1. Let _importedModule_ be GetImportedModule(_module_, _e_.[[ModuleRequest]]). + 1. If _e_.[[ImportName]] is ~all~, then + 1. Assert: _module_ does not provide the direct binding for this export. + 1. Return ResolvedBinding Record { [[Module]]: _importedModule_, [[BindingName]]: ~namespace~ }. + 1. Assert: _module_ imports a specific binding for this export. + 1. Assert: _e_.[[ImportName]] is a String. + 1. Return _importedModule_.ResolveExport(_e_.[[ImportName]], _resolveSet_). + 1. If _exportName_ is *"default"*, then + 1. Assert: A `default` export was not explicitly defined by this module. + 1. Return *null*. + 1. NOTE: A `default` export cannot be provided by an `export * from "mod"` declaration. + 1. Let _starResolution_ be *null*. + 1. For each ExportEntry Record _e_ of _module_.[[StarExportEntries]], do + 1. Assert: _e_.[[ModuleRequest]] is not *null*. + 1. Let _importedModule_ be GetImportedModule(_module_, _e_.[[ModuleRequest]]). + 1. Let _resolution_ be _importedModule_.ResolveExport(_exportName_, _resolveSet_). + 1. If _resolution_ is ~ambiguous~, return ~ambiguous~. + 1. If _resolution_ is not *null*, then + 1. Assert: _resolution_ is a ResolvedBinding Record. + 1. If _starResolution_ is *null*, then + 1. Set _starResolution_ to _resolution_. + 1. [id="step-resolveexport-conflict"] Else, + 1. Assert: There is more than one `*` export that includes the requested name. + 1. If _resolution_.[[Module]] and _starResolution_.[[Module]] are not the same Module Record, return ~ambiguous~. + 1. If _resolution_.[[BindingName]] is not _starResolution_.[[BindingName]], return ~ambiguous~. + 1. Return _starResolution_. + +
      +
      + + +

      Implementation of Cyclic Module Record Abstract Methods

      + +

      The following are the concrete methods for Source Text Module Record that implement the corresponding Cyclic Module Record abstract methods defined in .

      + + +

      InitializeEnvironment ( ): either a normal completion containing ~unused~ or a throw completion

      +
      +
      for
      +
      a Source Text Module Record _module_
      +
      + + + 1. For each ExportEntry Record _e_ of _module_.[[IndirectExportEntries]], do + 1. Assert: _e_.[[ExportName]] is not *null*. + 1. Let _resolution_ be _module_.ResolveExport(_e_.[[ExportName]]). + 1. If _resolution_ is either *null* or ~ambiguous~, throw a *SyntaxError* exception. + 1. Assert: _resolution_ is a ResolvedBinding Record. + 1. Assert: All named exports from _module_ are resolvable. + 1. Let _realm_ be _module_.[[Realm]]. + 1. Assert: _realm_ is not *undefined*. + 1. Let _env_ be NewModuleEnvironment(_realm_.[[GlobalEnv]]). + 1. Set _module_.[[Environment]] to _env_. + 1. For each ImportEntry Record _in_ of _module_.[[ImportEntries]], do + 1. Let _importedModule_ be GetImportedModule(_module_, _in_.[[ModuleRequest]]). + 1. If _in_.[[ImportName]] is ~namespace-object~, then + 1. Let _namespace_ be GetModuleNamespace(_importedModule_). + 1. Perform ! _env_.CreateImmutableBinding(_in_.[[LocalName]], *true*). + 1. Perform ! _env_.InitializeBinding(_in_.[[LocalName]], _namespace_). + 1. Else, + 1. Let _resolution_ be _importedModule_.ResolveExport(_in_.[[ImportName]]). + 1. If _resolution_ is either *null* or ~ambiguous~, throw a *SyntaxError* exception. + 1. If _resolution_.[[BindingName]] is ~namespace~, then + 1. Let _namespace_ be GetModuleNamespace(_resolution_.[[Module]]). + 1. Perform ! _env_.CreateImmutableBinding(_in_.[[LocalName]], *true*). + 1. Perform ! _env_.InitializeBinding(_in_.[[LocalName]], _namespace_). + 1. Else, + 1. Perform CreateImportBinding(_env_, _in_.[[LocalName]], _resolution_.[[Module]], _resolution_.[[BindingName]]). + 1. Let _moduleContext_ be a new ECMAScript code execution context. + 1. Set the Function of _moduleContext_ to *null*. + 1. Assert: _module_.[[Realm]] is not *undefined*. + 1. Set the Realm of _moduleContext_ to _module_.[[Realm]]. + 1. Set the ScriptOrModule of _moduleContext_ to _module_. + 1. Set the VariableEnvironment of _moduleContext_ to _module_.[[Environment]]. + 1. Set the LexicalEnvironment of _moduleContext_ to _module_.[[Environment]]. + 1. Set the PrivateEnvironment of _moduleContext_ to *null*. + 1. Set _module_.[[Context]] to _moduleContext_. + 1. Push _moduleContext_ onto the execution context stack; _moduleContext_ is now the running execution context. + 1. Let _code_ be _module_.[[ECMAScriptCode]]. + 1. Let _varDeclarations_ be the VarScopedDeclarations of _code_. + 1. Let _declaredVarNames_ be a new empty List. + 1. For each element _d_ of _varDeclarations_, do + 1. For each element _dn_ of the BoundNames of _d_, do + 1. If _declaredVarNames_ does not contain _dn_, then + 1. Perform ! _env_.CreateMutableBinding(_dn_, *false*). + 1. Perform ! _env_.InitializeBinding(_dn_, *undefined*). + 1. Append _dn_ to _declaredVarNames_. + 1. Let _lexDeclarations_ be the LexicallyScopedDeclarations of _code_. + 1. Let _privateEnv_ be *null*. + 1. For each element _d_ of _lexDeclarations_, do + 1. For each element _dn_ of the BoundNames of _d_, do + 1. If IsConstantDeclaration of _d_ is *true*, then + 1. Perform ! _env_.CreateImmutableBinding(_dn_, *true*). + 1. Else, + 1. Perform ! _env_.CreateMutableBinding(_dn_, *false*). + 1. If _d_ is either a |FunctionDeclaration|, a |GeneratorDeclaration|, an |AsyncFunctionDeclaration|, or an |AsyncGeneratorDeclaration|, then + 1. Let _fo_ be InstantiateFunctionObject of _d_ with arguments _env_ and _privateEnv_. + 1. Perform ! _env_.InitializeBinding(_dn_, _fo_). + 1. Remove _moduleContext_ from the execution context stack. + 1. Return ~unused~. + +
      + + +

      + ExecuteModule ( + optional _capability_: a PromiseCapability Record, + ): either a normal completion containing ~unused~ or a throw completion +

      +
      +
      for
      +
      a Source Text Module Record _module_
      +
      + + + 1. Let _moduleContext_ be a new ECMAScript code execution context. + 1. Set the Function of _moduleContext_ to *null*. + 1. Set the Realm of _moduleContext_ to _module_.[[Realm]]. + 1. Set the ScriptOrModule of _moduleContext_ to _module_. + 1. Assert: _module_ has been linked and declarations in its module environment have been instantiated. + 1. Set the VariableEnvironment of _moduleContext_ to _module_.[[Environment]]. + 1. Set the LexicalEnvironment of _moduleContext_ to _module_.[[Environment]]. + 1. Suspend the running execution context. + 1. If _module_.[[HasTLA]] is *false*, then + 1. Assert: _capability_ is not present. + 1. Push _moduleContext_ onto the execution context stack; _moduleContext_ is now the running execution context. + 1. Let _result_ be Completion(Evaluation of _module_.[[ECMAScriptCode]]). + 1. Suspend _moduleContext_ and remove it from the execution context stack. + 1. Resume the context that is now on the top of the execution context stack as the running execution context. + 1. If _result_ is an abrupt completion, then + 1. Return ? _result_. + 1. Else, + 1. Assert: _capability_ is a PromiseCapability Record. + 1. Perform AsyncBlockStart(_capability_, _module_.[[ECMAScriptCode]], _moduleContext_). + 1. Return ~unused~. + +
      +
      +
      + + +

      Synthetic Module Records

      + +

      A Synthetic Module Record is used to represent information about a module that is defined by specifications. Its exported names are statically defined at creation, while their corresponding values can change over time using SetSyntheticModuleExport. It has no imports or dependencies.

      + + A Synthetic Module Record could be used for defining a variety of module types: for example, JSON modules or CSS modules. + +

      In addition to the fields defined in Synthetic Module Records have the additional fields listed in .

      + + + + + + + + + + + + + + + + + + + + +
      Field NameValue TypeMeaning
      [[ExportNames]]a List of StringsThe names of the exports of the module. This list does not contain duplicates.
      [[EvaluationSteps]]an Abstract ClosureThe initialization logic to perform upon evaluation of the module, taking the Synthetic Module Record as its sole argument. It must not modify [[ExportNames]]. It may return an abrupt completion.
      +
      + +

      - GetExportedNames ( - optional _exportStarSet_: a List of Source Text Module Records, - ): a List of Strings + CreateDefaultExportSyntheticModule ( + _defaultExport_: an ECMAScript language value, + ): a Synthetic Module Record

      -
      for
      -
      a Source Text Module Record _module_
      +
      description
      +
      It creates a Synthetic Module Record whose default export is _defaultExport_.
      - 1. Assert: _module_.[[Status]] is not ~new~. - 1. If _exportStarSet_ is not present, set _exportStarSet_ to a new empty List. - 1. If _exportStarSet_ contains _module_, then - 1. Assert: We've reached the starting point of an `export *` circularity. - 1. Return a new empty List. - 1. Append _module_ to _exportStarSet_. - 1. Let _exportedNames_ be a new empty List. - 1. For each ExportEntry Record _e_ of _module_.[[LocalExportEntries]], do - 1. Assert: _module_ provides the direct binding for this export. - 1. Assert: _e_.[[ExportName]] is not *null*. - 1. Append _e_.[[ExportName]] to _exportedNames_. - 1. For each ExportEntry Record _e_ of _module_.[[IndirectExportEntries]], do - 1. Assert: _module_ imports a specific binding for this export. - 1. Assert: _e_.[[ExportName]] is not *null*. - 1. Append _e_.[[ExportName]] to _exportedNames_. - 1. For each ExportEntry Record _e_ of _module_.[[StarExportEntries]], do - 1. Assert: _e_.[[ModuleRequest]] is not *null*. - 1. Let _requestedModule_ be GetImportedModule(_module_, _e_.[[ModuleRequest]]). - 1. Let _starNames_ be _requestedModule_.GetExportedNames(_exportStarSet_). - 1. For each element _n_ of _starNames_, do - 1. If _n_ is not *"default"*, then - 1. If _exportedNames_ does not contain _n_, then - 1. Append _n_ to _exportedNames_. - 1. Return _exportedNames_. + 1. Let _realm_ be the current Realm Record. + 1. Let _setDefaultExport_ be a new Abstract Closure with parameters (_module_) that captures _defaultExport_ and performs the following steps when called: + 1. Perform SetSyntheticModuleExport(_module_, *"default"*, _defaultExport_). + 1. Return NormalCompletion(~unused~). + 1. Return the Synthetic Module Record { [[Realm]]: _realm_, [[Environment]]: ~empty~, [[Namespace]]: ~empty~, [[HostDefined]]: *undefined*, [[ExportNames]]: « *"default"* », [[EvaluationSteps]]: _setDefaultExport_ }. - -

      GetExportedNames does not filter out or throw an exception for names that have ambiguous star export bindings.

      -
      - +

      - ResolveExport ( - _exportName_: a String, - optional _resolveSet_: a List of Records with fields [[Module]] (a Module Record) and [[ExportName]] (a String), - ): a ResolvedBinding Record, *null*, or ~ambiguous~ + ParseJSONModule ( + _source_: a String, + ): either a normal completion containing a Synthetic Module Record, or a throw completion

      -
      for
      -
      a Source Text Module Record _module_
      -
      description
      -
      -

      ResolveExport attempts to resolve an imported binding to the actual defining module and local binding name. The defining module may be the module represented by the Module Record this method was invoked on or some other module that is imported by that module. The parameter _resolveSet_ is used to detect unresolved circular import/export paths. If a pair consisting of specific Module Record and _exportName_ is reached that is already in _resolveSet_, an import circularity has been encountered. Before recursively calling ResolveExport, a pair consisting of _module_ and _exportName_ is added to _resolveSet_.

      -

      If a defining module is found, a ResolvedBinding Record { [[Module]], [[BindingName]] } is returned. This record identifies the resolved binding of the originally requested export, unless this is the export of a namespace with no local binding. In this case, [[BindingName]] will be set to ~namespace~. If no definition was found or the request is found to be circular, *null* is returned. If the request is found to be ambiguous, ~ambiguous~ is returned.

      -
      +
      - 1. Assert: _module_.[[Status]] is not ~new~. - 1. If _resolveSet_ is not present, set _resolveSet_ to a new empty List. - 1. For each Record { [[Module]], [[ExportName]] } _r_ of _resolveSet_, do - 1. If _module_ and _r_.[[Module]] are the same Module Record and _exportName_ is _r_.[[ExportName]], then - 1. Assert: This is a circular import request. - 1. Return *null*. - 1. Append the Record { [[Module]]: _module_, [[ExportName]]: _exportName_ } to _resolveSet_. - 1. For each ExportEntry Record _e_ of _module_.[[LocalExportEntries]], do - 1. If _e_.[[ExportName]] is _exportName_, then - 1. Assert: _module_ provides the direct binding for this export. - 1. Return ResolvedBinding Record { [[Module]]: _module_, [[BindingName]]: _e_.[[LocalName]] }. - 1. For each ExportEntry Record _e_ of _module_.[[IndirectExportEntries]], do - 1. If _e_.[[ExportName]] is _exportName_, then - 1. Assert: _e_.[[ModuleRequest]] is not *null*. - 1. Let _importedModule_ be GetImportedModule(_module_, _e_.[[ModuleRequest]]). - 1. If _e_.[[ImportName]] is ~all~, then - 1. Assert: _module_ does not provide the direct binding for this export. - 1. Return ResolvedBinding Record { [[Module]]: _importedModule_, [[BindingName]]: ~namespace~ }. - 1. Else, - 1. Assert: _module_ imports a specific binding for this export. - 1. Return _importedModule_.ResolveExport(_e_.[[ImportName]], _resolveSet_). - 1. If _exportName_ is *"default"*, then - 1. Assert: A `default` export was not explicitly defined by this module. - 1. Return *null*. - 1. NOTE: A `default` export cannot be provided by an `export * from "mod"` declaration. - 1. Let _starResolution_ be *null*. - 1. For each ExportEntry Record _e_ of _module_.[[StarExportEntries]], do - 1. Assert: _e_.[[ModuleRequest]] is not *null*. - 1. Let _importedModule_ be GetImportedModule(_module_, _e_.[[ModuleRequest]]). - 1. Let _resolution_ be _importedModule_.ResolveExport(_exportName_, _resolveSet_). - 1. If _resolution_ is ~ambiguous~, return ~ambiguous~. - 1. If _resolution_ is not *null*, then - 1. Assert: _resolution_ is a ResolvedBinding Record. - 1. If _starResolution_ is *null*, then - 1. Set _starResolution_ to _resolution_. - 1. Else, - 1. Assert: There is more than one `*` import that includes the requested name. - 1. If _resolution_.[[Module]] and _starResolution_.[[Module]] are not the same Module Record, return ~ambiguous~. - 1. If _resolution_.[[BindingName]] is not _starResolution_.[[BindingName]] and either _resolution_.[[BindingName]] or _starResolution_.[[BindingName]] is ~namespace~, return ~ambiguous~. - 1. If _resolution_.[[BindingName]] is a String, _starResolution_.[[BindingName]] is a String, and _resolution_.[[BindingName]] is not _starResolution_.[[BindingName]], return ~ambiguous~. - 1. Return _starResolution_. + 1. Let _parseResult_ be ? ParseJSON(_source_). + 1. Return CreateDefaultExportSyntheticModule(_parseResult_.[[Value]]).
      - -

      InitializeEnvironment ( ): either a normal completion containing ~unused~ or a throw completion

      + +

      + SetSyntheticModuleExport ( + _module_: a Synthetic Module Record, + _exportName_: a String, + _exportValue_: an ECMAScript language value, + ): ~unused~ +

      -
      for
      -
      a Source Text Module Record _module_
      +
      description
      +
      It can be used to set or change the exported value for an existing export of a Synthetic Module Record.
      - 1. For each ExportEntry Record _e_ of _module_.[[IndirectExportEntries]], do - 1. Assert: _e_.[[ExportName]] is not *null*. - 1. Let _resolution_ be _module_.ResolveExport(_e_.[[ExportName]]). - 1. If _resolution_ is either *null* or ~ambiguous~, throw a *SyntaxError* exception. - 1. Assert: _resolution_ is a ResolvedBinding Record. - 1. Assert: All named exports from _module_ are resolvable. - 1. Let _realm_ be _module_.[[Realm]]. - 1. Assert: _realm_ is not *undefined*. - 1. Let _env_ be NewModuleEnvironment(_realm_.[[GlobalEnv]]). - 1. Set _module_.[[Environment]] to _env_. - 1. For each ImportEntry Record _in_ of _module_.[[ImportEntries]], do - 1. Let _importedModule_ be GetImportedModule(_module_, _in_.[[ModuleRequest]]). - 1. If _in_.[[ImportName]] is ~namespace-object~, then - 1. Let _namespace_ be GetModuleNamespace(_importedModule_). - 1. Perform ! _env_.CreateImmutableBinding(_in_.[[LocalName]], *true*). - 1. Perform ! _env_.InitializeBinding(_in_.[[LocalName]], _namespace_). - 1. Else, - 1. Let _resolution_ be _importedModule_.ResolveExport(_in_.[[ImportName]]). - 1. If _resolution_ is either *null* or ~ambiguous~, throw a *SyntaxError* exception. - 1. If _resolution_.[[BindingName]] is ~namespace~, then - 1. Let _namespace_ be GetModuleNamespace(_resolution_.[[Module]]). - 1. Perform ! _env_.CreateImmutableBinding(_in_.[[LocalName]], *true*). - 1. Perform ! _env_.InitializeBinding(_in_.[[LocalName]], _namespace_). - 1. Else, - 1. Perform _env_.CreateImportBinding(_in_.[[LocalName]], _resolution_.[[Module]], _resolution_.[[BindingName]]). - 1. Let _moduleContext_ be a new ECMAScript code execution context. - 1. Set the Function of _moduleContext_ to *null*. - 1. Assert: _module_.[[Realm]] is not *undefined*. - 1. Set the Realm of _moduleContext_ to _module_.[[Realm]]. - 1. Set the ScriptOrModule of _moduleContext_ to _module_. - 1. Set the VariableEnvironment of _moduleContext_ to _module_.[[Environment]]. - 1. Set the LexicalEnvironment of _moduleContext_ to _module_.[[Environment]]. - 1. Set the PrivateEnvironment of _moduleContext_ to *null*. - 1. Set _module_.[[Context]] to _moduleContext_. - 1. Push _moduleContext_ onto the execution context stack; _moduleContext_ is now the running execution context. - 1. Let _code_ be _module_.[[ECMAScriptCode]]. - 1. Let _varDeclarations_ be the VarScopedDeclarations of _code_. - 1. Let _declaredVarNames_ be a new empty List. - 1. For each element _d_ of _varDeclarations_, do - 1. For each element _dn_ of the BoundNames of _d_, do - 1. If _declaredVarNames_ does not contain _dn_, then - 1. Perform ! _env_.CreateMutableBinding(_dn_, *false*). - 1. Perform ! _env_.InitializeBinding(_dn_, *undefined*). - 1. Append _dn_ to _declaredVarNames_. - 1. Let _lexDeclarations_ be the LexicallyScopedDeclarations of _code_. - 1. Let _privateEnv_ be *null*. - 1. For each element _d_ of _lexDeclarations_, do - 1. For each element _dn_ of the BoundNames of _d_, do - 1. If IsConstantDeclaration of _d_ is *true*, then - 1. Perform ! _env_.CreateImmutableBinding(_dn_, *true*). - 1. Else, - 1. Perform ! _env_.CreateMutableBinding(_dn_, *false*). - 1. If _d_ is either a |FunctionDeclaration|, a |GeneratorDeclaration|, an |AsyncFunctionDeclaration|, or an |AsyncGeneratorDeclaration|, then - 1. Let _fo_ be InstantiateFunctionObject of _d_ with arguments _env_ and _privateEnv_. - 1. Perform ! _env_.InitializeBinding(_dn_, _fo_). - 1. Remove _moduleContext_ from the execution context stack. + 1. Assert: _module_.[[ExportNames]] contains _exportName_. + 1. Let _envRec_ be _module_.[[Environment]]. + 1. Assert: _envRec_ is not ~empty~. + 1. Perform ! _envRec_.SetMutableBinding(_exportName_, _exportValue_, *true*). 1. Return ~unused~.
      - -

      - ExecuteModule ( - optional _capability_: a PromiseCapability Record, - ): either a normal completion containing ~unused~ or a throw completion -

      -
      -
      for
      -
      a Source Text Module Record _module_
      -
      + +

      Implementation of Module Record Abstract Methods

      - - 1. Let _moduleContext_ be a new ECMAScript code execution context. - 1. Set the Function of _moduleContext_ to *null*. - 1. Set the Realm of _moduleContext_ to _module_.[[Realm]]. - 1. Set the ScriptOrModule of _moduleContext_ to _module_. - 1. Assert: _module_ has been linked and declarations in its module environment have been instantiated. - 1. Set the VariableEnvironment of _moduleContext_ to _module_.[[Environment]]. - 1. Set the LexicalEnvironment of _moduleContext_ to _module_.[[Environment]]. - 1. Suspend the running execution context. - 1. If _module_.[[HasTLA]] is *false*, then - 1. Assert: _capability_ is not present. +

      The following are the concrete methods for Synthetic Module Record that implement the corresponding Module Record abstract methods defined in .

      + + +

      + LoadRequestedModules ( + optional _hostDefined_: anything, + ): a Promise +

      +
      +
      for
      +
      a Synthetic Module Record _module_
      +
      + + + 1. NOTE: This implementation of LoadRequestedModules does not use _hostDefined_. + 1. Return ! PromiseResolve(%Promise%, *undefined*). + + + + Synthetic Module Records have no dependencies. + +
      + + +

      + GetExportedNames ( + optional _exportStarSet_: a List of Source Text Module Records, + ): a List of Strings +

      +
      +
      for
      +
      a Synthetic Module Record _module_
      +
      + + + 1. NOTE: This implementation of GetExportedNames does not use _exportStarSet_. + 1. Return _module_.[[ExportNames]]. + +
      + + +

      + ResolveExport ( + _exportName_: a String, + optional _resolveSet_: a List of Records with fields [[Module]] (a Module Record) and [[ExportName]] (a String), + ): a ResolvedBinding Record, *null*, or ~ambiguous~ +

      +
      +
      for
      +
      a Synthetic Module Record _module_
      +
      + + + 1. NOTE: This implementation of ResolveExport does not use _resolveSet_. + 1. If _module_.[[ExportNames]] does not contain _exportName_, return *null*. + 1. Return ResolvedBinding Record { [[Module]]: _module_, [[BindingName]]: _exportName_ }. + +
      + + +

      Link ( ): a normal completion containing ~unused~

      +
      +
      for
      +
      a Synthetic Module Record _module_
      +
      + + + 1. Let _realm_ be _module_.[[Realm]]. + 1. Let _env_ be NewModuleEnvironment(_realm_.[[GlobalEnv]]). + 1. Set _module_.[[Environment]] to _env_. + 1. For each String _exportName_ of _module_.[[ExportNames]], do + 1. Perform ! _env_.CreateMutableBinding(_exportName_, *false*). + 1. Perform ! _env_.InitializeBinding(_exportName_, *undefined*). + 1. Return NormalCompletion(~unused~). + +
      + + +

      Evaluate ( ): a Promise

      +
      +
      for
      +
      a Synthetic Module Record _module_
      +
      + + + 1. Let _moduleContext_ be a new ECMAScript code execution context. + 1. Set the Function of _moduleContext_ to *null*. + 1. Set the Realm of _moduleContext_ to _module_.[[Realm]]. + 1. Set the ScriptOrModule of _moduleContext_ to _module_. + 1. Set the VariableEnvironment of _moduleContext_ to _module_.[[Environment]]. + 1. Set the LexicalEnvironment of _moduleContext_ to _module_.[[Environment]]. + 1. Suspend the running execution context. 1. Push _moduleContext_ onto the execution context stack; _moduleContext_ is now the running execution context. - 1. Let _result_ be Completion(Evaluation of _module_.[[ECMAScriptCode]]). + 1. Let _steps_ be _module_.[[EvaluationSteps]]. + 1. Let _result_ be Completion(_steps_(_module_)). 1. Suspend _moduleContext_ and remove it from the execution context stack. 1. Resume the context that is now on the top of the execution context stack as the running execution context. - 1. If _result_ is an abrupt completion, then - 1. Return ? _result_. - 1. Else, - 1. Assert: _capability_ is a PromiseCapability Record. - 1. Perform AsyncBlockStart(_capability_, _module_.[[ECMAScriptCode]], _moduleContext_). - 1. Return ~unused~. - + 1. Let _pc_ be ! NewPromiseCapability(%Promise%). + 1. IfAbruptRejectPromise(_result_, _pc_). + 1. Perform ! Call(_pc_.[[Resolve]], *undefined*, « *undefined* »). + 1. Return _pc_.[[Promise]]. +
      +
      @@ -28011,7 +28920,7 @@

      GetImportedModule ( _referrer_: a Cyclic Module Record, - _specifier_: a String, + _request_: a ModuleRequest Record, ): a Module Record

      @@ -28020,8 +28929,9 @@

      - 1. Assert: Exactly one element of _referrer_.[[LoadedModules]] is a Record whose [[Specifier]] is _specifier_, since LoadRequestedModules has completed successfully on _referrer_ prior to invoking this abstract operation. - 1. Let _record_ be the Record in _referrer_.[[LoadedModules]] whose [[Specifier]] is _specifier_. + 1. [declared="r"] Let _records_ be a List consisting of each LoadedModuleRequest Record _r_ of _referrer_.[[LoadedModules]] such that ModuleRequestsEqual(_r_, _request_) is *true*. + 1. Assert: _records_ has exactly one element, since LoadRequestedModules has completed successfully on _referrer_ prior to invoking this abstract operation. + 1. Let _record_ be the sole element of _records_. 1. Return _record_.[[Module]].
      @@ -28030,7 +28940,7 @@

      HostLoadImportedModule ( _referrer_: a Script Record, a Cyclic Module Record, or a Realm Record, - _specifier_: a String, + _moduleRequest_: a ModuleRequest Record, _hostDefined_: anything, _payload_: a GraphLoadingState Record or a PromiseCapability Record, ): ~unused~ @@ -28051,24 +28961,36 @@

      An implementation of HostLoadImportedModule must conform to the following requirements:

      • - The host environment must perform FinishLoadingImportedModule(_referrer_, _specifier_, _payload_, _result_), where _result_ is either a normal completion containing the loaded Module Record or a throw completion, either synchronously or asynchronously. + The host environment must perform FinishLoadingImportedModule(_referrer_, _moduleRequest_, _payload_, _result_), where _result_ is either a normal completion containing the loaded Module Record or a throw completion, either synchronously or asynchronously. +
      • +
      • +

        If this operation is called multiple times with two (_referrer_, _moduleRequest_) pairs such that:

        +
          +
        • the first _referrer_ is the same as the second _referrer_;
        • +
        • ModuleRequestsEqual(the first _moduleRequest_, the second _moduleRequest_) is *true*;
        • +
        +

        and it performs FinishLoadingImportedModule(_referrer_, _moduleRequest_, _payload_, _result_) where _result_ is a normal completion, then it must perform FinishLoadingImportedModule(_referrer_, _moduleRequest_, _payload_, _result_) with the same _result_ each time.

      • - If this operation is called multiple times with the same (_referrer_, _specifier_) pair and it performs FinishLoadingImportedModule(_referrer_, _specifier_, _payload_, _result_) where _result_ is a normal completion, then it must perform FinishLoadingImportedModule(_referrer_, _specifier_, _payload_, _result_) with the same _result_ each time. +

        If _moduleRequest_.[[Attributes]] has an entry _entry_ such that _entry_.[[Key]] is *"type"* and _entry_.[[Value]] is *"json"*, when the host environment performs FinishLoadingImportedModule(_referrer_, _moduleRequest_, _payload_, _result_), _result_ must either be the Completion Record returned by an invocation of ParseJSONModule or a throw completion.

      • The operation must treat _payload_ as an opaque value to be passed through to FinishLoadingImportedModule.
      -

      The actual process performed is host-defined, but typically consists of performing whatever I/O operations are necessary to load the appropriate Module Record. Multiple different (_referrer_, _specifier_) pairs may map to the same Module Record instance. The actual mapping semantics is host-defined but typically a normalization process is applied to _specifier_ as part of the mapping process. A typical normalization process would include actions such as expansion of relative and abbreviated path specifiers.

      +

      The actual process performed is host-defined, but typically consists of performing whatever I/O operations are necessary to load the appropriate Module Record. Multiple different (_referrer_, _moduleRequest_.[[Specifier]], _moduleRequest_.[[Attributes]]) triples may map to the same Module Record instance. The actual mapping semantics is host-defined but typically a normalization process is applied to _specifier_ as part of the mapping process. A typical normalization process would include actions such as expansion of relative and abbreviated path specifiers.

      + + +

      The above text requires that hosts support JSON modules when imported with `type: "json"` (and HostLoadImportedModule completes normally), but it does not prohibit hosts from supporting JSON modules when imported without `type: "json"`.

      +

      FinishLoadingImportedModule ( _referrer_: a Script Record, a Cyclic Module Record, or a Realm Record, - _specifier_: a String, + _moduleRequest_: a ModuleRequest Record, _payload_: a GraphLoadingState Record or a PromiseCapability Record, _result_: either a normal completion containing a Module Record or a throw completion, ): ~unused~ @@ -28079,10 +29001,10 @@

      1. If _result_ is a normal completion, then - 1. If _referrer_.[[LoadedModules]] contains a Record whose [[Specifier]] is _specifier_, then - 1. Assert: That Record's [[Module]] is _result_.[[Value]]. + 1. If _referrer_.[[LoadedModules]] contains a LoadedModuleRequest Record _record_ such that ModuleRequestsEqual(_record_, _moduleRequest_) is *true*, then + 1. Assert: _record_.[[Module]] and _result_.[[Value]] are the same Module Record. 1. Else, - 1. Append the Record { [[Specifier]]: _specifier_, [[Module]]: _result_.[[Value]] } to _referrer_.[[LoadedModules]]. + 1. Append the LoadedModuleRequest Record { [[Specifier]]: _moduleRequest_.[[Specifier]], [[Attributes]]: _moduleRequest_.[[Attributes]], [[Module]]: _result_.[[Value]] } to _referrer_.[[LoadedModules]]. 1. If _payload_ is a GraphLoadingState Record, then 1. Perform ContinueModuleLoading(_payload_, _result_). 1. Else, @@ -28091,11 +29013,49 @@

      + +

      + AllImportAttributesSupported ( + _attributes_: a List of ImportAttribute Records, + ): a Boolean +

      +
      +
      description
      +
      +
      + + 1. Let _supported_ be HostGetSupportedImportAttributes(). + 1. For each ImportAttribute Record _attribute_ of _attributes_, do + 1. If _supported_ does not contain _attribute_.[[Key]], return *false*. + 1. Return *true*. + + + +

      HostGetSupportedImportAttributes ( ): a List of Strings

      +
      +
      description
      +
      It allows host environments to specify which import attributes they support. Only attributes with supported keys will be provided to the host.
      +
      + +

      An implementation of HostGetSupportedImportAttributes must conform to the following requirements:

      + +
        +
      • It must return a List of Strings, each indicating a supported attribute.
      • + +
      • Each time this operation is called, it must return the same List with the same contents in the same order.
      • +
      + +

      The default implementation of HostGetSupportedImportAttributes is to return a new empty List.

      + + The purpose of requiring the host to specify its supported import attributes, rather than passing all attributes to the host and letting it then choose which ones it wants to handle, is to ensure that unsupported attributes are handled in a consistent way across different hosts. +
      +
      +

      GetModuleNamespace ( _module_: an instance of a concrete subclass of Module Record, - ): a Module Namespace Object or ~empty~ + ): a Module Namespace Object

      description
      @@ -28153,8 +29113,8 @@

      Imports

      Syntax

      ImportDeclaration : - `import` ImportClause FromClause `;` - `import` ModuleSpecifier `;` + `import` ImportClause FromClause WithClause? `;` + `import` ModuleSpecifier WithClause? `;` ImportClause : ImportedDefaultBinding @@ -28190,6 +29150,18 @@

      Syntax

      ImportedBinding : BindingIdentifier[~Yield, +Await] + + WithClause : + `with` `{` `}` + `with` `{` WithEntries `,`? `}` + + WithEntries : + AttributeKey `:` StringLiteral + AttributeKey `:` StringLiteral `,` WithEntries + + AttributeKey : + IdentifierName + StringLiteral
      @@ -28200,6 +29172,13 @@

      Static Semantics: Early Errors

      It is a Syntax Error if the BoundNames of |ImportDeclaration| contains any duplicate entries. + + WithClause : `with` `{` WithEntries `,`? `}` +
        +
      • + It is a Syntax Error if WithClauseToAttributes of |WithClause| has two different entries _a_ and _b_ such that _a_.[[Key]] is _b_.[[Key]]. +
      • +
      @@ -28224,12 +29203,12 @@

      Static Semantics: ImportEntries ( ): a List of ImportEntry Records

      1. Return a new empty List. - ImportDeclaration : `import` ImportClause FromClause `;` + ImportDeclaration : `import` ImportClause FromClause WithClause? `;` - 1. Let _module_ be the sole element of the ModuleRequests of |FromClause|. + 1. Let _module_ be the sole element of the ModuleRequests of |ImportDeclaration|. 1. Return the ImportEntriesForModule of |ImportClause| with argument _module_. - ImportDeclaration : `import` ModuleSpecifier `;` + ImportDeclaration : `import` ModuleSpecifier WithClause? `;` 1. Return a new empty List. @@ -28238,7 +29217,7 @@

      Static Semantics: ImportEntries ( ): a List of ImportEntry Records

      Static Semantics: ImportEntriesForModule ( - _module_: a String, + _module_: a ModuleRequest Record, ): a List of ImportEntry Records

      @@ -28291,6 +29270,43 @@

      1. Return « _entry_ ». + + +

      Static Semantics: WithClauseToAttributes ( ): a List of ImportAttribute Records

      +
      +
      + + + WithClause : `with` `{` `}` + + + 1. Return a new empty List. + + + + WithClause : `with` `{` WithEntries `,`? `}` + + + 1. Let _attributes_ be WithClauseToAttributes of |WithEntries|. + 1. Sort _attributes_ according to the lexicographic order of their [[Key]] field, treating the value of each such field as a sequence of UTF-16 code unit values. NOTE: This sorting is observable only in that hosts are prohibited from changing behaviour based on the order in which attributes are enumerated. + 1. Return _attributes_. + + + WithEntries : AttributeKey `:` StringLiteral + + 1. Let _key_ be the PropName of |AttributeKey|. + 1. Let _entry_ be the ImportAttribute Record { [[Key]]: _key_, [[Value]]: the SV of |StringLiteral| }. + 1. Return « _entry_ ». + + + WithEntries : AttributeKey `:` StringLiteral `,` WithEntries + + 1. Let _key_ be the PropName of |AttributeKey|. + 1. Let _entry_ be the ImportAttribute Record { [[Key]]: _key_, [[Value]]: the SV of |StringLiteral| }. + 1. Let _rest_ be WithClauseToAttributes of |WithEntries|. + 1. Return the list-concatenation of « _entry_ » and _rest_. + +
      @@ -28298,7 +29314,7 @@

      Exports

      Syntax

      ExportDeclaration : - `export` ExportFromClause FromClause `;` + `export` ExportFromClause FromClause WithClause? `;` `export` NamedExports `;` `export` VariableStatement[~Yield, +Await] `export` Declaration[~Yield, +Await] @@ -28362,10 +29378,7 @@

      Static Semantics: ExportedBindings ( ): a List of Strings

      1. Return a new empty List. - - ExportDeclaration : - `export` ExportFromClause FromClause `;` - + ExportDeclaration : `export` ExportFromClause FromClause WithClause? `;` 1. Return a new empty List. @@ -28435,7 +29448,7 @@

      Static Semantics: ExportedNames ( ): a List of Strings

      1. Return a new empty List. - ExportDeclaration : `export` ExportFromClause FromClause `;` + ExportDeclaration : `export` ExportFromClause FromClause WithClause? `;` 1. Return the ExportedNames of |ExportFromClause|. @@ -28510,9 +29523,9 @@

      Static Semantics: ExportEntries ( ): a List of ExportEntry Records

      1. Return a new empty List. - ExportDeclaration : `export` ExportFromClause FromClause `;` + ExportDeclaration : `export` ExportFromClause FromClause WithClause? `;` - 1. Let _module_ be the sole element of the ModuleRequests of |FromClause|. + 1. Let _module_ be the sole element of the ModuleRequests of |ExportDeclaration|. 1. Return the ExportEntriesForModule of |ExportFromClause| with argument _module_. ExportDeclaration : `export` NamedExports `;` @@ -28560,7 +29573,7 @@

      Static Semantics: ExportEntries ( ): a List of ExportEntry Records

      Static Semantics: ExportEntriesForModule ( - _module_: a String or *null*, + _module_: a ModuleRequest Record or *null*, ): a List of ExportEntry Records

      @@ -28643,7 +29656,7 @@

      Static Semantics: ReferencedBindings ( ): a List of Parse Nodes

      Runtime Semantics: Evaluation

      ExportDeclaration : - `export` ExportFromClause FromClause `;` + `export` ExportFromClause FromClause WithClause? `;` `export` NamedExports `;` @@ -28761,7 +29774,7 @@

      ECMAScript Standard Built-in Objects

      Each built-in function defined in this specification is created by calling the CreateBuiltinFunction abstract operation (). The values of the _length_ and _name_ parameters are the initial values of the *"length"* and *"name"* properties as discussed below. The values of the _prefix_ parameter are similarly discussed below.

      Every built-in function object, including constructors, has a *"length"* property whose value is a non-negative integral Number. Unless otherwise specified, this value is the number of required parameters shown in the subclause heading for the function description. Optional parameters and rest parameters are not included in the parameter count.

      -

      For example, the function object that is the initial value of the *"map"* property of the Array prototype object is described under the subclause heading «Array.prototype.map (callbackFn [ , thisArg])» which shows the two named arguments callbackFn and thisArg, the latter being optional; therefore the value of the *"length"* property of that function object is *1*𝔽.

      +

      For example, the function object that is the initial value of the *"map"* property of the Array prototype object is described under the subclause heading «Array.prototype.map (callback [ , thisArg])» which shows the two named arguments callback and thisArg, the latter being optional; therefore the value of the *"length"* property of that function object is *1*𝔽.

      Unless otherwise specified, the *"length"* property of a built-in function object has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

      Every built-in function object, including constructors, has a *"name"* property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification. Functions that are identified as anonymous functions use the empty String as the value of the *"name"* property. For functions that are specified as properties of objects, the name value is the property name string used to access the function. Functions that are specified as get or set accessor functions of built-in properties have *"get"* or *"set"* (respectively) passed to the _prefix_ parameter when calling CreateBuiltinFunction.

      @@ -28810,7 +29823,7 @@

      undefined

      Function Properties of the Global Object

      - +

      eval ( _x_ )

      This function is the %eval% intrinsic object.

      It performs the following steps when called:

      @@ -28912,7 +29925,7 @@

      The default implementation of HostEnsureCanCompileStrings is to return NormalCompletion(~unused~).

      - +

      EvalDeclarationInstantiation ( _body_: a |ScriptBody| Parse Node, @@ -28924,19 +29937,13 @@

      - 1. Let _varNames_ be the VarDeclaredNames of _body_. 1. Let _varDeclarations_ be the VarScopedDeclarations of _body_. 1. If _strict_ is *false*, then 1. If _varEnv_ is a Global Environment Record, then 1. For each element _name_ of _varNames_, do - 1. If _varEnv_.HasLexicalDeclaration(_name_) is *true*, throw a *SyntaxError* exception. + 1. If HasLexicalDeclaration(_varEnv_, _name_) is *true*, throw a *SyntaxError* exception. 1. NOTE: `eval` will not create a global var declaration that would be shadowed by a global lexical declaration. 1. Let _thisEnv_ be _lexEnv_. 1. Assert: The following loop will terminate. @@ -28945,8 +29952,10 @@

      1. NOTE: The environment of with statements cannot contain any lexical declaration so it doesn't need to be checked for var/let hoisting conflicts. 1. For each element _name_ of _varNames_, do 1. If ! _thisEnv_.HasBinding(_name_) is *true*, then - 1. [id="step-evaldeclarationinstantiation-throw-duplicate-binding"] Throw a *SyntaxError* exception. - 1. NOTE: Annex defines alternate semantics for the above step. + 1. [id="step-evaldeclarationinstantiation-throw-duplicate-binding", normative-optional] If the host is a web browser or otherwise supports , then + 1. If _thisEnv_ is not the Environment Record for a |Catch| clause, throw a *SyntaxError* exception. + 1. Else, + 1. Throw a *SyntaxError* exception. 1. NOTE: A direct eval will not hoist var declaration over a like-named lexical declaration. 1. Set _thisEnv_ to _thisEnv_.[[OuterEnv]]. 1. Let _privateIdentifiers_ be a new empty List. @@ -28965,7 +29974,7 @@

      1. Let _fn_ be the sole element of the BoundNames of _d_. 1. If _declaredFunctionNames_ does not contain _fn_, then 1. If _varEnv_ is a Global Environment Record, then - 1. Let _fnDefinable_ be ? _varEnv_.CanDeclareGlobalFunction(_fn_). + 1. Let _fnDefinable_ be ? CanDeclareGlobalFunction(_varEnv_, _fn_). 1. If _fnDefinable_ is *false*, throw a *TypeError* exception. 1. Append _fn_ to _declaredFunctionNames_. 1. Insert _d_ as the first element of _functionsToInitialize_. @@ -28975,11 +29984,49 @@

      1. For each String _vn_ of the BoundNames of _d_, do 1. If _declaredFunctionNames_ does not contain _vn_, then 1. If _varEnv_ is a Global Environment Record, then - 1. Let _vnDefinable_ be ? _varEnv_.CanDeclareGlobalVar(_vn_). + 1. Let _vnDefinable_ be ? CanDeclareGlobalVar(_varEnv_, _vn_). 1. If _vnDefinable_ is *false*, throw a *TypeError* exception. 1. If _declaredVarNames_ does not contain _vn_, then 1. Append _vn_ to _declaredVarNames_. - 1. [id="step-evaldeclarationinstantiation-web-compat-insertion-point"] NOTE: Annex adds additional steps at this point. + 1. [id="step-evaldeclarationinstantiation-web-compat-insertion-point", normative-optional] If _strict_ is *false* and the host is a web browser or otherwise supports , then + 1. Let _declaredFunctionOrVarNames_ be the list-concatenation of _declaredFunctionNames_ and _declaredVarNames_. + 1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of any |Block|, |CaseClause|, or |DefaultClause| _x_ such that _body_ Contains _x_ is *true*, do + 1. Let _F_ be the StringValue of the |BindingIdentifier| of _f_. + 1. If replacing the |FunctionDeclaration| _f_ with a |VariableStatement| that has _F_ as a |BindingIdentifier| would not produce any Early Errors for _body_, then + 1. Let _bindingExists_ be *false*. + 1. Set _thisEnv_ to _lexEnv_. + 1. Assert: The following loop will terminate. + 1. Repeat, while _thisEnv_ is not _varEnv_, + 1. If _thisEnv_ is not an Object Environment Record, then + 1. If ! _thisEnv_.HasBinding(_F_) is *true*, then + 1. [id="step-evaldeclarationinstantiation-web-compat-bindingexists", normative-optional] If the host is a web browser or otherwise supports , then + 1. If _thisEnv_ is not the Environment Record for a |Catch| clause, set _bindingExists_ to *true*. + 1. Else, + 1. Set _bindingExists_ to *true*. + 1. Set _thisEnv_ to _thisEnv_.[[OuterEnv]]. + 1. If _bindingExists_ is *false* and _varEnv_ is a Global Environment Record, then + 1. If HasLexicalDeclaration(_varEnv_, _F_) is *false*, then + 1. Let _fnDefinable_ be ? CanDeclareGlobalVar(_varEnv_, _F_). + 1. Else, + 1. Let _fnDefinable_ be *false*. + 1. Else, + 1. Let _fnDefinable_ be *true*. + 1. If _bindingExists_ is *false* and _fnDefinable_ is *true*, then + 1. If _declaredFunctionOrVarNames_ does not contain _F_, then + 1. If _varEnv_ is a Global Environment Record, then + 1. Perform ? CreateGlobalVarBinding(_varEnv_, _F_, *true*). + 1. Else, + 1. Set _bindingExists_ to ! _varEnv_.HasBinding(_F_). + 1. If _bindingExists_ is *false*, then + 1. Perform ! _varEnv_.CreateMutableBinding(_F_, *true*). + 1. Perform ! _varEnv_.InitializeBinding(_F_, *undefined*). + 1. Append _F_ to _declaredFunctionOrVarNames_. + 1. [id="step-evaldeclarationinstantiation-alt-funcdecl-eval"] When the |FunctionDeclaration| _f_ is evaluated, perform the following steps in place of the |FunctionDeclaration| Evaluation algorithm provided in : + 1. Let _gEnv_ be the running execution context's VariableEnvironment. + 1. Let _bEnv_ be the running execution context's LexicalEnvironment. + 1. Let _fObj_ be ! _bEnv_.GetBindingValue(_F_, *false*). + 1. Perform ? _gEnv_.SetMutableBinding(_F_, _fObj_, *false*). + 1. Return ~unused~. 1. [id="step-evaldeclarationinstantiation-post-validation"] NOTE: No abnormal terminations occur after this algorithm step unless _varEnv_ is a Global Environment Record and the global object is a Proxy exotic object. 1. Let _lexDeclarations_ be the LexicallyScopedDeclarations of _body_. 1. For each element _d_ of _lexDeclarations_, do @@ -28993,7 +30040,7 @@

      1. Let _fn_ be the sole element of the BoundNames of _f_. 1. Let _fo_ be InstantiateFunctionObject of _f_ with arguments _lexEnv_ and _privateEnv_. 1. If _varEnv_ is a Global Environment Record, then - 1. Perform ? _varEnv_.CreateGlobalFunctionBinding(_fn_, _fo_, *true*). + 1. Perform ? CreateGlobalFunctionBinding(_varEnv_, _fn_, _fo_, *true*). 1. Else, 1. Let _bindingExists_ be ! _varEnv_.HasBinding(_fn_). 1. If _bindingExists_ is *false*, then @@ -29004,7 +30051,7 @@

      1. Perform ! _varEnv_.SetMutableBinding(_fn_, _fo_, *false*). 1. For each String _vn_ of _declaredVarNames_, do 1. If _varEnv_ is a Global Environment Record, then - 1. Perform ? _varEnv_.CreateGlobalVarBinding(_vn_, *true*). + 1. Perform ? CreateGlobalVarBinding(_varEnv_, _vn_, *true*). 1. Else, 1. Let _bindingExists_ be ! _varEnv_.HasBinding(_vn_). 1. If _bindingExists_ is *false*, then @@ -29013,38 +30060,35 @@

      1. Perform ! _varEnv_.InitializeBinding(_vn_, *undefined*). 1. Return ~unused~. - -

      An alternative version of this algorithm is described in .

      -
      - +

      isFinite ( _number_ )

      This function is the %isFinite% intrinsic object.

      It performs the following steps when called:

      1. Let _num_ be ? ToNumber(_number_). - 1. If _num_ is not finite, return *false*. - 1. Otherwise, return *true*. + 1. If _num_ is finite, return *true*. + 1. Return *false*.
      - +

      isNaN ( _number_ )

      This function is the %isNaN% intrinsic object.

      It performs the following steps when called:

      1. Let _num_ be ? ToNumber(_number_). 1. If _num_ is *NaN*, return *true*. - 1. Otherwise, return *false*. + 1. Return *false*.

      A reliable way for ECMAScript code to test if a value `X` is *NaN* is an expression of the form `X !== X`. The result will be *true* if and only if `X` is *NaN*.

      - +

      parseFloat ( _string_ )

      This function produces a Number value dictated by interpretation of the contents of the _string_ argument as a decimal literal.

      It is the %parseFloat% intrinsic object.

      @@ -29063,7 +30107,7 @@

      parseFloat ( _string_ )

      - +

      parseInt ( _string_, _radix_ )

      This function produces an integral Number dictated by interpretation of the contents of _string_ according to the specified _radix_. Leading white space in _string_ is ignored. If _radix_ coerces to 0 (such as when it is *undefined*), it is assumed to be 10 except when the number representation begins with *"0x"* or *"0X"*, in which case it is assumed to be 16. If _radix_ is 16, the number representation may optionally begin with *"0x"* or *"0X"*.

      It is the %parseInt% intrinsic object.

      @@ -29082,10 +30126,10 @@

      parseInt ( _string_, _radix_ )

      1. Else, 1. Set _R_ to 10. 1. If _stripPrefix_ is *true*, then - 1. If the length of _S_ is at least 2 and the first two code units of _S_ are either *"0x"* or *"0X"*, then + 1. If the length of _S_ ≥ 2 and the first two code units of _S_ are either *"0x"* or *"0X"*, then 1. Set _S_ to the substring of _S_ from index 2. 1. Set _R_ to 16. - 1. If _S_ contains a code unit that is not a radix-_R_ digit, let _end_ be the index within _S_ of the first such code unit; otherwise, let _end_ be the length of _S_. + 1. If _S_ contains a code unit that is not a radix-_R_ digit, let _end_ be the index within _S_ of the first such code unit; else let _end_ be the length of _S_. 1. Let _Z_ be the substring of _S_ from 0 to _end_. 1. If _Z_ is empty, return *NaN*. 1. Let _mathInt_ be the integer value that is represented by _Z_ in radix-_R_ notation, using the letters A through Z and a through z for digits with values 10 through 35. (However, if _R_ = 10 and _Z_ contains more than 20 significant digits, every significant digit after the 20th may be replaced by a 0 digit, at the option of the implementation; and if _R_ is not one of 2, 4, 8, 10, 16, or 32, then _mathInt_ may be an implementation-approximated integer representing the integer value denoted by _Z_ in radix-_R_ notation.) @@ -29109,7 +30153,7 @@

      URI Handling Functions

      Many implementations of ECMAScript provide additional functions and methods that manipulate web pages; these functions are beyond the scope of this standard.

      - +

      decodeURI ( _encodedURI_ )

      This function computes a new version of a URI in which each escape sequence and UTF-8 encoding of the sort that might be introduced by the `encodeURI` function is replaced with the UTF-16 encoding of the code point that it represents. Escape sequences that could not have been introduced by `encodeURI` are not replaced.

      It is the %decodeURI% intrinsic object.

      @@ -29121,7 +30165,7 @@

      decodeURI ( _encodedURI_ )

      - +

      decodeURIComponent ( _encodedURIComponent_ )

      This function computes a new version of a URI in which each escape sequence and UTF-8 encoding of the sort that might be introduced by the `encodeURIComponent` function is replaced with the UTF-16 encoding of the code point that it represents.

      It is the %decodeURIComponent% intrinsic object.

      @@ -29133,7 +30177,7 @@

      decodeURIComponent ( _encodedURIComponent_ )

      - +

      encodeURI ( _uri_ )

      This function computes a new version of a UTF-16 encoded () URI in which each instance of certain code points is replaced by one, two, three, or four escape sequences representing the UTF-8 encoding of the code point.

      It is the %encodeURI% intrinsic object.

      @@ -29145,7 +30189,7 @@

      encodeURI ( _uri_ )

      - +

      encodeURIComponent ( _uriComponent_ )

      This function computes a new version of a UTF-16 encoded () URI in which each instance of certain code points is replaced by one, two, three, or four escape sequences representing the UTF-8 encoding of the code point.

      It is the %encodeURIComponent% intrinsic object.

      @@ -29221,7 +30265,7 @@

      1. Let _n_ be the number of leading 1 bits in _B_. 1. If _n_ = 0, then 1. Let _asciiChar_ be the code unit whose numeric value is _B_. - 1. If _preserveEscapeSet_ contains _asciiChar_, set _S_ to _escape_. Otherwise, set _S_ to _asciiChar_. + 1. If _preserveEscapeSet_ contains _asciiChar_, set _S_ to _escape_; else set _S_ to _asciiChar_. 1. Else, 1. If _n_ = 1 or _n_ > 4, throw a *URIError* exception. 1. Let _Octets_ be « _B_ ». @@ -29331,11 +30375,16 @@

      EvalError ( . . . )

      See .

      - +

      FinalizationRegistry ( . . . )

      See .

      + +

      Float16Array ( . . . )

      +

      See .

      +
      +

      Float32Array ( . . . )

      See .

      @@ -29366,6 +30415,11 @@

      Int32Array ( . . . )

      See .

      + +

      Iterator ( . . . )

      +

      See .

      +
      +

      Map ( . . . )

      See .

      @@ -29436,7 +30490,7 @@

      TypeError ( . . . )

      See .

      - +

      Uint8Array ( . . . )

      See .

      @@ -29519,8 +30573,8 @@

      The Object Constructor

    • may be used as the value of an `extends` clause of a class definition.
    • - -

      Object ( [ _value_ ] )

      + +

      Object ( _value_ )

      This function performs the following steps when called:

      1. If NewTarget is neither *undefined* nor the active function object, then @@ -29536,11 +30590,10 @@

      Properties of the Object Constructor

      The Object constructor:

      • has a [[Prototype]] internal slot whose value is %Function.prototype%.
      • -
      • has a *"length"* property whose value is *1*𝔽.
      • has the following additional properties:
      - +

      Object.assign ( _target_, ..._sources_ )

      This function copies the values of all of the enumerable own properties from one or more source objects to a _target_ object.

      It performs the following steps when called:

      @@ -29552,7 +30605,7 @@

      Object.assign ( _target_, ..._sources_ )

      1. Let _from_ be ! ToObject(_nextSource_). 1. Let _keys_ be ? _from_.[[OwnPropertyKeys]](). 1. For each element _nextKey_ of _keys_, do - 1. Let _desc_ be ? _from_.[[GetOwnProperty]](_nextKey_). + 1. Let _desc_ be ? _from_.[[GetOwnProperty]](_nextKey_). 1. If _desc_ is not *undefined* and _desc_.[[Enumerable]] is *true*, then 1. Let _propValue_ be ? Get(_from_, _nextKey_). 1. Perform ? Set(_to_, _nextKey_, _propValue_, *true*). @@ -29561,7 +30614,7 @@

      Object.assign ( _target_, ..._sources_ )

      The *"length"* property of this function is *2*𝔽.

      - +

      Object.create ( _O_, _Properties_ )

      This function creates a new object with a specified prototype.

      It performs the following steps when called:

      @@ -29574,7 +30627,7 @@

      Object.create ( _O_, _Properties_ )

      - +

      Object.defineProperties ( _O_, _Properties_ )

      This function adds own properties and/or updates the attributes of existing own properties of an object.

      It performs the following steps when called:

      @@ -29597,7 +30650,7 @@

      1. Let _keys_ be ? _props_.[[OwnPropertyKeys]](). 1. Let _descriptors_ be a new empty List. 1. For each element _nextKey_ of _keys_, do - 1. Let _propDesc_ be ? _props_.[[GetOwnProperty]](_nextKey_). + 1. Let _propDesc_ be ? _props_.[[GetOwnProperty]](_nextKey_). 1. If _propDesc_ is not *undefined* and _propDesc_.[[Enumerable]] is *true*, then 1. Let _descObj_ be ? Get(_props_, _nextKey_). 1. Let _desc_ be ? ToPropertyDescriptor(_descObj_). @@ -29609,7 +30662,7 @@

      - +

      Object.defineProperty ( _O_, _P_, _Attributes_ )

      This function adds an own property and/or updates the attributes of an existing own property of an object.

      It performs the following steps when called:

      @@ -29622,7 +30675,7 @@

      Object.defineProperty ( _O_, _P_, _Attributes_ )

      - +

      Object.entries ( _O_ )

      This function performs the following steps when called:

      @@ -29632,7 +30685,7 @@

      Object.entries ( _O_ )

      - +

      Object.freeze ( _O_ )

      This function performs the following steps when called:

      @@ -29643,7 +30696,7 @@

      Object.freeze ( _O_ )

      - +

      Object.fromEntries ( _iterable_ )

      This function performs the following steps when called:

      @@ -29653,7 +30706,7 @@

      Object.fromEntries ( _iterable_ )

      1. Let _closure_ be a new Abstract Closure with parameters (_key_, _value_) that captures _obj_ and performs the following steps when called: 1. Let _propertyKey_ be ? ToPropertyKey(_key_). 1. Perform ! CreateDataPropertyOrThrow(_obj_, _propertyKey_, _value_). - 1. Return *undefined*. + 1. Return NormalCompletion(*undefined*). 1. Let _adder_ be CreateBuiltinFunction(_closure_, 2, *""*, « »). 1. Return ? AddEntriesFromIterable(_obj_, _iterable_, _adder_).
      @@ -29662,18 +30715,18 @@

      Object.fromEntries ( _iterable_ )

      - +

      Object.getOwnPropertyDescriptor ( _O_, _P_ )

      This function performs the following steps when called:

      1. Let _obj_ be ? ToObject(_O_). 1. Let _key_ be ? ToPropertyKey(_P_). - 1. Let _desc_ be ? _obj_.[[GetOwnProperty]](_key_). + 1. Let _desc_ be ? _obj_.[[GetOwnProperty]](_key_). 1. Return FromPropertyDescriptor(_desc_).
      - +

      Object.getOwnPropertyDescriptors ( _O_ )

      This function performs the following steps when called:

      @@ -29681,14 +30734,14 @@

      Object.getOwnPropertyDescriptors ( _O_ )

      1. Let _ownKeys_ be ? _obj_.[[OwnPropertyKeys]](). 1. Let _descriptors_ be OrdinaryObjectCreate(%Object.prototype%). 1. For each element _key_ of _ownKeys_, do - 1. Let _desc_ be ? _obj_.[[GetOwnProperty]](_key_). + 1. Let _desc_ be ? _obj_.[[GetOwnProperty]](_key_). 1. Let _descriptor_ be FromPropertyDescriptor(_desc_). 1. If _descriptor_ is not *undefined*, perform ! CreateDataPropertyOrThrow(_descriptors_, _key_, _descriptor_). 1. Return _descriptors_.
      - +

      Object.getOwnPropertyNames ( _O_ )

      This function performs the following steps when called:

      @@ -29696,7 +30749,7 @@

      Object.getOwnPropertyNames ( _O_ )

      - +

      Object.getOwnPropertySymbols ( _O_ )

      This function performs the following steps when called:

      @@ -29724,7 +30777,7 @@

      - +

      Object.getPrototypeOf ( _O_ )

      This function performs the following steps when called:

      @@ -29733,16 +30786,16 @@

      Object.getPrototypeOf ( _O_ )

      - -

      Object.groupBy ( _items_, _callbackfn_ )

      + +

      Object.groupBy ( _items_, _callback_ )

      -

      _callbackfn_ should be a function that accepts two arguments. `groupBy` calls _callbackfn_ once for each element in _items_, in ascending order, and constructs a new object. Each value returned by _callbackfn_ is coerced to a property key. For each such property key, the result object has a property whose key is that property key and whose value is an array containing all the elements for which the _callbackfn_ return value coerced to that key.

      -

      _callbackfn_ is called with two arguments: the value of the element and the index of the element.

      +

      _callback_ should be a function that accepts two arguments. `groupBy` calls _callback_ once for each element in _items_, in ascending order, and constructs a new object. Each value returned by _callback_ is coerced to a property key. For each such property key, the result object has a property whose key is that property key and whose value is an array containing all the elements for which the _callback_ return value coerced to that key.

      +

      _callback_ is called with two arguments: the value of the element and the index of the element.

      The return value of `groupBy` is an object that does not inherit from %Object.prototype%.

      This function performs the following steps when called:

      - 1. Let _groups_ be ? GroupBy(_items_, _callbackfn_, ~property~). + 1. Let _groups_ be ? GroupBy(_items_, _callback_, ~property~). 1. Let _obj_ be OrdinaryObjectCreate(*null*). 1. For each Record { [[Key]], [[Elements]] } _g_ of _groups_, do 1. Let _elements_ be CreateArrayFromList(_g_.[[Elements]]). @@ -29751,7 +30804,7 @@

      Object.groupBy ( _items_, _callbackfn_ )

      - +

      Object.hasOwn ( _O_, _P_ )

      This function performs the following steps when called:

      @@ -29761,7 +30814,7 @@

      Object.hasOwn ( _O_, _P_ )

      - +

      Object.is ( _value1_, _value2_ )

      This function performs the following steps when called:

      @@ -29769,7 +30822,7 @@

      Object.is ( _value1_, _value2_ )

      - +

      Object.isExtensible ( _O_ )

      This function performs the following steps when called:

      @@ -29778,7 +30831,7 @@

      Object.isExtensible ( _O_ )

      - +

      Object.isFrozen ( _O_ )

      This function performs the following steps when called:

      @@ -29787,7 +30840,7 @@

      Object.isFrozen ( _O_ )

      - +

      Object.isSealed ( _O_ )

      This function performs the following steps when called:

      @@ -29796,7 +30849,7 @@

      Object.isSealed ( _O_ )

      - +

      Object.keys ( _O_ )

      This function performs the following steps when called:

      @@ -29806,7 +30859,7 @@

      Object.keys ( _O_ )

      - +

      Object.preventExtensions ( _O_ )

      This function performs the following steps when called:

      @@ -29823,7 +30876,7 @@

      Object.prototype

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      - +

      Object.seal ( _O_ )

      This function performs the following steps when called:

      @@ -29834,20 +30887,20 @@

      Object.seal ( _O_ )

      - +

      Object.setPrototypeOf ( _O_, _proto_ )

      This function performs the following steps when called:

      - 1. Set _O_ to ? RequireObjectCoercible(_O_). + 1. Perform ? RequireObjectCoercible(_O_). 1. If _proto_ is not an Object and _proto_ is not *null*, throw a *TypeError* exception. 1. If _O_ is not an Object, return _O_. - 1. Let _status_ be ? _O_.[[SetPrototypeOf]](_proto_). + 1. Let _status_ be ? _O_.[[SetPrototypeOf]](_proto_). 1. If _status_ is *false*, throw a *TypeError* exception. 1. Return _O_.
      - +

      Object.values ( _O_ )

      This function performs the following steps when called:

      @@ -29873,7 +30926,7 @@

      Object.prototype.constructor

      The initial value of `Object.prototype.constructor` is %Object%.

      - +

      Object.prototype.hasOwnProperty ( _V_ )

      This method performs the following steps when called:

      @@ -29886,7 +30939,7 @@

      Object.prototype.hasOwnProperty ( _V_ )

      - +

      Object.prototype.isPrototypeOf ( _V_ )

      This method performs the following steps when called:

      @@ -29902,13 +30955,13 @@

      Object.prototype.isPrototypeOf ( _V_ )

      - +

      Object.prototype.propertyIsEnumerable ( _V_ )

      This method performs the following steps when called:

      1. [id="step-propertyisenumerable-topropertykey"] Let _P_ be ? ToPropertyKey(_V_). 1. [id="step-propertyisenumerable-toobject"] Let _O_ be ? ToObject(*this* value). - 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_P_). + 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_P_). 1. If _desc_ is *undefined*, return *false*. 1. Return _desc_.[[Enumerable]]. @@ -29920,7 +30973,7 @@

      Object.prototype.propertyIsEnumerable ( _V_ )

      - +

      Object.prototype.toLocaleString ( [ _reserved1_ [ , _reserved2_ ] ] )

      This method performs the following steps when called:

      @@ -29936,7 +30989,7 @@

      Object.prototype.toLocaleString ( [ _reserved1_ [ , _reserved2_ ] ] )

      - +

      Object.prototype.toString ( )

      This method performs the following steps when called:

      @@ -29954,16 +31007,16 @@

      Object.prototype.toString ( )

      1. Else if _O_ has a [[DateValue]] internal slot, let _builtinTag_ be *"Date"*. 1. Else if _O_ has a [[RegExpMatcher]] internal slot, let _builtinTag_ be *"RegExp"*. 1. Else, let _builtinTag_ be *"Object"*. - 1. Let _tag_ be ? Get(_O_, @@toStringTag). + 1. Let _tag_ be ? Get(_O_, %Symbol.toStringTag%). 1. If _tag_ is not a String, set _tag_ to _builtinTag_. 1. Return the string-concatenation of *"[object "*, _tag_, and *"]"*.
      -

      Historically, this method was occasionally used to access the String value of the [[Class]] internal slot that was used in previous editions of this specification as a nominal type tag for various built-in objects. The above definition of `toString` preserves compatibility for legacy code that uses `toString` as a test for those specific kinds of built-in objects. It does not provide a reliable type testing mechanism for other kinds of built-in or program defined objects. In addition, programs can use @@toStringTag in ways that will invalidate the reliability of such legacy type tests.

      +

      Historically, this method was occasionally used to access the String value of the [[Class]] internal slot that was used in previous editions of this specification as a nominal type tag for various built-in objects. The above definition of `toString` preserves compatibility for legacy code that uses `toString` as a test for those specific kinds of built-in objects. It does not provide a reliable type testing mechanism for other kinds of built-in or program defined objects. In addition, programs can use %Symbol.toStringTag% in ways that will invalidate the reliability of such legacy type tests.

      - +

      Object.prototype.valueOf ( )

      This method performs the following steps when called:

      @@ -29975,7 +31028,7 @@

      Object.prototype.valueOf ( )

      Object.prototype.__proto__

      `Object.prototype.__proto__` is an accessor property with attributes { [[Enumerable]]: *false*, [[Configurable]]: *true* }. The [[Get]] and [[Set]] attributes are defined as follows:

      - +

      get Object.prototype.__proto__

      The value of the [[Get]] attribute is a built-in function that requires no arguments. It performs the following steps when called:

      @@ -29984,14 +31037,15 @@

      get Object.prototype.__proto__

      - +

      set Object.prototype.__proto__

      The value of the [[Set]] attribute is a built-in function that takes an argument _proto_. It performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. If _proto_ is not an Object and _proto_ is not *null*, return *undefined*. 1. If _O_ is not an Object, return *undefined*. - 1. Let _status_ be ? _O_.[[SetPrototypeOf]](_proto_). + 1. Let _status_ be ? _O_.[[SetPrototypeOf]](_proto_). 1. If _status_ is *false*, throw a *TypeError* exception. 1. Return *undefined*. @@ -30001,7 +31055,7 @@

      set Object.prototype.__proto__

      Legacy Object.prototype Accessor Methods

      - +

      Object.prototype.__defineGetter__ ( _P_, _getter_ )

      This method performs the following steps when called:

      @@ -30014,7 +31068,7 @@

      Object.prototype.__defineGetter__ ( _P_, _getter_ )

      - +

      Object.prototype.__defineSetter__ ( _P_, _setter_ )

      This method performs the following steps when called:

      @@ -30027,14 +31081,14 @@

      Object.prototype.__defineSetter__ ( _P_, _setter_ )

      - +

      Object.prototype.__lookupGetter__ ( _P_ )

      This method performs the following steps when called:

      1. Let _O_ be ? ToObject(*this* value). 1. Let _key_ be ? ToPropertyKey(_P_). 1. Repeat, - 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_key_). + 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_key_). 1. If _desc_ is not *undefined*, then 1. If IsAccessorDescriptor(_desc_) is *true*, return _desc_.[[Get]]. 1. Return *undefined*. @@ -30043,14 +31097,14 @@

      Object.prototype.__lookupGetter__ ( _P_ )

      - +

      Object.prototype.__lookupSetter__ ( _P_ )

      This method performs the following steps when called:

      1. Let _O_ be ? ToObject(*this* value). 1. Let _key_ be ? ToPropertyKey(_P_). 1. Repeat, - 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_key_). + 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_key_). 1. If _desc_ is not *undefined*, then 1. If IsAccessorDescriptor(_desc_) is *true*, return _desc_.[[Set]]. 1. Return *undefined*. @@ -30080,7 +31134,7 @@

      The Function Constructor

    • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified Function behaviour must include a `super` call to the Function constructor to create and initialize a subclass instance with the internal slots necessary for built-in function behaviour. All ECMAScript syntactic forms for defining function objects create instances of Function. There is no syntactic means to create instances of Function subclasses except for the built-in GeneratorFunction, AsyncFunction, and AsyncGeneratorFunction subclasses.
    • - +

      Function ( ..._parameterArgs_, _bodyArg_ )

      The last argument (if any) specifies the body (executable code) of a function; any preceding arguments specify formal parameters.

      This function performs the following steps when called:

      @@ -30102,7 +31156,7 @@

      Function ( ..._parameterArgs_, _bodyArg_ )

      CreateDynamicFunction ( _constructor_: a constructor, - _newTarget_: a constructor, + _newTarget_: a constructor or *undefined*, _kind_: ~normal~, ~generator~, ~async~, or ~async-generator~, _parameterArgs_: a List of ECMAScript language values, _bodyArg_: an ECMAScript language value, @@ -30171,14 +31225,14 @@

      1. Let _F_ be OrdinaryFunctionCreate(_proto_, _sourceText_, _parameters_, _body_, ~non-lexical-this~, _env_, _privateEnv_). 1. Perform SetFunctionName(_F_, *"anonymous"*). 1. If _kind_ is ~generator~, then - 1. Let _prototype_ be OrdinaryObjectCreate(%GeneratorFunction.prototype.prototype%). + 1. Let _prototype_ be OrdinaryObjectCreate(%GeneratorPrototype%). 1. Perform ! DefinePropertyOrThrow(_F_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Else if _kind_ is ~async-generator~, then - 1. Let _prototype_ be OrdinaryObjectCreate(%AsyncGeneratorFunction.prototype.prototype%). + 1. Let _prototype_ be OrdinaryObjectCreate(%AsyncGeneratorPrototype%). 1. Perform ! DefinePropertyOrThrow(_F_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Else if _kind_ is ~normal~, then 1. Perform MakeConstructor(_F_). - 1. NOTE: Functions whose _kind_ is ~async~ are not constructible and do not have a [[Construct]] internal method or a *"prototype"* property. + 1. NOTE: Functions whose _kind_ is ~async~ are not constructable and do not have a [[Construct]] internal method or a *"prototype"* property. 1. Return _F_. @@ -30222,7 +31276,7 @@

      Properties of the Function Prototype Object

      The Function prototype object is specified to be a function object to ensure compatibility with ECMAScript code that was created prior to the ECMAScript 2015 specification.

      - +

      Function.prototype.apply ( _thisArg_, _argArray_ )

      This method performs the following steps when called:

      @@ -30243,7 +31297,7 @@

      Function.prototype.apply ( _thisArg_, _argArray_ )

      - +

      Function.prototype.bind ( _thisArg_, ..._args_ )

      This method performs the following steps when called:

      @@ -30278,7 +31332,7 @@

      Function.prototype.bind ( _thisArg_, ..._args_ )

      - +

      Function.prototype.call ( _thisArg_, ..._args_ )

      This method performs the following steps when called:

      @@ -30300,14 +31354,14 @@

      Function.prototype.constructor

      The initial value of `Function.prototype.constructor` is %Function%.

      - +

      Function.prototype.toString ( )

      This method performs the following steps when called:

      1. Let _func_ be the *this* value. 1. If _func_ is an Object, _func_ has a [[SourceText]] internal slot, _func_.[[SourceText]] is a sequence of Unicode code points, and HostHasSourceTextAvailable(_func_) is *true*, then 1. Return CodePointsToString(_func_.[[SourceText]]). - 1. If _func_ is a built-in function object, return an implementation-defined String source code representation of _func_. The representation must have the syntax of a |NativeFunction|. Additionally, if _func_ has an [[InitialName]] internal slot and _func_.[[InitialName]] is a String, the portion of the returned String that would be matched by |NativeFunctionAccessor?| |PropertyName| must be the value of _func_.[[InitialName]]. + 1. If _func_ is a built-in function object, return an implementation-defined String source code representation of _func_. The representation must have the syntax of a |NativeFunction|. Additionally, if _func_ has an [[InitialName]] internal slot and _func_.[[InitialName]] is a String, the portion of the returned String that would be matched by |NativeFunctionAccessor?| |PropertyName| must be _func_.[[InitialName]]. 1. If _func_ is an Object and IsCallable(_func_) is *true*, return an implementation-defined String source code representation of _func_. The representation must have the syntax of a |NativeFunction|. 1. Throw a *TypeError* exception. @@ -30322,8 +31376,8 @@

      Function.prototype.toString ( )

      - -

      Function.prototype [ @@hasInstance ] ( _V_ )

      + +

      Function.prototype [ %Symbol.hasInstance% ] ( _V_ )

      This method performs the following steps when called:

      1. Let _F_ be the *this* value. @@ -30331,15 +31385,15 @@

      Function.prototype [ @@hasInstance ] ( _V_ )

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      -

      This is the default implementation of `@@hasInstance` that most functions inherit. `@@hasInstance` is called by the `instanceof` operator to determine whether a value is an instance of a specific constructor. An expression such as

      +

      This is the default implementation of `%Symbol.hasInstance%` that most functions inherit. `%Symbol.hasInstance%` is called by the `instanceof` operator to determine whether a value is an instance of a specific constructor. An expression such as

      
                   v instanceof F
                 

      evaluates as

      
      -            F[@@hasInstance](v)
      +            F[%Symbol.hasInstance%](v)
                 
      -

      A constructor function can control which objects are recognized as its instances by `instanceof` by exposing a different `@@hasInstance` method on the function.

      +

      A constructor function can control which objects are recognized as its instances by `instanceof` by exposing a different `%Symbol.hasInstance%` method on the function.

      This property is non-writable and non-configurable to prevent tampering that could be used to globally expose the target function of a bound function.

      The value of the *"name"* property of this method is *"[Symbol.hasInstance]"*.

      @@ -30359,7 +31413,7 @@

      length

      name

      The value of the *"name"* property is a String that is descriptive of the function. The name has no semantic significance but is typically a variable or property name that is used to refer to the function at its point of definition in ECMAScript source text. This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

      -

      Anonymous functions objects that do not have a contextual name associated with them by this specification use the empty String as the value of the *"name"* property.

      +

      Anonymous function objects that do not have a contextual name associated with them by this specification use the empty String as the value of the *"name"* property.

      @@ -30404,7 +31458,7 @@

      The Boolean Constructor

    • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified Boolean behaviour must include a `super` call to the Boolean constructor to create and initialize the subclass instance with a [[BooleanData]] internal slot.
    • - +

      Boolean ( _value_ )

      This function performs the following steps when called:

      @@ -30447,16 +31501,17 @@

      Boolean.prototype.constructor

      The initial value of `Boolean.prototype.constructor` is %Boolean%.

      - +

      Boolean.prototype.toString ( )

      This method performs the following steps when called:

      1. Let _b_ be ? ThisBooleanValue(*this* value). - 1. If _b_ is *true*, return *"true"*; else return *"false"*. + 1. If _b_ is *true*, return *"true"*. + 1. Return *"false"*.
      - +

      Boolean.prototype.valueOf ( )

      This method performs the following steps when called:

      @@ -30504,7 +31559,7 @@

      The Symbol Constructor

    • may be used as the value of an `extends` clause of a class definition but a `super` call to it will cause an exception.
    • - +

      Symbol ( [ _description_ ] )

      This function performs the following steps when called:

      @@ -30526,36 +31581,38 @@

      Properties of the Symbol Constructor

      Symbol.asyncIterator

      -

      The initial value of `Symbol.asyncIterator` is the well-known symbol @@asyncIterator ().

      +

      The initial value of `Symbol.asyncIterator` is the well-known symbol %Symbol.asyncIterator% ().

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      - +

      Symbol.for ( _key_ )

      This function performs the following steps when called:

      1. Let _stringKey_ be ? ToString(_key_). 1. For each element _e_ of the GlobalSymbolRegistry List, do 1. If _e_.[[Key]] is _stringKey_, return _e_.[[Symbol]]. - 1. Assert: GlobalSymbolRegistry does not currently contain an entry for _stringKey_. + 1. Assert: The GlobalSymbolRegistry List does not currently contain an entry for _stringKey_. 1. Let _newSymbol_ be a new Symbol whose [[Description]] is _stringKey_. - 1. Append the Record { [[Key]]: _stringKey_, [[Symbol]]: _newSymbol_ } to the GlobalSymbolRegistry List. + 1. Append the GlobalSymbolRegistry Record { [[Key]]: _stringKey_, [[Symbol]]: _newSymbol_ } to the GlobalSymbolRegistry List. 1. Return _newSymbol_. -

      The GlobalSymbolRegistry is an append-only List that is globally available. It is shared by all realms. Prior to the evaluation of any ECMAScript code, it is initialized as a new empty List. Elements of the GlobalSymbolRegistry are Records with the structure defined in .

      +

      The GlobalSymbolRegistry List is an append-only List that is globally available. It is shared by all realms. Prior to the evaluation of any ECMAScript code, it is initialized as a new empty List. Elements of the GlobalSymbolRegistry List are Records with the structure defined in .

      - - - - - + + + + + + +
      - Field Name - - Value - - Usage -
      + Field Name + + Value + + Usage +
      [[Key]] @@ -30584,23 +31641,23 @@

      Symbol.for ( _key_ )

      Symbol.hasInstance

      -

      The initial value of `Symbol.hasInstance` is the well-known symbol @@hasInstance ().

      +

      The initial value of `Symbol.hasInstance` is the well-known symbol %Symbol.hasInstance% ().

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      Symbol.isConcatSpreadable

      -

      The initial value of `Symbol.isConcatSpreadable` is the well-known symbol @@isConcatSpreadable ().

      +

      The initial value of `Symbol.isConcatSpreadable` is the well-known symbol %Symbol.isConcatSpreadable% ().

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      Symbol.iterator

      -

      The initial value of `Symbol.iterator` is the well-known symbol @@iterator ().

      +

      The initial value of `Symbol.iterator` is the well-known symbol %Symbol.iterator% ().

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      - +

      Symbol.keyFor ( _sym_ )

      This function performs the following steps when called:

      @@ -30611,13 +31668,13 @@

      Symbol.keyFor ( _sym_ )

      Symbol.match

      -

      The initial value of `Symbol.match` is the well-known symbol @@match ().

      +

      The initial value of `Symbol.match` is the well-known symbol %Symbol.match% ().

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      Symbol.matchAll

      -

      The initial value of `Symbol.matchAll` is the well-known symbol @@matchAll ().

      +

      The initial value of `Symbol.matchAll` is the well-known symbol %Symbol.matchAll% ().

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      @@ -30629,43 +31686,43 @@

      Symbol.prototype

      Symbol.replace

      -

      The initial value of `Symbol.replace` is the well-known symbol @@replace ().

      +

      The initial value of `Symbol.replace` is the well-known symbol %Symbol.replace% ().

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      Symbol.search

      -

      The initial value of `Symbol.search` is the well-known symbol @@search ().

      +

      The initial value of `Symbol.search` is the well-known symbol %Symbol.search% ().

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      Symbol.species

      -

      The initial value of `Symbol.species` is the well-known symbol @@species ().

      +

      The initial value of `Symbol.species` is the well-known symbol %Symbol.species% ().

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      Symbol.split

      -

      The initial value of `Symbol.split` is the well-known symbol @@split ().

      +

      The initial value of `Symbol.split` is the well-known symbol %Symbol.split% ().

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      Symbol.toPrimitive

      -

      The initial value of `Symbol.toPrimitive` is the well-known symbol @@toPrimitive ().

      +

      The initial value of `Symbol.toPrimitive` is the well-known symbol %Symbol.toPrimitive% ().

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      Symbol.toStringTag

      -

      The initial value of `Symbol.toStringTag` is the well-known symbol @@toStringTag ().

      +

      The initial value of `Symbol.toStringTag` is the well-known symbol %Symbol.toStringTag% ().

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      Symbol.unscopables

      -

      The initial value of `Symbol.unscopables` is the well-known symbol @@unscopables ().

      +

      The initial value of `Symbol.unscopables` is the well-known symbol %Symbol.unscopables% ().

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      @@ -30685,7 +31742,7 @@

      Symbol.prototype.constructor

      The initial value of `Symbol.prototype.constructor` is %Symbol%.

      - +

      get Symbol.prototype.description

      `Symbol.prototype.description` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

      @@ -30695,7 +31752,7 @@

      get Symbol.prototype.description

      - +

      Symbol.prototype.toString ( )

      This method performs the following steps when called:

      @@ -30712,7 +31769,7 @@

      - 1. Let _desc_ be _sym_'s [[Description]] value. + 1. Let _desc_ be _sym_.[[Description]]. 1. If _desc_ is *undefined*, set _desc_ to the empty String. 1. Assert: _desc_ is a String. 1. Return the string-concatenation of *"Symbol("*, _desc_, and *")"*. @@ -30720,7 +31777,7 @@

      - +

      Symbol.prototype.valueOf ( )

      This method performs the following steps when called:

      @@ -30746,8 +31803,8 @@

      - -

      Symbol.prototype [ @@toPrimitive ] ( _hint_ )

      + +

      Symbol.prototype [ %Symbol.toPrimitive% ] ( _hint_ )

      This method is called by ECMAScript language operators to convert a Symbol object to a primitive value.

      It performs the following steps when called:

      @@ -30760,9 +31817,9 @@

      Symbol.prototype [ @@toPrimitive ] ( _hint_ )

      The value of the *"name"* property of this method is *"[Symbol.toPrimitive]"*.

      - -

      Symbol.prototype [ @@toStringTag ]

      -

      The initial value of the @@toStringTag property is the String value *"Symbol"*.

      + +

      Symbol.prototype [ %Symbol.toStringTag% ]

      +

      The initial value of the %Symbol.toStringTag% property is the String value *"Symbol"*.

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

      @@ -30783,12 +31840,12 @@

      description
      -
      If _sym_ is in the GlobalSymbolRegistry (see ) the String used to register _sym_ will be returned.
      +
      If _sym_ is in the GlobalSymbolRegistry List, the String used to register _sym_ will be returned.
      1. For each element _e_ of the GlobalSymbolRegistry List, do 1. If SameValue(_e_.[[Symbol]], _sym_) is *true*, return _e_.[[Key]]. - 1. Assert: GlobalSymbolRegistry does not currently contain an entry for _sym_. + 1. Assert: The GlobalSymbolRegistry List does not currently contain an entry for _sym_. 1. Return *undefined*.
      @@ -30810,7 +31867,7 @@

      The Error Constructor

    • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified Error behaviour must include a `super` call to the Error constructor to create and initialize subclass instances with an [[ErrorData]] internal slot.
    • - +

      Error ( _message_ [ , _options_ ] )

      This function performs the following steps when called:

      @@ -30833,6 +31890,16 @@

      Properties of the Error Constructor

    • has the following properties:
    • + +

      Error.isError ( _arg_ )

      +

      This function performs the following steps when called:

      + + 1. If _arg_ is not an Object, return *false*. + 1. If _arg_ does not have an [[ErrorData]] internal slot, return *false*. + 1. Return *true*. + +
      +

      Error.prototype

      The initial value of `Error.prototype` is the Error prototype object.

      @@ -30865,16 +31932,16 @@

      Error.prototype.name

      The initial value of `Error.prototype.name` is *"Error"*.

      - +

      Error.prototype.toString ( )

      This method performs the following steps when called:

      1. Let _O_ be the *this* value. 1. If _O_ is not an Object, throw a *TypeError* exception. 1. Let _name_ be ? Get(_O_, *"name"*). - 1. If _name_ is *undefined*, set _name_ to *"Error"*; otherwise set _name_ to ? ToString(_name_). + 1. If _name_ is *undefined*, set _name_ to *"Error"*; else set _name_ to ? ToString(_name_). 1. Let _msg_ be ? Get(_O_, *"message"*). - 1. If _msg_ is *undefined*, set _msg_ to the empty String; otherwise set _msg_ to ? ToString(_msg_). + 1. If _msg_ is *undefined*, set _msg_ to the empty String; else set _msg_ to ? ToString(_msg_). 1. If _name_ is the empty String, return _msg_. 1. If _msg_ is the empty String, return _name_. 1. Return the string-concatenation of _name_, the code unit 0x003A (COLON), the code unit 0x0020 (SPACE), and _msg_. @@ -30884,7 +31951,7 @@

      Error.prototype.toString ( )

      Properties of Error Instances

      -

      Error instances are ordinary objects that inherit properties from the Error prototype object and have an [[ErrorData]] internal slot whose value is *undefined*. The only specified uses of [[ErrorData]] is to identify Error, AggregateError, and _NativeError_ instances as Error objects within `Object.prototype.toString`.

      +

      Error instances are ordinary objects that inherit properties from the Error prototype object and have an [[ErrorData]] internal slot whose value is *undefined*. The only specified use of [[ErrorData]] is to identify Error, AggregateError, and _NativeError_ instances as Error objects within `Object.prototype.toString` and `Error.isError`.

      @@ -30941,19 +32008,19 @@

      The _NativeError_ Constructors

    • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified _NativeError_ behaviour must include a `super` call to the _NativeError_ constructor to create and initialize subclass instances with an [[ErrorData]] internal slot.
    • - +

      _NativeError_ ( _message_ [ , _options_ ] )

      Each _NativeError_ function performs the following steps when called:

      1. If NewTarget is *undefined*, let _newTarget_ be the active function object; else let _newTarget_ be NewTarget. - 1. [id="step-nativerror-ordinarycreatefromconstructor"] Let _O_ be ? OrdinaryCreateFromConstructor(_newTarget_, "%NativeError.prototype%", « [[ErrorData]] »). + 1. [id="step-nativeerror-ordinarycreatefromconstructor"] Let _O_ be ? OrdinaryCreateFromConstructor(_newTarget_, "%NativeError.prototype%", « [[ErrorData]] »). 1. If _message_ is not *undefined*, then 1. Let _msg_ be ? ToString(_message_). 1. Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"message"*, _msg_). 1. Perform ? InstallErrorCause(_O_, _options_). 1. Return _O_. -

      The actual value of the string passed in step is either *"%EvalError.prototype%"*, *"%RangeError.prototype%"*, *"%ReferenceError.prototype%"*, *"%SyntaxError.prototype%"*, *"%TypeError.prototype%"*, or *"%URIError.prototype%"* corresponding to which _NativeError_ constructor is being defined.

      +

      The actual value of the string passed in step is either *"%EvalError.prototype%"*, *"%RangeError.prototype%"*, *"%ReferenceError.prototype%"*, *"%SyntaxError.prototype%"*, *"%TypeError.prototype%"*, or *"%URIError.prototype%"* corresponding to which _NativeError_ constructor is being defined.

      @@ -31000,7 +32067,7 @@

      _NativeError_.prototype.name

      Properties of _NativeError_ Instances

      -

      _NativeError_ instances are ordinary objects that inherit properties from their _NativeError_ prototype object and have an [[ErrorData]] internal slot whose value is *undefined*. The only specified use of [[ErrorData]] is by `Object.prototype.toString` () to identify Error, AggregateError, or _NativeError_ instances.

      +

      _NativeError_ instances are ordinary objects that inherit properties from their _NativeError_ prototype object and have an [[ErrorData]] internal slot whose value is *undefined*. The only specified use of [[ErrorData]] is by `Object.prototype.toString` () and `Error.isError` () to identify Error, AggregateError, or _NativeError_ instances.

      @@ -31017,7 +32084,7 @@

      The AggregateError Constructor

    • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified AggregateError behaviour must include a `super` call to the AggregateError constructor to create and initialize subclass instances with an [[ErrorData]] internal slot.
    • - +

      AggregateError ( _errors_, _message_ [ , _options_ ] )

      This function performs the following steps when called:

      @@ -31077,7 +32144,7 @@

      AggregateError.prototype.name

      Properties of AggregateError Instances

      -

      AggregateError instances are ordinary objects that inherit properties from their AggregateError prototype object and have an [[ErrorData]] internal slot whose value is *undefined*. The only specified use of [[ErrorData]] is by `Object.prototype.toString` () to identify Error, AggregateError, or _NativeError_ instances.

      +

      AggregateError instances are ordinary objects that inherit properties from their AggregateError prototype object and have an [[ErrorData]] internal slot whose value is *undefined*. The only specified use of [[ErrorData]] is by `Object.prototype.toString` () and `Error.isError` () to identify Error, AggregateError, or _NativeError_ instances.

      @@ -31123,14 +32190,14 @@

      The Number Constructor

    • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified Number behaviour must include a `super` call to the Number constructor to create and initialize the subclass instance with a [[NumberData]] internal slot.
    • - +

      Number ( _value_ )

      This function performs the following steps when called:

      1. If _value_ is present, then 1. Let _prim_ be ? ToNumeric(_value_). 1. If _prim_ is a BigInt, let _n_ be 𝔽(ℝ(_prim_)). - 1. Otherwise, let _n_ be _prim_. + 1. Else, let _n_ be _prim_. 1. Else, 1. Let _n_ be *+0*𝔽. 1. If NewTarget is *undefined*, return _n_. @@ -31155,45 +32222,46 @@

      Number.EPSILON

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      - +

      Number.isFinite ( _number_ )

      This function performs the following steps when called:

      1. If _number_ is not a Number, return *false*. 1. If _number_ is not finite, return *false*. - 1. Otherwise, return *true*. + 1. Return *true*.
      - +

      Number.isInteger ( _number_ )

      This function performs the following steps when called:

      - 1. Return IsIntegralNumber(_number_). + 1. If _number_ is an integral Number, return *true*. + 1. Return *false*.
      - +

      Number.isNaN ( _number_ )

      This function performs the following steps when called:

      1. If _number_ is not a Number, return *false*. 1. If _number_ is *NaN*, return *true*. - 1. Otherwise, return *false*. + 1. Return *false*.

      This function differs from the global isNaN function () in that it does not convert its argument to a Number before determining whether it is *NaN*.

      - +

      Number.isSafeInteger ( _number_ )

      An integer _n_ is a "safe integer" if and only if the Number value for _n_ is not the Number value for any other integer.

      This function performs the following steps when called:

      - 1. If IsIntegralNumber(_number_) is *true*, then + 1. If _number_ is an integral Number, then 1. If abs(ℝ(_number_)) ≤ 253 - 1, return *true*. 1. Return *false*. @@ -31242,12 +32310,12 @@

      Number.NEGATIVE_INFINITY

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      - +

      Number.parseFloat ( _string_ )

      The initial value of the *"parseFloat"* property is %parseFloat%.

      - +

      Number.parseInt ( _string_, _radix_ )

      The initial value of the *"parseInt"* property is %parseInt%.

      @@ -31282,7 +32350,7 @@

      Number.prototype.constructor

      The initial value of `Number.prototype.constructor` is %Number%.

      - +

      Number.prototype.toExponential ( _fractionDigits_ )

      This method returns a String containing this Number value represented in decimal exponential notation with one digit before the significand's decimal point and _fractionDigits_ digits after the significand's decimal point. If _fractionDigits_ is *undefined*, it includes as many significand digits as necessary to uniquely specify the Number (just like in ToString except that in this case the Number is always output in exponential notation).

      It performs the following steps when called:

      @@ -31328,12 +32396,12 @@

      Number.prototype.toExponential ( _fractionDigits_ )

      For implementations that provide more accurate conversions than required by the rules above, it is recommended that the following alternative version of step be used as a guideline:

      - 1. Let _e_, _n_, and _f_ be integers such that _f_ ≥ 0, 10_f_ ≤ _n_ < 10_f_ + 1, 𝔽(_n_ × 10_e_ - _f_) is 𝔽(_x_), and _f_ is as small as possible. If there are multiple possibilities for _n_, choose the value of _n_ for which 𝔽(_n_ × 10_e_ - _f_) is closest in value to 𝔽(_x_). If there are two such possible values of _n_, choose the one that is even. + 1. Let _e_, _n_, and _ff_ be integers such that _ff_ ≥ 0, 10_ff_ ≤ _n_ < 10_ff_ + 1, 𝔽(_n_ × 10_e_ - _ff_) is 𝔽(_x_), and _ff_ is as small as possible. If there are multiple possibilities for _n_, choose the value of _n_ for which 𝔽(_n_ × 10_e_ - _ff_) is closest in value to 𝔽(_x_). If there are two such possible values of _n_, choose the one that is even.
      - +

      Number.prototype.toFixed ( _fractionDigits_ )

      This method returns a String containing this Number value represented in decimal fixed-point notation with _fractionDigits_ digits after the decimal point. If _fractionDigits_ is *undefined*, 0 is assumed.

      @@ -31355,7 +32423,7 @@

      Number.prototype.toFixed ( _fractionDigits_ )

      1. Let _m_ be ! ToString(𝔽(_x_)). 1. Else, 1. Let _n_ be an integer for which _n_ / 10_f_ - _x_ is as close to zero as possible. If there are two such _n_, pick the larger _n_. - 1. If _n_ = 0, let _m_ be *"0"*. Otherwise, let _m_ be the String value consisting of the digits of the decimal representation of _n_ (in order, with no leading zeroes). + 1. If _n_ = 0, let _m_ be *"0"*; else let _m_ be the String value consisting of the digits of the decimal representation of _n_ (in order, with no leading zeroes). 1. If _f_ ≠ 0, then 1. Let _k_ be the length of _m_. 1. If _k_ ≤ _f_, then @@ -31376,14 +32444,14 @@

      Number.prototype.toFixed ( _fractionDigits_ )

      - +

      Number.prototype.toLocaleString ( [ _reserved1_ [ , _reserved2_ ] ] )

      An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used:

      This method produces a String value that represents this Number value formatted according to the conventions of the host environment's current locale. This method is implementation-defined, and it is permissible, but not encouraged, for it to return the same thing as `toString`.

      The meanings of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.

      - +

      Number.prototype.toPrecision ( _precision_ )

      This method returns a String containing this Number value represented either in decimal exponential notation with one digit before the significand's decimal point and _precision_ - 1 digits after the significand's decimal point or in decimal fixed notation with _precision_ significant digits. If _precision_ is *undefined*, it calls ToString instead.

      It performs the following steps when called:

      @@ -31427,7 +32495,7 @@

      Number.prototype.toPrecision ( _precision_ )

      - +

      Number.prototype.toString ( [ _radix_ ] )

      The optional _radix_ should be an integral Number value in the inclusive interval from *2*𝔽 to *36*𝔽. If _radix_ is *undefined* then *10*𝔽 is used as the value of _radix_.

      @@ -31444,7 +32512,7 @@

      Number.prototype.toString ( [ _radix_ ] )

      The *"length"* property of this method is *1*𝔽.

      - +

      Number.prototype.valueOf ( )

      1. Return ? ThisNumberValue(*this* value). @@ -31489,14 +32557,14 @@

      The BigInt Constructor

    • is not intended to be used with the `new` operator or to be subclassed. It may be used as the value of an `extends` clause of a class definition but a `super` call to the BigInt constructor will cause an exception.
    • - +

      BigInt ( _value_ )

      This function performs the following steps when called:

      1. If NewTarget is not *undefined*, throw a *TypeError* exception. 1. Let _prim_ be ? ToPrimitive(_value_, ~number~). 1. If _prim_ is a Number, return ? NumberToBigInt(_prim_). - 1. Otherwise, return ? ToBigInt(_prim_). + 1. Return ? ToBigInt(_prim_). @@ -31508,7 +32576,7 @@

      - 1. If IsIntegralNumber(_number_) is *false*, throw a *RangeError* exception. + 1. If _number_ is not an integral Number, throw a *RangeError* exception. 1. Return ℤ(ℝ(_number_)). @@ -31523,18 +32591,19 @@

      Properties of the BigInt Constructor

    • has the following properties:
    • - +

      BigInt.asIntN ( _bits_, _bigint_ )

      This function performs the following steps when called:

      1. Set _bits_ to ? ToIndex(_bits_). 1. Set _bigint_ to ? ToBigInt(_bigint_). 1. Let _mod_ be ℝ(_bigint_) modulo 2_bits_. - 1. If _mod_ ≥ 2_bits_ - 1, return ℤ(_mod_ - 2_bits_); otherwise, return ℤ(_mod_). + 1. If _mod_ ≥ 2_bits_ - 1, return ℤ(_mod_ - 2_bits_). + 1. Return ℤ(_mod_).
      - +

      BigInt.asUintN ( _bits_, _bigint_ )

      This function performs the following steps when called:

      @@ -31567,14 +32636,14 @@

      BigInt.prototype.constructor

      The initial value of `BigInt.prototype.constructor` is %BigInt%.

      - +

      BigInt.prototype.toLocaleString ( [ _reserved1_ [ , _reserved2_ ] ] )

      An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used:

      This method produces a String value that represents this BigInt value formatted according to the conventions of the host environment's current locale. This method is implementation-defined, and it is permissible, but not encouraged, for it to return the same thing as `toString`.

      The meanings of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.

      - +

      BigInt.prototype.toString ( [ _radix_ ] )

      The optional _radix_ should be an integral Number value in the inclusive interval from *2*𝔽 to *36*𝔽. If _radix_ is *undefined* then *10*𝔽 is used as the value of _radix_.

      @@ -31590,7 +32659,7 @@

      BigInt.prototype.toString ( [ _radix_ ] )

      This method is not generic; it throws a *TypeError* exception if its *this* value is not a BigInt or a BigInt object. Therefore, it cannot be transferred to other kinds of objects for use as a method.

      - +

      BigInt.prototype.valueOf ( )

      1. Return ? ThisBigIntValue(*this* value). @@ -31614,9 +32683,9 @@

      - -

      BigInt.prototype [ @@toStringTag ]

      -

      The initial value of the @@toStringTag property is the String value *"BigInt"*.

      + +

      BigInt.prototype [ %Symbol.toStringTag% ]

      +

      The initial value of the %Symbol.toStringTag% property is the String value *"BigInt"*.

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

      @@ -31703,9 +32772,9 @@

      Math.SQRT2

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      - -

      Math [ @@toStringTag ]

      -

      The initial value of the @@toStringTag property is the String value *"Math"*.

      + +

      Math [ %Symbol.toStringTag% ]

      +

      The initial value of the %Symbol.toStringTag% property is the String value *"Math"*.

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

      @@ -31713,11 +32782,11 @@

      Math [ @@toStringTag ]

      Function Properties of the Math Object

      -

      The behaviour of the functions `acos`, `acosh`, `asin`, `asinh`, `atan`, `atanh`, `atan2`, `cbrt`, `cos`, `cosh`, `exp`, `expm1`, `hypot`, `log`, `log1p`, `log2`, `log10`, `pow`, `random`, `sin`, `sinh`, `sqrt`, `tan`, and `tanh` is not precisely specified here except to require specific results for certain argument values that represent boundary cases of interest. For other argument values, these functions are intended to compute approximations to the results of familiar mathematical functions, but some latitude is allowed in the choice of approximation algorithms. The general intent is that an implementer should be able to use the same mathematical library for ECMAScript on a given hardware platform that is available to C programmers on that platform.

      +

      The behaviour of the functions `acos`, `acosh`, `asin`, `asinh`, `atan`, `atanh`, `atan2`, `cbrt`, `cos`, `cosh`, `exp`, `expm1`, `hypot`, `log`, `log1p`, `log2`, `log10`, `pow`, `random`, `sin`, `sinh`, `tan`, and `tanh` is not precisely specified here except to require specific results for certain argument values that represent boundary cases of interest. For other argument values, these functions are intended to compute approximations to the results of familiar mathematical functions, but some latitude is allowed in the choice of approximation algorithms. The general intent is that an implementer should be able to use the same mathematical library for ECMAScript on a given hardware platform that is available to C programmers on that platform.

      Although the choice of algorithms is left to the implementation, it is recommended (but not specified by this standard) that implementations use the approximation algorithms for IEEE 754-2019 arithmetic contained in `fdlibm`, the freely distributable mathematical library from Sun Microsystems (http://www.netlib.org/fdlibm).

      - +

      Math.abs ( _x_ )

      This function returns the absolute value of _x_; the result has the same magnitude as _x_ but has positive sign.

      It performs the following steps when called:

      @@ -31731,7 +32800,7 @@

      Math.abs ( _x_ )

      - +

      Math.acos ( _x_ )

      This function returns the inverse cosine of _x_. The result is expressed in radians and is in the inclusive interval from *+0*𝔽 to 𝔽(π).

      It performs the following steps when called:

      @@ -31739,11 +32808,11 @@

      Math.acos ( _x_ )

      1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is *NaN*, _n_ > *1*𝔽, or _n_ < *-1*𝔽, return *NaN*. 1. If _n_ is *1*𝔽, return *+0*𝔽. - 1. Return an implementation-approximated Number value representing the result of the inverse cosine of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the inverse cosine of ℝ(_n_).
      - +

      Math.acosh ( _x_ )

      This function returns the inverse hyperbolic cosine of _x_.

      It performs the following steps when called:

      @@ -31752,11 +32821,11 @@

      Math.acosh ( _x_ )

      1. If _n_ is either *NaN* or *+∞*𝔽, return _n_. 1. If _n_ is *1*𝔽, return *+0*𝔽. 1. If _n_ < *1*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the inverse hyperbolic cosine of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the inverse hyperbolic cosine of ℝ(_n_).
      - +

      Math.asin ( _x_ )

      This function returns the inverse sine of _x_. The result is expressed in radians and is in the inclusive interval from 𝔽(-π / 2) to 𝔽(π / 2).

      It performs the following steps when called:

      @@ -31764,22 +32833,22 @@

      Math.asin ( _x_ )

      1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is one of *NaN*, *+0*𝔽, or *-0*𝔽, return _n_. 1. If _n_ > *1*𝔽 or _n_ < *-1*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the inverse sine of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the inverse sine of ℝ(_n_).
      - +

      Math.asinh ( _x_ )

      This function returns the inverse hyperbolic sine of _x_.

      It performs the following steps when called:

      1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is not finite or _n_ is either *+0*𝔽 or *-0*𝔽, return _n_. - 1. Return an implementation-approximated Number value representing the result of the inverse hyperbolic sine of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the inverse hyperbolic sine of ℝ(_n_).
      - +

      Math.atan ( _x_ )

      This function returns the inverse tangent of _x_. The result is expressed in radians and is in the inclusive interval from 𝔽(-π / 2) to 𝔽(π / 2).

      It performs the following steps when called:

      @@ -31788,11 +32857,11 @@

      Math.atan ( _x_ )

      1. If _n_ is one of *NaN*, *+0*𝔽, or *-0*𝔽, return _n_. 1. If _n_ is *+∞*𝔽, return an implementation-approximated Number value representing π / 2. 1. If _n_ is *-∞*𝔽, return an implementation-approximated Number value representing -π / 2. - 1. Return an implementation-approximated Number value representing the result of the inverse tangent of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the inverse tangent of ℝ(_n_).
      - +

      Math.atanh ( _x_ )

      This function returns the inverse hyperbolic tangent of _x_.

      It performs the following steps when called:

      @@ -31802,11 +32871,11 @@

      Math.atanh ( _x_ )

      1. If _n_ > *1*𝔽 or _n_ < *-1*𝔽, return *NaN*. 1. If _n_ is *1*𝔽, return *+∞*𝔽. 1. If _n_ is *-1*𝔽, return *-∞*𝔽. - 1. Return an implementation-approximated Number value representing the result of the inverse hyperbolic tangent of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the inverse hyperbolic tangent of ℝ(_n_).
      - +

      Math.atan2 ( _y_, _x_ )

      This function returns the inverse tangent of the quotient _y_ / _x_ of the arguments _y_ and _x_, where the signs of _y_ and _x_ are used to determine the quadrant of the result. Note that it is intentional and traditional for the two-argument inverse tangent function that the argument named _y_ be first and the argument named _x_ be second. The result is expressed in radians and is in the inclusive interval from -π to +π.

      It performs the following steps when called:

      @@ -31848,18 +32917,18 @@

      Math.atan2 ( _y_, _x_ )

      - +

      Math.cbrt ( _x_ )

      This function returns the cube root of _x_.

      It performs the following steps when called:

      1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is not finite or _n_ is either *+0*𝔽 or *-0*𝔽, return _n_. - 1. Return an implementation-approximated Number value representing the result of the cube root of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the cube root of ℝ(_n_).
      - +

      Math.ceil ( _x_ )

      This function returns the smallest (closest to -∞) integral Number value that is not less than _x_. If _x_ is already an integral Number, the result is _x_.

      It performs the following steps when called:

      @@ -31875,7 +32944,7 @@

      Math.ceil ( _x_ )

      - +

      Math.clz32 ( _x_ )

      This function performs the following steps when called:

      @@ -31888,7 +32957,7 @@

      Math.clz32 ( _x_ )

      - +

      Math.cos ( _x_ )

      This function returns the cosine of _x_. The argument is expressed in radians.

      It performs the following steps when called:

      @@ -31896,11 +32965,11 @@

      Math.cos ( _x_ )

      1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is not finite, return *NaN*. 1. If _n_ is either *+0*𝔽 or *-0*𝔽, return *1*𝔽. - 1. Return an implementation-approximated Number value representing the result of the cosine of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the cosine of ℝ(_n_).
      - +

      Math.cosh ( _x_ )

      This function returns the hyperbolic cosine of _x_.

      It performs the following steps when called:

      @@ -31909,14 +32978,14 @@

      Math.cosh ( _x_ )

      1. If _n_ is *NaN*, return *NaN*. 1. If _n_ is either *+∞*𝔽 or *-∞*𝔽, return *+∞*𝔽. 1. If _n_ is either *+0*𝔽 or *-0*𝔽, return *1*𝔽. - 1. Return an implementation-approximated Number value representing the result of the hyperbolic cosine of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the hyperbolic cosine of ℝ(_n_).

      The value of `Math.cosh(x)` is the same as the value of `(Math.exp(x) + Math.exp(-x)) / 2`.

      - +

      Math.exp ( _x_ )

      This function returns the exponential function of _x_ (_e_ raised to the power of _x_, where _e_ is the base of the natural logarithms).

      It performs the following steps when called:

      @@ -31925,11 +32994,11 @@

      Math.exp ( _x_ )

      1. If _n_ is either *NaN* or *+∞*𝔽, return _n_. 1. If _n_ is either *+0*𝔽 or *-0*𝔽, return *1*𝔽. 1. If _n_ is *-∞*𝔽, return *+0*𝔽. - 1. Return an implementation-approximated Number value representing the result of the exponential function of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the exponential function of ℝ(_n_).
      - +

      Math.expm1 ( _x_ )

      This function returns the result of subtracting 1 from the exponential function of _x_ (_e_ raised to the power of _x_, where _e_ is the base of the natural logarithms). The result is computed in a way that is accurate even when the value of _x_ is close to 0.

      It performs the following steps when called:

      @@ -31937,11 +33006,12 @@

      Math.expm1 ( _x_ )

      1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is one of *NaN*, *+0*𝔽, *-0*𝔽, or *+∞*𝔽, return _n_. 1. If _n_ is *-∞*𝔽, return *-1*𝔽. - 1. Return an implementation-approximated Number value representing the result of subtracting 1 from the exponential function of ℝ(_n_). + 1. Let _exp_ be the exponential function of ℝ(_n_). + 1. Return an implementation-approximated Number value representing _exp_ - 1.
      - +

      Math.floor ( _x_ )

      This function returns the greatest (closest to +∞) integral Number value that is not greater than _x_. If _x_ is already an integral Number, the result is _x_.

      It performs the following steps when called:

      @@ -31957,7 +33027,7 @@

      Math.floor ( _x_ )

      - +

      Math.fround ( _x_ )

      This function performs the following steps when called:

      @@ -31970,7 +33040,24 @@

      Math.fround ( _x_ )

      - + +

      Math.f16round ( _x_ )

      +

      This function performs the following steps when called:

      + + 1. Let _n_ be ? ToNumber(_x_). + 1. If _n_ is *NaN*, return *NaN*. + 1. If _n_ is one of *+0*𝔽, *-0*𝔽, *+∞*𝔽, or *-∞*𝔽, return _n_. + 1. Let _n16_ be the result of converting _n_ to IEEE 754-2019 binary16 format using roundTiesToEven mode. + 1. Let _n64_ be the result of converting _n16_ to IEEE 754-2019 binary64 format. + 1. Return the ECMAScript Number value corresponding to _n64_. + + +

      This operation is not the same as casting to binary32 and then to binary16 because of the possibility of double-rounding: consider the number _k_ = *1.00048828125000022204*𝔽, for example, for which Math.f16round(_k_) is *1.0009765625*𝔽, but Math.f16round(Math.fround(_k_)) is *1*𝔽.

      +

      Not all platforms provide native support for casting from binary64 to binary16. There are various libraries which can provide this, including the MIT-licensed half library. Alternatively, it is possible to first cast from binary64 to binary32 under roundTiesToEven and then check whether the result could lead to incorrect double-rounding. Such cases can be handled explicitly by adjusting the mantissa of the binary32 value so that it is the value which would be produced by performing the initial cast under roundTiesToOdd. Casting the adjusted value to binary16 under roundTiesToEven then produces the correct value.

      +
      +
      + +

      Math.hypot ( ..._args_ )

      Given zero or more arguments, this function returns the square root of the sum of squares of its arguments.

      It performs the following steps when called:

      @@ -31994,18 +33081,19 @@

      Math.hypot ( ..._args_ )

      - +

      Math.imul ( _x_, _y_ )

      This function performs the following steps when called:

      1. Let _a_ be ℝ(? ToUint32(_x_)). 1. Let _b_ be ℝ(? ToUint32(_y_)). 1. Let _product_ be (_a_ × _b_) modulo 232. - 1. If _product_ ≥ 231, return 𝔽(_product_ - 232); otherwise return 𝔽(_product_). + 1. If _product_ ≥ 231, return 𝔽(_product_ - 232). + 1. Return 𝔽(_product_).
      - +

      Math.log ( _x_ )

      This function returns the natural logarithm of _x_.

      It performs the following steps when called:

      @@ -32015,11 +33103,11 @@

      Math.log ( _x_ )

      1. If _n_ is *1*𝔽, return *+0*𝔽. 1. If _n_ is either *+0*𝔽 or *-0*𝔽, return *-∞*𝔽. 1. If _n_ < *-0*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the natural logarithm of ℝ(_n_). + 1. Return an implementation-approximated Number value representing ln(ℝ(_n_)).
      - +

      Math.log1p ( _x_ )

      This function returns the natural logarithm of 1 + _x_. The result is computed in a way that is accurate even when the value of x is close to zero.

      It performs the following steps when called:

      @@ -32028,11 +33116,11 @@

      Math.log1p ( _x_ )

      1. If _n_ is one of *NaN*, *+0*𝔽, *-0*𝔽, or *+∞*𝔽, return _n_. 1. If _n_ is *-1*𝔽, return *-∞*𝔽. 1. If _n_ < *-1*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the natural logarithm of 1 + ℝ(_n_). + 1. Return an implementation-approximated Number value representing ln(1 + ℝ(_n_)).
      - +

      Math.log10 ( _x_ )

      This function returns the base 10 logarithm of _x_.

      It performs the following steps when called:

      @@ -32042,11 +33130,11 @@

      Math.log10 ( _x_ )

      1. If _n_ is *1*𝔽, return *+0*𝔽. 1. If _n_ is either *+0*𝔽 or *-0*𝔽, return *-∞*𝔽. 1. If _n_ < *-0*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the base 10 logarithm of ℝ(_n_). + 1. Return an implementation-approximated Number value representing log10(ℝ(_n_)).
      - +

      Math.log2 ( _x_ )

      This function returns the base 2 logarithm of _x_.

      It performs the following steps when called:

      @@ -32056,11 +33144,11 @@

      Math.log2 ( _x_ )

      1. If _n_ is *1*𝔽, return *+0*𝔽. 1. If _n_ is either *+0*𝔽 or *-0*𝔽, return *-∞*𝔽. 1. If _n_ < *-0*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the base 2 logarithm of ℝ(_n_). + 1. Return an implementation-approximated Number value representing log2(ℝ(_n_)).
      - +

      Math.max ( ..._args_ )

      Given zero or more arguments, this function calls ToNumber on each of the arguments and returns the largest of the resulting values.

      It performs the following steps when called:

      @@ -32082,7 +33170,7 @@

      Math.max ( ..._args_ )

      The *"length"* property of this function is *2*𝔽.

      - +

      Math.min ( ..._args_ )

      Given zero or more arguments, this function calls ToNumber on each of the arguments and returns the smallest of the resulting values.

      It performs the following steps when called:

      @@ -32104,7 +33192,7 @@

      Math.min ( ..._args_ )

      The *"length"* property of this function is *2*𝔽.

      - +

      Math.pow ( _base_, _exponent_ )

      This function performs the following steps when called:

      @@ -32114,13 +33202,13 @@

      Math.pow ( _base_, _exponent_ )

      - +

      Math.random ( )

      This function returns a Number value with positive sign, greater than or equal to *+0*𝔽 but strictly less than *1*𝔽, chosen randomly or pseudo randomly with approximately uniform distribution over that range, using an implementation-defined algorithm or strategy.

      Each `Math.random` function created for distinct realms must produce a distinct sequence of values from successive calls.

      - +

      Math.round ( _x_ )

      This function returns the Number value that is closest to _x_ and is integral. If two integral Numbers are equally close to _x_, then the result is the Number value that is closer to +∞. If _x_ is already integral, the result is _x_.

      It performs the following steps when called:

      @@ -32135,11 +33223,11 @@

      Math.round ( _x_ )

      `Math.round(3.5)` returns 4, but `Math.round(-3.5)` returns -3.

      -

      The value of `Math.round(x)` is not always the same as the value of `Math.floor(x + 0.5)`. When `x` is *-0*𝔽 or `x` is less than *+0*𝔽 but greater than or equal to *-0.5*𝔽, `Math.round(x)` returns *-0*𝔽, but `Math.floor(x + 0.5)` returns *+0*𝔽. `Math.round(x)` may also differ from the value of `Math.floor(x + 0.5)`because of internal rounding when computing `x + 0.5`.

      +

      The value of `Math.round(x)` is not always the same as the value of `Math.floor(x + 0.5)`. When `x` is *-0*𝔽 or `x` is less than *-0*𝔽 but greater than or equal to *-0.5*𝔽, `Math.round(x)` returns *-0*𝔽, but `Math.floor(x + 0.5)` returns *+0*𝔽. `Math.round(x)` may also differ from the value of `Math.floor(x + 0.5)`because of internal rounding when computing `x + 0.5`.

      - +

      Math.sign ( _x_ )

      This function returns the sign of _x_, indicating whether _x_ is positive, negative, or zero.

      It performs the following steps when called:

      @@ -32151,7 +33239,7 @@

      Math.sign ( _x_ )

      - +

      Math.sin ( _x_ )

      This function returns the sine of _x_. The argument is expressed in radians.

      It performs the following steps when called:

      @@ -32159,25 +33247,25 @@

      Math.sin ( _x_ )

      1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is one of *NaN*, *+0*𝔽, or *-0*𝔽, return _n_. 1. If _n_ is either *+∞*𝔽 or *-∞*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the sine of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the sine of ℝ(_n_).
      - +

      Math.sinh ( _x_ )

      This function returns the hyperbolic sine of _x_.

      It performs the following steps when called:

      1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is not finite or _n_ is either *+0*𝔽 or *-0*𝔽, return _n_. - 1. Return an implementation-approximated Number value representing the result of the hyperbolic sine of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the hyperbolic sine of ℝ(_n_).

      The value of `Math.sinh(x)` is the same as the value of `(Math.exp(x) - Math.exp(-x)) / 2`.

      - +

      Math.sqrt ( _x_ )

      This function returns the square root of _x_.

      It performs the following steps when called:

      @@ -32185,11 +33273,57 @@

      Math.sqrt ( _x_ )

      1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is one of *NaN*, *+0*𝔽, *-0*𝔽, or *+∞*𝔽, return _n_. 1. If _n_ < *-0*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the square root of ℝ(_n_). + 1. Return 𝔽(the square root of ℝ(_n_)).
      - + +

      Math.sumPrecise ( _items_ )

      +

      Given an iterable of Numbers, this function sums each value in the iterable and returns their sum. If any value is not a Number it throws a *TypeError* exception.

      +

      It performs the following steps when called:

      + + 1. Perform ? RequireObjectCoercible(_items_). + 1. Let _iteratorRecord_ be ? GetIterator(_items_, ~sync~). + 1. Let _state_ be ~minus-zero~. + 1. Let _sum_ be 0. + 1. Let _count_ be 0. + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_iteratorRecord_). + 1. If _next_ is not ~done~, then + 1. If _count_ ≥ 253 - 1, then + 1. NOTE: This step is not expected to be reached in practice and is included only so that implementations may rely on inputs being "reasonably sized" without violating this specification. + 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). + 1. Return ? IteratorClose(_iteratorRecord_, _error_). + 1. If _next_ is not a Number, then + 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). + 1. Return ? IteratorClose(_iteratorRecord_, _error_). + 1. Let _n_ be _next_. + 1. If _state_ is not ~not-a-number~, then + 1. If _n_ is *NaN*, then + 1. Set _state_ to ~not-a-number~. + 1. Else if _n_ is *+∞*𝔽, then + 1. If _state_ is ~minus-infinity~, set _state_ to ~not-a-number~. + 1. Else, set _state_ to ~plus-infinity~. + 1. Else if _n_ is *-∞*𝔽, then + 1. If _state_ is ~plus-infinity~, set _state_ to ~not-a-number~. + 1. Else, set _state_ to ~minus-infinity~. + 1. Else if _n_ is not *-0*𝔽 and _state_ is either ~minus-zero~ or ~finite~, then + 1. Set _state_ to ~finite~. + 1. Set _sum_ to _sum_ + ℝ(_n_). + 1. Set _count_ to _count_ + 1. + 1. If _state_ is ~not-a-number~, return *NaN*. + 1. If _state_ is ~plus-infinity~, return *+∞*𝔽. + 1. If _state_ is ~minus-infinity~, return *-∞*𝔽. + 1. If _state_ is ~minus-zero~, return *-0*𝔽. + 1. Return 𝔽(_sum_). + + +

      The value of _sum_ can be computed without arbitrary-precision arithmetic by a variety of algorithms. One such is the "Grow-Expansion" algorithm given in Adaptive Precision Floating-Point Arithmetic and Fast Robust Geometric Predicates by Jonathan Richard Shewchuk. A more recent algorithm is given in "Fast exact summation using small and large superaccumulators", code for which is available at https://gitlab.com/radfordneal/xsum.

      +
      +
      + +

      Math.tan ( _x_ )

      This function returns the tangent of _x_. The argument is expressed in radians.

      It performs the following steps when called:

      @@ -32197,11 +33331,11 @@

      Math.tan ( _x_ )

      1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is one of *NaN*, *+0*𝔽, or *-0*𝔽, return _n_. 1. If _n_ is either *+∞*𝔽 or *-∞*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the tangent of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the tangent of ℝ(_n_).
      - +

      Math.tanh ( _x_ )

      This function returns the hyperbolic tangent of _x_.

      It performs the following steps when called:

      @@ -32210,14 +33344,14 @@

      Math.tanh ( _x_ )

      1. If _n_ is one of *NaN*, *+0*𝔽, or *-0*𝔽, return _n_. 1. If _n_ is *+∞*𝔽, return *1*𝔽. 1. If _n_ is *-∞*𝔽, return *-1*𝔽. - 1. Return an implementation-approximated Number value representing the result of the hyperbolic tangent of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the hyperbolic tangent of ℝ(_n_).

      The value of `Math.tanh(x)` is the same as the value of `(Math.exp(x) - Math.exp(-x)) / (Math.exp(x) + Math.exp(-x))`.

      - +

      Math.trunc ( _x_ )

      This function returns the integral part of the number _x_, removing any fractional digits. If _x_ is already integral, the result is _x_.

      It performs the following steps when called:

      @@ -32388,7 +33522,8 @@

      It returns *1*𝔽 if _t_ is within a leap year and *+0*𝔽 otherwise.
      - 1. If DaysInYear(YearFromTime(_t_)) is *366*𝔽, return *1*𝔽; else return *+0*𝔽. + 1. If DaysInYear(YearFromTime(_t_)) is *366*𝔽, return *1*𝔽. + 1. Return *+0*𝔽. @@ -32644,11 +33779,13 @@

      Time Zone Identifier Record

      Time Zone Identifier Records have the fields listed in .

      - - - - - + + + + + + + @@ -33084,46 +34221,14 @@

      Time Zone Offset String Format

      ECMAScript defines a string interchange format for UTC offsets, derived from ISO 8601. The format is described by the following grammar. - The usage of Unicode code points in this grammar is listed in .

      - -
      Field NameValueMeaning
      Field NameValueMeaning
      [[Identifier]] a String
      - - - - - - - - - - -
      - Code Point - - Unicode Name - - Abbreviation -
      - `U+2212` - - MINUS SIGN - - <MINUS> -
      -
      -

      Syntax

      UTCOffset ::: - TemporalSign Hour - TemporalSign Hour HourSubcomponents[+Extended] - TemporalSign Hour HourSubcomponents[~Extended] - - TemporalSign ::: - ASCIISign - <MINUS> + ASCIISign Hour + ASCIISign Hour HourSubcomponents[+Extended] + ASCIISign Hour HourSubcomponents[~Extended] ASCIISign ::: one of `+` `-` @@ -33197,9 +34302,9 @@

      1. Let _parseResult_ be ParseText(_offsetString_, |UTCOffset|). 1. Assert: _parseResult_ is not a List of errors. - 1. Assert: _parseResult_ contains a |TemporalSign| Parse Node. - 1. Let _parsedSign_ be the source text matched by the |TemporalSign| Parse Node contained within _parseResult_. - 1. If _parsedSign_ is the single code point U+002D (HYPHEN-MINUS) or U+2212 (MINUS SIGN), then + 1. Assert: _parseResult_ contains a |ASCIISign| Parse Node. + 1. Let _parsedSign_ be the source text matched by the |ASCIISign| Parse Node contained within _parseResult_. + 1. If _parsedSign_ is the single code point U+002D (HYPHEN-MINUS), then 1. Let _sign_ be -1. 1. Else, 1. Let _sign_ be 1. @@ -33242,7 +34347,7 @@

      The Date Constructor

    • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified Date behaviour must include a `super` call to the Date constructor to create and initialize the subclass instance with a [[DateValue]] internal slot.
    • - +

      Date ( ..._values_ )

      This function performs the following steps when called:

      @@ -33292,12 +34397,12 @@

      Properties of the Date Constructor

    • has the following properties:
    • - +

      Date.now ( )

      This function returns the time value designating the UTC date and time of the occurrence of the call to it.

      - +

      Date.parse ( _string_ )

      This function applies the ToString operator to its argument. If ToString results in an abrupt completion the Completion Record is immediately returned. Otherwise, this function interprets the resulting String as a date and time; it returns a Number, the UTC time value corresponding to the date and time. The String may be interpreted as a local time, a UTC time, or a time in some other time zone, depending on the contents of the String. The function first attempts to parse the String according to the format described in Date Time String Format (), including expanded years. If the String does not conform to that format the function may fall back to any implementation-specific heuristics or implementation-specific date formats. Strings that are unrecognizable or contain out-of-bounds format element values shall cause this function to return *NaN*.

      If the String conforms to the Date Time String Format, substitute values take the place of absent format elements. When the `MM` or `DD` elements are absent, *"01"* is used. When the `HH`, `mm`, or `ss` elements are absent, *"00"* is used. When the `sss` element is absent, *"000"* is used. When the UTC offset representation is absent, date-only forms are interpreted as a UTC time and date-time forms are interpreted as a local time.

      @@ -33321,7 +34426,7 @@

      Date.prototype

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      - +

      Date.UTC ( _year_ [ , _month_ [ , _date_ [ , _hours_ [ , _minutes_ [ , _seconds_ [ , _ms_ ] ] ] ] ] ] )

      This function performs the following steps when called:

      @@ -33358,7 +34463,7 @@

      Date.prototype.constructor

      The initial value of `Date.prototype.constructor` is %Date%.

      - +

      Date.prototype.getDate ( )

      This method performs the following steps when called:

      @@ -33370,7 +34475,7 @@

      Date.prototype.getDate ( )

      - +

      Date.prototype.getDay ( )

      This method performs the following steps when called:

      @@ -33382,7 +34487,7 @@

      Date.prototype.getDay ( )

      - +

      Date.prototype.getFullYear ( )

      This method performs the following steps when called:

      @@ -33394,7 +34499,7 @@

      Date.prototype.getFullYear ( )

      - +

      Date.prototype.getHours ( )

      This method performs the following steps when called:

      @@ -33406,7 +34511,7 @@

      Date.prototype.getHours ( )

      - +

      Date.prototype.getMilliseconds ( )

      This method performs the following steps when called:

      @@ -33418,7 +34523,7 @@

      Date.prototype.getMilliseconds ( )

      - +

      Date.prototype.getMinutes ( )

      This method performs the following steps when called:

      @@ -33430,7 +34535,7 @@

      Date.prototype.getMinutes ( )

      - +

      Date.prototype.getMonth ( )

      This method performs the following steps when called:

      @@ -33442,7 +34547,7 @@

      Date.prototype.getMonth ( )

      - +

      Date.prototype.getSeconds ( )

      This method performs the following steps when called:

      @@ -33454,7 +34559,7 @@

      Date.prototype.getSeconds ( )

      - +

      Date.prototype.getTime ( )

      This method performs the following steps when called:

      @@ -33464,7 +34569,7 @@

      Date.prototype.getTime ( )

      - +

      Date.prototype.getTimezoneOffset ( )

      This method performs the following steps when called:

      @@ -33476,7 +34581,7 @@

      Date.prototype.getTimezoneOffset ( )

      - +

      Date.prototype.getUTCDate ( )

      This method performs the following steps when called:

      @@ -33488,7 +34593,7 @@

      Date.prototype.getUTCDate ( )

      - +

      Date.prototype.getUTCDay ( )

      This method performs the following steps when called:

      @@ -33500,7 +34605,7 @@

      Date.prototype.getUTCDay ( )

      - +

      Date.prototype.getUTCFullYear ( )

      This method performs the following steps when called:

      @@ -33512,7 +34617,7 @@

      Date.prototype.getUTCFullYear ( )

      - +

      Date.prototype.getUTCHours ( )

      This method performs the following steps when called:

      @@ -33524,7 +34629,7 @@

      Date.prototype.getUTCHours ( )

      - +

      Date.prototype.getUTCMilliseconds ( )

      This method performs the following steps when called:

      @@ -33536,7 +34641,7 @@

      Date.prototype.getUTCMilliseconds ( )

      - +

      Date.prototype.getUTCMinutes ( )

      This method performs the following steps when called:

      @@ -33548,7 +34653,7 @@

      Date.prototype.getUTCMinutes ( )

      - +

      Date.prototype.getUTCMonth ( )

      This method performs the following steps when called:

      @@ -33560,7 +34665,7 @@

      Date.prototype.getUTCMonth ( )

      - +

      Date.prototype.getUTCSeconds ( )

      This method performs the following steps when called:

      @@ -33572,7 +34677,7 @@

      Date.prototype.getUTCSeconds ( )

      - +

      Date.prototype.setDate ( _date_ )

      This method performs the following steps when called:

      @@ -33589,7 +34694,7 @@

      Date.prototype.setDate ( _date_ )

      - +

      Date.prototype.setFullYear ( _year_ [ , _month_ [ , _date_ ] ] )

      This method performs the following steps when called:

      @@ -33597,9 +34702,9 @@

      Date.prototype.setFullYear ( _year_ [ , _month_ [ , _date_ ] ] )

      1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). 1. Let _t_ be _dateObject_.[[DateValue]]. 1. Let _y_ be ? ToNumber(_year_). - 1. If _t_ is *NaN*, set _t_ to *+0*𝔽; otherwise, set _t_ to LocalTime(_t_). - 1. If _month_ is not present, let _m_ be MonthFromTime(_t_); otherwise, let _m_ be ? ToNumber(_month_). - 1. If _date_ is not present, let _dt_ be DateFromTime(_t_); otherwise, let _dt_ be ? ToNumber(_date_). + 1. If _t_ is *NaN*, set _t_ to *+0*𝔽; else set _t_ to LocalTime(_t_). + 1. If _month_ is present, let _m_ be ? ToNumber(_month_); else let _m_ be MonthFromTime(_t_). + 1. If _date_ is present, let _dt_ be ? ToNumber(_date_); else let _dt_ be DateFromTime(_t_). 1. Let _newDate_ be MakeDate(MakeDay(_y_, _m_, _dt_), TimeWithinDay(_t_)). 1. Let _u_ be TimeClip(UTC(_newDate_)). 1. Set _dateObject_.[[DateValue]] to _u_. @@ -33611,7 +34716,7 @@

      Date.prototype.setFullYear ( _year_ [ , _month_ [ , _date_ ] ] )

      - +

      Date.prototype.setHours ( _hour_ [ , _min_ [ , _sec_ [ , _ms_ ] ] ] )

      This method performs the following steps when called:

      @@ -33638,7 +34743,7 @@

      Date.prototype.setHours ( _hour_ [ , _min_ [ , _sec_ [ , _ms_ ] ] ] )

      - +

      Date.prototype.setMilliseconds ( _ms_ )

      This method performs the following steps when called:

      @@ -33655,7 +34760,7 @@

      Date.prototype.setMilliseconds ( _ms_ )

      - +

      Date.prototype.setMinutes ( _min_ [ , _sec_ [ , _ms_ ] ] )

      This method performs the following steps when called:

      @@ -33680,7 +34785,7 @@

      Date.prototype.setMinutes ( _min_ [ , _sec_ [ , _ms_ ] ] )

      - +

      Date.prototype.setMonth ( _month_ [ , _date_ ] )

      This method performs the following steps when called:

      @@ -33703,7 +34808,7 @@

      Date.prototype.setMonth ( _month_ [ , _date_ ] )

      - +

      Date.prototype.setSeconds ( _sec_ [ , _ms_ ] )

      This method performs the following steps when called:

      @@ -33726,7 +34831,7 @@

      Date.prototype.setSeconds ( _sec_ [ , _ms_ ] )

      - +

      Date.prototype.setTime ( _time_ )

      This method performs the following steps when called:

      @@ -33739,7 +34844,7 @@

      Date.prototype.setTime ( _time_ )

      - +

      Date.prototype.setUTCDate ( _date_ )

      This method performs the following steps when called:

      @@ -33755,7 +34860,7 @@

      Date.prototype.setUTCDate ( _date_ )

      - +

      Date.prototype.setUTCFullYear ( _year_ [ , _month_ [ , _date_ ] ] )

      This method performs the following steps when called:

      @@ -33764,8 +34869,8 @@

      Date.prototype.setUTCFullYear ( _year_ [ , _month_ [ , _date_ ] ] )

      1. Let _t_ be _dateObject_.[[DateValue]]. 1. If _t_ is *NaN*, set _t_ to *+0*𝔽. 1. Let _y_ be ? ToNumber(_year_). - 1. If _month_ is not present, let _m_ be MonthFromTime(_t_); otherwise, let _m_ be ? ToNumber(_month_). - 1. If _date_ is not present, let _dt_ be DateFromTime(_t_); otherwise, let _dt_ be ? ToNumber(_date_). + 1. If _month_ is present, let _m_ be ? ToNumber(_month_); else let _m_ be MonthFromTime(_t_). + 1. If _date_ is present, let _dt_ be ? ToNumber(_date_); else let _dt_ be DateFromTime(_t_). 1. Let _newDate_ be MakeDate(MakeDay(_y_, _m_, _dt_), TimeWithinDay(_t_)). 1. Let _v_ be TimeClip(_newDate_). 1. Set _dateObject_.[[DateValue]] to _v_. @@ -33777,7 +34882,7 @@

      Date.prototype.setUTCFullYear ( _year_ [ , _month_ [ , _date_ ] ] )

      - +

      Date.prototype.setUTCHours ( _hour_ [ , _min_ [ , _sec_ [ , _ms_ ] ] ] )

      This method performs the following steps when called:

      @@ -33803,7 +34908,7 @@

      Date.prototype.setUTCHours ( _hour_ [ , _min_ [ , _sec_ [ , _ms_ ] ] ] )

      - +

      Date.prototype.setUTCMilliseconds ( _ms_ )

      This method performs the following steps when called:

      @@ -33819,7 +34924,7 @@

      Date.prototype.setUTCMilliseconds ( _ms_ )

      - +

      Date.prototype.setUTCMinutes ( _min_ [ , _sec_ [ , _ms_ ] ] )

      This method performs the following steps when called:

      @@ -33843,7 +34948,7 @@

      Date.prototype.setUTCMinutes ( _min_ [ , _sec_ [ , _ms_ ] ] )

      - +

      Date.prototype.setUTCMonth ( _month_ [ , _date_ ] )

      This method performs the following steps when called:

      @@ -33865,7 +34970,7 @@

      Date.prototype.setUTCMonth ( _month_ [ , _date_ ] )

      - +

      Date.prototype.setUTCSeconds ( _sec_ [ , _ms_ ] )

      This method performs the following steps when called:

      @@ -33887,7 +34992,7 @@

      Date.prototype.setUTCSeconds ( _sec_ [ , _ms_ ] )

      - +

      Date.prototype.toDateString ( )

      This method performs the following steps when called:

      @@ -33900,7 +35005,7 @@

      Date.prototype.toDateString ( )

      - +

      Date.prototype.toISOString ( )

      This method performs the following steps when called:

      @@ -33914,7 +35019,7 @@

      Date.prototype.toISOString ( )

      - +

      Date.prototype.toJSON ( _key_ )

      This method provides a String representation of a Date for use by `JSON.stringify` ().

      It performs the following steps when called:

      @@ -33932,28 +35037,28 @@

      Date.prototype.toJSON ( _key_ )

      - +

      Date.prototype.toLocaleDateString ( [ _reserved1_ [ , _reserved2_ ] ] )

      An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used:

      This method returns a String value. The contents of the String are implementation-defined, but are intended to represent the “date” portion of the Date in the current time zone in a convenient, human-readable form that corresponds to the conventions of the host environment's current locale.

      The meaning of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.

      - +

      Date.prototype.toLocaleString ( [ _reserved1_ [ , _reserved2_ ] ] )

      An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used:

      This method returns a String value. The contents of the String are implementation-defined, but are intended to represent the Date in the current time zone in a convenient, human-readable form that corresponds to the conventions of the host environment's current locale.

      The meaning of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.

      - +

      Date.prototype.toLocaleTimeString ( [ _reserved1_ [ , _reserved2_ ] ] )

      An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used:

      This method returns a String value. The contents of the String are implementation-defined, but are intended to represent the “time” portion of the Date in the current time zone in a convenient, human-readable form that corresponds to the conventions of the host environment's current locale.

      The meaning of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.

      - +

      Date.prototype.toString ( )

      This method performs the following steps when called:

      @@ -33998,20 +35103,22 @@

      1. Let _month_ be the Name of the entry in with the Number MonthFromTime(_tv_). 1. Let _day_ be ToZeroPaddedDecimalString(ℝ(DateFromTime(_tv_)), 2). 1. Let _yv_ be YearFromTime(_tv_). - 1. If _yv_ is *+0*𝔽 or _yv_ > *+0*𝔽, let _yearSign_ be the empty String; otherwise, let _yearSign_ be *"-"*. + 1. If _yv_ is *+0*𝔽 or _yv_ > *+0*𝔽, let _yearSign_ be the empty String; else let _yearSign_ be *"-"*. 1. Let _paddedYear_ be ToZeroPaddedDecimalString(abs(ℝ(_yv_)), 4). 1. Return the string-concatenation of _weekday_, the code unit 0x0020 (SPACE), _month_, the code unit 0x0020 (SPACE), _day_, the code unit 0x0020 (SPACE), _yearSign_, and _paddedYear_. - - - - + + + + + +
      - Number - - Name -
      + Number + + Name +
      *+0*𝔽 @@ -34072,14 +35179,16 @@

      - - - - + + + + + +
      - Number - - Name -
      + Number + + Name +
      *+0*𝔽 @@ -34224,7 +35333,7 @@

      - +

      Date.prototype.toTimeString ( )

      This method performs the following steps when called:

      @@ -34237,7 +35346,7 @@

      Date.prototype.toTimeString ( )

      - +

      Date.prototype.toUTCString ( )

      This method returns a String value representing the instant in time corresponding to the *this* value. The format of the String is based upon "HTTP-date" from RFC 7231, generalized to support the full range of times supported by ECMAScript Dates.

      It performs the following steps when called:

      @@ -34250,13 +35359,13 @@

      Date.prototype.toUTCString ( )

      1. Let _month_ be the Name of the entry in with the Number MonthFromTime(_tv_). 1. Let _day_ be ToZeroPaddedDecimalString(ℝ(DateFromTime(_tv_)), 2). 1. Let _yv_ be YearFromTime(_tv_). - 1. If _yv_ is *+0*𝔽 or _yv_ > *+0*𝔽, let _yearSign_ be the empty String; otherwise, let _yearSign_ be *"-"*. + 1. If _yv_ is *+0*𝔽 or _yv_ > *+0*𝔽, let _yearSign_ be the empty String; else let _yearSign_ be *"-"*. 1. Let _paddedYear_ be ToZeroPaddedDecimalString(abs(ℝ(_yv_)), 4). 1. Return the string-concatenation of _weekday_, *","*, the code unit 0x0020 (SPACE), _day_, the code unit 0x0020 (SPACE), _month_, the code unit 0x0020 (SPACE), _yearSign_, _paddedYear_, the code unit 0x0020 (SPACE), and TimeString(_tv_).
      - +

      Date.prototype.valueOf ( )

      This method performs the following steps when called:

      @@ -34266,8 +35375,8 @@

      Date.prototype.valueOf ( )

      - -

      Date.prototype [ @@toPrimitive ] ( _hint_ )

      + +

      Date.prototype [ %Symbol.toPrimitive% ] ( _hint_ )

      This method is called by ECMAScript language operators to convert a Date to a primitive value. The allowed values for _hint_ are *"default"*, *"number"*, and *"string"*. Dates are unique among built-in ECMAScript object in that they treat *"default"* as being equivalent to *"string"*, All other built-in ECMAScript objects treat *"default"* as being equivalent to *"number"*.

      It performs the following steps when called:

      @@ -34310,7 +35419,7 @@

      The String Constructor

    • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified String behaviour must include a `super` call to the String constructor to create and initialize the subclass instance with a [[StringData]] internal slot.
    • - +

      String ( _value_ )

      This function performs the following steps when called:

      @@ -34333,7 +35442,7 @@

      Properties of the String Constructor

    • has the following properties:
    • - +

      String.fromCharCode ( ..._codeUnits_ )

      This function may be called with any number of arguments which form the rest parameter _codeUnits_.

      It performs the following steps when called:

      @@ -34347,7 +35456,7 @@

      String.fromCharCode ( ..._codeUnits_ )

      The *"length"* property of this function is *1*𝔽.

      - +

      String.fromCodePoint ( ..._codePoints_ )

      This function may be called with any number of arguments which form the rest parameter _codePoints_.

      It performs the following steps when called:

      @@ -34355,7 +35464,7 @@

      String.fromCodePoint ( ..._codePoints_ )

      1. Let _result_ be the empty String. 1. For each element _next_ of _codePoints_, do 1. Let _nextCP_ be ? ToNumber(_next_). - 1. If IsIntegralNumber(_nextCP_) is *false*, throw a *RangeError* exception. + 1. If _nextCP_ is not an integral Number, throw a *RangeError* exception. 1. If ℝ(_nextCP_) < 0 or ℝ(_nextCP_) > 0x10FFFF, throw a *RangeError* exception. 1. Set _result_ to the string-concatenation of _result_ and UTF16EncodeCodePoint(ℝ(_nextCP_)). 1. Assert: If _codePoints_ is empty, then _result_ is the empty String. @@ -34370,7 +35479,7 @@

      String.prototype

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

      - +

      String.raw ( _template_, ..._substitutions_ )

      This function may be called with a variable number of arguments. The first argument is _template_ and the remainder of the arguments form the List _substitutions_.

      It performs the following steps when called:

      @@ -34411,10 +35520,11 @@

      Properties of the String Prototype Object

      Unless explicitly stated otherwise, the methods of the String prototype object defined below are not generic and the *this* value passed to them must be either a String value or an object that has a [[StringData]] internal slot that has been initialized to a String value.

      - +

      String.prototype.at ( _index_ )

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Let _len_ be the length of _S_. 1. Let _relativeIndex_ be ? ToIntegerOrInfinity(_index_). @@ -34427,7 +35537,7 @@

      String.prototype.at ( _index_ )

      - +

      String.prototype.charAt ( _pos_ )

      This method returns a single element String containing the code unit at index _pos_ within the String value resulting from converting this object to a String. If there is no element at that index, the result is the empty String. The result is a String value, not a String object.

      @@ -34435,7 +35545,8 @@

      String.prototype.charAt ( _pos_ )

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Let _position_ be ? ToIntegerOrInfinity(_pos_). 1. Let _size_ be the length of _S_. @@ -34447,14 +35558,15 @@

      String.prototype.charAt ( _pos_ )

      - +

      String.prototype.charCodeAt ( _pos_ )

      This method returns a Number (a non-negative integral Number less than 216) that is the numeric value of the code unit at index _pos_ within the String resulting from converting this object to a String. If there is no element at that index, the result is *NaN*.

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Let _position_ be ? ToIntegerOrInfinity(_pos_). 1. Let _size_ be the length of _S_. @@ -34466,14 +35578,15 @@

      String.prototype.charCodeAt ( _pos_ )

      - +

      String.prototype.codePointAt ( _pos_ )

      This method returns a non-negative integral Number less than or equal to *0x10FFFF*𝔽 that is the numeric value of the UTF-16 encoded code point () starting at the string element at index _pos_ within the String resulting from converting this object to a String. If there is no element at that index, the result is *undefined*. If a valid UTF-16 surrogate pair does not begin at _pos_, the result is the code unit at _pos_.

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Let _position_ be ? ToIntegerOrInfinity(_pos_). 1. Let _size_ be the length of _S_. @@ -34486,14 +35599,15 @@

      String.prototype.codePointAt ( _pos_ )

      - +

      String.prototype.concat ( ..._args_ )

      When this method is called it returns the String value consisting of the code units of the *this* value (converted to a String) followed by the code units of each of the arguments converted to a String. The result is a String value, not a String object.

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Let _R_ be _S_. 1. For each element _next_ of _args_, do @@ -34512,11 +35626,12 @@

      String.prototype.constructor

      The initial value of `String.prototype.constructor` is %String%.

      - +

      String.prototype.endsWith ( _searchString_ [ , _endPosition_ ] )

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Let _isRegExp_ be ? IsRegExp(_searchString_). 1. If _isRegExp_ is *true*, throw a *TypeError* exception. @@ -34543,11 +35658,12 @@

      String.prototype.endsWith ( _searchString_ [ , _endPosition_ ] )

      - +

      String.prototype.includes ( _searchString_ [ , _position_ ] )

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Let _isRegExp_ be ? IsRegExp(_searchString_). 1. If _isRegExp_ is *true*, throw a *TypeError* exception. @@ -34571,14 +35687,15 @@

      String.prototype.includes ( _searchString_ [ , _position_ ] )

      - +

      String.prototype.indexOf ( _searchString_ [ , _position_ ] )

      If _searchString_ appears as a substring of the result of converting this object to a String, at one or more indices that are greater than or equal to _position_, then the smallest such index is returned; otherwise, *-1*𝔽 is returned. If _position_ is *undefined*, *+0*𝔽 is assumed, so as to search all of the String.

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Let _searchStr_ be ? ToString(_searchString_). 1. Let _pos_ be ? ToIntegerOrInfinity(_position_). @@ -34594,31 +35711,34 @@

      String.prototype.indexOf ( _searchString_ [ , _position_ ] )

      - +

      String.prototype.isWellFormed ( )

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Return IsStringWellFormedUnicode(_S_).
      - +

      String.prototype.lastIndexOf ( _searchString_ [ , _position_ ] )

      If _searchString_ appears as a substring of the result of converting this object to a String at one or more indices that are smaller than or equal to _position_, then the greatest such index is returned; otherwise, *-1*𝔽 is returned. If _position_ is *undefined*, the length of the String value is assumed, so as to search all of the String.

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Let _searchStr_ be ? ToString(_searchString_). 1. Let _numPos_ be ? ToNumber(_position_). 1. Assert: If _position_ is *undefined*, then _numPos_ is *NaN*. - 1. If _numPos_ is *NaN*, let _pos_ be +∞; otherwise, let _pos_ be ! ToIntegerOrInfinity(_numPos_). + 1. If _numPos_ is *NaN*, let _pos_ be +∞; else let _pos_ be ! ToIntegerOrInfinity(_numPos_). 1. Let _len_ be the length of _S_. 1. Let _searchLen_ be the length of _searchStr_. + 1. If _len_ < _searchLen_, return *-1*𝔽. 1. Let _start_ be the result of clamping _pos_ between 0 and _len_ - _searchLen_. 1. Let _result_ be StringLastIndexOf(_S_, _searchStr_, _start_). 1. If _result_ is ~not-found~, return *-1*𝔽. @@ -34629,13 +35749,14 @@

      String.prototype.lastIndexOf ( _searchString_ [ , _position_ ] )

      - +

      String.prototype.localeCompare ( _that_ [ , _reserved1_ [ , _reserved2_ ] ] )

      An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used:

      This method returns a Number other than *NaN* representing the result of an implementation-defined locale-sensitive String comparison of the *this* value (converted to a String _S_) with _that_ (converted to a String _thatValue_). The result is intended to correspond with a sort order of String values according to conventions of the host environment's current locale, and will be negative when _S_ is ordered before _thatValue_, positive when _S_ is ordered after _thatValue_, and zero in all other cases (representing no relative ordering between _S_ and _thatValue_).

      Before performing the comparisons, this method performs the following steps to prepare the Strings:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Let _thatValue_ be ? ToString(_that_). @@ -34675,53 +35796,56 @@

      String.prototype.localeCompare ( _that_ [ , _reserved1_ [ , _reserved2_ ] ] - +

      String.prototype.match ( _regexp_ )

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). - 1. If _regexp_ is neither *undefined* nor *null*, then - 1. Let _matcher_ be ? GetMethod(_regexp_, @@match). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). + 1. If _regexp_ is an Object, then + 1. Let _matcher_ be ? GetMethod(_regexp_, %Symbol.match%). 1. If _matcher_ is not *undefined*, then 1. Return ? Call(_matcher_, _regexp_, « _O_ »). 1. Let _S_ be ? ToString(_O_). 1. Let _rx_ be ? RegExpCreate(_regexp_, *undefined*). - 1. Return ? Invoke(_rx_, @@match, « _S_ »). + 1. Return ? Invoke(_rx_, %Symbol.match%, « _S_ »).

      This method is intentionally generic; it does not require that its *this* value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

      - +

      String.prototype.matchAll ( _regexp_ )

      -

      This method performs a regular expression match of the String representing the *this* value against _regexp_ and returns an iterator. Each iteration result's value is an Array containing the results of the match, or *null* if the String did not match.

      +

      This method performs a regular expression match of the String representing the *this* value against _regexp_ and returns an iterator that yields match results. Each match result is an Array containing the matched portion of the String as the first element, followed by the portions matched by any capturing groups. If the regular expression never matches, the returned iterator does not yield any match results.

      It performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). - 1. If _regexp_ is neither *undefined* nor *null*, then + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). + 1. If _regexp_ is an Object, then 1. Let _isRegExp_ be ? IsRegExp(_regexp_). 1. If _isRegExp_ is *true*, then 1. Let _flags_ be ? Get(_regexp_, *"flags"*). 1. Perform ? RequireObjectCoercible(_flags_). 1. If ? ToString(_flags_) does not contain *"g"*, throw a *TypeError* exception. - 1. Let _matcher_ be ? GetMethod(_regexp_, @@matchAll). + 1. Let _matcher_ be ? GetMethod(_regexp_, %Symbol.matchAll%). 1. If _matcher_ is not *undefined*, then 1. Return ? Call(_matcher_, _regexp_, « _O_ »). 1. Let _S_ be ? ToString(_O_). 1. Let _rx_ be ? RegExpCreate(_regexp_, *"g"*). - 1. Return ? Invoke(_rx_, @@matchAll, « _S_ »). + 1. Return ? Invoke(_rx_, %Symbol.matchAll%, « _S_ »). This method is intentionally generic, it does not require that its *this* value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method. Similarly to `String.prototype.split`, `String.prototype.matchAll` is designed to typically act without mutating its inputs.
      - +

      String.prototype.normalize ( [ _form_ ] )

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. If _form_ is *undefined*, let _f_ be *"NFC"*. 1. Else, let _f_ be ? ToString(_form_). @@ -34734,20 +35858,22 @@

      String.prototype.normalize ( [ _form_ ] )

      - +

      String.prototype.padEnd ( _maxLength_ [ , _fillString_ ] )

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Return ? StringPaddingBuiltinsImpl(_O_, _maxLength_, _fillString_, ~end~).
      - +

      String.prototype.padStart ( _maxLength_ [ , _fillString_ ] )

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Return ? StringPaddingBuiltinsImpl(_O_, _maxLength_, _fillString_, ~start~). @@ -34791,7 +35917,7 @@

      1. Let _fillLen_ be _maxLength_ - _stringLength_. 1. Let _truncatedStringFiller_ be the String value consisting of repeated concatenations of _fillString_ truncated to length _fillLen_. 1. If _placement_ is ~start~, return the string-concatenation of _truncatedStringFiller_ and _S_. - 1. Else, return the string-concatenation of _S_ and _truncatedStringFiller_. + 1. Return the string-concatenation of _S_ and _truncatedStringFiller_.

      The argument _maxLength_ will be clamped such that it can be no smaller than the length of _S_.

      @@ -34817,11 +35943,12 @@

      - +

      String.prototype.repeat ( _count_ )

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Let _n_ be ? ToIntegerOrInfinity(_count_). 1. If _n_ < 0 or _n_ = +∞, throw a *RangeError* exception. @@ -34836,13 +35963,14 @@

      String.prototype.repeat ( _count_ )

      - +

      String.prototype.replace ( _searchValue_, _replaceValue_ )

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). - 1. If _searchValue_ is neither *undefined* nor *null*, then - 1. Let _replacer_ be ? GetMethod(_searchValue_, @@replace). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). + 1. If _searchValue_ is an Object, then + 1. Let _replacer_ be ? GetMethod(_searchValue_, %Symbol.replace%). 1. If _replacer_ is not *undefined*, then 1. Return ? Call(_replacer_, _searchValue_, « _O_, _replaceValue_ »). 1. Let _string_ be ? ToString(_O_). @@ -34903,9 +36031,9 @@

      1. Let _matchLength_ be the length of _matched_. 1. Let _tailPos_ be _position_ + _matchLength_. 1. Let _refReplacement_ be the substring of _str_ from min(_tailPos_, _stringLength_). - 1. NOTE: _tailPos_ can exceed _stringLength_ only if this abstract operation was invoked by a call to the intrinsic @@replace method of %RegExp.prototype% on an object whose *"exec"* property is not the intrinsic %RegExp.prototype.exec%. + 1. NOTE: _tailPos_ can exceed _stringLength_ only if this abstract operation was invoked by a call to the intrinsic %Symbol.replace% method of %RegExp.prototype% on an object whose *"exec"* property is not the intrinsic %RegExp.prototype.exec%. 1. Else if _templateRemainder_ starts with *"$"* followed by 1 or more decimal digits, then - 1. If _templateRemainder_ starts with *"$"* followed by 2 or more decimal digits, let _digitCount_ be 2. Otherwise, let _digitCount_ be 1. + 1. If _templateRemainder_ starts with *"$"* followed by 2 or more decimal digits, let _digitCount_ be 2; else let _digitCount_ be 1. 1. Let _digits_ be the substring of _templateRemainder_ from 1 to 1 + _digitCount_. 1. Let _index_ be ℝ(StringToNumber(_digits_)). 1. Assert: 0 ≤ _index_ ≤ 99. @@ -34949,18 +36077,19 @@

      - +

      String.prototype.replaceAll ( _searchValue_, _replaceValue_ )

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). - 1. If _searchValue_ is neither *undefined* nor *null*, then + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). + 1. If _searchValue_ is an Object, then 1. Let _isRegExp_ be ? IsRegExp(_searchValue_). 1. If _isRegExp_ is *true*, then 1. Let _flags_ be ? Get(_searchValue_, *"flags"*). 1. Perform ? RequireObjectCoercible(_flags_). 1. If ? ToString(_flags_) does not contain *"g"*, throw a *TypeError* exception. - 1. Let _replacer_ be ? GetMethod(_searchValue_, @@replace). + 1. Let _replacer_ be ? GetMethod(_searchValue_, %Symbol.replace%). 1. If _replacer_ is not *undefined*, then 1. Return ? Call(_replacer_, _searchValue_, « _O_, _replaceValue_ »). 1. Let _string_ be ? ToString(_O_). @@ -34993,30 +36122,32 @@

      String.prototype.replaceAll ( _searchValue_, _replaceValue_ )

      - +

      String.prototype.search ( _regexp_ )

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). - 1. If _regexp_ is neither *undefined* nor *null*, then - 1. Let _searcher_ be ? GetMethod(_regexp_, @@search). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). + 1. If _regexp_ is an Object, then + 1. Let _searcher_ be ? GetMethod(_regexp_, %Symbol.search%). 1. If _searcher_ is not *undefined*, then 1. Return ? Call(_searcher_, _regexp_, « _O_ »). 1. Let _string_ be ? ToString(_O_). 1. Let _rx_ be ? RegExpCreate(_regexp_, *undefined*). - 1. Return ? Invoke(_rx_, @@search, « _string_ »). + 1. Return ? Invoke(_rx_, %Symbol.search%, « _string_ »).

      This method is intentionally generic; it does not require that its *this* value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

      - +

      String.prototype.slice ( _start_, _end_ )

      This method returns a substring of the result of converting this object to a String, starting from index _start_ and running to, but not including, index _end_ (or through the end of the String if _end_ is *undefined*). If _start_ is negative, it is treated as _sourceLength_ + _start_ where _sourceLength_ is the length of the String. If _end_ is negative, it is treated as _sourceLength_ + _end_ where _sourceLength_ is the length of the String. The result is a String value, not a String object.

      It performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Let _len_ be the length of _S_. 1. Let _intStart_ be ? ToIntegerOrInfinity(_start_). @@ -35035,14 +36166,15 @@

      String.prototype.slice ( _start_, _end_ )

      - +

      String.prototype.split ( _separator_, _limit_ )

      -

      This method returns an Array into which substrings of the result of converting this object to a String have been stored. The substrings are determined by searching from left to right for occurrences of _separator_; these occurrences are not part of any String in the returned array, but serve to divide up the String value. The value of _separator_ may be a String of any length or it may be an object, such as a RegExp, that has a @@split method.

      +

      This method returns an Array into which substrings of the result of converting this object to a String have been stored. The substrings are determined by searching from left to right for occurrences of _separator_; these occurrences are not part of any String in the returned array, but serve to divide up the String value. The value of _separator_ may be a String of any length or it may be an object, such as a RegExp, that has a %Symbol.split% method.

      It performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). - 1. If _separator_ is neither *undefined* nor *null*, then - 1. Let _splitter_ be ? GetMethod(_separator_, @@split). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). + 1. If _separator_ is an Object, then + 1. Let _splitter_ be ? GetMethod(_separator_, %Symbol.split%). 1. If _splitter_ is not *undefined*, then 1. Return ? Call(_splitter_, _separator_, « _O_, _limit_ »). 1. Let _S_ be ? ToString(_O_). @@ -35054,7 +36186,9 @@

      String.prototype.split ( _separator_, _limit_ )

      1. Return CreateArrayFromList(« _S_ »). 1. Let _separatorLength_ be the length of _R_. 1. If _separatorLength_ = 0, then - 1. Let _head_ be the substring of _S_ from 0 to _lim_. + 1. Let _strLen_ be the length of _S_. + 1. Let _outLen_ be the result of clamping _lim_ between 0 and _strLen_. + 1. Let _head_ be the substring of _S_ from 0 to _outLen_. 1. Let _codeUnits_ be a List consisting of the sequence of code units that are the elements of _head_. 1. Return CreateArrayFromList(_codeUnits_). 1. If _S_ is the empty String, return CreateArrayFromList(« _S_ »). @@ -35081,11 +36215,12 @@

      String.prototype.split ( _separator_, _limit_ )

      - +

      String.prototype.startsWith ( _searchString_ [ , _position_ ] )

      This method performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Let _isRegExp_ be ? IsRegExp(_searchString_). 1. If _isRegExp_ is *true*, throw a *TypeError* exception. @@ -35112,14 +36247,15 @@

      String.prototype.startsWith ( _searchString_ [ , _position_ ] )

      - +

      String.prototype.substring ( _start_, _end_ )

      This method returns a substring of the result of converting this object to a String, starting from index _start_ and running to, but not including, index _end_ of the String (or through the end of the String if _end_ is *undefined*). The result is a String value, not a String object.

      If either argument is *NaN* or negative, it is replaced with zero; if either argument is strictly greater than the length of the String, it is replaced with the length of the String.

      If _start_ is strictly greater than _end_, they are swapped.

      It performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Let _len_ be the length of _S_. 1. Let _intStart_ be ? ToIntegerOrInfinity(_start_). @@ -35135,7 +36271,7 @@

      String.prototype.substring ( _start_, _end_ )

      - +

      String.prototype.toLocaleLowerCase ( [ _reserved1_ [ , _reserved2_ ] ] )

      An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used:

      This method interprets a String value as a sequence of UTF-16 encoded code points, as described in .

      @@ -35146,7 +36282,7 @@

      String.prototype.toLocaleLowerCase ( [ _reserved1_ [ , _reserved2_ ] ] )

      - +

      String.prototype.toLocaleUpperCase ( [ _reserved1_ [ , _reserved2_ ] ] )

      An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used:

      This method interprets a String value as a sequence of UTF-16 encoded code points, as described in .

      @@ -35157,15 +36293,16 @@

      String.prototype.toLocaleUpperCase ( [ _reserved1_ [ , _reserved2_ ] ] )

      - +

      String.prototype.toLowerCase ( )

      This method interprets a String value as a sequence of UTF-16 encoded code points, as described in .

      It performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Let _sText_ be StringToCodePoints(_S_). - 1. Let _lowerText_ be the result of toLowercase(_sText_), according to the Unicode Default Case Conversion algorithm. + 1. Let _lowerText_ be toLowercase(_sText_), according to the Unicode Default Case Conversion algorithm. 1. Let _L_ be CodePointsToString(_lowerText_). 1. Return _L_. @@ -35178,7 +36315,7 @@

      String.prototype.toLowerCase ( )

      - +

      String.prototype.toString ( )

      This method performs the following steps when called:

      @@ -35189,7 +36326,7 @@

      String.prototype.toString ( )

      - +

      String.prototype.toUpperCase ( )

      This method interprets a String value as a sequence of UTF-16 encoded code points, as described in .

      It behaves in exactly the same way as `String.prototype.toLowerCase`, except that the String is mapped using the toUppercase algorithm of the Unicode Default Case Conversion.

      @@ -35198,12 +36335,13 @@

      String.prototype.toUpperCase ( )

      - +

      String.prototype.toWellFormed ( )

      This method returns a String representation of this object with all leading surrogates and trailing surrogates that are not part of a surrogate pair replaced with U+FFFD (REPLACEMENT CHARACTER).

      It performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Let _strLen_ be the length of _S_. 1. Let _k_ be 0. @@ -35219,7 +36357,7 @@

      String.prototype.toWellFormed ( )

      - +

      String.prototype.trim ( )

      This method interprets a String value as a sequence of UTF-16 encoded code points, as described in .

      It performs the following steps when called:

      @@ -35243,8 +36381,8 @@

      It interprets _string_ as a sequence of UTF-16 encoded code points, as described in .
      - 1. Let _str_ be ? RequireObjectCoercible(_string_). - 1. Let _S_ be ? ToString(_str_). + 1. Perform ? RequireObjectCoercible(_string_). + 1. Let _S_ be ? ToString(_string_). 1. If _where_ is ~start~, then 1. Let _T_ be the String value that is a copy of _S_ with leading white space removed. 1. Else if _where_ is ~end~, then @@ -35258,7 +36396,7 @@

      - +

      String.prototype.trimEnd ( )

      This method interprets a String value as a sequence of UTF-16 encoded code points, as described in .

      It performs the following steps when called:

      @@ -35271,7 +36409,7 @@

      String.prototype.trimEnd ( )

      - +

      String.prototype.trimStart ( )

      This method interprets a String value as a sequence of UTF-16 encoded code points, as described in .

      It performs the following steps when called:

      @@ -35284,7 +36422,7 @@

      String.prototype.trimStart ( )

      - +

      String.prototype.valueOf ( )

      This method performs the following steps when called:

      @@ -35310,12 +36448,13 @@

      - -

      String.prototype [ @@iterator ] ( )

      -

      This method returns an Iterator object () that iterates over the code points of a String value, returning each code point as a String value.

      + +

      String.prototype [ %Symbol.iterator% ] ( )

      +

      This method returns an iterator object that iterates over the code points of a String value, returning each code point as a String value.

      It performs the following steps when called:

      - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _s_ be ? ToString(_O_). 1. Let _closure_ be a new Abstract Closure with no parameters that captures _s_ and performs the following steps when called: 1. Let _len_ be the length of _s_. @@ -35325,8 +36464,8 @@

      String.prototype [ @@iterator ] ( )

      1. Let _nextIndex_ be _position_ + _cp_.[[CodeUnitCount]]. 1. Let _resultString_ be the substring of _s_ from _position_ to _nextIndex_. 1. Set _position_ to _nextIndex_. - 1. Perform ? GeneratorYield(CreateIterResultObject(_resultString_, *false*)). - 1. Return *undefined*. + 1. Perform ? GeneratorYield(CreateIteratorResultObject(_resultString_, *false*)). + 1. Return NormalCompletion(~unused~). 1. Return CreateIteratorFromClosure(_closure_, *"%StringIteratorPrototype%"*, %StringIteratorPrototype%).

      The value of the *"name"* property of this method is *"[Symbol.iterator]"*.

      @@ -35347,28 +36486,28 @@

      length

      String Iterator Objects

      -

      A String Iterator is an object, that represents a specific iteration over some specific String instance object. There is not a named constructor for String Iterator objects. Instead, String iterator objects are created by calling certain methods of String instance objects.

      +

      A String Iterator is an object that represents a specific iteration over some specific String instance object. There is not a named constructor for String Iterator objects. Instead, String Iterator objects are created by calling certain methods of String instance objects.

      The %StringIteratorPrototype% Object

      The %StringIteratorPrototype% object:

        -
      • has properties that are inherited by all String Iterator Objects.
      • +
      • has properties that are inherited by all String Iterator objects.
      • is an ordinary object.
      • -
      • has a [[Prototype]] internal slot whose value is %IteratorPrototype%.
      • +
      • has a [[Prototype]] internal slot whose value is %Iterator.prototype%.
      • has the following properties:
      - +

      %StringIteratorPrototype%.next ( )

      1. Return ? GeneratorResume(*this* value, ~empty~, *"%StringIteratorPrototype%"*).
      - -

      %StringIteratorPrototype% [ @@toStringTag ]

      -

      The initial value of the @@toStringTag property is the String value *"String Iterator"*.

      + +

      %StringIteratorPrototype% [ %Symbol.toStringTag% ]

      +

      The initial value of the %Symbol.toStringTag% property is the String value *"String Iterator"*.

      This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

      @@ -35431,7 +36570,15 @@

      Syntax

      `\` AtomEscape[?UnicodeMode, ?NamedCaptureGroups] CharacterClass[?UnicodeMode, ?UnicodeSetsMode] `(` GroupSpecifier[?UnicodeMode]? Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] `)` - `(?:` Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] `)` + `(?` RegularExpressionModifiers `:` Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] `)` + `(?` RegularExpressionModifiers `-` RegularExpressionModifiers `:` Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] `)` + + RegularExpressionModifiers :: + [empty] + RegularExpressionModifiers RegularExpressionModifier + + RegularExpressionModifier :: one of + `i` `m` `s` SyntaxCharacter :: one of `^` `$` `\` `.` `*` `+` `?` `(` `)` `[` `]` `{` `}` `|` @@ -35667,7 +36814,7 @@

      Static Semantics: Early Errors

      It is a Syntax Error if CountLeftCapturingParensWithin(|Pattern|) ≥ 232 - 1.
    • - It is a Syntax Error if |Pattern| contains two or more |GroupSpecifier|s for which the CapturingGroupName of |GroupSpecifier| is the same. + It is a Syntax Error if |Pattern| contains two distinct |GroupSpecifier|s _x_ and _y_ such that the CapturingGroupName of _x_ is the CapturingGroupName of _y_ and such that MightBothParticipate(_x_, _y_) is *true*.
    • QuantifierPrefix :: `{` DecimalDigits `,` DecimalDigits `}` @@ -35676,6 +36823,27 @@

      Static Semantics: Early Errors

      It is a Syntax Error if the MV of the first |DecimalDigits| is strictly greater than the MV of the second |DecimalDigits|. + Atom :: `(?` RegularExpressionModifiers `:` Disjunction `)` +
        +
      • + It is a Syntax Error if the source text matched by |RegularExpressionModifiers| contains the same code point more than once. +
      • +
      + Atom :: `(?` RegularExpressionModifiers `-` RegularExpressionModifiers `:` Disjunction `)` +
        +
      • + It is a Syntax Error if the source text matched by the first |RegularExpressionModifiers| and the source text matched by the second |RegularExpressionModifiers| are both empty. +
      • +
      • + It is a Syntax Error if the source text matched by the first |RegularExpressionModifiers| contains the same code point more than once. +
      • +
      • + It is a Syntax Error if the source text matched by the second |RegularExpressionModifiers| contains the same code point more than once. +
      • +
      • + It is a Syntax Error if any code point in the source text matched by the first |RegularExpressionModifiers| is also contained in the source text matched by the second |RegularExpressionModifiers|. +
      • +
      AtomEscape :: `k` GroupName
      • @@ -35733,7 +36901,7 @@

        Static Semantics: Early Errors

        UnicodePropertyValueExpression :: UnicodePropertyName `=` UnicodePropertyValue
        • - It is a Syntax Error if the source text matched by |UnicodePropertyName| is not a Unicode property name or property alias listed in the “Property name and aliases” column of . + It is a Syntax Error if the source text matched by |UnicodePropertyName| is not a Unicode property name or property alias listed in the “Property name and aliases” column of .
        • It is a Syntax Error if the source text matched by |UnicodePropertyValue| is not a property value or property value alias for the Unicode property or property alias given by the source text matched by |UnicodePropertyName| listed in PropertyValueAliases.txt. @@ -35742,10 +36910,10 @@

          Static Semantics: Early Errors

          UnicodePropertyValueExpression :: LoneUnicodePropertyNameOrValue
          • - It is a Syntax Error if the source text matched by |LoneUnicodePropertyNameOrValue| is not a Unicode property value or property value alias for the General_Category (gc) property listed in PropertyValueAliases.txt, nor a binary property or binary property alias listed in the “Property name and aliases” column of , nor a binary property of strings listed in the “Property name” column of . + It is a Syntax Error if the source text matched by |LoneUnicodePropertyNameOrValue| is not a Unicode property value or property value alias for the General_Category (gc) property listed in PropertyValueAliases.txt, nor a binary property or binary property alias listed in the “Property name and aliases” column of , nor a binary property of strings listed in the “Property name” column of .
          • - It is a Syntax Error if the enclosing |Pattern| does not have a [UnicodeSetsMode] parameter and the source text matched by |LoneUnicodePropertyNameOrValue| is a binary property of strings listed in the “Property name” column of . + It is a Syntax Error if the enclosing |Pattern| does not have a [UnicodeSetsMode] parameter and the source text matched by |LoneUnicodePropertyNameOrValue| is a binary property of strings listed in the “Property name” column of .
          CharacterClassEscape :: `P{` UnicodePropertyValueExpression `}` @@ -35813,6 +36981,22 @@

          + +

          + Static Semantics: MightBothParticipate ( + _x_: a Parse Node, + _y_: a Parse Node, + ): a Boolean +

          +
          +
          + + 1. Assert: _x_ and _y_ have the same enclosing |Pattern|. + 1. If the enclosing |Pattern| contains a Disjunction :: Alternative `|` Disjunction Parse Node such that either _x_ is contained within the |Alternative| and _y_ is contained within the derived |Disjunction|, or _x_ is contained within the derived |Disjunction| and _y_ is contained within the |Alternative|, return *false*. + 1. Return *true*. + +
          +

          Static Semantics: CapturingGroupNumber ( ): a positive integer

          @@ -35898,23 +37082,25 @@

          Static Semantics: CharacterValue ( ): a non-negative integer

          - - - - - - - + + + + + + + + +
          - ControlEscape - - Numeric Value - - Code Point - - Unicode Name - - Symbol -
          + ControlEscape + + Numeric Value + + Code Point + + Unicode Name + + Symbol +
          `t` @@ -36097,7 +37283,7 @@

          Static Semantics: MayContainStrings ( ): a Boolean

          UnicodePropertyValueExpression :: LoneUnicodePropertyNameOrValue - 1. If the source text matched by |LoneUnicodePropertyNameOrValue| is a binary property of strings listed in the “Property name” column of , return *true*. + 1. If the source text matched by |LoneUnicodePropertyNameOrValue| is a binary property of strings listed in the “Property name” column of , return *true*. 1. Return *false*. ClassUnion :: ClassSetRange ClassUnion? @@ -36266,16 +37452,13 @@

          Notation

          A CaptureRange is a Record { [[StartIndex]], [[EndIndex]] } that represents the range of characters included in a capture, where [[StartIndex]] is an integer representing the start index (inclusive) of the range within _Input_, and [[EndIndex]] is an integer representing the end index (exclusive) of the range within _Input_. For any CaptureRange, these indices must satisfy the invariant that [[StartIndex]] ≤ [[EndIndex]].
        • - A MatchState is a Record { [[Input]], [[EndIndex]], [[Captures]] } where [[Input]] is a List of characters representing the String being matched, [[EndIndex]] is an integer, and [[Captures]] is a List of values, one for each left-capturing parenthesis in the pattern. States are used to represent partial match states in the regular expression matching algorithms. The [[EndIndex]] is one plus the index of the last input character matched so far by the pattern, while [[Captures]] holds the results of capturing parentheses. The _n_th element of [[Captures]] is either a CaptureRange representing the range of characters captured by the _n_th set of capturing parentheses, or *undefined* if the _n_th set of capturing parentheses hasn't been reached yet. Due to backtracking, many States may be in use at any time during the matching process. + A MatchState is a Record { [[Input]], [[EndIndex]], [[Captures]] } where [[Input]] is a List of characters representing the String being matched, [[EndIndex]] is an integer, and [[Captures]] is a List of values, one for each left-capturing parenthesis in the pattern. MatchStates are used to represent partial match states in the regular expression matching algorithms. The [[EndIndex]] is one plus the index of the last input character matched so far by the pattern, while [[Captures]] holds the results of capturing parentheses. The _n_th element of [[Captures]] is either a CaptureRange representing the range of characters captured by the _n_th set of capturing parentheses, or *undefined* if the _n_th set of capturing parentheses hasn't been reached yet. Due to backtracking, many MatchStates may be in use at any time during the matching process.
        • - A MatchResult is either a MatchState or the special token ~failure~ that indicates that the match failed. + A MatcherContinuation is an Abstract Closure that takes one MatchState argument and returns either a MatchState or ~failure~. The MatcherContinuation attempts to match the remaining portion (specified by the closure's captured values) of the pattern against _Input_, starting at the intermediate state given by its MatchState argument. If the match succeeds, the MatcherContinuation returns the final MatchState that it reached; if the match fails, the MatcherContinuation returns ~failure~.
        • - A MatcherContinuation is an Abstract Closure that takes one MatchState argument and returns a MatchResult result. The MatcherContinuation attempts to match the remaining portion (specified by the closure's captured values) of the pattern against _Input_, starting at the intermediate state given by its MatchState argument. If the match succeeds, the MatcherContinuation returns the final MatchState that it reached; if the match fails, the MatcherContinuation returns ~failure~. -
        • -
        • - A Matcher is an Abstract Closure that takes two arguments—a MatchState and a MatcherContinuation—and returns a MatchResult result. A Matcher attempts to match a middle subpattern (specified by the closure's captured values) of the pattern against the MatchState's [[Input]], starting at the intermediate state given by its MatchState argument. The MatcherContinuation argument should be a closure that matches the rest of the pattern. After matching the subpattern of a pattern to obtain a new MatchState, the Matcher then calls MatcherContinuation on that new MatchState to test if the rest of the pattern can match as well. If it can, the Matcher returns the MatchState returned by MatcherContinuation; if not, the Matcher may try different choices at its choice points, repeatedly calling MatcherContinuation until it either succeeds or all possibilities have been exhausted. + A Matcher is an Abstract Closure that takes two arguments—a MatchState and a MatcherContinuation—and returns either a MatchState or ~failure~. A Matcher attempts to match a middle subpattern (specified by the closure's captured values) of the pattern against the MatchState's [[Input]], starting at the intermediate state given by its MatchState argument. The MatcherContinuation argument should be a closure that matches the rest of the pattern. After matching the subpattern of a pattern to obtain a new MatchState, the Matcher then calls MatcherContinuation on that new MatchState to test if the rest of the pattern can match as well. If it can, the Matcher returns the MatchState returned by MatcherContinuation; if not, the Matcher may try different choices at its choice points, repeatedly calling MatcherContinuation until it either succeeds or all possibilities have been exhausted.
        • @@ -36285,11 +37468,13 @@

          RegExp Records

          It has the following fields:

          - - - - - + + + + + + + @@ -36329,7 +37514,7 @@

          RegExp Records

          Runtime Semantics: CompilePattern ( _rer_: a RegExp Record, - ): an Abstract Closure that takes a List of characters and a non-negative integer and returns a MatchResult + ): an Abstract Closure that takes a List of characters and a non-negative integer and returns either a MatchState or ~failure~

          @@ -36434,7 +37619,7 @@

          _c_: a MatcherContinuation, _parenIndex_: a non-negative integer, _parenCount_: a non-negative integer, - ): a MatchResult + ): either a MatchState or ~failure~

          @@ -36443,8 +37628,8 @@

          1. Let _d_ be a new MatcherContinuation with parameters (_y_) that captures _m_, _min_, _max_, _greedy_, _x_, _c_, _parenIndex_, and _parenCount_ and performs the following steps when called: 1. Assert: _y_ is a MatchState. 1. [id="step-repeatmatcher-done"] If _min_ = 0 and _y_.[[EndIndex]] = _x_.[[EndIndex]], return ~failure~. - 1. If _min_ = 0, let _min2_ be 0; otherwise let _min2_ be _min_ - 1. - 1. If _max_ = +∞, let _max2_ be +∞; otherwise let _max2_ be _max_ - 1. + 1. If _min_ = 0, let _min2_ be 0; else let _min2_ be _min_ - 1. + 1. If _max_ = +∞, let _max2_ be +∞; else let _max2_ be _max_ - 1. 1. Return RepeatMatcher(_m_, _min2_, _max2_, _greedy_, _y_, _c_, _parenIndex_, _parenCount_). 1. Let _cap_ be a copy of _x_.[[Captures]]. 1. [id="step-repeatmatcher-clear-captures"] For each integer _k_ in the inclusive interval from _parenIndex_ + 1 to _parenIndex_ + _parenCount_, set _cap_[_k_] to *undefined*. @@ -36552,15 +37737,14 @@

          1. Assert: _y_ is a MatchState. 1. Return _m2_(_y_, _c_). 1. Return _m1_(_x_, _d_). - 1. Else, - 1. Assert: _direction_ is ~backward~. - 1. Return a new Matcher with parameters (_x_, _c_) that captures _m1_ and _m2_ and performs the following steps when called: - 1. Assert: _x_ is a MatchState. - 1. Assert: _c_ is a MatcherContinuation. - 1. Let _d_ be a new MatcherContinuation with parameters (_y_) that captures _c_ and _m1_ and performs the following steps when called: - 1. Assert: _y_ is a MatchState. - 1. Return _m1_(_y_, _c_). - 1. Return _m2_(_x_, _d_). + 1. Assert: _direction_ is ~backward~. + 1. Return a new Matcher with parameters (_x_, _c_) that captures _m1_ and _m2_ and performs the following steps when called: + 1. Assert: _x_ is a MatchState. + 1. Assert: _c_ is a MatcherContinuation. + 1. Let _d_ be a new MatcherContinuation with parameters (_y_) that captures _c_ and _m1_ and performs the following steps when called: + 1. Assert: _y_ is a MatchState. + 1. Return _m1_(_y_, _c_). + 1. Return _m2_(_x_, _d_). @@ -36856,9 +38040,19 @@

          Parentheses of the form `(` |Disjunction| `)` serve both to group the components of the |Disjunction| pattern together and to save the result of the match. The result can be used either in a backreference (`\\` followed by a non-zero decimal number), referenced in a replace String, or returned as part of an array from the regular expression matching Abstract Closure. To inhibit the capturing behaviour of parentheses, use the form `(?:` |Disjunction| `)` instead.

          - Atom :: `(?:` Disjunction `)` + Atom :: `(?` RegularExpressionModifiers `:` Disjunction `)` + + 1. Let _addModifiers_ be the source text matched by |RegularExpressionModifiers|. + 1. Let _removeModifiers_ be the empty String. + 1. Let _modifiedRer_ be UpdateModifiers(_rer_, CodePointsToString(_addModifiers_), _removeModifiers_). + 1. Return CompileSubpattern of |Disjunction| with arguments _modifiedRer_ and _direction_. + + Atom :: `(?` RegularExpressionModifiers `-` RegularExpressionModifiers `:` Disjunction `)` - 1. Return CompileSubpattern of |Disjunction| with arguments _rer_ and _direction_. + 1. Let _addModifiers_ be the source text matched by the first |RegularExpressionModifiers|. + 1. Let _removeModifiers_ be the source text matched by the second |RegularExpressionModifiers|. + 1. Let _modifiedRer_ be UpdateModifiers(_rer_, CodePointsToString(_addModifiers_), CodePointsToString(_removeModifiers_)). + 1. Return CompileSubpattern of |Disjunction| with arguments _modifiedRer_ and _direction_. @@ -36866,7 +38060,7 @@

          1. Let _n_ be the CapturingGroupNumber of |DecimalEscape|. 1. Assert: _n_ ≤ _rer_.[[CapturingGroupsCount]]. - 1. Return BackreferenceMatcher(_rer_, _n_, _direction_). + 1. Return BackreferenceMatcher(_rer_, « _n_ », _direction_).

          An escape sequence of the form `\\` followed by a non-zero decimal number _n_ matches the result of the _n_th set of capturing parentheses (). It is an error if the regular expression has fewer than _n_ capturing parentheses. If the regular expression has _n_ or more capturing parentheses but the _n_th one is *undefined* because it has not captured anything, then the backreference always succeeds.

          @@ -36902,10 +38096,11 @@

          AtomEscape :: `k` GroupName 1. Let _matchingGroupSpecifiers_ be GroupSpecifiersThatMatch(|GroupName|). - 1. Assert: _matchingGroupSpecifiers_ contains a single |GroupSpecifier|. - 1. Let _groupSpecifier_ be the sole element of _matchingGroupSpecifiers_. - 1. Let _parenIndex_ be CountLeftCapturingParensBefore(_groupSpecifier_). - 1. Return BackreferenceMatcher(_rer_, _parenIndex_, _direction_). + 1. Let _parenIndices_ be a new empty List. + 1. For each |GroupSpecifier| _groupSpecifier_ of _matchingGroupSpecifiers_, do + 1. Let _parenIndex_ be CountLeftCapturingParensBefore(_groupSpecifier_). + 1. Append _parenIndex_ to _parenIndices_. + 1. Return BackreferenceMatcher(_rer_, _parenIndices_, _direction_). @@ -36935,7 +38130,7 @@

          1. Let _index_ be min(_e_, _f_). 1. Let _ch_ be the character _Input_[_index_]. 1. Let _cc_ be Canonicalize(_rer_, _ch_). - 1. If there exists a CharSetElement in _A_ containing exactly one character _a_ such that Canonicalize(_rer_, _a_) is _cc_, let _found_ be *true*. Otherwise, let _found_ be *false*. + 1. If there exists a CharSetElement in _A_ containing exactly one character _a_ such that Canonicalize(_rer_, _a_) is _cc_, let _found_ be *true*; else let _found_ be *false*. 1. If _invert_ is *false* and _found_ is *false*, return ~failure~. 1. If _invert_ is *true* and _found_ is *true*, return ~failure~. 1. Let _cap_ be _x_.[[Captures]]. @@ -36948,20 +38143,23 @@

          BackreferenceMatcher ( _rer_: a RegExp Record, - _n_: a positive integer, + _ns_: a List of positive integers, _direction_: ~forward~ or ~backward~, ): a Matcher

          - 1. Assert: _n_ ≥ 1. - 1. Return a new Matcher with parameters (_x_, _c_) that captures _rer_, _n_, and _direction_ and performs the following steps when called: + 1. Return a new Matcher with parameters (_x_, _c_) that captures _rer_, _ns_, and _direction_ and performs the following steps when called: 1. Assert: _x_ is a MatchState. 1. Assert: _c_ is a MatcherContinuation. 1. Let _Input_ be _x_.[[Input]]. 1. Let _cap_ be _x_.[[Captures]]. - 1. Let _r_ be _cap_[_n_]. + 1. Let _r_ be *undefined*. + 1. For each integer _n_ of _ns_, do + 1. If _cap_[_n_] is not *undefined*, then + 1. Assert: _r_ is *undefined*. + 1. Set _r_ to _cap_[_n_]. 1. If _r_ is *undefined*, return _c_(_x_). 1. Let _e_ be _x_.[[EndIndex]]. 1. Let _rs_ be _r_.[[StartIndex]]. @@ -36994,7 +38192,7 @@

          1. If _rer_.[[IgnoreCase]] is *false*, return _ch_. 1. Assert: _ch_ is a UTF-16 code unit. 1. Let _cp_ be the code point whose numeric value is the numeric value of _ch_. - 1. Let _u_ be the result of toUppercase(« _cp_ »), according to the Unicode Default Case Conversion algorithm. + 1. Let _u_ be toUppercase(« _cp_ »), according to the Unicode Default Case Conversion algorithm. 1. Let _uStr_ be CodePointsToString(_u_). 1. If the length of _uStr_ ≠ 1, return _ch_. 1. Let _cu_ be _uStr_'s single code unit element. @@ -37006,6 +38204,34 @@

          In case-insignificant matches when HasEitherUnicodeFlag(_rer_) is *false*, the mapping is based on Unicode Default Case Conversion algorithm toUppercase rather than toCasefold, which results in some subtle differences. For example, `Ω` (U+2126 OHM SIGN) is mapped by toUppercase to itself but by toCasefold to `ω` (U+03C9 GREEK SMALL LETTER OMEGA) along with `Ω` (U+03A9 GREEK CAPITAL LETTER OMEGA), so *"\u2126"* is matched by `/[ω]/ui` and `/[\u03A9]/ui` but not by `/[ω]/i` or `/[\u03A9]/i`. Also, no code point outside the Basic Latin block is mapped to a code point within it, so strings such as *"\u017F ſ"* and *"\u212A K"* are not matched by `/[a-z]/i`.

          + + +

          + UpdateModifiers ( + _rer_: a RegExp Record, + _add_: a String, + _remove_: a String, + ): a RegExp Record +

          +
          +
          + + 1. Assert: _add_ and _remove_ have no elements in common. + 1. Let _ignoreCase_ be _rer_.[[IgnoreCase]]. + 1. Let _multiline_ be _rer_.[[Multiline]]. + 1. Let _dotAll_ be _rer_.[[DotAll]]. + 1. Let _unicode_ be _rer_.[[Unicode]]. + 1. Let _unicodeSets_ be _rer_.[[UnicodeSets]]. + 1. Let _capturingGroupsCount_ be _rer_.[[CapturingGroupsCount]]. + 1. If _remove_ contains *"i"*, set _ignoreCase_ to *false*. + 1. Else if _add_ contains *"i"*, set _ignoreCase_ to *true*. + 1. If _remove_ contains *"m"*, set _multiline_ to *false*. + 1. Else if _add_ contains *"m"*, set _multiline_ to *true*. + 1. If _remove_ contains *"s"*, set _dotAll_ to *false*. + 1. Else if _add_ contains *"s"*, set _dotAll_ to *true*. + 1. Return the RegExp Record { [[IgnoreCase]]: _ignoreCase_, [[Multiline]]: _multiline_, [[DotAll]]: _dotAll_, [[Unicode]]: _unicode_, [[UnicodeSets]]: _unicodeSets_, [[CapturingGroupsCount]]: _capturingGroupsCount_ }. + +
          @@ -37159,7 +38385,7 @@

          1. Let _ps_ be the source text matched by |UnicodePropertyName|. 1. Let _p_ be UnicodeMatchProperty(_rer_, _ps_). - 1. Assert: _p_ is a Unicode property name or property alias listed in the “Property name and aliases” column of . + 1. Assert: _p_ is a Unicode property name or property alias listed in the “Property name and aliases” column of . 1. Let _vs_ be the source text matched by |UnicodePropertyValue|. 1. Let _v_ be UnicodeMatchPropertyValue(_p_, _vs_). 1. Let _A_ be the CharSet containing all Unicode code points whose character database definition includes the property _p_ with value _v_. @@ -37171,7 +38397,7 @@

          1. If UnicodeMatchPropertyValue(`General_Category`, _s_) is a Unicode property value or property value alias for the General_Category (gc) property listed in PropertyValueAliases.txt, then 1. Return the CharSet containing all Unicode code points whose character database definition includes the property “General_Category” with value _s_. 1. Let _p_ be UnicodeMatchProperty(_rer_, _s_). - 1. Assert: _p_ is a binary Unicode property or binary property alias listed in the “Property name and aliases” column of , or a binary Unicode property of strings listed in the “Property name” column of . + 1. Assert: _p_ is a binary Unicode property or binary property alias listed in the “Property name and aliases” column of , or a binary Unicode property of strings listed in the “Property name” column of . 1. Let _A_ be the CharSet containing all CharSetElements whose character database definition includes the property _p_ with value “True”. 1. Return MaybeSimpleCaseFolding(_rer_, _A_). @@ -37330,8 +38556,7 @@

          - 1. If _rer_.[[Unicode]] is *true* or _rer_.[[UnicodeSets]] is *true*, then - 1. Return *true*. + 1. If _rer_.[[Unicode]] is *true* or _rer_.[[UnicodeSets]] is *true*, return *true*. 1. Return *false*. @@ -37367,10 +38592,9 @@

          1. If _rer_.[[UnicodeSets]] is *true* and _rer_.[[IgnoreCase]] is *true*, then 1. [declared="c"] Return the CharSet containing all Unicode code points _c_ that do not have a Simple Case Folding mapping (that is, scf(_c_)=_c_). - 1. Else if HasEitherUnicodeFlag(_rer_) is *true*, then + 1. If HasEitherUnicodeFlag(_rer_) is *true*, then 1. Return the CharSet containing all code point values. - 1. Else, - 1. Return the CharSet containing all code unit values. + 1. Return the CharSet containing all code unit values. @@ -37417,20 +38641,20 @@

          UnicodeMatchProperty ( _rer_: a RegExp Record, _p_: ECMAScript source text, - ): a Unicode property name + ): a Unicode property name

          - 1. If _rer_.[[UnicodeSets]] is *true* and _p_ is a Unicode property name listed in the “Property name” column of , then + 1. If _rer_.[[UnicodeSets]] is *true* and _p_ is a Unicode property name listed in the “Property name” column of , then 1. Return the List of Unicode code points _p_. - 1. Assert: _p_ is a Unicode property name or property alias listed in the “Property name and aliases” column of or . - 1. Let _c_ be the canonical property name of _p_ as given in the “Canonical property name” column of the corresponding row. + 1. Assert: _p_ is a Unicode property name or property alias listed in the “Property name and aliases” column of or . + 1. Let _c_ be the canonical property name of _p_ as given in the “Canonical property name” column of the corresponding row. 1. Return the List of Unicode code points _c_. -

          Implementations must support the Unicode property names and aliases listed in , , and . To ensure interoperability, implementations must not support any other property names or aliases.

          +

          Implementations must support the Unicode property names and aliases listed in , , and . To ensure interoperability, implementations must not support any other property names or aliases.

          -

          For example, `Script_Extensions` (property name) and `scx` (property alias) are valid, but `script_extensions` or `Scx` aren't.

          +

          For example, `Script_Extensions` (property name) and `scx` (property alias) are valid, but `script_extensions` or `Scx` aren't.

          The listed properties form a superset of what UTS18 RL1.2 requires.

          @@ -37453,7 +38677,7 @@

          - 1. Assert: _p_ is a canonical, unaliased Unicode property name listed in the “Canonical property name” column of . + 1. Assert: _p_ is a canonical, unaliased Unicode property name listed in the “Canonical property name” column of . 1. Assert: _v_ is a property value or property value alias for the Unicode property _p_ listed in PropertyValueAliases.txt. 1. Let _value_ be the canonical property value of _v_ as given in the “Canonical property value” column of the corresponding row. 1. Return the List of Unicode code points _value_. @@ -37564,7 +38788,7 @@

          1. Let _rer_ be the RegExp Record { [[IgnoreCase]]: _i_, [[Multiline]]: _m_, [[DotAll]]: _s_, [[Unicode]]: _u_, [[UnicodeSets]]: _v_, [[CapturingGroupsCount]]: _capturingGroupsCount_ }. 1. Set _obj_.[[RegExpRecord]] to _rer_. 1. Set _obj_.[[RegExpMatcher]] to CompilePattern of _parseResult_ with argument _rer_. - 1. Perform ? Set(_obj_, *"lastIndex"*, *+0*𝔽, *true*). + 1. Perform ? Set(_obj_, *"lastIndex"*, *+0*𝔽, *true*). 1. Return _obj_. @@ -37607,7 +38831,7 @@

          The RegExp Constructor

        • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified RegExp behaviour must include a `super` call to the RegExp constructor to create and initialize subclass instances with the necessary internal slots.
        • - +

          RegExp ( _pattern_, _flags_ )

          This function performs the following steps when called:

          @@ -37649,21 +38873,79 @@

          Properties of the RegExp Constructor

        • has the following properties:
        • + +

          RegExp.escape ( _S_ )

          +

          This function returns a copy of _S_ in which characters that are potentially special in a regular expression |Pattern| have been replaced by equivalent escape sequences.

          +

          It performs the following steps when called:

          + + + 1. If _S_ is not a String, throw a *TypeError* exception. + 1. Let _escaped_ be the empty String. + 1. Let _cpList_ be StringToCodePoints(_S_). + 1. For each code point _cp_ of _cpList_, do + 1. If _escaped_ is the empty String and _cp_ is matched by either |DecimalDigit| or |AsciiLetter|, then + 1. NOTE: Escaping a leading digit ensures that output corresponds with pattern text which may be used after a `\0` character escape or a |DecimalEscape| such as `\1` and still match _S_ rather than be interpreted as an extension of the preceding escape sequence. Escaping a leading ASCII letter does the same for the context after `\c`. + 1. Let _numericValue_ be the numeric value of _cp_. + 1. Let _hex_ be Number::toString(𝔽(_numericValue_), 16). + 1. Assert: The length of _hex_ is 2. + 1. Set _escaped_ to the string-concatenation of the code unit 0x005C (REVERSE SOLIDUS), *"x"*, and _hex_. + 1. Else, + 1. Set _escaped_ to the string-concatenation of _escaped_ and EncodeForRegExpEscape(_cp_). + 1. Return _escaped_. + + + +

          Despite having similar names, EscapeRegExpPattern and `RegExp.escape` do not perform similar actions. The former escapes a pattern for representation as a string, while this function escapes a string for representation inside a pattern.

          +
          + + +

          + EncodeForRegExpEscape ( + _cp_: a code point, + ): a String +

          +
          +
          description
          +
          It returns a String representing a |Pattern| for matching _cp_. If _cp_ is white space or an ASCII punctuator, the returned value is an escape sequence. Otherwise, the returned value is a String representation of _cp_ itself.
          +
          + + + 1. If _cp_ is matched by |SyntaxCharacter| or _cp_ is U+002F (SOLIDUS), then + 1. Return the string-concatenation of 0x005C (REVERSE SOLIDUS) and UTF16EncodeCodePoint(_cp_). + 1. If _cp_ is a code point listed in the “Code Point” column of , then + 1. Return the string-concatenation of 0x005C (REVERSE SOLIDUS) and the string in the “ControlEscape” column of the row whose “Code Point” column contains _cp_. + 1. Let _otherPunctuators_ be the string-concatenation of *",-=<>#&!%:;@~'`"* and the code unit 0x0022 (QUOTATION MARK). + 1. Let _toEscape_ be StringToCodePoints(_otherPunctuators_). + 1. If _toEscape_ contains _cp_, _cp_ is matched by either |WhiteSpace| or |LineTerminator|, or _cp_ has the same numeric value as a leading surrogate or trailing surrogate, then + 1. Let _cpNum_ be the numeric value of _cp_. + 1. If _cpNum_ ≤ 0xFF, then + 1. Let _hex_ be Number::toString(𝔽(_cpNum_), 16). + 1. Return the string-concatenation of the code unit 0x005C (REVERSE SOLIDUS), *"x"*, and StringPad(_hex_, 2, *"0"*, ~start~). + 1. Let _escaped_ be the empty String. + 1. Let _codeUnits_ be UTF16EncodeCodePoint(_cp_). + 1. For each code unit _cu_ of _codeUnits_, do + 1. Set _escaped_ to the string-concatenation of _escaped_ and UnicodeEscape(_cu_). + 1. Return _escaped_. + 1. Return UTF16EncodeCodePoint(_cp_). + +
          +
          +

          RegExp.prototype

          The initial value of `RegExp.prototype` is the RegExp prototype object.

          This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

          - -

          get RegExp [ @@species ]

          -

          `RegExp[@@species]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

          + +

          get RegExp [ %Symbol.species% ]

          +

          `RegExp[%Symbol.species%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

          1. Return the *this* value.

          The value of the *"name"* property of this function is *"get [Symbol.species]"*.

          -

          RegExp prototype methods normally use their *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour by redefining its @@species property.

          +

          RegExp prototype methods normally use their *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour by redefining its %Symbol.species% property.

          @@ -37686,7 +38968,7 @@

          RegExp.prototype.constructor

          The initial value of `RegExp.prototype.constructor` is %RegExp%.

          - +

          RegExp.prototype.exec ( _string_ )

          This method searches _string_ for an occurrence of the regular expression pattern and returns an Array containing the results of the match, or *null* if _string_ did not match.

          It performs the following steps when called:

          @@ -37698,7 +38980,7 @@

          RegExp.prototype.exec ( _string_ )

          - +

          get RegExp.prototype.dotAll

          `RegExp.prototype.dotAll` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

          @@ -37708,7 +38990,7 @@

          get RegExp.prototype.dotAll

          - +

          get RegExp.prototype.flags

          `RegExp.prototype.flags` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

          @@ -37747,7 +39029,7 @@

          1. If _R_ is not an Object, throw a *TypeError* exception. 1. If _R_ does not have an [[OriginalFlags]] internal slot, then 1. If SameValue(_R_, %RegExp.prototype%) is *true*, return *undefined*. - 1. Otherwise, throw a *TypeError* exception. + 1. Throw a *TypeError* exception. 1. Let _flags_ be _R_.[[OriginalFlags]]. 1. If _flags_ contains _codeUnit_, return *true*. 1. Return *false*. @@ -37755,7 +39037,7 @@

          - +

          get RegExp.prototype.global

          `RegExp.prototype.global` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

          @@ -37765,7 +39047,7 @@

          get RegExp.prototype.global

          - +

          get RegExp.prototype.hasIndices

          `RegExp.prototype.hasIndices` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

          @@ -37775,7 +39057,7 @@

          get RegExp.prototype.hasIndices

          - +

          get RegExp.prototype.ignoreCase

          `RegExp.prototype.ignoreCase` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

          @@ -37785,43 +39067,40 @@

          get RegExp.prototype.ignoreCase

          - -

          RegExp.prototype [ @@match ] ( _string_ )

          + +

          RegExp.prototype [ %Symbol.match% ] ( _string_ )

          This method performs the following steps when called:

          1. Let _rx_ be the *this* value. 1. If _rx_ is not an Object, throw a *TypeError* exception. 1. Let _S_ be ? ToString(_string_). 1. Let _flags_ be ? ToString(? Get(_rx_, *"flags"*)). - 1. If _flags_ does not contain *"g"*, then - 1. Return ? RegExpExec(_rx_, _S_). - 1. Else, - 1. If _flags_ contains *"u"* or _flags_ contains *"v"*, let _fullUnicode_ be *true*. Otherwise, let _fullUnicode_ be *false*. - 1. Perform ? Set(_rx_, *"lastIndex"*, *+0*𝔽, *true*). - 1. Let _A_ be ! ArrayCreate(0). - 1. Let _n_ be 0. - 1. Repeat, - 1. Let _result_ be ? RegExpExec(_rx_, _S_). - 1. If _result_ is *null*, then - 1. If _n_ = 0, return *null*. - 1. Return _A_. - 1. Else, - 1. Let _matchStr_ be ? ToString(? Get(_result_, *"0"*)). - 1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_n_)), _matchStr_). - 1. If _matchStr_ is the empty String, then - 1. Let _thisIndex_ be ℝ(? ToLength(? Get(_rx_, *"lastIndex"*))). - 1. Let _nextIndex_ be AdvanceStringIndex(_S_, _thisIndex_, _fullUnicode_). - 1. Perform ? Set(_rx_, *"lastIndex"*, 𝔽(_nextIndex_), *true*). - 1. Set _n_ to _n_ + 1. + 1. If _flags_ does not contain *"g"*, return ? RegExpExec(_rx_, _S_). + 1. If _flags_ contains *"u"* or _flags_ contains *"v"*, let _fullUnicode_ be *true*; else let _fullUnicode_ be *false*. + 1. Perform ? Set(_rx_, *"lastIndex"*, *+0*𝔽, *true*). + 1. Let _A_ be ! ArrayCreate(0). + 1. Let _n_ be 0. + 1. Repeat, + 1. Let _result_ be ? RegExpExec(_rx_, _S_). + 1. If _result_ is *null*, then + 1. If _n_ = 0, return *null*. + 1. Return _A_. + 1. Let _matchStr_ be ? ToString(? Get(_result_, *"0"*)). + 1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_n_)), _matchStr_). + 1. If _matchStr_ is the empty String, then + 1. Let _thisIndex_ be ℝ(? ToLength(? Get(_rx_, *"lastIndex"*))). + 1. Let _nextIndex_ be AdvanceStringIndex(_S_, _thisIndex_, _fullUnicode_). + 1. Perform ? Set(_rx_, *"lastIndex"*, 𝔽(_nextIndex_), *true*). + 1. Set _n_ to _n_ + 1.

          The value of the *"name"* property of this method is *"[Symbol.match]"*.

          -

          The @@match property is used by the IsRegExp abstract operation to identify objects that have the basic behaviour of regular expressions. The absence of a @@match property or the existence of such a property whose value does not Boolean coerce to *true* indicates that the object is not intended to be used as a regular expression object.

          +

          The %Symbol.match% property is used by the IsRegExp abstract operation to identify objects that have the basic behaviour of regular expressions. The absence of a %Symbol.match% property or the existence of such a property whose value does not Boolean coerce to *true* indicates that the object is not intended to be used as a regular expression object.

          - -

          RegExp.prototype [ @@matchAll ] ( _string_ )

          + +

          RegExp.prototype [ %Symbol.matchAll% ] ( _string_ )

          This method performs the following steps when called:

          1. Let _R_ be the *this* value. @@ -37841,7 +39120,7 @@

          RegExp.prototype [ @@matchAll ] ( _string_ )

          The value of the *"name"* property of this method is *"[Symbol.matchAll]"*.

          - +

          get RegExp.prototype.multiline

          `RegExp.prototype.multiline` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

          @@ -37851,8 +39130,8 @@

          get RegExp.prototype.multiline

          - -

          RegExp.prototype [ @@replace ] ( _string_, _replaceValue_ )

          + +

          RegExp.prototype [ %Symbol.replace% ] ( _string_, _replaceValue_ )

          This method performs the following steps when called:

          1. Let _rx_ be the *this* value. @@ -37863,7 +39142,7 @@

          RegExp.prototype [ @@replace ] ( _string_, _replaceValue_ )

          1. If _functionalReplace_ is *false*, then 1. Set _replaceValue_ to ? ToString(_replaceValue_). 1. Let _flags_ be ? ToString(? Get(_rx_, *"flags"*)). - 1. If _flags_ contains *"g"*, let _global_ be *true*. Otherwise, let _global_ be *false*. + 1. If _flags_ contains *"g"*, let _global_ be *true*; else let _global_ be *false*. 1. If _global_ is *true*, then 1. Perform ? Set(_rx_, *"lastIndex"*, *+0*𝔽, *true*). 1. Let _results_ be a new empty List. @@ -37880,7 +39159,7 @@

          RegExp.prototype [ @@replace ] ( _string_, _replaceValue_ )

          1. Let _matchStr_ be ? ToString(? Get(_result_, *"0"*)). 1. If _matchStr_ is the empty String, then 1. Let _thisIndex_ be ℝ(? ToLength(? Get(_rx_, *"lastIndex"*))). - 1. If _flags_ contains *"u"* or _flags_ contains *"v"*, let _fullUnicode_ be *true*. Otherwise, let _fullUnicode_ be *false*. + 1. If _flags_ contains *"u"* or _flags_ contains *"v"*, let _fullUnicode_ be *true*; else let _fullUnicode_ be *false*. 1. Let _nextIndex_ be AdvanceStringIndex(_S_, _thisIndex_, _fullUnicode_). 1. Perform ? Set(_rx_, *"lastIndex"*, 𝔽(_nextIndex_), *true*). 1. Let _accumulatedResult_ be the empty String. @@ -37906,15 +39185,15 @@

          RegExp.prototype [ @@replace ] ( _string_, _replaceValue_ )

          1. Let _replacerArgs_ be the list-concatenation of « _matched_ », _captures_, and « 𝔽(_position_), _S_ ». 1. If _namedCaptures_ is not *undefined*, then 1. Append _namedCaptures_ to _replacerArgs_. - 1. Let _replValue_ be ? Call(_replaceValue_, *undefined*, _replacerArgs_). - 1. Let _replacement_ be ? ToString(_replValue_). + 1. Let _replacementValue_ be ? Call(_replaceValue_, *undefined*, _replacerArgs_). + 1. Let _replacementString_ be ? ToString(_replacementValue_). 1. Else, 1. If _namedCaptures_ is not *undefined*, then 1. Set _namedCaptures_ to ? ToObject(_namedCaptures_). - 1. Let _replacement_ be ? GetSubstitution(_matched_, _S_, _position_, _captures_, _namedCaptures_, _replaceValue_). + 1. Let _replacementString_ be ? GetSubstitution(_matched_, _S_, _position_, _captures_, _namedCaptures_, _replaceValue_). 1. If _position_ ≥ _nextSourcePosition_, then 1. NOTE: _position_ should not normally move backwards. If it does, it is an indication of an ill-behaving RegExp subclass or use of an access triggered side-effect to change the global flag or other characteristics of _rx_. In such cases, the corresponding substitution is ignored. - 1. Set _accumulatedResult_ to the string-concatenation of _accumulatedResult_, the substring of _S_ from _nextSourcePosition_ to _position_, and _replacement_. + 1. Set _accumulatedResult_ to the string-concatenation of _accumulatedResult_, the substring of _S_ from _nextSourcePosition_ to _position_, and _replacementString_. 1. Set _nextSourcePosition_ to _position_ + _matchLength_. 1. If _nextSourcePosition_ ≥ _lengthS_, return _accumulatedResult_. 1. Return the string-concatenation of _accumulatedResult_ and the substring of _S_ from _nextSourcePosition_. @@ -37922,8 +39201,8 @@

          RegExp.prototype [ @@replace ] ( _string_, _replaceValue_ )

          The value of the *"name"* property of this method is *"[Symbol.replace]"*.

          - -

          RegExp.prototype [ @@search ] ( _string_ )

          + +

          RegExp.prototype [ %Symbol.search% ] ( _string_ )

          This method performs the following steps when called:

          1. Let _rx_ be the *this* value. @@ -37945,7 +39224,7 @@

          RegExp.prototype [ @@search ] ( _string_ )

          - +

          get RegExp.prototype.source

          `RegExp.prototype.source` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

          @@ -37953,7 +39232,7 @@

          get RegExp.prototype.source

          1. If _R_ is not an Object, throw a *TypeError* exception. 1. If _R_ does not have an [[OriginalSource]] internal slot, then 1. If SameValue(_R_, %RegExp.prototype%) is *true*, return *"(?:)"*. - 1. Otherwise, throw a *TypeError* exception. + 1. Throw a *TypeError* exception. 1. Assert: _R_ has an [[OriginalFlags]] internal slot. 1. Let _src_ be _R_.[[OriginalSource]]. 1. Let _flags_ be _R_.[[OriginalFlags]]. @@ -37980,11 +39259,15 @@

          1. The code points `/` or any |LineTerminator| occurring in the pattern shall be escaped in _S_ as necessary to ensure that the string-concatenation of *"/"*, _S_, *"/"*, and _F_ can be parsed (in an appropriate lexical context) as a |RegularExpressionLiteral| that behaves identically to the constructed regular expression. For example, if _P_ is *"/"*, then _S_ could be *"\\/"* or *"\\u002F"*, among other possibilities, but not *"/"*, because `///` followed by _F_ would be parsed as a |SingleLineComment| rather than a |RegularExpressionLiteral|. If _P_ is the empty String, this specification can be met by letting _S_ be *"(?:)"*. 1. Return _S_. + + +

          Despite having similar names, `RegExp.escape` and EscapeRegExpPattern do not perform similar actions. The former escapes a string for representation inside a pattern, while this function escapes a pattern for representation as a string.

          +
          - -

          RegExp.prototype [ @@split ] ( _string_, _limit_ )

          + +

          RegExp.prototype [ %Symbol.split% ] ( _string_, _limit_ )

          This method returns an Array into which substrings of the result of converting _string_ to a String have been stored. The substrings are determined by searching from left to right for matches of the *this* value regular expression; these occurrences are not part of any String in the returned array, but serve to divide up the String value.

          The *this* value may be an empty regular expression or a regular expression that can match an empty String. In this case, the regular expression does not match the empty substring at the beginning or end of the input String, nor does it match the empty substring at the end of the previous separator match. (For example, if the regular expression matches the empty String, the String is split up into individual code unit elements; the length of the result array equals the length of the String, and each substring contains one code unit.) Only the first match at a given index of the String is considered, even if backtracking could yield a non-empty substring match at that index. (For example, `/a*?/[Symbol.split]("ab")` evaluates to the array `["a", "b"]`, while `/a*/[Symbol.split]("ab")` evaluates to the array `["","b"]`.)

          @@ -38055,7 +39338,7 @@

          RegExp.prototype [ @@split ] ( _string_, _limit_ )

          - +

          get RegExp.prototype.sticky

          `RegExp.prototype.sticky` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

          @@ -38065,7 +39348,7 @@

          get RegExp.prototype.sticky

          - +

          RegExp.prototype.test ( _S_ )

          This method performs the following steps when called:

          @@ -38073,11 +39356,12 @@

          RegExp.prototype.test ( _S_ )

          1. If _R_ is not an Object, throw a *TypeError* exception. 1. Let _string_ be ? ToString(_S_). 1. Let _match_ be ? RegExpExec(_R_, _string_). - 1. If _match_ is not *null*, return *true*; else return *false*. + 1. If _match_ is *null*, return *false*. + 1. Return *true*.
          - +

          RegExp.prototype.toString ( )

          1. Let _R_ be the *this* value. @@ -38092,7 +39376,7 @@

          RegExp.prototype.toString ( )

          - +

          get RegExp.prototype.unicode

          `RegExp.prototype.unicode` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

          @@ -38102,7 +39386,7 @@

          get RegExp.prototype.unicode

          - +

          get RegExp.prototype.unicodeSets

          `RegExp.prototype.unicodeSets` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

          @@ -38150,7 +39434,7 @@

          1. Let _length_ be the length of _S_. - 1. Let _lastIndex_ be ℝ(? ToLength(? Get(_R_, *"lastIndex"*))). + 1. Let _lastIndex_ be ℝ(? ToLength(! Get(_R_, *"lastIndex"*))). 1. Let _flags_ be _R_.[[OriginalFlags]]. 1. If _flags_ contains *"g"*, let _global_ be *true*; else let _global_ be *false*. 1. If _flags_ contains *"y"*, let _sticky_ be *true*; else let _sticky_ be *false*. @@ -38159,18 +39443,18 @@

          1. Let _matcher_ be _R_.[[RegExpMatcher]]. 1. If _flags_ contains *"u"* or _flags_ contains *"v"*, let _fullUnicode_ be *true*; else let _fullUnicode_ be *false*. 1. Let _matchSucceeded_ be *false*. - 1. If _fullUnicode_ is *true*, let _input_ be StringToCodePoints(_S_). Otherwise, let _input_ be a List whose elements are the code units that are the elements of _S_. + 1. If _fullUnicode_ is *true*, let _input_ be StringToCodePoints(_S_); else let _input_ be a List whose elements are the code units that are the elements of _S_. 1. NOTE: Each element of _input_ is considered to be a character. 1. Repeat, while _matchSucceeded_ is *false*, 1. If _lastIndex_ > _length_, then 1. If _global_ is *true* or _sticky_ is *true*, then - 1. Perform ? Set(_R_, *"lastIndex"*, *+0*𝔽, *true*). + 1. Perform ? Set(_R_, *"lastIndex"*, *+0*𝔽, *true*). 1. Return *null*. 1. Let _inputIndex_ be the index into _input_ of the character that was obtained from element _lastIndex_ of _S_. 1. Let _r_ be _matcher_(_input_, _inputIndex_). 1. If _r_ is ~failure~, then 1. If _sticky_ is *true*, then - 1. Perform ? Set(_R_, *"lastIndex"*, *+0*𝔽, *true*). + 1. Perform ? Set(_R_, *"lastIndex"*, *+0*𝔽, *true*). 1. Return *null*. 1. Set _lastIndex_ to AdvanceStringIndex(_S_, _lastIndex_, _fullUnicode_). 1. Else, @@ -38179,7 +39463,7 @@

          1. Let _e_ be _r_.[[EndIndex]]. 1. If _fullUnicode_ is *true*, set _e_ to GetStringIndex(_S_, _e_). 1. If _global_ is *true* or _sticky_ is *true*, then - 1. Perform ? Set(_R_, *"lastIndex"*, 𝔽(_e_), *true*). + 1. Perform ? Set(_R_, *"lastIndex"*, 𝔽(_e_), *true*). 1. Let _n_ be the number of elements in _r_.[[Captures]]. 1. Assert: _n_ = _R_.[[RegExpRecord]].[[CapturingGroupsCount]]. 1. Assert: _n_ < 232 - 1. @@ -38200,6 +39484,7 @@

          1. Let _groups_ be *undefined*. 1. Let _hasGroups_ be *false*. 1. Perform ! CreateDataPropertyOrThrow(_A_, *"groups"*, _groups_). + 1. Let _matchedGroupNames_ be a new empty List. 1. For each integer _i_ such that 1 ≤ _i_ ≤ _n_, in ascending order, do 1. Let _captureI_ be _i_th element of _r_.[[Captures]]. 1. If _captureI_ is *undefined*, then @@ -38217,8 +39502,14 @@

          1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_i_)), _capturedValue_). 1. If the _i_th capture of _R_ was defined with a |GroupName|, then 1. Let _s_ be the CapturingGroupName of that |GroupName|. - 1. Perform ! CreateDataPropertyOrThrow(_groups_, _s_, _capturedValue_). - 1. Append _s_ to _groupNames_. + 1. If _matchedGroupNames_ contains _s_, then + 1. Assert: _capturedValue_ is *undefined*. + 1. Append *undefined* to _groupNames_. + 1. Else, + 1. If _capturedValue_ is not *undefined*, append _s_ to _matchedGroupNames_. + 1. NOTE: If there are multiple groups named _s_, _groups_ may already have an _s_ property at this point. However, because _groups_ is an ordinary object whose properties are all writable data properties, the call to CreateDataPropertyOrThrow is nevertheless guaranteed to succeed. + 1. Perform ! CreateDataPropertyOrThrow(_groups_, _s_, _capturedValue_). + 1. Append _s_ to _groupNames_. 1. Else, 1. Append *undefined* to _groupNames_. 1. If _hasIndices_ is *true*, then @@ -38279,11 +39570,13 @@

          Match Records

          Match Records have the fields listed in .

          Field NameValueMeaning
          Field NameValueMeaning
          [[IgnoreCase]] a Boolean
          - - - - - + + + + + + + @@ -38357,9 +39650,12 @@

          1. Else, 1. Let _matchIndexPair_ be *undefined*. 1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_i_)), _matchIndexPair_). - 1. If _i_ > 0 and _groupNames_[_i_ - 1] is not *undefined*, then - 1. Assert: _groups_ is not *undefined*. - 1. Perform ! CreateDataPropertyOrThrow(_groups_, _groupNames_[_i_ - 1], _matchIndexPair_). + 1. If _i_ > 0, then + 1. Let _s_ be _groupNames_[_i_ - 1]. + 1. If _s_ is not *undefined*, then + 1. Assert: _groups_ is not *undefined*. + 1. NOTE: If there are multiple groups named _s_, _groups_ may already have an _s_ property at this point. However, because _groups_ is an ordinary object whose properties are all writable data properties, the call to CreateDataPropertyOrThrow is nevertheless guaranteed to succeed. + 1. Perform ! CreateDataPropertyOrThrow(_groups_, _s_, _matchIndexPair_). 1. Return _A_. @@ -38381,34 +39677,27 @@

          lastIndex

          RegExp String Iterator Objects

          -

          A RegExp String Iterator is an object, that represents a specific iteration over some specific String instance object, matching against some specific RegExp instance object. There is not a named constructor for RegExp String Iterator objects. Instead, RegExp String Iterator objects are created by calling certain methods of RegExp instance objects.

          +

          A RegExp String Iterator is an object that represents a specific iteration over some specific String instance object, matching against some specific RegExp instance object. There is not a named constructor for RegExp String Iterator objects. Instead, RegExp String Iterator objects are created by calling certain methods of RegExp instance objects.

          - +

          CreateRegExpStringIterator ( _R_: an Object, _S_: a String, _global_: a Boolean, _fullUnicode_: a Boolean, - ): a Generator + ): an Object

          - 1. Let _closure_ be a new Abstract Closure with no parameters that captures _R_, _S_, _global_, and _fullUnicode_ and performs the following steps when called: - 1. Repeat, - 1. Let _match_ be ? RegExpExec(_R_, _S_). - 1. If _match_ is *null*, return *undefined*. - 1. If _global_ is *false*, then - 1. Perform ? GeneratorYield(CreateIterResultObject(_match_, *false*)). - 1. Return *undefined*. - 1. Let _matchStr_ be ? ToString(? Get(_match_, *"0"*)). - 1. If _matchStr_ is the empty String, then - 1. Let _thisIndex_ be ℝ(? ToLength(? Get(_R_, *"lastIndex"*))). - 1. Let _nextIndex_ be AdvanceStringIndex(_S_, _thisIndex_, _fullUnicode_). - 1. Perform ? Set(_R_, *"lastIndex"*, 𝔽(_nextIndex_), *true*). - 1. Perform ? GeneratorYield(CreateIterResultObject(_match_, *false*)). - 1. Return CreateIteratorFromClosure(_closure_, *"%RegExpStringIteratorPrototype%"*, %RegExpStringIteratorPrototype%). + 1. Let _iterator_ be OrdinaryObjectCreate(%RegExpStringIteratorPrototype%, « [[IteratingRegExp]], [[IteratedString]], [[Global]], [[Unicode]], [[Done]] »). + 1. Set _iterator_.[[IteratingRegExp]] to _R_. + 1. Set _iterator_.[[IteratedString]] to _S_. + 1. Set _iterator_.[[Global]] to _global_. + 1. Set _iterator_.[[Unicode]] to _fullUnicode_. + 1. Set _iterator_.[[Done]] to *false*. + 1. Return _iterator_.
          @@ -38416,25 +39705,85 @@

          The %RegExpStringIteratorPrototype% Object

          The %RegExpStringIteratorPrototype% object:

            -
          • has properties that are inherited by all RegExp String Iterator Objects.
          • +
          • has properties that are inherited by all RegExp String Iterator objects.
          • is an ordinary object.
          • -
          • has a [[Prototype]] internal slot whose value is %IteratorPrototype%.
          • +
          • has a [[Prototype]] internal slot whose value is %Iterator.prototype%.
          • has the following properties:
          - +

          %RegExpStringIteratorPrototype%.next ( )

          - 1. Return ? GeneratorResume(*this* value, ~empty~, *"%RegExpStringIteratorPrototype%"*). + 1. Let _O_ be the *this* value. + 1. If _O_ is not an Object, throw a *TypeError* exception. + 1. If _O_ does not have all of the internal slots of a RegExp String Iterator Object Instance (see ), throw a *TypeError* exception. + 1. If _O_.[[Done]] is *true*, then + 1. Return CreateIteratorResultObject(*undefined*, *true*). + 1. Let _R_ be _O_.[[IteratingRegExp]]. + 1. Let _S_ be _O_.[[IteratedString]]. + 1. Let _global_ be _O_.[[Global]]. + 1. Let _fullUnicode_ be _O_.[[Unicode]]. + 1. Let _match_ be ? RegExpExec(_R_, _S_). + 1. If _match_ is *null*, then + 1. Set _O_.[[Done]] to *true*. + 1. Return CreateIteratorResultObject(*undefined*, *true*). + 1. If _global_ is *false*, then + 1. Set _O_.[[Done]] to *true*. + 1. Return CreateIteratorResultObject(_match_, *false*). + 1. Let _matchStr_ be ? ToString(? Get(_match_, *"0"*)). + 1. If _matchStr_ is the empty String, then + 1. Let _thisIndex_ be ℝ(? ToLength(? Get(_R_, *"lastIndex"*))). + 1. Let _nextIndex_ be AdvanceStringIndex(_S_, _thisIndex_, _fullUnicode_). + 1. Perform ? Set(_R_, *"lastIndex"*, 𝔽(_nextIndex_), *true*). + 1. Return CreateIteratorResultObject(_match_, *false*).
          - -

          %RegExpStringIteratorPrototype% [ @@toStringTag ]

          -

          The initial value of the @@toStringTag property is the String value *"RegExp String Iterator"*.

          + +

          %RegExpStringIteratorPrototype% [ %Symbol.toStringTag% ]

          +

          The initial value of the %Symbol.toStringTag% property is the String value *"RegExp String Iterator"*.

          This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

          + + +

          Properties of RegExp String Iterator Instances

          +

          RegExp String Iterator instances are ordinary objects that inherit properties from the %RegExpStringIteratorPrototype% intrinsic object. RegExp String Iterator instances are initially created with the internal slots listed in .

          + +
          Field NameValueMeaning
          Field NameValueMeaning
          [[StartIndex]] a non-negative integer
          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Internal SlotTypeDescription
          [[IteratingRegExp]]an ObjectThe regular expression used for iteration. IsRegExp([[IteratingRegExp]]) is initially *true*.
          [[IteratedString]]a StringThe String value being iterated upon.
          [[Global]]a BooleanIndicates whether the [[IteratingRegExp]] is global or not.
          [[Unicode]]a BooleanIndicates whether the [[IteratingRegExp]] is in Unicode mode or not.
          [[Done]]a BooleanIndicates whether the iteration is complete or not.
          +
          + @@ -38458,16 +39807,15 @@

          The Array Constructor

        • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the exotic Array behaviour must include a `super` call to the Array constructor to initialize subclass instances that are Array exotic objects. However, most of the `Array.prototype` methods are generic methods that are not dependent upon their *this* value being an Array exotic object.
        • - +

          Array ( ..._values_ )

          This function performs the following steps when called:

          1. If NewTarget is *undefined*, let _newTarget_ be the active function object; else let _newTarget_ be NewTarget. 1. Let _proto_ be ? GetPrototypeFromConstructor(_newTarget_, *"%Array.prototype%"*). 1. Let _numberOfArgs_ be the number of elements in _values_. - 1. If _numberOfArgs_ = 0, then - 1. Return ! ArrayCreate(0, _proto_). - 1. Else if _numberOfArgs_ = 1, then + 1. If _numberOfArgs_ = 0, return ! ArrayCreate(0, _proto_). + 1. If _numberOfArgs_ = 1, then 1. Let _len_ be _values_[0]. 1. Let _array_ be ! ArrayCreate(0, _proto_). 1. If _len_ is not a Number, then @@ -38478,17 +39826,16 @@

          Array ( ..._values_ )

          1. If SameValueZero(_intLen_, _len_) is *false*, throw a *RangeError* exception. 1. Perform ! Set(_array_, *"length"*, _intLen_, *true*). 1. Return _array_. - 1. Else, - 1. Assert: _numberOfArgs_ ≥ 2. - 1. Let _array_ be ? ArrayCreate(_numberOfArgs_, _proto_). - 1. Let _k_ be 0. - 1. Repeat, while _k_ < _numberOfArgs_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Let _itemK_ be _values_[_k_]. - 1. Perform ! CreateDataPropertyOrThrow(_array_, _Pk_, _itemK_). - 1. Set _k_ to _k_ + 1. - 1. Assert: The mathematical value of _array_'s *"length"* property is _numberOfArgs_. - 1. Return _array_. + 1. Assert: _numberOfArgs_ ≥ 2. + 1. Let _array_ be ? ArrayCreate(_numberOfArgs_, _proto_). + 1. Let _k_ be 0. + 1. Repeat, while _k_ < _numberOfArgs_, + 1. Let _Pk_ be ! ToString(𝔽(_k_)). + 1. Let _itemK_ be _values_[_k_]. + 1. Perform ! CreateDataPropertyOrThrow(_array_, _Pk_, _itemK_). + 1. Set _k_ to _k_ + 1. + 1. Assert: The mathematical value of _array_'s *"length"* property is _numberOfArgs_. + 1. Return _array_.
          @@ -38502,17 +39849,17 @@

          Properties of the Array Constructor

        • has the following properties:
        • - -

          Array.from ( _items_ [ , _mapfn_ [ , _thisArg_ ] ] )

          -

          This method performs the following steps when called:

          + +

          Array.from ( _items_ [ , _mapper_ [ , _thisArg_ ] ] )

          +

          This function performs the following steps when called:

          1. Let _C_ be the *this* value. - 1. If _mapfn_ is *undefined*, then + 1. If _mapper_ is *undefined*, then 1. Let _mapping_ be *false*. 1. Else, - 1. If IsCallable(_mapfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_mapper_) is *false*, throw a *TypeError* exception. 1. Let _mapping_ be *true*. - 1. Let _usingIterator_ be ? GetMethod(_items_, @@iterator). + 1. Let _usingIterator_ be ? GetMethod(_items_, %Symbol.iterator%). 1. If _usingIterator_ is not *undefined*, then 1. If IsConstructor(_C_) is *true*, then 1. Let _A_ be ? Construct(_C_). @@ -38530,14 +39877,14 @@

          Array.from ( _items_ [ , _mapfn_ [ , _thisArg_ ] ] )

          1. Perform ? Set(_A_, *"length"*, 𝔽(_k_), *true*). 1. Return _A_. 1. If _mapping_ is *true*, then - 1. Let _mappedValue_ be Completion(Call(_mapfn_, _thisArg_, « _next_, 𝔽(_k_) »)). + 1. Let _mappedValue_ be Completion(Call(_mapper_, _thisArg_, « _next_, 𝔽(_k_) »)). 1. IfAbruptCloseIterator(_mappedValue_, _iteratorRecord_). 1. Else, 1. Let _mappedValue_ be _next_. 1. Let _defineStatus_ be Completion(CreateDataPropertyOrThrow(_A_, _Pk_, _mappedValue_)). 1. IfAbruptCloseIterator(_defineStatus_, _iteratorRecord_). 1. Set _k_ to _k_ + 1. - 1. NOTE: _items_ is not an Iterable so assume it is an array-like object. + 1. NOTE: _items_ is not iterable so assume it is an array-like object. 1. Let _arrayLike_ be ! ToObject(_items_). 1. Let _len_ be ? LengthOfArrayLike(_arrayLike_). 1. If IsConstructor(_C_) is *true*, then @@ -38549,7 +39896,7 @@

          Array.from ( _items_ [ , _mapfn_ [ , _thisArg_ ] ] )

          1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ? Get(_arrayLike_, _Pk_). 1. If _mapping_ is *true*, then - 1. Let _mappedValue_ be ? Call(_mapfn_, _thisArg_, « _kValue_, 𝔽(_k_) »). + 1. Let _mappedValue_ be ? Call(_mapper_, _thisArg_, « _kValue_, 𝔽(_k_) »). 1. Else, 1. Let _mappedValue_ be _kValue_. 1. Perform ? CreateDataPropertyOrThrow(_A_, _Pk_, _mappedValue_). @@ -38562,7 +39909,82 @@

          Array.from ( _items_ [ , _mapfn_ [ , _thisArg_ ] ] )

          - + +

          Array.fromAsync ( _items_ [ , _mapper_ [ , _thisArg_ ] ] )

          + +

          This async function performs the following steps when called:

          + + 1. Let _C_ be the *this* value. + 1. Let _mapping_ be *false*. + 1. If _mapper_ is not *undefined*, then + 1. If IsCallable(_mapper_) is *false*, throw a *TypeError* exception. + 1. Set _mapping_ to *true*. + 1. Let _iteratorRecord_ be *undefined*. + 1. Let _usingAsyncIterator_ be ? GetMethod(_items_, %Symbol.asyncIterator%). + 1. If _usingAsyncIterator_ is *undefined*, then + 1. Let _usingSyncIterator_ be ? GetMethod(_items_, %Symbol.iterator%). + 1. If _usingSyncIterator_ is not *undefined*, then + 1. Set _iteratorRecord_ to CreateAsyncFromSyncIterator(? GetIteratorFromMethod(_items_, _usingSyncIterator_)). + 1. Else, + 1. Set _iteratorRecord_ to ? GetIteratorFromMethod(_items_, _usingAsyncIterator_). + 1. If _iteratorRecord_ is not *undefined*, then + 1. If IsConstructor(_C_) is *true*, then + 1. Let _A_ be ? Construct(_C_). + 1. Else, + 1. Let _A_ be ! ArrayCreate(0). + 1. Let _k_ be 0. + 1. Repeat, + 1. If _k_ ≥ 253 - 1, then + 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). + 1. Return ? AsyncIteratorClose(_iteratorRecord_, _error_). + 1. Let _Pk_ be ! ToString(𝔽(_k_)). + 1. Let _nextResult_ be ? Call(_iteratorRecord_.[[NextMethod]], _iteratorRecord_.[[Iterator]]). + 1. Set _nextResult_ to ? Await(_nextResult_). + 1. If _nextResult_ is not an Object, throw a *TypeError* exception. + 1. Let _done_ be ? IteratorComplete(_nextResult_). + 1. If _done_ is *true*, then + 1. Perform ? Set(_A_, *"length"*, 𝔽(_k_), *true*). + 1. Return _A_. + 1. Let _nextValue_ be ? IteratorValue(_nextResult_). + 1. If _mapping_ is *true*, then + 1. Let _mappedValue_ be Completion(Call(_mapper_, _thisArg_, « _nextValue_, 𝔽(_k_) »)). + 1. IfAbruptCloseAsyncIterator(_mappedValue_, _iteratorRecord_). + 1. Set _mappedValue_ to Completion(Await(_mappedValue_)). + 1. IfAbruptCloseAsyncIterator(_mappedValue_, _iteratorRecord_). + 1. Else, + 1. Let _mappedValue_ be _nextValue_. + 1. Let _defineStatus_ be Completion(CreateDataPropertyOrThrow(_A_, _Pk_, _mappedValue_)). + 1. IfAbruptCloseAsyncIterator(_defineStatus_, _iteratorRecord_). + 1. Set _k_ to _k_ + 1. + 1. Else, + 1. NOTE: _items_ is neither async iterable nor iterable so assume it is an array-like object. + 1. Let _arrayLike_ be ! ToObject(_items_). + 1. Let _len_ be ? LengthOfArrayLike(_arrayLike_). + 1. If IsConstructor(_C_) is *true*, then + 1. Let _A_ be ? Construct(_C_, « 𝔽(_len_) »). + 1. Else, + 1. Let _A_ be ? ArrayCreate(_len_). + 1. Let _k_ be 0. + 1. Repeat, while _k_ < _len_, + 1. Let _Pk_ be ! ToString(𝔽(_k_)). + 1. Let _kValue_ be ? Get(_arrayLike_, _Pk_). + 1. Set _kValue_ to ? Await(_kValue_). + 1. If _mapping_ is *true*, then + 1. Let _mappedValue_ be ? Call(_mapper_, _thisArg_, « _kValue_, 𝔽(_k_) »). + 1. Set _mappedValue_ to ? Await(_mappedValue_). + 1. Else, + 1. Let _mappedValue_ be _kValue_. + 1. Perform ? CreateDataPropertyOrThrow(_A_, _Pk_, _mappedValue_). + 1. Set _k_ to _k_ + 1. + 1. Perform ? Set(_A_, *"length"*, 𝔽(_len_), *true*). + 1. Return _A_. + + +

          This method is an intentionally generic factory method; it does not require that its *this* value be the Array constructor. Therefore it can be transferred to or inherited by any other constructors that may be called with a single numeric argument.

          +
          +
          + +

          Array.isArray ( _arg_ )

          This function performs the following steps when called:

          @@ -38570,7 +39992,7 @@

          Array.isArray ( _arg_ )

          - +

          Array.of ( ..._items_ )

          This method performs the following steps when called:

          @@ -38601,15 +40023,15 @@

          Array.prototype

          This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

          - -

          get Array [ @@species ]

          -

          `Array[@@species]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

          + +

          get Array [ %Symbol.species% ]

          +

          `Array[%Symbol.species%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

          1. Return the *this* value.

          The value of the *"name"* property of this function is *"get [Symbol.species]"*.

          -

          Array prototype methods normally use their *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour by redefining its @@species property.

          +

          Array prototype methods normally use their *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour by redefining its %Symbol.species% property.

          @@ -38627,7 +40049,7 @@

          Properties of the Array Prototype Object

          The Array prototype object is specified to be an Array exotic object to ensure compatibility with ECMAScript code that was created prior to the ECMAScript 2015 specification.

          - +

          Array.prototype.at ( _index_ )

          1. Let _O_ be ? ToObject(*this* value). @@ -38642,7 +40064,7 @@

          Array.prototype.at ( _index_ )

          - +

          Array.prototype.concat ( ..._items_ )

          This method returns an array containing the array elements of the object followed by the array elements of each argument.

          It performs the following steps when called:

          @@ -38691,7 +40113,7 @@

          1. If _O_ is not an Object, return *false*. - 1. Let _spreadable_ be ? Get(_O_, @@isConcatSpreadable). + 1. Let _spreadable_ be ? Get(_O_, %Symbol.isConcatSpreadable%). 1. If _spreadable_ is not *undefined*, return ToBoolean(_spreadable_). 1. Return ? IsArray(_O_). @@ -38703,7 +40125,7 @@

          Array.prototype.constructor

          The initial value of `Array.prototype.constructor` is %Array%.

          - +

          Array.prototype.copyWithin ( _target_, _start_ [ , _end_ ] )

          The _end_ argument is optional. If it is not provided, the length of the *this* value is used.

          @@ -38754,7 +40176,7 @@

          Array.prototype.copyWithin ( _target_, _start_ [ , _end_ ] )

          - +

          Array.prototype.entries ( )

          This method performs the following steps when called:

          @@ -38763,27 +40185,27 @@

          Array.prototype.entries ( )

          - -

          Array.prototype.every ( _callbackfn_ [ , _thisArg_ ] )

          + +

          Array.prototype.every ( _callback_ [ , _thisArg_ ] )

          -

          _callbackfn_ should be a function that accepts three arguments and returns a value that is coercible to a Boolean value. `every` calls _callbackfn_ once for each element present in the array, in ascending order, until it finds one where _callbackfn_ returns *false*. If such an element is found, `every` immediately returns *false*. Otherwise, `every` returns *true*. _callbackfn_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

          -

          If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callbackfn_. If it is not provided, *undefined* is used instead.

          -

          _callbackfn_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

          -

          `every` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_.

          -

          The range of elements processed by `every` is set before the first call to _callbackfn_. Elements which are appended to the array after the call to `every` begins will not be visited by _callbackfn_. If existing elements of the array are changed, their value as passed to _callbackfn_ will be the value at the time `every` visits them; elements that are deleted after the call to `every` begins and before being visited are not visited. `every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns *true*.

          +

          _callback_ should be a function that accepts three arguments and returns a value that is coercible to a Boolean value. `every` calls _callback_ once for each element present in the array, in ascending order, until it finds one where _callback_ returns *false*. If such an element is found, `every` immediately returns *false*. Otherwise, `every` returns *true*. _callback_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

          +

          If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callback_. If it is not provided, *undefined* is used instead.

          +

          _callback_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

          +

          `every` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_.

          +

          The range of elements processed by `every` is set before the first call to _callback_. Elements which are appended to the array after the call to `every` begins will not be visited by _callback_. If existing elements of the array are changed, their value as passed to _callback_ will be the value at the time `every` visits them; elements that are deleted after the call to `every` begins and before being visited are not visited. `every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns *true*.

          This method performs the following steps when called:

          1. Let _O_ be ? ToObject(*this* value). 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). 1. If _kPresent_ is *true*, then 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Let _testResult_ be ToBoolean(? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). + 1. Let _testResult_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). 1. If _testResult_ is *false*, return *false*. 1. Set _k_ to _k_ + 1. 1. Return *true*. @@ -38793,7 +40215,7 @@

          Array.prototype.every ( _callbackfn_ [ , _thisArg_ ] )

          - +

          Array.prototype.fill ( _value_ [ , _start_ [ , _end_ ] ] )

          The _start_ argument is optional. If it is not provided, *+0*𝔽 is used.

          @@ -38825,20 +40247,20 @@

          Array.prototype.fill ( _value_ [ , _start_ [ , _end_ ] ] )

          - -

          Array.prototype.filter ( _callbackfn_ [ , _thisArg_ ] )

          + +

          Array.prototype.filter ( _callback_ [ , _thisArg_ ] )

          -

          _callbackfn_ should be a function that accepts three arguments and returns a value that is coercible to a Boolean value. `filter` calls _callbackfn_ once for each element in the array, in ascending order, and constructs a new array of all the values for which _callbackfn_ returns *true*. _callbackfn_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

          -

          If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callbackfn_. If it is not provided, *undefined* is used instead.

          -

          _callbackfn_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

          -

          `filter` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_.

          -

          The range of elements processed by `filter` is set before the first call to _callbackfn_. Elements which are appended to the array after the call to `filter` begins will not be visited by _callbackfn_. If existing elements of the array are changed their value as passed to _callbackfn_ will be the value at the time `filter` visits them; elements that are deleted after the call to `filter` begins and before being visited are not visited.

          +

          _callback_ should be a function that accepts three arguments and returns a value that is coercible to a Boolean value. `filter` calls _callback_ once for each element in the array, in ascending order, and constructs a new array of all the values for which _callback_ returns *true*. _callback_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

          +

          If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callback_. If it is not provided, *undefined* is used instead.

          +

          _callback_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

          +

          `filter` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_.

          +

          The range of elements processed by `filter` is set before the first call to _callback_. Elements which are appended to the array after the call to `filter` begins will not be visited by _callback_. If existing elements of the array are changed their value as passed to _callback_ will be the value at the time `filter` visits them; elements that are deleted after the call to `filter` begins and before being visited are not visited.

          This method performs the following steps when called:

          1. Let _O_ be ? ToObject(*this* value). 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _A_ be ? ArraySpeciesCreate(_O_, 0). 1. Let _k_ be 0. 1. Let _to_ be 0. @@ -38847,7 +40269,7 @@

          Array.prototype.filter ( _callbackfn_ [ , _thisArg_ ] )

          1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). 1. If _kPresent_ is *true*, then 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Let _selected_ be ToBoolean(? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). + 1. Let _selected_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). 1. If _selected_ is *true*, then 1. Perform ? CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_to_)), _kValue_). 1. Set _to_ to _to_ + 1. @@ -38859,7 +40281,7 @@

          Array.prototype.filter ( _callbackfn_ [ , _thisArg_ ] )

          - +

          Array.prototype.find ( _predicate_ [ , _thisArg_ ] )

          This method calls _predicate_ once for each element of the array, in ascending index order, until it finds one where _predicate_ returns a value that coerces to *true*. If such an element is found, `find` immediately returns that element value. Otherwise, `find` returns *undefined*.

          @@ -38877,7 +40299,7 @@

          Array.prototype.find ( _predicate_ [ , _thisArg_ ] )

          - +

          Array.prototype.findIndex ( _predicate_ [ , _thisArg_ ] )

          This method calls _predicate_ once for each element of the array, in ascending index order, until it finds one where _predicate_ returns a value that coerces to *true*. If such an element is found, `findIndex` immediately returns the index of that element value. Otherwise, `findIndex` returns -1.

          @@ -38895,7 +40317,7 @@

          Array.prototype.findIndex ( _predicate_ [ , _thisArg_ ] )

          - +

          Array.prototype.findLast ( _predicate_ [ , _thisArg_ ] )

          This method calls _predicate_ once for each element of the array, in descending index order, until it finds one where _predicate_ returns a value that coerces to *true*. If such an element is found, `findLast` immediately returns that element value. Otherwise, `findLast` returns *undefined*.

          @@ -38913,7 +40335,7 @@

          Array.prototype.findLast ( _predicate_ [ , _thisArg_ ] )

          - +

          Array.prototype.findLastIndex ( _predicate_ [ , _thisArg_ ] )

          This method calls _predicate_ once for each element of the array, in descending index order, until it finds one where _predicate_ returns a value that coerces to *true*. If such an element is found, `findLastIndex` immediately returns the index of that element value. Otherwise, `findLastIndex` returns -1.

          @@ -38967,7 +40389,7 @@

          - +

          Array.prototype.flat ( [ _depth_ ] )

          This method performs the following steps when called:

          @@ -39025,7 +40447,7 @@

          - +

          Array.prototype.flatMap ( _mapperFunction_ [ , _thisArg_ ] )

          This method performs the following steps when called:

          @@ -39038,27 +40460,27 @@

          Array.prototype.flatMap ( _mapperFunction_ [ , _thisArg_ ] )

          - -

          Array.prototype.forEach ( _callbackfn_ [ , _thisArg_ ] )

          + +

          Array.prototype.forEach ( _callback_ [ , _thisArg_ ] )

          -

          _callbackfn_ should be a function that accepts three arguments. `forEach` calls _callbackfn_ once for each element present in the array, in ascending order. _callbackfn_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

          -

          If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callbackfn_. If it is not provided, *undefined* is used instead.

          -

          _callbackfn_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

          -

          `forEach` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_.

          -

          The range of elements processed by `forEach` is set before the first call to _callbackfn_. Elements which are appended to the array after the call to `forEach` begins will not be visited by _callbackfn_. If existing elements of the array are changed, their value as passed to _callbackfn_ will be the value at the time `forEach` visits them; elements that are deleted after the call to `forEach` begins and before being visited are not visited.

          +

          _callback_ should be a function that accepts three arguments. `forEach` calls _callback_ once for each element present in the array, in ascending order. _callback_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

          +

          If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callback_. If it is not provided, *undefined* is used instead.

          +

          _callback_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

          +

          `forEach` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_.

          +

          The range of elements processed by `forEach` is set before the first call to _callback_. Elements which are appended to the array after the call to `forEach` begins will not be visited by _callback_. If existing elements of the array are changed, their value as passed to _callback_ will be the value at the time `forEach` visits them; elements that are deleted after the call to `forEach` begins and before being visited are not visited.

          This method performs the following steps when called:

          1. Let _O_ be ? ToObject(*this* value). 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). 1. If _kPresent_ is *true*, then 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Perform ? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). + 1. Perform ? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). 1. Set _k_ to _k_ + 1. 1. Return *undefined*. @@ -39067,7 +40489,7 @@

          Array.prototype.forEach ( _callbackfn_ [ , _thisArg_ ] )

          - +

          Array.prototype.includes ( _searchElement_ [ , _fromIndex_ ] )

          This method compares _searchElement_ to the elements of the array, in ascending order, using the SameValueZero algorithm, and if found at any position, returns *true*; otherwise, it returns *false*.

          @@ -39081,7 +40503,7 @@

          Array.prototype.includes ( _searchElement_ [ , _fromIndex_ ] )

          1. Let _n_ be ? ToIntegerOrInfinity(_fromIndex_). 1. Assert: If _fromIndex_ is *undefined*, then _n_ is 0. 1. If _n_ = +∞, return *false*. - 1. Else if _n_ = -∞, set _n_ to 0. + 1. If _n_ = -∞, set _n_ to 0. 1. If _n_ ≥ 0, then 1. Let _k_ be _n_. 1. Else, @@ -39101,7 +40523,7 @@

          Array.prototype.includes ( _searchElement_ [ , _fromIndex_ ] )

          - +

          Array.prototype.indexOf ( _searchElement_ [ , _fromIndex_ ] )

          This method compares _searchElement_ to the elements of the array, in ascending order, using the IsStrictlyEqual algorithm, and if found at one or more indices, returns the smallest such index; otherwise, it returns *-1*𝔽.

          @@ -39115,7 +40537,7 @@

          Array.prototype.indexOf ( _searchElement_ [ , _fromIndex_ ] )

          1. Let _n_ be ? ToIntegerOrInfinity(_fromIndex_). 1. Assert: If _fromIndex_ is *undefined*, then _n_ is 0. 1. If _n_ = +∞, return *-1*𝔽. - 1. Else if _n_ = -∞, set _n_ to 0. + 1. If _n_ = -∞, set _n_ to 0. 1. If _n_ ≥ 0, then 1. Let _k_ be _n_. 1. Else, @@ -39135,7 +40557,7 @@

          Array.prototype.indexOf ( _searchElement_ [ , _fromIndex_ ] )

          - +

          Array.prototype.join ( _separator_ )

          This method converts the elements of the array to Strings, and then concatenates these Strings, separated by occurrences of the _separator_. If no separator is provided, a single comma is used as the separator.

          It performs the following steps when called:

          @@ -39160,7 +40582,7 @@

          Array.prototype.join ( _separator_ )

          - +

          Array.prototype.keys ( )

          This method performs the following steps when called:

          @@ -39169,7 +40591,7 @@

          Array.prototype.keys ( )

          - +

          Array.prototype.lastIndexOf ( _searchElement_ [ , _fromIndex_ ] )

          This method compares _searchElement_ to the elements of the array in descending order using the IsStrictlyEqual algorithm, and if found at one or more indices, returns the largest such index; otherwise, it returns *-1*𝔽.

          @@ -39200,20 +40622,20 @@

          Array.prototype.lastIndexOf ( _searchElement_ [ , _fromIndex_ ] )

          - -

          Array.prototype.map ( _callbackfn_ [ , _thisArg_ ] )

          + +

          Array.prototype.map ( _callback_ [ , _thisArg_ ] )

          -

          _callbackfn_ should be a function that accepts three arguments. `map` calls _callbackfn_ once for each element in the array, in ascending order, and constructs a new Array from the results. _callbackfn_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

          -

          If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callbackfn_. If it is not provided, *undefined* is used instead.

          -

          _callbackfn_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

          -

          `map` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_.

          -

          The range of elements processed by `map` is set before the first call to _callbackfn_. Elements which are appended to the array after the call to `map` begins will not be visited by _callbackfn_. If existing elements of the array are changed, their value as passed to _callbackfn_ will be the value at the time `map` visits them; elements that are deleted after the call to `map` begins and before being visited are not visited.

          +

          _callback_ should be a function that accepts three arguments. `map` calls _callback_ once for each element in the array, in ascending order, and constructs a new Array from the results. _callback_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

          +

          If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callback_. If it is not provided, *undefined* is used instead.

          +

          _callback_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

          +

          `map` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_.

          +

          The range of elements processed by `map` is set before the first call to _callback_. Elements which are appended to the array after the call to `map` begins will not be visited by _callback_. If existing elements of the array are changed, their value as passed to _callback_ will be the value at the time `map` visits them; elements that are deleted after the call to `map` begins and before being visited are not visited.

          This method performs the following steps when called:

          1. Let _O_ be ? ToObject(*this* value). 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _A_ be ? ArraySpeciesCreate(_O_, _len_). 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, @@ -39221,7 +40643,7 @@

          Array.prototype.map ( _callbackfn_ [ , _thisArg_ ] )

          1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). 1. If _kPresent_ is *true*, then 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Let _mappedValue_ be ? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). + 1. Let _mappedValue_ be ? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). 1. Perform ? CreateDataPropertyOrThrow(_A_, _Pk_, _mappedValue_). 1. Set _k_ to _k_ + 1. 1. Return _A_. @@ -39231,7 +40653,7 @@

          Array.prototype.map ( _callbackfn_ [ , _thisArg_ ] )

          - +

          Array.prototype.pop ( )

          This method removes the last element of the array and returns it.

          @@ -39243,21 +40665,20 @@

          Array.prototype.pop ( )

          1. If _len_ = 0, then 1. Perform ? Set(_O_, *"length"*, *+0*𝔽, *true*). 1. Return *undefined*. - 1. Else, - 1. Assert: _len_ > 0. - 1. Let _newLen_ be 𝔽(_len_ - 1). - 1. Let _index_ be ! ToString(_newLen_). - 1. Let _element_ be ? Get(_O_, _index_). - 1. Perform ? DeletePropertyOrThrow(_O_, _index_). - 1. Perform ? Set(_O_, *"length"*, _newLen_, *true*). - 1. Return _element_. + 1. Assert: _len_ > 0. + 1. Let _newLen_ be 𝔽(_len_ - 1). + 1. Let _index_ be ! ToString(_newLen_). + 1. Let _element_ be ? Get(_O_, _index_). + 1. Perform ? DeletePropertyOrThrow(_O_, _index_). + 1. Perform ? Set(_O_, *"length"*, _newLen_, *true*). + 1. Return _element_.

          This method is intentionally generic; it does not require that its *this* value be an Array. Therefore it can be transferred to other kinds of objects for use as a method.

          - +

          Array.prototype.push ( ..._items_ )

          This method appends the arguments to the end of the array, in the order in which they appear. It returns the new length of the array.

          @@ -39280,19 +40701,19 @@

          Array.prototype.push ( ..._items_ )

          - -

          Array.prototype.reduce ( _callbackfn_ [ , _initialValue_ ] )

          + +

          Array.prototype.reduce ( _callback_ [ , _initialValue_ ] )

          -

          _callbackfn_ should be a function that takes four arguments. `reduce` calls the callback, as a function, once for each element after the first element present in the array, in ascending order.

          -

          _callbackfn_ is called with four arguments: the _previousValue_ (value from the previous call to _callbackfn_), the _currentValue_ (value of the current element), the _currentIndex_, and the object being traversed. The first time that callback is called, the _previousValue_ and _currentValue_ can be one of two values. If an _initialValue_ was supplied in the call to `reduce`, then _previousValue_ will be _initialValue_ and _currentValue_ will be the first value in the array. If no _initialValue_ was supplied, then _previousValue_ will be the first value in the array and _currentValue_ will be the second. It is a *TypeError* if the array contains no elements and _initialValue_ is not provided.

          -

          `reduce` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_.

          -

          The range of elements processed by `reduce` is set before the first call to _callbackfn_. Elements that are appended to the array after the call to `reduce` begins will not be visited by _callbackfn_. If existing elements of the array are changed, their value as passed to _callbackfn_ will be the value at the time `reduce` visits them; elements that are deleted after the call to `reduce` begins and before being visited are not visited.

          +

          _callback_ should be a function that takes four arguments. `reduce` calls the callback, as a function, once for each element after the first element present in the array, in ascending order.

          +

          _callback_ is called with four arguments: the _previousValue_ (value from the previous call to _callback_), the _currentValue_ (value of the current element), the _currentIndex_, and the object being traversed. The first time that callback is called, the _previousValue_ and _currentValue_ can be one of two values. If an _initialValue_ was supplied in the call to `reduce`, then _previousValue_ will be _initialValue_ and _currentValue_ will be the first value in the array. If no _initialValue_ was supplied, then _previousValue_ will be the first value in the array and _currentValue_ will be the second. It is a *TypeError* if the array contains no elements and _initialValue_ is not provided.

          +

          `reduce` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_.

          +

          The range of elements processed by `reduce` is set before the first call to _callback_. Elements that are appended to the array after the call to `reduce` begins will not be visited by _callback_. If existing elements of the array are changed, their value as passed to _callback_ will be the value at the time `reduce` visits them; elements that are deleted after the call to `reduce` begins and before being visited are not visited.

          This method performs the following steps when called:

          1. Let _O_ be ? ToObject(*this* value). 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. If _len_ = 0 and _initialValue_ is not present, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Let _accumulator_ be *undefined*. @@ -39312,7 +40733,7 @@

          Array.prototype.reduce ( _callbackfn_ [ , _initialValue_ ] )

          1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). 1. If _kPresent_ is *true*, then 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Set _accumulator_ to ? Call(_callbackfn_, *undefined*, « _accumulator_, _kValue_, 𝔽(_k_), _O_ »). + 1. Set _accumulator_ to ? Call(_callback_, *undefined*, « _accumulator_, _kValue_, 𝔽(_k_), _O_ »). 1. Set _k_ to _k_ + 1. 1. Return _accumulator_.
          @@ -39321,19 +40742,19 @@

          Array.prototype.reduce ( _callbackfn_ [ , _initialValue_ ] )

          - -

          Array.prototype.reduceRight ( _callbackfn_ [ , _initialValue_ ] )

          + +

          Array.prototype.reduceRight ( _callback_ [ , _initialValue_ ] )

          -

          _callbackfn_ should be a function that takes four arguments. `reduceRight` calls the callback, as a function, once for each element after the first element present in the array, in descending order.

          -

          _callbackfn_ is called with four arguments: the _previousValue_ (value from the previous call to _callbackfn_), the _currentValue_ (value of the current element), the _currentIndex_, and the object being traversed. The first time the function is called, the _previousValue_ and _currentValue_ can be one of two values. If an _initialValue_ was supplied in the call to `reduceRight`, then _previousValue_ will be _initialValue_ and _currentValue_ will be the last value in the array. If no _initialValue_ was supplied, then _previousValue_ will be the last value in the array and _currentValue_ will be the second-to-last value. It is a *TypeError* if the array contains no elements and _initialValue_ is not provided.

          -

          `reduceRight` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_.

          -

          The range of elements processed by `reduceRight` is set before the first call to _callbackfn_. Elements that are appended to the array after the call to `reduceRight` begins will not be visited by _callbackfn_. If existing elements of the array are changed by _callbackfn_, their value as passed to _callbackfn_ will be the value at the time `reduceRight` visits them; elements that are deleted after the call to `reduceRight` begins and before being visited are not visited.

          +

          _callback_ should be a function that takes four arguments. `reduceRight` calls the callback, as a function, once for each element after the first element present in the array, in descending order.

          +

          _callback_ is called with four arguments: the _previousValue_ (value from the previous call to _callback_), the _currentValue_ (value of the current element), the _currentIndex_, and the object being traversed. The first time the function is called, the _previousValue_ and _currentValue_ can be one of two values. If an _initialValue_ was supplied in the call to `reduceRight`, then _previousValue_ will be _initialValue_ and _currentValue_ will be the last value in the array. If no _initialValue_ was supplied, then _previousValue_ will be the last value in the array and _currentValue_ will be the second-to-last value. It is a *TypeError* if the array contains no elements and _initialValue_ is not provided.

          +

          `reduceRight` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_.

          +

          The range of elements processed by `reduceRight` is set before the first call to _callback_. Elements that are appended to the array after the call to `reduceRight` begins will not be visited by _callback_. If existing elements of the array are changed by _callback_, their value as passed to _callback_ will be the value at the time `reduceRight` visits them; elements that are deleted after the call to `reduceRight` begins and before being visited are not visited.

          This method performs the following steps when called:

          1. Let _O_ be ? ToObject(*this* value). 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. If _len_ = 0 and _initialValue_ is not present, throw a *TypeError* exception. 1. Let _k_ be _len_ - 1. 1. Let _accumulator_ be *undefined*. @@ -39353,7 +40774,7 @@

          Array.prototype.reduceRight ( _callbackfn_ [ , _initialValue_ ] )

          1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). 1. If _kPresent_ is *true*, then 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Set _accumulator_ to ? Call(_callbackfn_, *undefined*, « _accumulator_, _kValue_, 𝔽(_k_), _O_ »). + 1. Set _accumulator_ to ? Call(_callback_, *undefined*, « _accumulator_, _kValue_, 𝔽(_k_), _O_ »). 1. Set _k_ to _k_ - 1. 1. Return _accumulator_.
          @@ -39362,10 +40783,10 @@

          Array.prototype.reduceRight ( _callbackfn_ [ , _initialValue_ ] )

          - +

          Array.prototype.reverse ( )

          -

          This method rearranges the elements of the array so as to reverse their order. It returns the object as the result of the call.

          +

          This method rearranges the elements of the array so as to reverse their order. It returns the reversed array.

          This method performs the following steps when called:

          @@ -39403,7 +40824,7 @@

          Array.prototype.reverse ( )

          - +

          Array.prototype.shift ( )

          This method removes the first element of the array and returns it.

          It performs the following steps when called:

          @@ -39435,7 +40856,7 @@

          Array.prototype.shift ( )

          - +

          Array.prototype.slice ( _start_, _end_ )

          This method returns an array containing the elements of the array from element _start_ up to, but not including, element _end_ (or through the end of the array if _end_ is *undefined*). If _start_ is negative, it is treated as _length_ + _start_ where _length_ is the length of the array. If _end_ is negative, it is treated as _length_ + _end_ where _length_ is the length of the array.

          It performs the following steps when called:

          @@ -39472,27 +40893,27 @@

          Array.prototype.slice ( _start_, _end_ )

          - -

          Array.prototype.some ( _callbackfn_ [ , _thisArg_ ] )

          + +

          Array.prototype.some ( _callback_ [ , _thisArg_ ] )

          -

          _callbackfn_ should be a function that accepts three arguments and returns a value that is coercible to a Boolean value. `some` calls _callbackfn_ once for each element present in the array, in ascending order, until it finds one where _callbackfn_ returns *true*. If such an element is found, `some` immediately returns *true*. Otherwise, `some` returns *false*. _callbackfn_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

          -

          If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callbackfn_. If it is not provided, *undefined* is used instead.

          -

          _callbackfn_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

          -

          `some` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_.

          -

          The range of elements processed by `some` is set before the first call to _callbackfn_. Elements that are appended to the array after the call to `some` begins will not be visited by _callbackfn_. If existing elements of the array are changed, their value as passed to _callbackfn_ will be the value at the time that `some` visits them; elements that are deleted after the call to `some` begins and before being visited are not visited. `some` acts like the "exists" quantifier in mathematics. In particular, for an empty array, it returns *false*.

          +

          _callback_ should be a function that accepts three arguments and returns a value that is coercible to a Boolean value. `some` calls _callback_ once for each element present in the array, in ascending order, until it finds one where _callback_ returns *true*. If such an element is found, `some` immediately returns *true*. Otherwise, `some` returns *false*. _callback_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

          +

          If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callback_. If it is not provided, *undefined* is used instead.

          +

          _callback_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

          +

          `some` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_.

          +

          The range of elements processed by `some` is set before the first call to _callback_. Elements that are appended to the array after the call to `some` begins will not be visited by _callback_. If existing elements of the array are changed, their value as passed to _callback_ will be the value at the time that `some` visits them; elements that are deleted after the call to `some` begins and before being visited are not visited. `some` acts like the "exists" quantifier in mathematics. In particular, for an empty array, it returns *false*.

          This method performs the following steps when called:

          1. Let _O_ be ? ToObject(*this* value). 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). 1. If _kPresent_ is *true*, then 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Let _testResult_ be ToBoolean(? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). + 1. Let _testResult_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). 1. If _testResult_ is *true*, return *true*. 1. Set _k_ to _k_ + 1. 1. Return *false*. @@ -39502,16 +40923,16 @@

          Array.prototype.some ( _callbackfn_ [ , _thisArg_ ] )

          - -

          Array.prototype.sort ( _comparefn_ )

          -

          This method sorts the elements of this array. The sort must be stable (that is, elements that compare equal must remain in their original order). If _comparefn_ is not *undefined*, it should be a function that accepts two arguments _x_ and _y_ and returns a negative Number if _x_ < _y_, a positive Number if _x_ > _y_, or a zero otherwise.

          + +

          Array.prototype.sort ( _comparator_ )

          +

          This method sorts the elements of this array. If _comparator_ is not *undefined*, it should be a function that accepts two arguments _x_ and _y_ and returns a negative Number if _x_ < _y_, a positive Number if _x_ > _y_, or a zero otherwise.

          It performs the following steps when called:

          - 1. [id="step-array-sort-comparefn"] If _comparefn_ is not *undefined* and IsCallable(_comparefn_) is *false*, throw a *TypeError* exception. + 1. [id="step-array-sort-comparefn"] If _comparator_ is not *undefined* and IsCallable(_comparator_) is *false*, throw a *TypeError* exception. 1. Let _obj_ be ? ToObject(*this* value). 1. [id="step-array-sort-len"] Let _len_ be ? LengthOfArrayLike(_obj_). - 1. Let _SortCompare_ be a new Abstract Closure with parameters (_x_, _y_) that captures _comparefn_ and performs the following steps when called: - 1. Return ? CompareArrayElements(_x_, _y_, _comparefn_). + 1. Let _SortCompare_ be a new Abstract Closure with parameters (_x_, _y_) that captures _comparator_ and performs the following steps when called: + 1. Return ? CompareArrayElements(_x_, _y_, _comparator_). 1. [id="step-array-sortindexedproperties"] Let _sortedList_ be ? SortIndexedProperties(_obj_, _len_, _SortCompare_, ~skip-holes~). 1. Let _itemCount_ be the number of elements in _sortedList_. 1. Let _j_ be 0. @@ -39562,7 +40983,7 @@

          1. [id="step-array-sort"] Sort _items_ using an implementation-defined sequence of calls to _SortCompare_. If any such call returns an abrupt completion, stop before performing any further calls to _SortCompare_ and return that Completion Record. 1. Return _items_. -

          The sort order is the ordering of _items_ after completion of step of the algorithm above. The sort order is implementation-defined if _SortCompare_ is not a consistent comparator for the elements of _items_. When SortIndexedProperties is invoked by Array.prototype.sort, the sort order is also implementation-defined if _comparefn_ is *undefined*, and all applications of ToString, to any specific value passed as an argument to _SortCompare_, do not produce the same result.

          +

          The sort order is the ordering of _items_ after completion of step of the algorithm above. The sort order is implementation-defined if _SortCompare_ is not a consistent comparator for the elements of _items_. When SortIndexedProperties is invoked by Array.prototype.sort or Array.prototype.toSorted, the sort order is also implementation-defined if _comparator_ is *undefined*, and all applications of ToString, to any specific value passed as an argument to _SortCompare_, do not produce the same result.

          Unless the sort order is specified to be implementation-defined, it must satisfy all of the following conditions:

          • @@ -39571,9 +40992,12 @@

          • Then for all non-negative integers _j_ and _k_, each less than _itemCount_, if ℝ(_SortCompare_(old[_j_], old[_k_])) < 0, then π(_j_) < π(_k_).
          • +
          • + And for all non-negative integers _j_ and _k_ such that _j_ < _k_ < _itemCount_, if ℝ(_SortCompare_(old[_j_], old[_k_])) = 0, then π(_j_) < π(_k_); i.e., the sort is stable. +

          Here the notation old[_j_] is used to refer to _items_[_j_] before step is executed, and the notation new[_j_] to refer to _items_[_j_] after step has been executed.

          -

          An abstract closure or function _comparator_ is a consistent comparator for a set of values _S_ if all of the requirements below are met for all values _a_, _b_, and _c_ (possibly the same value) in the set _S_: The notation _a_ <C _b_ means ℝ(_comparator_(_a_, _b_)) < 0; _a_ =C _b_ means ℝ(_comparator_(_a_, _b_)) = 0; and _a_ >C _b_ means ℝ(_comparator_(_a_, _b_)) > 0.

          +

          An Abstract Closure or function _comparator_ is a consistent comparator for a set of values _S_ if all of the requirements below are met for all values _a_, _b_, and _c_ (possibly the same value) in the set _S_: The notation _a_ <C _b_ means ℝ(_comparator_(_a_, _b_)) < 0; _a_ =C _b_ means ℝ(_comparator_(_a_, _b_)) = 0; and _a_ >C _b_ means ℝ(_comparator_(_a_, _b_)) > 0.

          • Calling _comparator_(_a_, _b_) always returns the same value _v_ when given a specific pair of values _a_ and _b_ as its two arguments. Furthermore, _v_ is a Number, and _v_ is not *NaN*. Note that this implies that exactly one of _a_ <C _b_, _a_ =C _b_, and _a_ >C _b_ will be true for a given pair of _a_ and _b_. @@ -39607,7 +41031,7 @@

            CompareArrayElements ( _x_: an ECMAScript language value, _y_: an ECMAScript language value, - _comparefn_: a function object or *undefined*, + _comparator_: a function object or *undefined*, ): either a normal completion containing a Number or an abrupt completion

            @@ -39616,8 +41040,8 @@

            1. If _x_ and _y_ are both *undefined*, return *+0*𝔽. 1. If _x_ is *undefined*, return *1*𝔽. 1. If _y_ is *undefined*, return *-1*𝔽. - 1. If _comparefn_ is not *undefined*, then - 1. Let _v_ be ? ToNumber(? Call(_comparefn_, *undefined*, « _x_, _y_ »)). + 1. If _comparator_ is not *undefined*, then + 1. Let _v_ be ? ToNumber(? Call(_comparator_, *undefined*, « _x_, _y_ »)). 1. If _v_ is *NaN*, return *+0*𝔽. 1. Return _v_. 1. [id="step-sortcompare-tostring-x"] Let _xString_ be ? ToString(_x_). @@ -39631,7 +41055,7 @@

            - +

            Array.prototype.splice ( _start_, _deleteCount_, ..._items_ )

            This method deletes the _deleteCount_ elements of the array starting at integer index _start_ and replaces them with the elements of _items_. It returns an Array containing the deleted elements (if any).

            @@ -39703,7 +41127,7 @@

            Array.prototype.splice ( _start_, _deleteCount_, ..._items_ )

            - +

            Array.prototype.toLocaleString ( [ _reserved1_ [ , _reserved2_ ] ] )

            An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used.

            @@ -39734,7 +41158,7 @@

            Array.prototype.toLocaleString ( [ _reserved1_ [ , _reserved2_ ] ] )

            - +

            Array.prototype.toReversed ( )

            This method performs the following steps when called:

            @@ -39752,16 +41176,16 @@

            Array.prototype.toReversed ( )

            - -

            Array.prototype.toSorted ( _comparefn_ )

            + +

            Array.prototype.toSorted ( _comparator_ )

            This method performs the following steps when called:

            - 1. If _comparefn_ is not *undefined* and IsCallable(_comparefn_) is *false*, throw a *TypeError* exception. + 1. If _comparator_ is not *undefined* and IsCallable(_comparator_) is *false*, throw a *TypeError* exception. 1. Let _O_ be ? ToObject(*this* value). 1. Let _len_ be ? LengthOfArrayLike(_O_). 1. Let _A_ be ? ArrayCreate(_len_). - 1. Let _SortCompare_ be a new Abstract Closure with parameters (_x_, _y_) that captures _comparefn_ and performs the following steps when called: - 1. Return ? CompareArrayElements(_x_, _y_, _comparefn_). + 1. Let _SortCompare_ be a new Abstract Closure with parameters (_x_, _y_) that captures _comparator_ and performs the following steps when called: + 1. Return ? CompareArrayElements(_x_, _y_, _comparator_). 1. Let _sortedList_ be ? SortIndexedProperties(_O_, _len_, _SortCompare_, ~read-through-holes~). 1. Let _j_ be 0. 1. Repeat, while _j_ < _len_, @@ -39771,7 +41195,7 @@

            Array.prototype.toSorted ( _comparefn_ )

            - +

            Array.prototype.toSpliced ( _start_, _skipCount_, ..._items_ )

            This method performs the following steps when called:

            @@ -39814,7 +41238,7 @@

            Array.prototype.toSpliced ( _start_, _skipCount_, ..._items_ )

            - +

            Array.prototype.toString ( )

            This method performs the following steps when called:

            @@ -39828,7 +41252,7 @@

            Array.prototype.toString ( )

            - +

            Array.prototype.unshift ( ..._items_ )

            This method prepends the arguments to the start of the array, such that their order within the array is the same as the order in which they appear in the argument list.

            It performs the following steps when called:

            @@ -39863,7 +41287,7 @@

            Array.prototype.unshift ( ..._items_ )

            - +

            Array.prototype.values ( )

            This method performs the following steps when called:

            @@ -39872,7 +41296,7 @@

            Array.prototype.values ( )

            - +

            Array.prototype.with ( _index_, _value_ )

            This method performs the following steps when called:

            @@ -39894,14 +41318,14 @@

            Array.prototype.with ( _index_, _value_ )

            - -

            Array.prototype [ @@iterator ] ( )

            -

            The initial value of the @@iterator property is %Array.prototype.values%, defined in .

            + +

            Array.prototype [ %Symbol.iterator% ] ( )

            +

            The initial value of the %Symbol.iterator% property is %Array.prototype.values%, defined in .

            - -

            Array.prototype [ @@unscopables ]

            -

            The initial value of the @@unscopables data property is an object created by the following steps:

            + +

            Array.prototype [ %Symbol.unscopables% ]

            +

            The initial value of the %Symbol.unscopables% data property is an object created by the following steps:

            1. Let _unscopableList_ be OrdinaryObjectCreate(*null*). 1. Perform ! CreateDataPropertyOrThrow(_unscopableList_, *"at"*, *true*). @@ -39947,44 +41371,25 @@

            length

            Array Iterator Objects

            -

            An Array Iterator is an object, that represents a specific iteration over some specific Array instance object. There is not a named constructor for Array Iterator objects. Instead, Array iterator objects are created by calling certain methods of Array instance objects.

            +

            An Array Iterator is an object that represents a specific iteration over some specific Array instance object. There is not a named constructor for Array Iterator objects. Instead, Array Iterator objects are created by calling certain methods of Array instance objects.

            - +

            CreateArrayIterator ( _array_: an Object, _kind_: ~key+value~, ~key~, or ~value~, - ): a Generator + ): an Object

            description
            It is used to create iterator objects for Array methods that return such iterators.
            - 1. Let _closure_ be a new Abstract Closure with no parameters that captures _kind_ and _array_ and performs the following steps when called: - 1. Let _index_ be 0. - 1. Repeat, - 1. If _array_ has a [[TypedArrayName]] internal slot, then - 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_array_, ~seq-cst~). - 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception. - 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. Else, - 1. Let _len_ be ? LengthOfArrayLike(_array_). - 1. If _index_ ≥ _len_, return NormalCompletion(*undefined*). - 1. Let _indexNumber_ be 𝔽(_index_). - 1. If _kind_ is ~key~, then - 1. Let _result_ be _indexNumber_. - 1. Else, - 1. Let _elementKey_ be ! ToString(_indexNumber_). - 1. Let _elementValue_ be ? Get(_array_, _elementKey_). - 1. If _kind_ is ~value~, then - 1. Let _result_ be _elementValue_. - 1. Else, - 1. Assert: _kind_ is ~key+value~. - 1. Let _result_ be CreateArrayFromList(« _indexNumber_, _elementValue_ »). - 1. Perform ? GeneratorYield(CreateIterResultObject(_result_, *false*)). - 1. Set _index_ to _index_ + 1. - 1. Return CreateIteratorFromClosure(_closure_, *"%ArrayIteratorPrototype%"*, %ArrayIteratorPrototype%). + 1. Let _iterator_ be OrdinaryObjectCreate(%ArrayIteratorPrototype%, « [[IteratedArrayLike]], [[ArrayLikeNextIndex]], [[ArrayLikeIterationKind]] »). + 1. Set _iterator_.[[IteratedArrayLike]] to _array_. + 1. Set _iterator_.[[ArrayLikeNextIndex]] to 0. + 1. Set _iterator_.[[ArrayLikeIterationKind]] to _kind_. + 1. Return _iterator_.
            @@ -39992,25 +41397,106 @@

            The %ArrayIteratorPrototype% Object

            The %ArrayIteratorPrototype% object:

              -
            • has properties that are inherited by all Array Iterator Objects.
            • +
            • has properties that are inherited by all Array Iterator objects.
            • is an ordinary object.
            • -
            • has a [[Prototype]] internal slot whose value is %IteratorPrototype%.
            • +
            • has a [[Prototype]] internal slot whose value is %Iterator.prototype%.
            • has the following properties:
            - +

            %ArrayIteratorPrototype%.next ( )

            - 1. Return ? GeneratorResume(*this* value, ~empty~, *"%ArrayIteratorPrototype%"*). + 1. Let _O_ be the *this* value. + 1. If _O_ is not an Object, throw a *TypeError* exception. + 1. If _O_ does not have all of the internal slots of an Array Iterator Instance (), throw a *TypeError* exception. + 1. Let _array_ be _O_.[[IteratedArrayLike]]. + 1. If _array_ is *undefined*, return CreateIteratorResultObject(*undefined*, *true*). + 1. Let _index_ be _O_.[[ArrayLikeNextIndex]]. + 1. Let _kind_ be _O_.[[ArrayLikeIterationKind]]. + 1. If _array_ has a [[TypedArrayName]] internal slot, then + 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_array_, ~seq-cst~). + 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception. + 1. Let _len_ be TypedArrayLength(_taRecord_). + 1. Else, + 1. Let _len_ be ? LengthOfArrayLike(_array_). + 1. If _index_ ≥ _len_, then + 1. Set _O_.[[IteratedArrayLike]] to *undefined*. + 1. Return CreateIteratorResultObject(*undefined*, *true*). + 1. Set _O_.[[ArrayLikeNextIndex]] to _index_ + 1. + 1. Let _indexNumber_ be 𝔽(_index_). + 1. If _kind_ is ~key~, then + 1. Let _result_ be _indexNumber_. + 1. Else, + 1. Let _elementKey_ be ! ToString(_indexNumber_). + 1. Let _elementValue_ be ? Get(_array_, _elementKey_). + 1. If _kind_ is ~value~, then + 1. Let _result_ be _elementValue_. + 1. Else, + 1. Assert: _kind_ is ~key+value~. + 1. Let _result_ be CreateArrayFromList(« _indexNumber_, _elementValue_ »). + 1. Return CreateIteratorResultObject(_result_, *false*).
            - -

            %ArrayIteratorPrototype% [ @@toStringTag ]

            -

            The initial value of the @@toStringTag property is the String value *"Array Iterator"*.

            + +

            %ArrayIteratorPrototype% [ %Symbol.toStringTag% ]

            +

            The initial value of the %Symbol.toStringTag% property is the String value *"Array Iterator"*.

            This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

            + + +

            Properties of Array Iterator Instances

            +

            Array Iterator instances are ordinary objects that inherit properties from the %ArrayIteratorPrototype% intrinsic object. Array Iterator instances are initially created with the internal slots listed in .

            + + + + + + + + + + + + + + + + + + + + + + +
            + Internal Slot + + Type + + Description +
            + [[IteratedArrayLike]] + + an Object or *undefined* + + The array-like object that is being iterated. +
            + [[ArrayLikeNextIndex]] + + a non-negative integer + + The integer index of the next element to be examined by this iterator. +
            + [[ArrayLikeIterationKind]] + + ~key+value~, ~key~, or ~value~ + + A value that identifies what is returned for each element of the iteration. +
            +
            +
            @@ -40019,23 +41505,25 @@

            TypedArray Objects

            A _TypedArray_ presents an array-like view of an underlying binary data buffer (). A TypedArray element type is the underlying binary scalar data type that all elements of a _TypedArray_ instance have. There is a distinct _TypedArray_ constructor, listed in , for each of the supported element types. Each constructor in has a corresponding distinct prototype object.

            - - - - - - - + + + + + + + + + + + + + + + +
            - Constructor Name and Intrinsic - - Element Type - - Element Size - - Conversion Operation - - Description -
            + Constructor Name and Intrinsic + + Element Type + + Element Size + + Conversion Operation + + Description +
            Int8Array
            @@ -40198,6 +41686,23 @@

            TypedArray Objects

            64-bit unsigned integer
            + Float16Array
            + %Float16Array% +
            + ~float16~ + + 2 + + + 16-bit IEEE floating point +
            Float32Array
            @@ -40247,7 +41752,7 @@

            The %TypedArray% Intrinsic Object

          • will throw an error when invoked, because it is an abstract class constructor. The _TypedArray_ constructors do not perform a `super` call to it.
          • - +

            %TypedArray% ( )

            This function performs the following steps when called:

            @@ -40266,18 +41771,18 @@

            Properties of the %TypedArray% Intrinsic Object

          • has the following properties:
          • - -

            %TypedArray%.from ( _source_ [ , _mapfn_ [ , _thisArg_ ] ] )

            + +

            %TypedArray%.from ( _source_ [ , _mapper_ [ , _thisArg_ ] ] )

            This method performs the following steps when called:

            1. Let _C_ be the *this* value. 1. If IsConstructor(_C_) is *false*, throw a *TypeError* exception. - 1. If _mapfn_ is *undefined*, then + 1. If _mapper_ is *undefined*, then 1. Let _mapping_ be *false*. 1. Else, - 1. If IsCallable(_mapfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_mapper_) is *false*, throw a *TypeError* exception. 1. Let _mapping_ be *true*. - 1. Let _usingIterator_ be ? GetMethod(_source_, @@iterator). + 1. Let _usingIterator_ be ? GetMethod(_source_, %Symbol.iterator%). 1. If _usingIterator_ is not *undefined*, then 1. Let _values_ be ? IteratorToList(? GetIteratorFromMethod(_source_, _usingIterator_)). 1. Let _len_ be the number of elements in _values_. @@ -40288,14 +41793,14 @@

            %TypedArray%.from ( _source_ [ , _mapfn_ [ , _thisArg_ ] ] )

            1. Let _kValue_ be the first element of _values_. 1. Remove the first element from _values_. 1. If _mapping_ is *true*, then - 1. Let _mappedValue_ be ? Call(_mapfn_, _thisArg_, « _kValue_, 𝔽(_k_) »). + 1. Let _mappedValue_ be ? Call(_mapper_, _thisArg_, « _kValue_, 𝔽(_k_) »). 1. Else, 1. Let _mappedValue_ be _kValue_. 1. Perform ? Set(_targetObj_, _Pk_, _mappedValue_, *true*). 1. Set _k_ to _k_ + 1. 1. Assert: _values_ is now an empty List. 1. Return _targetObj_. - 1. NOTE: _source_ is not an Iterable so assume it is already an array-like object. + 1. NOTE: _source_ is not an iterable object, so assume it is already an array-like object. 1. Let _arrayLike_ be ! ToObject(_source_). 1. Let _len_ be ? LengthOfArrayLike(_arrayLike_). 1. Let _targetObj_ be ? TypedArrayCreateFromConstructor(_C_, « 𝔽(_len_) »). @@ -40304,7 +41809,7 @@

            %TypedArray%.from ( _source_ [ , _mapfn_ [ , _thisArg_ ] ] )

            1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ? Get(_arrayLike_, _Pk_). 1. If _mapping_ is *true*, then - 1. Let _mappedValue_ be ? Call(_mapfn_, _thisArg_, « _kValue_, 𝔽(_k_) »). + 1. Let _mappedValue_ be ? Call(_mapper_, _thisArg_, « _kValue_, 𝔽(_k_) »). 1. Else, 1. Let _mappedValue_ be _kValue_. 1. Perform ? Set(_targetObj_, _Pk_, _mappedValue_, *true*). @@ -40313,7 +41818,7 @@

            %TypedArray%.from ( _source_ [ , _mapfn_ [ , _thisArg_ ] ] )

            - +

            %TypedArray%.of ( ..._items_ )

            This method performs the following steps when called:

            @@ -40337,15 +41842,15 @@

            %TypedArray%.prototype

            This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

            - -

            get %TypedArray% [ @@species ]

            -

            %TypedArray%`[@@species]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            + +

            get %TypedArray% [ %Symbol.species% ]

            +

            %TypedArray%`[%Symbol.species%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            1. Return the *this* value.

            The value of the *"name"* property of this function is *"get [Symbol.species]"*.

            -

            %TypedArray.prototype% methods normally use their *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour by redefining its @@species property.

            +

            %TypedArray.prototype% methods normally use their *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour by redefining its %Symbol.species% property.

            @@ -40360,7 +41865,7 @@

            Properties of the %TypedArray% Prototype Object

          • does not have a [[ViewedArrayBuffer]] or any other of the internal slots that are specific to _TypedArray_ instance objects.
          • - +

            %TypedArray%.prototype.at ( _index_ )

            1. Let _O_ be the *this* value. @@ -40376,7 +41881,7 @@

            %TypedArray%.prototype.at ( _index_ )

            - +

            get %TypedArray%.prototype.buffer

            %TypedArray%`.prototype.buffer` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            @@ -40388,7 +41893,7 @@

            get %TypedArray%.prototype.buffer

            - +

            get %TypedArray%.prototype.byteLength

            %TypedArray%`.prototype.byteLength` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            @@ -40396,12 +41901,13 @@

            get %TypedArray%.prototype.byteLength

            1. Perform ? RequireInternalSlot(_O_, [[TypedArrayName]]). 1. Assert: _O_ has a [[ViewedArrayBuffer]] internal slot. 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~). + 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, return *+0*𝔽. 1. Let _size_ be TypedArrayByteLength(_taRecord_). 1. Return 𝔽(_size_).
            - +

            get %TypedArray%.prototype.byteOffset

            %TypedArray%`.prototype.byteOffset` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            @@ -40420,7 +41926,7 @@

            %TypedArray%.prototype.constructor

            The initial value of %TypedArray%`.prototype.constructor` is %TypedArray%.

            - +

            %TypedArray%.prototype.copyWithin ( _target_, _start_ [ , _end_ ] )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.copyWithin` as defined in .

            This method performs the following steps when called:

            @@ -40447,9 +41953,10 @@

            %TypedArray%.prototype.copyWithin ( _target_, _start_ [ , _end_ ] )

            1. Set _taRecord_ to MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~). 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception. 1. Set _len_ to TypedArrayLength(_taRecord_). + 1. NOTE: Side-effects of the above steps may have reduced the size of _O_, in which case copying should proceed with the longest still-applicable prefix. + 1. Set _count_ to min(_count_, _len_ - _startIndex_, _len_ - _targetIndex_). 1. Let _elementSize_ be TypedArrayElementSize(_O_). 1. Let _byteOffset_ be _O_.[[ByteOffset]]. - 1. Let _bufferByteLimit_ be (_len_ × _elementSize_) + _byteOffset_. 1. Let _toByteIndex_ be (_targetIndex_ × _elementSize_) + _byteOffset_. 1. Let _fromByteIndex_ be (_startIndex_ × _elementSize_) + _byteOffset_. 1. Let _countBytes_ be _count_ × _elementSize_. @@ -40460,19 +41967,16 @@

            %TypedArray%.prototype.copyWithin ( _target_, _start_ [ , _end_ ] )

            1. Else, 1. Let _direction_ be 1. 1. Repeat, while _countBytes_ > 0, - 1. If _fromByteIndex_ < _bufferByteLimit_ and _toByteIndex_ < _bufferByteLimit_, then - 1. Let _value_ be GetValueFromBuffer(_buffer_, _fromByteIndex_, ~uint8~, *true*, ~unordered~). - 1. Perform SetValueInBuffer(_buffer_, _toByteIndex_, ~uint8~, _value_, *true*, ~unordered~). - 1. Set _fromByteIndex_ to _fromByteIndex_ + _direction_. - 1. Set _toByteIndex_ to _toByteIndex_ + _direction_. - 1. Set _countBytes_ to _countBytes_ - 1. - 1. Else, - 1. Set _countBytes_ to 0. + 1. Let _value_ be GetValueFromBuffer(_buffer_, _fromByteIndex_, ~uint8~, *true*, ~unordered~). + 1. Perform SetValueInBuffer(_buffer_, _toByteIndex_, ~uint8~, _value_, *true*, ~unordered~). + 1. Set _fromByteIndex_ to _fromByteIndex_ + _direction_. + 1. Set _toByteIndex_ to _toByteIndex_ + _direction_. + 1. Set _countBytes_ to _countBytes_ - 1. 1. Return _O_.
            - +

            %TypedArray%.prototype.entries ( )

            This method performs the following steps when called:

            @@ -40482,20 +41986,20 @@

            %TypedArray%.prototype.entries ( )

            - -

            %TypedArray%.prototype.every ( _callbackfn_ [ , _thisArg_ ] )

            + +

            %TypedArray%.prototype.every ( _callback_ [ , _thisArg_ ] )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.every` as defined in .

            This method performs the following steps when called:

            1. Let _O_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ! Get(_O_, _Pk_). - 1. Let _testResult_ be ToBoolean(? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). + 1. Let _testResult_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). 1. If _testResult_ is *false*, return *false*. 1. Set _k_ to _k_ + 1. 1. Return *true*. @@ -40503,7 +42007,7 @@

            %TypedArray%.prototype.every ( _callbackfn_ [ , _thisArg_ ] )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - +

            %TypedArray%.prototype.fill ( _value_ [ , _start_ [ , _end_ ] ] )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.fill` as defined in .

            This method performs the following steps when called:

            @@ -40512,7 +42016,7 @@

            %TypedArray%.prototype.fill ( _value_ [ , _start_ [ , _end_ ] ] )

            1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). 1. If _O_.[[ContentType]] is ~bigint~, set _value_ to ? ToBigInt(_value_). - 1. Otherwise, set _value_ to ? ToNumber(_value_). + 1. Else, set _value_ to ? ToNumber(_value_). 1. Let _relativeStart_ be ? ToIntegerOrInfinity(_start_). 1. If _relativeStart_ = -∞, let _startIndex_ be 0. 1. Else if _relativeStart_ < 0, let _startIndex_ be max(_len_ + _relativeStart_, 0). @@ -40534,22 +42038,22 @@

            %TypedArray%.prototype.fill ( _value_ [ , _start_ [ , _end_ ] ] )

            - -

            %TypedArray%.prototype.filter ( _callbackfn_ [ , _thisArg_ ] )

            + +

            %TypedArray%.prototype.filter ( _callback_ [ , _thisArg_ ] )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.filter` as defined in .

            This method performs the following steps when called:

            1. Let _O_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _kept_ be a new empty List. 1. Let _captured_ be 0. 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ! Get(_O_, _Pk_). - 1. Let _selected_ be ToBoolean(? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). + 1. Let _selected_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). 1. If _selected_ is *true*, then 1. Append _kValue_ to _kept_. 1. Set _captured_ to _captured_ + 1. @@ -40564,7 +42068,7 @@

            %TypedArray%.prototype.filter ( _callbackfn_ [ , _thisArg_ ] )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - +

            %TypedArray%.prototype.find ( _predicate_ [ , _thisArg_ ] )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.find` as defined in .

            This method performs the following steps when called:

            @@ -40578,7 +42082,7 @@

            %TypedArray%.prototype.find ( _predicate_ [ , _thisArg_ ] )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - +

            %TypedArray%.prototype.findIndex ( _predicate_ [ , _thisArg_ ] )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.findIndex` as defined in .

            This method performs the following steps when called:

            @@ -40592,7 +42096,7 @@

            %TypedArray%.prototype.findIndex ( _predicate_ [ , _thisArg_ ] )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - +

            %TypedArray%.prototype.findLast ( _predicate_ [ , _thisArg_ ] )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.findLast` as defined in .

            This method performs the following steps when called:

            @@ -40606,7 +42110,7 @@

            %TypedArray%.prototype.findLast ( _predicate_ [ , _thisArg_ ] )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - +

            %TypedArray%.prototype.findLastIndex ( _predicate_ [ , _thisArg_ ] )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.findLastIndex` as defined in .

            This method performs the following steps when called:

            @@ -40620,27 +42124,27 @@

            %TypedArray%.prototype.findLastIndex ( _predicate_ [ , _thisArg_ ] )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - -

            %TypedArray%.prototype.forEach ( _callbackfn_ [ , _thisArg_ ] )

            + +

            %TypedArray%.prototype.forEach ( _callback_ [ , _thisArg_ ] )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.forEach` as defined in .

            This method performs the following steps when called:

            1. Let _O_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ! Get(_O_, _Pk_). - 1. Perform ? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). + 1. Perform ? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). 1. Set _k_ to _k_ + 1. 1. Return *undefined*.

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - +

            %TypedArray%.prototype.includes ( _searchElement_ [ , _fromIndex_ ] )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.includes` as defined in .

            This method performs the following steps when called:

            @@ -40652,7 +42156,7 @@

            %TypedArray%.prototype.includes ( _searchElement_ [ , _fromIndex_ ] )

            1. Let _n_ be ? ToIntegerOrInfinity(_fromIndex_). 1. Assert: If _fromIndex_ is *undefined*, then _n_ is 0. 1. If _n_ = +∞, return *false*. - 1. Else if _n_ = -∞, set _n_ to 0. + 1. If _n_ = -∞, set _n_ to 0. 1. If _n_ ≥ 0, then 1. Let _k_ be _n_. 1. Else, @@ -40667,7 +42171,7 @@

            %TypedArray%.prototype.includes ( _searchElement_ [ , _fromIndex_ ] )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - +

            %TypedArray%.prototype.indexOf ( _searchElement_ [ , _fromIndex_ ] )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.indexOf` as defined in .

            This method performs the following steps when called:

            @@ -40679,16 +42183,17 @@

            %TypedArray%.prototype.indexOf ( _searchElement_ [ , _fromIndex_ ] )

            1. Let _n_ be ? ToIntegerOrInfinity(_fromIndex_). 1. Assert: If _fromIndex_ is *undefined*, then _n_ is 0. 1. If _n_ = +∞, return *-1*𝔽. - 1. Else if _n_ = -∞, set _n_ to 0. + 1. If _n_ = -∞, set _n_ to 0. 1. If _n_ ≥ 0, then 1. Let _k_ be _n_. 1. Else, 1. Let _k_ be _len_ + _n_. 1. If _k_ < 0, set _k_ to 0. 1. Repeat, while _k_ < _len_, - 1. Let _kPresent_ be ! HasProperty(_O_, ! ToString(𝔽(_k_))). + 1. Let _Pk_ be ! ToString(𝔽(_k_)). + 1. Let _kPresent_ be ! HasProperty(_O_, _Pk_). 1. If _kPresent_ is *true*, then - 1. Let _elementK_ be ! Get(_O_, ! ToString(𝔽(_k_))). + 1. Let _elementK_ be ! Get(_O_, _Pk_). 1. If IsStrictlyEqual(_searchElement_, _elementK_) is *true*, return 𝔽(_k_). 1. Set _k_ to _k_ + 1. 1. Return *-1*𝔽. @@ -40696,7 +42201,7 @@

            %TypedArray%.prototype.indexOf ( _searchElement_ [ , _fromIndex_ ] )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - +

            %TypedArray%.prototype.join ( _separator_ )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.join` as defined in .

            This method performs the following steps when called:

            @@ -40720,7 +42225,7 @@

            %TypedArray%.prototype.join ( _separator_ )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - +

            %TypedArray%.prototype.keys ( )

            This method performs the following steps when called:

            @@ -40730,7 +42235,7 @@

            %TypedArray%.prototype.keys ( )

            - +

            %TypedArray%.prototype.lastIndexOf ( _searchElement_ [ , _fromIndex_ ] )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.lastIndexOf` as defined in .

            This method performs the following steps when called:

            @@ -40746,9 +42251,10 @@

            %TypedArray%.prototype.lastIndexOf ( _searchElement_ [ , _fromIndex_ ] )

            𝔽. @@ -40756,7 +42262,7 @@

            %TypedArray%.prototype.lastIndexOf ( _searchElement_ [ , _fromIndex_ ] )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - +

            get %TypedArray%.prototype.length

            %TypedArray%`.prototype.length` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            @@ -40771,21 +42277,21 @@

            get %TypedArray%.prototype.length

            This function is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - -

            %TypedArray%.prototype.map ( _callbackfn_ [ , _thisArg_ ] )

            + +

            %TypedArray%.prototype.map ( _callback_ [ , _thisArg_ ] )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.map` as defined in .

            This method performs the following steps when called:

            1. Let _O_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _A_ be ? TypedArraySpeciesCreate(_O_, « 𝔽(_len_) »). 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ! Get(_O_, _Pk_). - 1. Let _mappedValue_ be ? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). + 1. Let _mappedValue_ be ? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). 1. Perform ? Set(_A_, _Pk_, _mappedValue_, *true*). 1. Set _k_ to _k_ + 1. 1. Return _A_. @@ -40793,15 +42299,15 @@

            %TypedArray%.prototype.map ( _callbackfn_ [ , _thisArg_ ] )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - -

            %TypedArray%.prototype.reduce ( _callbackfn_ [ , _initialValue_ ] )

            + +

            %TypedArray%.prototype.reduce ( _callback_ [ , _initialValue_ ] )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.reduce` as defined in .

            This method performs the following steps when called:

            1. Let _O_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. If _len_ = 0 and _initialValue_ is not present, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Let _accumulator_ be *undefined*. @@ -40814,22 +42320,22 @@

            %TypedArray%.prototype.reduce ( _callbackfn_ [ , _initialValue_ ] )

            1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ! Get(_O_, _Pk_). - 1. Set _accumulator_ to ? Call(_callbackfn_, *undefined*, « _accumulator_, _kValue_, 𝔽(_k_), _O_ »). + 1. Set _accumulator_ to ? Call(_callback_, *undefined*, « _accumulator_, _kValue_, 𝔽(_k_), _O_ »). 1. Set _k_ to _k_ + 1. 1. Return _accumulator_.

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - -

            %TypedArray%.prototype.reduceRight ( _callbackfn_ [ , _initialValue_ ] )

            + +

            %TypedArray%.prototype.reduceRight ( _callback_ [ , _initialValue_ ] )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.reduceRight` as defined in .

            This method performs the following steps when called:

            1. Let _O_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. If _len_ = 0 and _initialValue_ is not present, throw a *TypeError* exception. 1. Let _k_ be _len_ - 1. 1. Let _accumulator_ be *undefined*. @@ -40842,14 +42348,14 @@

            %TypedArray%.prototype.reduceRight ( _callbackfn_ [ , _initialValue_ ] )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - +

            %TypedArray%.prototype.reverse ( )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.reverse` as defined in .

            This method performs the following steps when called:

            @@ -40873,7 +42379,7 @@

            %TypedArray%.prototype.reverse ( )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - +

            %TypedArray%.prototype.set ( _source_ [ , _offset_ ] )

            This method sets multiple values in this _TypedArray_, reading the values from _source_. The details differ based upon the type of _source_. The optional _offset_ value indicates the first element index in this _TypedArray_ where values are written. If omitted, it is assumed to be 0.

            It performs the following steps when called:

            @@ -40891,6 +42397,37 @@

            %TypedArray%.prototype.set ( _source_ [ , _offset_ ] )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            + +

            + SetTypedArrayFromArrayLike ( + _target_: a TypedArray, + _targetOffset_: a non-negative integer or +∞, + _source_: an ECMAScript language value, but not a TypedArray, + ): either a normal completion containing ~unused~ or a throw completion +

            +
            +
            description
            +
            It sets multiple values in _target_, starting at index _targetOffset_, reading the values from _source_.
            +
            + + 1. Let _targetRecord_ be MakeTypedArrayWithBufferWitnessRecord(_target_, ~seq-cst~). + 1. If IsTypedArrayOutOfBounds(_targetRecord_) is *true*, throw a *TypeError* exception. + 1. Let _targetLength_ be TypedArrayLength(_targetRecord_). + 1. Let _src_ be ? ToObject(_source_). + 1. Let _srcLength_ be ? LengthOfArrayLike(_src_). + 1. If _targetOffset_ = +∞, throw a *RangeError* exception. + 1. If _srcLength_ + _targetOffset_ > _targetLength_, throw a *RangeError* exception. + 1. Let _k_ be 0. + 1. Repeat, while _k_ < _srcLength_, + 1. Let _Pk_ be ! ToString(𝔽(_k_)). + 1. Let _value_ be ? Get(_src_, _Pk_). + 1. Let _targetIndex_ be 𝔽(_targetOffset_ + _k_). + 1. Perform ? TypedArraySetElement(_target_, _targetIndex_, _value_). + 1. Set _k_ to _k_ + 1. + 1. Return ~unused~. + +
            +

            SetTypedArrayFromTypedArray ( @@ -40921,7 +42458,7 @@

            1. If _targetOffset_ = +∞, throw a *RangeError* exception. 1. If _srcLength_ + _targetOffset_ > _targetLength_, throw a *RangeError* exception. 1. If _target_.[[ContentType]] is not _source_.[[ContentType]], throw a *TypeError* exception. - 1. If IsSharedArrayBuffer(_srcBuffer_) is *true*, IsSharedArrayBuffer(_targetBuffer_) is *true*, and _srcBuffer_.[[ArrayBufferData]] is _targetBuffer_.[[ArrayBufferData]], let _sameSharedArrayBuffer_ be *true*; otherwise, let _sameSharedArrayBuffer_ be *false*. + 1. If IsSharedArrayBuffer(_srcBuffer_) is *true*, IsSharedArrayBuffer(_targetBuffer_) is *true*, and _srcBuffer_.[[ArrayBufferData]] is _targetBuffer_.[[ArrayBufferData]], let _sameSharedArrayBuffer_ be *true*; else let _sameSharedArrayBuffer_ be *false*. 1. If SameValue(_srcBuffer_, _targetBuffer_) is *true* or _sameSharedArrayBuffer_ is *true*, then 1. Let _srcByteLength_ be TypedArrayByteLength(_srcRecord_). 1. Set _srcBuffer_ to ? CloneArrayBuffer(_srcBuffer_, _srcByteOffset_, _srcByteLength_). @@ -40946,40 +42483,9 @@

            1. Return ~unused~. - - -

            - SetTypedArrayFromArrayLike ( - _target_: a TypedArray, - _targetOffset_: a non-negative integer or +∞, - _source_: an ECMAScript language value, but not a TypedArray, - ): either a normal completion containing ~unused~ or a throw completion -

            -
            -
            description
            -
            It sets multiple values in _target_, starting at index _targetOffset_, reading the values from _source_.
            -
            - - 1. Let _targetRecord_ be MakeTypedArrayWithBufferWitnessRecord(_target_, ~seq-cst~). - 1. If IsTypedArrayOutOfBounds(_targetRecord_) is *true*, throw a *TypeError* exception. - 1. Let _targetLength_ be TypedArrayLength(_targetRecord_). - 1. Let _src_ be ? ToObject(_source_). - 1. Let _srcLength_ be ? LengthOfArrayLike(_src_). - 1. If _targetOffset_ = +∞, throw a *RangeError* exception. - 1. If _srcLength_ + _targetOffset_ > _targetLength_, throw a *RangeError* exception. - 1. Let _k_ be 0. - 1. Repeat, while _k_ < _srcLength_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Let _value_ be ? Get(_src_, _Pk_). - 1. Let _targetIndex_ be 𝔽(_targetOffset_ + _k_). - 1. Perform ? TypedArraySetElement(_target_, _targetIndex_, _value_). - 1. Set _k_ to _k_ + 1. - 1. Return ~unused~. - -
            - +

            %TypedArray%.prototype.slice ( _start_, _end_ )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.slice` as defined in .

            This method performs the following steps when called:

            @@ -41032,20 +42538,20 @@

            %TypedArray%.prototype.slice ( _start_, _end_ )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - -

            %TypedArray%.prototype.some ( _callbackfn_ [ , _thisArg_ ] )

            + +

            %TypedArray%.prototype.some ( _callback_ [ , _thisArg_ ] )

            The interpretation and use of the arguments of this method are the same as for `Array.prototype.some` as defined in .

            This method performs the following steps when called:

            1. Let _O_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ! Get(_O_, _Pk_). - 1. Let _testResult_ be ToBoolean(? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). + 1. Let _testResult_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). 1. If _testResult_ is *true*, return *true*. 1. Set _k_ to _k_ + 1. 1. Return *false*. @@ -41053,19 +42559,19 @@

            %TypedArray%.prototype.some ( _callbackfn_ [ , _thisArg_ ] )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - -

            %TypedArray%.prototype.sort ( _comparefn_ )

            + +

            %TypedArray%.prototype.sort ( _comparator_ )

            This is a distinct method that, except as described below, implements the same requirements as those of `Array.prototype.sort` as defined in . The implementation of this method may be optimized with the knowledge that the *this* value is an object that has a fixed length and whose integer-indexed properties are not sparse.

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            It performs the following steps when called:

            - 1. If _comparefn_ is not *undefined* and IsCallable(_comparefn_) is *false*, throw a *TypeError* exception. + 1. If _comparator_ is not *undefined* and IsCallable(_comparator_) is *false*, throw a *TypeError* exception. 1. Let _obj_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). 1. NOTE: The following closure performs a numeric comparison rather than the string comparison used in . - 1. Let _SortCompare_ be a new Abstract Closure with parameters (_x_, _y_) that captures _comparefn_ and performs the following steps when called: - 1. Return ? CompareTypedArrayElements(_x_, _y_, _comparefn_). + 1. Let _SortCompare_ be a new Abstract Closure with parameters (_x_, _y_) that captures _comparator_ and performs the following steps when called: + 1. Return ? CompareTypedArrayElements(_x_, _y_, _comparator_). 1. Let _sortedList_ be ? SortIndexedProperties(_obj_, _len_, _SortCompare_, ~read-through-holes~). 1. Let _j_ be 0. 1. Repeat, while _j_ < _len_, @@ -41074,11 +42580,11 @@

            %TypedArray%.prototype.sort ( _comparefn_ )

            1. Return _obj_.
            -

            Because *NaN* always compares greater than any other value (see CompareTypedArrayElements), *NaN* property values always sort to the end of the result when _comparefn_ is not provided.

            +

            Because *NaN* always compares greater than any other value (see CompareTypedArrayElements), *NaN* property values always sort to the end of the result when _comparator_ is not provided.

            - +

            %TypedArray%.prototype.subarray ( _start_, _end_ )

            This method returns a new _TypedArray_ whose element type is the element type of this _TypedArray_ and whose ArrayBuffer is the ArrayBuffer of this _TypedArray_, referencing the elements in the interval from _start_ (inclusive) to _end_ (exclusive). If either _start_ or _end_ is negative, it refers to an index from the end of the array, as opposed to from the beginning.

            It performs the following steps when called:

            @@ -41113,7 +42619,7 @@

            %TypedArray%.prototype.subarray ( _start_, _end_ )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - +

            %TypedArray%.prototype.toLocaleString ( [ _reserved1_ [ , _reserved2_ ] ] )

            This is a distinct method that implements the same algorithm as `Array.prototype.toLocaleString` as defined in except that TypedArrayLength is called in place of performing a [[Get]] of *"length"*. The implementation of the algorithm may be optimized with the knowledge that the *this* value has a fixed length when the underlying buffer is not resizable and whose integer-indexed properties are not sparse. However, such optimization must not introduce any observable changes in the specified behaviour of the algorithm.

            This method is not generic. ValidateTypedArray is called with the *this* value and ~seq-cst~ as arguments prior to evaluating the algorithm. If its result is an abrupt completion that exception is thrown instead of evaluating the algorithm.

            @@ -41122,17 +42628,17 @@

            %TypedArray%.prototype.toLocaleString ( [ _reserved1_ [ , _reserved2_ ] ] )< - +

            %TypedArray%.prototype.toReversed ( )

            This method performs the following steps when called:

            1. Let _O_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). - 1. Let _length_ be TypedArrayLength(_taRecord_). - 1. Let _A_ be ? TypedArrayCreateSameType(_O_, « 𝔽(_length_) »). + 1. Let _len_ be TypedArrayLength(_taRecord_). + 1. Let _A_ be ? TypedArrayCreateSameType(_O_, _len_). 1. Let _k_ be 0. - 1. Repeat, while _k_ < _length_, - 1. Let _from_ be ! ToString(𝔽(_length_ - _k_ - 1)). + 1. Repeat, while _k_ < _len_, + 1. Let _from_ be ! ToString(𝔽(_len_ - _k_ - 1)). 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _fromValue_ be ! Get(_O_, _from_). 1. Perform ! Set(_A_, _Pk_, _fromValue_, *true*). @@ -41141,18 +42647,18 @@

            %TypedArray%.prototype.toReversed ( )

            - -

            %TypedArray%.prototype.toSorted ( _comparefn_ )

            + +

            %TypedArray%.prototype.toSorted ( _comparator_ )

            This method performs the following steps when called:

            - 1. If _comparefn_ is not *undefined* and IsCallable(_comparefn_) is *false*, throw a *TypeError* exception. + 1. If _comparator_ is not *undefined* and IsCallable(_comparator_) is *false*, throw a *TypeError* exception. 1. Let _O_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. Let _A_ be ? TypedArrayCreateSameType(_O_, « 𝔽(_len_) »). + 1. Let _A_ be ? TypedArrayCreateSameType(_O_, _len_). 1. NOTE: The following closure performs a numeric comparison rather than the string comparison used in . - 1. Let _SortCompare_ be a new Abstract Closure with parameters (_x_, _y_) that captures _comparefn_ and performs the following steps when called: - 1. Return ? CompareTypedArrayElements(_x_, _y_, _comparefn_). + 1. Let _SortCompare_ be a new Abstract Closure with parameters (_x_, _y_) that captures _comparator_ and performs the following steps when called: + 1. Return ? CompareTypedArrayElements(_x_, _y_, _comparator_). 1. Let _sortedList_ be ? SortIndexedProperties(_O_, _len_, _SortCompare_, ~read-through-holes~). 1. Let _j_ be 0. 1. Repeat, while _j_ < _len_, @@ -41162,12 +42668,12 @@

            %TypedArray%.prototype.toSorted ( _comparefn_ )

            - +

            %TypedArray%.prototype.toString ( )

            The initial value of the *"toString"* property is %Array.prototype.toString%, defined in .

            - +

            %TypedArray%.prototype.values ( )

            This method performs the following steps when called:

            @@ -41177,7 +42683,7 @@

            %TypedArray%.prototype.values ( )

            - +

            %TypedArray%.prototype.with ( _index_, _value_ )

            This method performs the following steps when called:

            @@ -41190,7 +42696,7 @@

            %TypedArray%.prototype.with ( _index_, _value_ )

            1. If _O_.[[ContentType]] is ~bigint~, let _numericValue_ be ? ToBigInt(_value_). 1. Else, let _numericValue_ be ? ToNumber(_value_). 1. If IsValidIntegerIndex(_O_, 𝔽(_actualIndex_)) is *false*, throw a *RangeError* exception. - 1. Let _A_ be ? TypedArrayCreateSameType(_O_, « 𝔽(_len_) »). + 1. Let _A_ be ? TypedArrayCreateSameType(_O_, _len_). 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). @@ -41202,14 +42708,14 @@

            %TypedArray%.prototype.with ( _index_, _value_ )

            - -

            %TypedArray%.prototype [ @@iterator ] ( )

            -

            The initial value of the @@iterator property is %TypedArray.prototype.values%, defined in .

            + +

            %TypedArray%.prototype [ %Symbol.iterator% ] ( )

            +

            The initial value of the %Symbol.iterator% property is %TypedArray.prototype.values%, defined in .

            - -

            get %TypedArray%.prototype [ @@toStringTag ]

            -

            %TypedArray%`.prototype[@@toStringTag]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            + +

            get %TypedArray%.prototype [ %Symbol.toStringTag% ]

            +

            %TypedArray%`.prototype[%Symbol.toStringTag%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            1. Let _O_ be the *this* value. 1. If _O_ is not an Object, return *undefined*. @@ -41226,27 +42732,6 @@

            get %TypedArray%.prototype [ @@toStringTag ]

            Abstract Operations for TypedArray Objects

            - -

            - TypedArraySpeciesCreate ( - _exemplar_: a TypedArray, - _argumentList_: a List of ECMAScript language values, - ): either a normal completion containing a TypedArray or a throw completion -

            -
            -
            description
            -
            It is used to specify the creation of a new TypedArray using a constructor function that is derived from _exemplar_. Unlike ArraySpeciesCreate, which can create non-Array objects through the use of @@species, this operation enforces that the constructor function creates an actual TypedArray.
            -
            - - 1. Let _defaultConstructor_ be the intrinsic object associated with the constructor name _exemplar_.[[TypedArrayName]] in . - 1. Let _constructor_ be ? SpeciesConstructor(_exemplar_, _defaultConstructor_). - 1. Let _result_ be ? TypedArrayCreateFromConstructor(_constructor_, _argumentList_). - 1. Assert: _result_ has [[TypedArrayName]] and [[ContentType]] internal slots. - 1. If _result_.[[ContentType]] is not _exemplar_.[[ContentType]], throw a *TypeError* exception. - 1. Return _result_. - -
            -

            TypedArrayCreateFromConstructor ( @@ -41261,6 +42746,7 @@

            1. Let _newTypedArray_ be ? Construct(_constructor_, _argumentList_). 1. Let _taRecord_ be ? ValidateTypedArray(_newTypedArray_, ~seq-cst~). + 1. Assert: _newTypedArray_ has all the internal slots mentioned in . 1. If the number of elements in _argumentList_ is 1 and _argumentList_[0] is a Number, then 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception. 1. Let _length_ be TypedArrayLength(_taRecord_). @@ -41273,22 +42759,42 @@

            TypedArrayCreateSameType ( _exemplar_: a TypedArray, - _argumentList_: a List of ECMAScript language values, + _length_: a non-negative integer, ): either a normal completion containing a TypedArray or a throw completion

            description
            -
            It is used to specify the creation of a new TypedArray using a constructor function that is derived from _exemplar_. Unlike TypedArraySpeciesCreate, which can construct custom TypedArray subclasses through the use of @@species, this operation always uses one of the built-in TypedArray constructors.
            +
            It is used to specify the creation of a new TypedArray using a constructor function that is derived from _exemplar_. Unlike TypedArraySpeciesCreate, which can construct custom TypedArray subclasses through the use of %Symbol.species%, this operation always uses one of the built-in TypedArray constructors.
            1. Let _constructor_ be the intrinsic object associated with the constructor name _exemplar_.[[TypedArrayName]] in . - 1. Let _result_ be ? TypedArrayCreateFromConstructor(_constructor_, _argumentList_). + 1. Let _result_ be ? TypedArrayCreateFromConstructor(_constructor_, « 𝔽(_length_) »). 1. Assert: _result_ has [[TypedArrayName]] and [[ContentType]] internal slots. 1. Assert: _result_.[[ContentType]] is _exemplar_.[[ContentType]]. 1. Return _result_. + +

            + TypedArraySpeciesCreate ( + _exemplar_: a TypedArray, + _argumentList_: a List of ECMAScript language values, + ): either a normal completion containing a TypedArray or a throw completion +

            +
            +
            description
            +
            It is used to specify the creation of a new TypedArray using a constructor function that is derived from _exemplar_. Unlike ArraySpeciesCreate, which can create non-Array objects through the use of %Symbol.species%, this operation enforces that the constructor function creates an actual TypedArray.
            +
            + + 1. Let _defaultConstructor_ be the intrinsic object associated with the constructor name _exemplar_.[[TypedArrayName]] in . + 1. Let _constructor_ be ? SpeciesConstructor(_exemplar_, _defaultConstructor_). + 1. Let _result_ be ? TypedArrayCreateFromConstructor(_constructor_, _argumentList_). + 1. If _result_.[[ContentType]] is not _exemplar_.[[ContentType]], throw a *TypeError* exception. + 1. Return _result_. + +
            +

            ValidateTypedArray ( @@ -41338,15 +42844,15 @@

            CompareTypedArrayElements ( _x_: a Number or a BigInt, _y_: a Number or a BigInt, - _comparefn_: a function object or *undefined*, + _comparator_: a function object or *undefined*, ): either a normal completion containing a Number or an abrupt completion

            1. Assert: _x_ is a Number and _y_ is a Number, or _x_ is a BigInt and _y_ is a BigInt. - 1. If _comparefn_ is not *undefined*, then - 1. Let _v_ be ? ToNumber(? Call(_comparefn_, *undefined*, « _x_, _y_ »)). + 1. If _comparator_ is not *undefined*, then + 1. Let _v_ be ? ToNumber(? Call(_comparator_, *undefined*, « _x_, _y_ »)). 1. If _v_ is *NaN*, return *+0*𝔽. 1. Return _v_. 1. If _x_ and _y_ are both *NaN*, return *+0*𝔽. @@ -41368,13 +42874,13 @@

            The _TypedArray_ Constructors

            Each _TypedArray_ constructor:

              -
            • is an intrinsic object that has the structure described below, differing only in the name used as the constructor name instead of _TypedArray_, in .
            • +
            • is an intrinsic object that has the structure described below, differing only in the name used as the constructor name instead of _TypedArray_, in , except where otherwise noted.
            • is a function whose behaviour differs based upon the number and types of its arguments. The actual behaviour of a call of _TypedArray_ depends upon the number and kind of arguments that are passed to it.
            • is not intended to be called as a function and will throw an exception when called in that manner.
            • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified _TypedArray_ behaviour must include a `super` call to the _TypedArray_ constructor to create and initialize the subclass instance with the internal state necessary to support the %TypedArray%`.prototype` built-in methods.
            - +

            _TypedArray_ ( ..._args_ )

            Each _TypedArray_ constructor performs the following steps when called:

            @@ -41382,32 +42888,29 @@

            _TypedArray_ ( ..._args_ )

            1. Let _constructorName_ be the String value of the Constructor Name value specified in for this TypedArray constructor. 1. Let _proto_ be "%TypedArray.prototype%". 1. Let _numberOfArgs_ be the number of elements in _args_. - 1. If _numberOfArgs_ = 0, then - 1. Return ? AllocateTypedArray(_constructorName_, NewTarget, _proto_, 0). - 1. Else, - 1. Let _firstArgument_ be _args_[0]. - 1. If _firstArgument_ is an Object, then - 1. Let _O_ be ? AllocateTypedArray(_constructorName_, NewTarget, _proto_). - 1. If _firstArgument_ has a [[TypedArrayName]] internal slot, then - 1. Perform ? InitializeTypedArrayFromTypedArray(_O_, _firstArgument_). - 1. Else if _firstArgument_ has an [[ArrayBufferData]] internal slot, then - 1. If _numberOfArgs_ > 1, let _byteOffset_ be _args_[1]; else let _byteOffset_ be *undefined*. - 1. If _numberOfArgs_ > 2, let _length_ be _args_[2]; else let _length_ be *undefined*. - 1. Perform ? InitializeTypedArrayFromArrayBuffer(_O_, _firstArgument_, _byteOffset_, _length_). - 1. Else, - 1. Assert: _firstArgument_ is an Object and _firstArgument_ does not have either a [[TypedArrayName]] or an [[ArrayBufferData]] internal slot. - 1. Let _usingIterator_ be ? GetMethod(_firstArgument_, @@iterator). - 1. If _usingIterator_ is not *undefined*, then - 1. Let _values_ be ? IteratorToList(? GetIteratorFromMethod(_firstArgument_, _usingIterator_)). - 1. Perform ? InitializeTypedArrayFromList(_O_, _values_). - 1. Else, - 1. NOTE: _firstArgument_ is not an Iterable so assume it is already an array-like object. - 1. Perform ? InitializeTypedArrayFromArrayLike(_O_, _firstArgument_). - 1. Return _O_. + 1. If _numberOfArgs_ = 0, return ? AllocateTypedArray(_constructorName_, NewTarget, _proto_, 0). + 1. Let _firstArgument_ be _args_[0]. + 1. If _firstArgument_ is an Object, then + 1. Let _O_ be ? AllocateTypedArray(_constructorName_, NewTarget, _proto_). + 1. If _firstArgument_ has a [[TypedArrayName]] internal slot, then + 1. Perform ? InitializeTypedArrayFromTypedArray(_O_, _firstArgument_). + 1. Else if _firstArgument_ has an [[ArrayBufferData]] internal slot, then + 1. If _numberOfArgs_ > 1, let _byteOffset_ be _args_[1]; else let _byteOffset_ be *undefined*. + 1. If _numberOfArgs_ > 2, let _length_ be _args_[2]; else let _length_ be *undefined*. + 1. Perform ? InitializeTypedArrayFromArrayBuffer(_O_, _firstArgument_, _byteOffset_, _length_). 1. Else, - 1. Assert: _firstArgument_ is not an Object. - 1. Let _elementLength_ be ? ToIndex(_firstArgument_). - 1. Return ? AllocateTypedArray(_constructorName_, NewTarget, _proto_, _elementLength_). + 1. Assert: _firstArgument_ is an Object and _firstArgument_ does not have either a [[TypedArrayName]] or an [[ArrayBufferData]] internal slot. + 1. Let _usingIterator_ be ? GetMethod(_firstArgument_, %Symbol.iterator%). + 1. If _usingIterator_ is not *undefined*, then + 1. Let _values_ be ? IteratorToList(? GetIteratorFromMethod(_firstArgument_, _usingIterator_)). + 1. Perform ? InitializeTypedArrayFromList(_O_, _values_). + 1. Else, + 1. NOTE: _firstArgument_ is not an iterable object, so assume it is already an array-like object. + 1. Perform ? InitializeTypedArrayFromArrayLike(_O_, _firstArgument_). + 1. Return _O_. + 1. Assert: _firstArgument_ is not an Object. + 1. Let _elementLength_ be ? ToIndex(_firstArgument_). + 1. Return ? AllocateTypedArray(_constructorName_, NewTarget, _proto_, _elementLength_).
            @@ -41429,7 +42932,7 @@

            1. Assert: _obj_.[[ViewedArrayBuffer]] is *undefined*. 1. Set _obj_.[[TypedArrayName]] to _constructorName_. 1. If _constructorName_ is either *"BigInt64Array"* or *"BigUint64Array"*, set _obj_.[[ContentType]] to ~bigint~. - 1. Otherwise, set _obj_.[[ContentType]] to ~number~. + 1. Else, set _obj_.[[ContentType]] to ~number~. 1. If _length_ is not present, then 1. Set _obj_.[[ByteLength]] to 0. 1. Set _obj_.[[ByteOffset]] to 0. @@ -41640,7 +43143,390 @@

            _TypedArray_.prototype.constructor

            Properties of _TypedArray_ Instances

            -

            _TypedArray_ instances are TypedArrays. Each _TypedArray_ instance inherits properties from the corresponding _TypedArray_ prototype object. Each _TypedArray_ instance has the following internal slots: [[TypedArrayName]], [[ViewedArrayBuffer]], [[ByteLength]], [[ByteOffset]], and [[ArrayLength]].

            +

            _TypedArray_ instances are TypedArrays. Each _TypedArray_ instance inherits properties from the corresponding _TypedArray_ prototype object. Each _TypedArray_ instance has the following internal slots: [[ViewedArrayBuffer]], [[TypedArrayName]], [[ContentType]], [[ByteLength]], [[ByteOffset]], and [[ArrayLength]].

            +
            +
            + + +

            Uint8Array Objects

            +

            A Uint8Array is a particular kind of _TypedArray_ as described above. In addition, there are additional methods on the Uint8Array constructor () and on the Uint8Array prototype object ().

            + + +

            Additional Properties of the Uint8Array Constructor

            + + +

            Uint8Array.fromBase64 ( _string_ [ , _options_ ] )

            + + 1. If _string_ is not a String, throw a *TypeError* exception. + 1. Let _opts_ be ? GetOptionsObject(_options_). + 1. Let _alphabet_ be ? Get(_opts_, *"alphabet"*). + 1. If _alphabet_ is *undefined*, set _alphabet_ to *"base64"*. + 1. If _alphabet_ is neither *"base64"* nor *"base64url"*, throw a *TypeError* exception. + 1. Let _lastChunkHandling_ be ? Get(_opts_, *"lastChunkHandling"*). + 1. If _lastChunkHandling_ is *undefined*, set _lastChunkHandling_ to *"loose"*. + 1. If _lastChunkHandling_ is not one of *"loose"*, *"strict"*, or *"stop-before-partial"*, throw a *TypeError* exception. + 1. Let _result_ be FromBase64(_string_, _alphabet_, _lastChunkHandling_). + 1. If _result_.[[Error]] is not ~none~, then + 1. Return ThrowCompletion(_result_.[[Error]]). + 1. Let _resultLength_ be the number of elements in _result_.[[Bytes]]. + 1. Let _ta_ be ? AllocateTypedArray(*"Uint8Array"*, %Uint8Array%, *"%Uint8Array.prototype%"*, _resultLength_). + 1. Assert: _ta_.[[ViewedArrayBuffer]].[[ArrayBufferByteLength]] is the number of elements in _result_.[[Bytes]]. + 1. Set the value at each index of _ta_.[[ViewedArrayBuffer]].[[ArrayBufferData]] to the value at the corresponding index of _result_.[[Bytes]]. + 1. Return _ta_. + +
            + + +

            Uint8Array.fromHex ( _string_ )

            + + 1. If _string_ is not a String, throw a *TypeError* exception. + 1. Let _result_ be FromHex(_string_). + 1. If _result_.[[Error]] is not ~none~, then + 1. Return ThrowCompletion(_result_.[[Error]]). + 1. Let _resultLength_ be the number of elements in _result_.[[Bytes]]. + 1. Let _ta_ be ? AllocateTypedArray(*"Uint8Array"*, %Uint8Array%, *"%Uint8Array.prototype%"*, _resultLength_). + 1. Assert: _ta_.[[ViewedArrayBuffer]].[[ArrayBufferByteLength]] is the number of elements in _result_.[[Bytes]]. + 1. Set the value at each index of _ta_.[[ViewedArrayBuffer]].[[ArrayBufferData]] to the value at the corresponding index of _result_.[[Bytes]]. + 1. Return _ta_. + +
            +
            + + +

            Additional Properties of the Uint8Array Prototype Object

            + + +

            Uint8Array.prototype.setFromBase64 ( _string_ [ , _options_ ] )

            + + 1. Let _into_ be the *this* value. + 1. Perform ? ValidateUint8Array(_into_). + 1. If _string_ is not a String, throw a *TypeError* exception. + 1. Let _opts_ be ? GetOptionsObject(_options_). + 1. Let _alphabet_ be ? Get(_opts_, *"alphabet"*). + 1. If _alphabet_ is *undefined*, set _alphabet_ to *"base64"*. + 1. If _alphabet_ is neither *"base64"* nor *"base64url"*, throw a *TypeError* exception. + 1. Let _lastChunkHandling_ be ? Get(_opts_, *"lastChunkHandling"*). + 1. If _lastChunkHandling_ is *undefined*, set _lastChunkHandling_ to *"loose"*. + 1. If _lastChunkHandling_ is not one of *"loose"*, *"strict"*, or *"stop-before-partial"*, throw a *TypeError* exception. + 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_into_, ~seq-cst~). + 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception. + 1. Let _byteLength_ be TypedArrayLength(_taRecord_). + 1. Let _result_ be FromBase64(_string_, _alphabet_, _lastChunkHandling_, _byteLength_). + 1. Let _bytes_ be _result_.[[Bytes]]. + 1. Let _written_ be the number of elements in _bytes_. + 1. NOTE: FromBase64 does not invoke any user code, so the ArrayBuffer backing _into_ cannot have been detached or shrunk. + 1. Assert: _written_ ≤ _byteLength_. + 1. Perform SetUint8ArrayBytes(_into_, _bytes_). + 1. If _result_.[[Error]] is not ~none~, then + 1. Return ThrowCompletion(_result_.[[Error]]). + 1. Let _resultObject_ be OrdinaryObjectCreate(%Object.prototype%). + 1. Perform ! CreateDataPropertyOrThrow(_resultObject_, *"read"*, 𝔽(_result_.[[Read]])). + 1. Perform ! CreateDataPropertyOrThrow(_resultObject_, *"written"*, 𝔽(_written_)). + 1. Return _resultObject_. + +
            + + +

            Uint8Array.prototype.setFromHex ( _string_ )

            + + 1. Let _into_ be the *this* value. + 1. Perform ? ValidateUint8Array(_into_). + 1. If _string_ is not a String, throw a *TypeError* exception. + 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_into_, ~seq-cst~). + 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception. + 1. Let _byteLength_ be TypedArrayLength(_taRecord_). + 1. Let _result_ be FromHex(_string_, _byteLength_). + 1. Let _bytes_ be _result_.[[Bytes]]. + 1. Let _written_ be the number of elements in _bytes_. + 1. NOTE: FromHex does not invoke any user code, so the ArrayBuffer backing _into_ cannot have been detached or shrunk. + 1. Assert: _written_ ≤ _byteLength_. + 1. Perform SetUint8ArrayBytes(_into_, _bytes_). + 1. If _result_.[[Error]] is not ~none~, then + 1. Return ThrowCompletion(_result_.[[Error]]). + 1. Let _resultObject_ be OrdinaryObjectCreate(%Object.prototype%). + 1. Perform ! CreateDataPropertyOrThrow(_resultObject_, *"read"*, 𝔽(_result_.[[Read]])). + 1. Perform ! CreateDataPropertyOrThrow(_resultObject_, *"written"*, 𝔽(_written_)). + 1. Return _resultObject_. + +
            + + +

            Uint8Array.prototype.toBase64 ( [ _options_ ] )

            + + 1. Let _O_ be the *this* value. + 1. Perform ? ValidateUint8Array(_O_). + 1. Let _opts_ be ? GetOptionsObject(_options_). + 1. Let _alphabet_ be ? Get(_opts_, *"alphabet"*). + 1. If _alphabet_ is *undefined*, set _alphabet_ to *"base64"*. + 1. If _alphabet_ is neither *"base64"* nor *"base64url"*, throw a *TypeError* exception. + 1. Let _omitPadding_ be ToBoolean(? Get(_opts_, *"omitPadding"*)). + 1. Let _toEncode_ be ? GetUint8ArrayBytes(_O_). + 1. If _alphabet_ is *"base64"*, then + 1. Let _outAscii_ be the sequence of code points which results from encoding _toEncode_ according to the base64 encoding specified in section 4 of RFC 4648. Padding is included if and only if _omitPadding_ is *false*. + 1. Else, + 1. Assert: _alphabet_ is *"base64url"*. + 1. Let _outAscii_ be the sequence of code points which results from encoding _toEncode_ according to the base64url encoding specified in section 5 of RFC 4648. Padding is included if and only if _omitPadding_ is *false*. + 1. Return CodePointsToString(_outAscii_). + +
            + + +

            Uint8Array.prototype.toHex ( )

            + + 1. Let _O_ be the *this* value. + 1. Perform ? ValidateUint8Array(_O_). + 1. Let _toEncode_ be ? GetUint8ArrayBytes(_O_). + 1. Let _out_ be the empty String. + 1. For each byte _byte_ of _toEncode_, do + 1. Let _hex_ be Number::toString(𝔽(_byte_), 16). + 1. Set _hex_ to StringPad(_hex_, 2, *"0"*, ~start~). + 1. Set _out_ to the string-concatenation of _out_ and _hex_. + 1. Return _out_. + +
            +
            + + +

            Abstract Operations for Uint8Array Objects

            + + +

            + ValidateUint8Array ( + _ta_: an ECMAScript language value, + ): either a normal completion containing ~unused~ or a throw completion +

            +
            + + 1. Perform ? RequireInternalSlot(_ta_, [[TypedArrayName]]). + 1. If _ta_.[[TypedArrayName]] is not *"Uint8Array"*, throw a *TypeError* exception. + 1. Return ~unused~. + +
            + + +

            + GetUint8ArrayBytes ( + _ta_: a Uint8Array, + ): either a normal completion containing a List of byte values or a throw completion +

            +
            + + 1. Let _buffer_ be _ta_.[[ViewedArrayBuffer]]. + 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_ta_, ~seq-cst~). + 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception. + 1. Let _len_ be TypedArrayLength(_taRecord_). + 1. Let _byteOffset_ be _ta_.[[ByteOffset]]. + 1. Let _bytes_ be a new empty List. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _len_, + 1. Let _byteIndex_ be _byteOffset_ + _index_. + 1. Let _byte_ be ℝ(GetValueFromBuffer(_buffer_, _byteIndex_, ~uint8~, *true*, ~unordered~)). + 1. Append _byte_ to _bytes_. + 1. Set _index_ to _index_ + 1. + 1. Return _bytes_. + +
            + + +

            + SetUint8ArrayBytes ( + _into_: a Uint8Array, + _bytes_: a List of byte values, + ): ~unused~ +

            +
            + + 1. Let _offset_ be _into_.[[ByteOffset]]. + 1. Let _len_ be the number of elements in _bytes_. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _len_, + 1. Let _byte_ be _bytes_[_index_]. + 1. Let _byteIndexInBuffer_ be _index_ + _offset_. + 1. Perform SetValueInBuffer(_into_.[[ViewedArrayBuffer]], _byteIndexInBuffer_, ~uint8~, 𝔽(_byte_), *true*, ~unordered~). + 1. Set _index_ to _index_ + 1. + 1. Return ~unused~. + +
            + + +

            + SkipAsciiWhitespace ( + _string_: a String, + _index_: a non-negative integer, + ): a non-negative integer +

            +
            +
            + + 1. Let _length_ be the length of _string_. + 1. Repeat, while _index_ < _length_, + 1. Let _char_ be the code unit at index _index_ within _string_. + 1. If _char_ is not one of 0x0009 (TAB), 0x000A (LF), 0x000C (FF), 0x000D (CR), or 0x0020 (SPACE), then + 1. Return _index_. + 1. Set _index_ to _index_ + 1. + 1. Return _index_. + +
            + + +

            + DecodeFinalBase64Chunk ( + _chunk_: a String of length 2 or 3, + _throwOnExtraBits_: a Boolean, + ): either a normal completion containing a List of byte values, or a throw completion +

            +
            +
            + + 1. Let _chunkLength_ be the length of _chunk_. + 1. If _chunkLength_ = 2, then + 1. Set _chunk_ to the string-concatenation of _chunk_ and *"AA"*. + 1. Else, + 1. Assert: _chunkLength_ is 3. + 1. Set _chunk_ to the string-concatenation of _chunk_ and *"A"*. + 1. Let _bytes_ be DecodeFullLengthBase64Chunk(_chunk_). + 1. If _chunkLength_ = 2, then + 1. If _throwOnExtraBits_ is *true* and _bytes_[1] ≠ 0, throw a *SyntaxError* exception. + 1. Return « _bytes_[0] ». + 1. If _throwOnExtraBits_ is *true* and _bytes_[2] ≠ 0, throw a *SyntaxError* exception. + 1. Return « _bytes_[0], _bytes_[1] ». + +
            + + +

            + DecodeFullLengthBase64Chunk ( + _chunk_: a String of length 4, + ): a List of byte values of length 3 +

            +
            +
            +

            The standard base64 alphabet is *"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"*, i.e., the String whose elements are the code units corresponding to every letter and number in the Unicode Basic Latin block along with *"+"* and *"/"*.

            + + 1. Let _byteSequence_ be the unique sequence of 3 bytes resulting from decoding _chunk_ as base64 (i.e., the sequence such that applying the base64 encoding specified in section 4 of RFC 4648 to _byteSequence_ would produce _chunk_). + 1. Return a List whose elements are the elements of _byteSequence_, in order. + +
            + + +

            + FromBase64 ( + _string_: a String, + _alphabet_: *"base64"* or *"base64url"*, + _lastChunkHandling_: *"loose"*, *"strict"*, or *"stop-before-partial"*, + optional _maxLength_: a non-negative integer, + ): a Record with fields [[Read]] (an integer), [[Bytes]] (a List of byte values), and [[Error]] (a *SyntaxError* object or ~none~) +

            +
            +
            + + 1. If _maxLength_ is not present, then + 1. Set _maxLength_ to 253 - 1. + 1. NOTE: Because the input is a String, the length of Strings is limited to 253 - 1 characters, and the output requires no more bytes than the input has characters, this limit can never be reached. However, it is editorially convenient to use a finite value for _maxLength_. + 1. NOTE: The order of validation and decoding in the algorithm below is not observable. Implementations are encouraged to perform them in whatever order is most efficient, possibly interleaving validation with decoding. + 1. If _maxLength_ = 0, then + 1. Return the Record { [[Read]]: 0, [[Bytes]]: « », [[Error]]: ~none~ }. + 1. Let _read_ be 0. + 1. Let _bytes_ be a new empty List. + 1. Let _chunk_ be the empty String. + 1. Let _chunkLength_ be 0. + 1. Let _index_ be 0. + 1. Let _length_ be the length of _string_. + 1. Repeat, + 1. Set _index_ to SkipAsciiWhitespace(_string_, _index_). + 1. If _index_ = _length_, then + 1. If _chunkLength_ > 0, then + 1. If _lastChunkHandling_ is *"stop-before-partial"*, then + 1. Return the Record { [[Read]]: _read_, [[Bytes]]: _bytes_, [[Error]]: ~none~ }. + 1. If _lastChunkHandling_ is *"strict"*, then + 1. Let _error_ be a newly created *SyntaxError* object. + 1. Return the Record { [[Read]]: _read_, [[Bytes]]: _bytes_, [[Error]]: _error_ }. + 1. Assert: _lastChunkHandling_ is *"loose"*. + 1. If _chunkLength_ = 1, then + 1. Let _error_ be a newly created *SyntaxError* object. + 1. Return the Record { [[Read]]: _read_, [[Bytes]]: _bytes_, [[Error]]: _error_ }. + 1. Set _bytes_ to the list-concatenation of _bytes_ and ! DecodeFinalBase64Chunk(_chunk_, *false*). + 1. Return the Record { [[Read]]: _length_, [[Bytes]]: _bytes_, [[Error]]: ~none~ }. + 1. Let _char_ be the substring of _string_ from _index_ to _index_ + 1. + 1. Set _index_ to _index_ + 1. + 1. If _char_ is *"="*, then + 1. If _chunkLength_ < 2, then + 1. Let _error_ be a newly created *SyntaxError* object. + 1. Return the Record { [[Read]]: _read_, [[Bytes]]: _bytes_, [[Error]]: _error_ }. + 1. Set _index_ to SkipAsciiWhitespace(_string_, _index_). + 1. If _chunkLength_ = 2, then + 1. If _index_ = _length_, then + 1. If _lastChunkHandling_ is *"stop-before-partial"*, then + 1. Return the Record { [[Read]]: _read_, [[Bytes]]: _bytes_, [[Error]]: ~none~ }. + 1. Let _error_ be a newly created *SyntaxError* object. + 1. Return the Record { [[Read]]: _read_, [[Bytes]]: _bytes_, [[Error]]: _error_ }. + 1. Set _char_ to the substring of _string_ from _index_ to _index_ + 1. + 1. If _char_ is *"="*, then + 1. Set _index_ to SkipAsciiWhitespace(_string_, _index_ + 1). + 1. If _index_ < _length_, then + 1. Let _error_ be a newly created *SyntaxError* object. + 1. Return the Record { [[Read]]: _read_, [[Bytes]]: _bytes_, [[Error]]: _error_ }. + 1. If _lastChunkHandling_ is *"strict"*, let _throwOnExtraBits_ be *true*; else let _throwOnExtraBits_ be *false*. + 1. Let _decodeResult_ be Completion(DecodeFinalBase64Chunk(_chunk_, _throwOnExtraBits_)). + 1. If _decodeResult_ is an abrupt completion, then + 1. Let _error_ be _decodeResult_.[[Value]]. + 1. Return the Record { [[Read]]: _read_, [[Bytes]]: _bytes_, [[Error]]: _error_ }. + 1. Set _bytes_ to the list-concatenation of _bytes_ and ! _decodeResult_. + 1. Return the Record { [[Read]]: _length_, [[Bytes]]: _bytes_, [[Error]]: ~none~ }. + 1. If _alphabet_ is *"base64url"*, then + 1. If _char_ is either *"+"* or *"/"*, then + 1. Let _error_ be a newly created *SyntaxError* object. + 1. Return the Record { [[Read]]: _read_, [[Bytes]]: _bytes_, [[Error]]: _error_ }. + 1. Else if _char_ is *"-"*, then + 1. Set _char_ to *"+"*. + 1. Else if _char_ is *"_"*, then + 1. Set _char_ to *"/"*. + 1. If the sole code unit of _char_ is not an element of the standard base64 alphabet, then + 1. Let _error_ be a newly created *SyntaxError* object. + 1. Return the Record { [[Read]]: _read_, [[Bytes]]: _bytes_, [[Error]]: _error_ }. + 1. Let _remaining_ be _maxLength_ - the number of elements in _bytes_. + 1. If _remaining_ = 1 and _chunkLength_ = 2, or if _remaining_ = 2 and _chunkLength_ = 3, then + 1. Return the Record { [[Read]]: _read_, [[Bytes]]: _bytes_, [[Error]]: ~none~ }. + 1. Set _chunk_ to the string-concatenation of _chunk_ and _char_. + 1. Set _chunkLength_ to the length of _chunk_. + 1. If _chunkLength_ = 4, then + 1. Set _bytes_ to the list-concatenation of _bytes_ and DecodeFullLengthBase64Chunk(_chunk_). + 1. Set _chunk_ to the empty String. + 1. Set _chunkLength_ to 0. + 1. Set _read_ to _index_. + 1. If the number of elements in _bytes_ = _maxLength_, then + 1. Return the Record { [[Read]]: _read_, [[Bytes]]: _bytes_, [[Error]]: ~none~ }. + +
            + + +

            + FromHex ( + _string_: a String, + optional _maxLength_: a non-negative integer, + ): a Record with fields [[Read]] (an integer), [[Bytes]] (a List of byte values), and [[Error]] (a *SyntaxError* object or ~none~) +

            +
            +
            + + 1. If _maxLength_ is not present, set _maxLength_ to 253 - 1. + 1. Let _length_ be the length of _string_. + 1. Let _bytes_ be a new empty List. + 1. Let _read_ be 0. + 1. If _length_ modulo 2 ≠ 0, then + 1. Let _error_ be a newly created *SyntaxError* object. + 1. Return the Record { [[Read]]: _read_, [[Bytes]]: _bytes_, [[Error]]: _error_ }. + 1. Repeat, while _read_ < _length_ and the number of elements in _bytes_ < _maxLength_, + 1. Let _hexits_ be the substring of _string_ from _read_ to _read_ + 2. + 1. If _hexits_ contains any code units which are not in *"0123456789abcdefABCDEF"*, then + 1. Let _error_ be a newly created *SyntaxError* object. + 1. Return the Record { [[Read]]: _read_, [[Bytes]]: _bytes_, [[Error]]: _error_ }. + 1. Set _read_ to _read_ + 2. + 1. Let _byte_ be the integer value represented by _hexits_ in base-16 notation, using the letters *A* through *F* and *a* through *f* for digits with values 10 through 15. + 1. Append _byte_ to _bytes_. + 1. Return the Record { [[Read]]: _read_, [[Bytes]]: _bytes_, [[Error]]: ~none~ }. + +
            @@ -41650,7 +43536,7 @@

            Keyed Collections

            Map Objects

            -

            Maps are collections of key/value pairs where both the keys and values may be arbitrary ECMAScript language values. A distinct key value may only occur in one key/value pair within the Map's collection. Distinct key values are discriminated using the SameValueZero comparison algorithm.

            +

            Maps are collections of key/value pairs where both the keys and values may be arbitrary ECMAScript language values. A distinct key value may only occur in one key/value pair within the Map's collection. Distinct key values are discriminated using the semantics of the SameValueZero comparison algorithm.

            Maps must be implemented using either hash tables or other mechanisms that, on average, provide access times that are sublinear on the number of elements in the collection. The data structure used in this specification is only intended to describe the required observable semantics of Maps. It is not intended to be a viable implementation model.

            @@ -41664,7 +43550,7 @@

            The Map Constructor

          • may be used as the value in an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified Map behaviour must include a `super` call to the Map constructor to create and initialize the subclass instance with the internal state necessary to support the `Map.prototype` built-in methods.
          • - +

            Map ( [ _iterable_ ] )

            This function performs the following steps when called:

            @@ -41677,7 +43563,7 @@

            Map ( [ _iterable_ ] )

            1. Return ? AddEntriesFromIterable(_map_, _iterable_, _adder_).
            -

            If the parameter _iterable_ is present, it is expected to be an object that implements an @@iterator method that returns an iterator object that produces a two element array-like object whose first element is a value that will be used as a Map key and whose second element is the value to associate with that key.

            +

            If the parameter _iterable_ is present, it is expected to be an object that implements a %Symbol.iterator% method that returns an iterator object that produces a two element array-like object whose first element is a value that will be used as a Map key and whose second element is the value to associate with that key.

            @@ -41709,7 +43595,7 @@

            1. IfAbruptCloseIterator(_status_, _iteratorRecord_). -

            The parameter _iterable_ is expected to be an object that implements an @@iterator method that returns an iterator object that produces a two element array-like object whose first element is a value that will be used as a Map key and whose second element is the value to associate with that key.

            +

            The parameter _iterable_ is expected to be an object that implements a %Symbol.iterator% method that returns an iterator object that produces a two element array-like object whose first element is a value that will be used as a Map key and whose second element is the value to associate with that key.

            @@ -41722,16 +43608,16 @@

            Properties of the Map Constructor

          • has the following properties:
          • - -

            Map.groupBy ( _items_, _callbackfn_ )

            + +

            Map.groupBy ( _items_, _callback_ )

            -

            _callbackfn_ should be a function that accepts two arguments. `groupBy` calls _callbackfn_ once for each element in _items_, in ascending order, and constructs a new Map. Each value returned by _callbackfn_ is used as a key in the Map. For each such key, the result Map has an entry whose key is that key and whose value is an array containing all the elements for which _callbackfn_ returned that key.

            -

            _callbackfn_ is called with two arguments: the value of the element and the index of the element.

            +

            _callback_ should be a function that accepts two arguments. `groupBy` calls _callback_ once for each element in _items_, in ascending order, and constructs a new Map. Each value returned by _callback_ is used as a key in the Map. For each such key, the result Map has an entry whose key is that key and whose value is an array containing all the elements for which _callback_ returned that key.

            +

            _callback_ is called with two arguments: the value of the element and the index of the element.

            The return value of `groupBy` is a Map.

            This function performs the following steps when called:

            - 1. Let _groups_ be ? GroupBy(_items_, _callbackfn_, ~zero~). + 1. Let _groups_ be ? GroupBy(_items_, _callback_, ~collection~). 1. Let _map_ be ! Construct(%Map%). 1. For each Record { [[Key]], [[Elements]] } _g_ of _groups_, do 1. Let _elements_ be CreateArrayFromList(_g_.[[Elements]]). @@ -41747,15 +43633,15 @@

            Map.prototype

            This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

            - -

            get Map [ @@species ]

            -

            `Map[@@species]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            + +

            get Map [ %Symbol.species% ]

            +

            `Map[%Symbol.species%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            1. Return the *this* value.

            The value of the *"name"* property of this function is *"get [Symbol.species]"*.

            -

            Methods that create derived collection objects should call @@species to determine the constructor to use to create the derived objects. Subclass constructor may over-ride @@species to change the default constructor assignment.

            +

            Methods that create derived collection objects should call %Symbol.species% to determine the constructor to use to create the derived objects. Subclass constructor may over-ride %Symbol.species% to change the default constructor assignment.

            @@ -41770,7 +43656,7 @@

            Properties of the Map Prototype Object

          • does not have a [[MapData]] internal slot.
          • - +

            Map.prototype.clear ( )

            This method performs the following steps when called:

            @@ -41791,14 +43677,15 @@

            Map.prototype.constructor

            The initial value of `Map.prototype.constructor` is %Map%.

            - +

            Map.prototype.delete ( _key_ )

            This method performs the following steps when called:

            1. Let _M_ be the *this* value. 1. Perform ? RequireInternalSlot(_M_, [[MapData]]). + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do - 1. If _p_.[[Key]] is not ~empty~ and SameValueZero(_p_.[[Key]], _key_) is *true*, then + 1. If _p_.[[Key]] is not ~empty~ and SameValue(_p_.[[Key]], _key_) is *true*, then 1. Set _p_.[[Key]] to ~empty~. 1. Set _p_.[[Value]] to ~empty~. 1. Return *true*. @@ -41809,7 +43696,7 @@

            Map.prototype.delete ( _key_ )

            - +

            Map.prototype.entries ( )

            This method performs the following steps when called:

            @@ -41818,13 +43705,13 @@

            Map.prototype.entries ( )

            - -

            Map.prototype.forEach ( _callbackfn_ [ , _thisArg_ ] )

            + +

            Map.prototype.forEach ( _callback_ [ , _thisArg_ ] )

            This method performs the following steps when called:

            1. Let _M_ be the *this* value. 1. Perform ? RequireInternalSlot(_M_, [[MapData]]). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _entries_ be _M_.[[MapData]]. 1. Let _numEntries_ be the number of elements in _entries_. 1. Let _index_ be 0. @@ -41832,44 +43719,83 @@

            Map.prototype.forEach ( _callbackfn_ [ , _thisArg_ ] )

            1. Let _e_ be _entries_[_index_]. 1. Set _index_ to _index_ + 1. 1. If _e_.[[Key]] is not ~empty~, then - 1. Perform ? Call(_callbackfn_, _thisArg_, « _e_.[[Value]], _e_.[[Key]], _M_ »). - 1. NOTE: The number of elements in _entries_ may have increased during execution of _callbackfn_. + 1. Perform ? Call(_callback_, _thisArg_, « _e_.[[Value]], _e_.[[Key]], _M_ »). + 1. NOTE: The number of elements in _entries_ may have increased during execution of _callback_. 1. Set _numEntries_ to the number of elements in _entries_. 1. Return *undefined*.
            -

            _callbackfn_ should be a function that accepts three arguments. `forEach` calls _callbackfn_ once for each key/value pair present in the Map, in key insertion order. _callbackfn_ is called only for keys of the Map which actually exist; it is not called for keys that have been deleted from the Map.

            -

            If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callbackfn_. If it is not provided, *undefined* is used instead.

            -

            _callbackfn_ is called with three arguments: the value of the item, the key of the item, and the Map being traversed.

            -

            `forEach` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_. Each entry of a map's [[MapData]] is only visited once. New keys added after the call to `forEach` begins are visited. A key will be revisited if it is deleted after it has been visited and then re-added before the `forEach` call completes. Keys that are deleted after the call to `forEach` begins and before being visited are not visited unless the key is added again before the `forEach` call completes.

            +

            _callback_ should be a function that accepts three arguments. `forEach` calls _callback_ once for each key/value pair present in the Map, in key insertion order. _callback_ is called only for keys of the Map which actually exist; it is not called for keys that have been deleted from the Map.

            +

            If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callback_. If it is not provided, *undefined* is used instead.

            +

            _callback_ is called with three arguments: the value of the item, the key of the item, and the Map being traversed.

            +

            `forEach` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_. Each entry of a map's [[MapData]] is only visited once. New keys added after the call to `forEach` begins are visited. A key will be revisited if it is deleted after it has been visited and then re-added before the `forEach` call completes. Keys that are deleted after the call to `forEach` begins and before being visited are not visited unless the key is added again before the `forEach` call completes.

            - +

            Map.prototype.get ( _key_ )

            This method performs the following steps when called:

            1. Let _M_ be the *this* value. 1. Perform ? RequireInternalSlot(_M_, [[MapData]]). + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do - 1. If _p_.[[Key]] is not ~empty~ and SameValueZero(_p_.[[Key]], _key_) is *true*, return _p_.[[Value]]. + 1. If _p_.[[Key]] is not ~empty~ and SameValue(_p_.[[Key]], _key_) is *true*, return _p_.[[Value]]. 1. Return *undefined*.
            - + +

            Map.prototype.getOrInsert ( _key_, _value_ )

            +

            This method performs the following steps when called:

            + + 1. Let _M_ be the *this* value. + 1. Perform ? RequireInternalSlot(_M_, [[MapData]]). + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). + 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do + 1. If _p_.[[Key]] is not ~empty~ and SameValue(_p_.[[Key]], _key_) is *true*, return _p_.[[Value]]. + 1. Let _p_ be the Record { [[Key]]: _key_, [[Value]]: _value_ }. + 1. Append _p_ to _M_.[[MapData]]. + 1. Return _value_. + +
            + + +

            Map.prototype.getOrInsertComputed ( _key_, _callback_ )

            +

            This method performs the following steps when called:

            + + 1. Let _M_ be the *this* value. + 1. Perform ? RequireInternalSlot(_M_, [[MapData]]). + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). + 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do + 1. If _p_.[[Key]] is not ~empty~ and SameValue(_p_.[[Key]], _key_) is *true*, return _p_.[[Value]]. + 1. Let _value_ be ? Call(_callback_, *undefined*, « _key_ »). + 1. NOTE: The Map may have been modified during execution of _callback_. + 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do + 1. If _p_.[[Key]] is not ~empty~ and SameValue(_p_.[[Key]], _key_) is *true*, then + 1. Set _p_.[[Value]] to _value_. + 1. Return _value_. + 1. Let _p_ be the Record { [[Key]]: _key_, [[Value]]: _value_ }. + 1. Append _p_ to _M_.[[MapData]]. + 1. Return _value_. + +
            + +

            Map.prototype.has ( _key_ )

            This method performs the following steps when called:

            1. Let _M_ be the *this* value. 1. Perform ? RequireInternalSlot(_M_, [[MapData]]). + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do - 1. If _p_.[[Key]] is not ~empty~ and SameValueZero(_p_.[[Key]], _key_) is *true*, return *true*. + 1. If _p_.[[Key]] is not ~empty~ and SameValue(_p_.[[Key]], _key_) is *true*, return *true*. 1. Return *false*.
            - +

            Map.prototype.keys ( )

            This method performs the following steps when called:

            @@ -41878,24 +43804,24 @@

            Map.prototype.keys ( )

            - +

            Map.prototype.set ( _key_, _value_ )

            This method performs the following steps when called:

            1. Let _M_ be the *this* value. 1. Perform ? RequireInternalSlot(_M_, [[MapData]]). + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do - 1. If _p_.[[Key]] is not ~empty~ and SameValueZero(_p_.[[Key]], _key_) is *true*, then + 1. If _p_.[[Key]] is not ~empty~ and SameValue(_p_.[[Key]], _key_) is *true*, then 1. Set _p_.[[Value]] to _value_. 1. Return _M_. - 1. If _key_ is *-0*𝔽, set _key_ to *+0*𝔽. 1. Let _p_ be the Record { [[Key]]: _key_, [[Value]]: _value_ }. 1. Append _p_ to _M_.[[MapData]]. 1. Return _M_.
            - +

            get Map.prototype.size

            `Map.prototype.size` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            @@ -41908,7 +43834,7 @@

            get Map.prototype.size

            - +

            Map.prototype.values ( )

            This method performs the following steps when called:

            @@ -41917,26 +43843,26 @@

            Map.prototype.values ( )

            - -

            Map.prototype [ @@iterator ] ( )

            -

            The initial value of the @@iterator property is %Map.prototype.entries%, defined in .

            + +

            Map.prototype [ %Symbol.iterator% ] ( )

            +

            The initial value of the %Symbol.iterator% property is %Map.prototype.entries%, defined in .

            - -

            Map.prototype [ @@toStringTag ]

            -

            The initial value of the @@toStringTag property is the String value *"Map"*.

            + +

            Map.prototype [ %Symbol.toStringTag% ]

            +

            The initial value of the %Symbol.toStringTag% property is the String value *"Map"*.

            This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

            Properties of Map Instances

            -

            Map instances are ordinary objects that inherit properties from the Map prototype. Map instances also have a [[MapData]] internal slot.

            +

            Map instances are ordinary objects that inherit properties from the Map prototype object. Map instances also have a [[MapData]] internal slot.

            Map Iterator Objects

            -

            A Map Iterator is an object, that represents a specific iteration over some specific Map instance object. There is not a named constructor for Map Iterator objects. Instead, map iterator objects are created by calling certain methods of Map instance objects.

            +

            A Map Iterator is an object that represents a specific iteration over some specific Map instance object. There is not a named constructor for Map Iterator objects. Instead, Map Iterator objects are created by calling certain methods of Map instance objects.

            @@ -41966,10 +43892,10 @@

            1. Else, 1. Assert: _kind_ is ~key+value~. 1. Let _result_ be CreateArrayFromList(« _e_.[[Key]], _e_.[[Value]] »). - 1. Perform ? GeneratorYield(CreateIterResultObject(_result_, *false*)). - 1. NOTE: The number of elements in _entries_ may have increased while execution of this abstract operation was paused by Yield. + 1. Perform ? GeneratorYield(CreateIteratorResultObject(_result_, *false*)). + 1. NOTE: The number of elements in _entries_ may have increased while execution of this abstract operation was paused by GeneratorYield. 1. Set _numEntries_ to the number of elements in _entries_. - 1. Return *undefined*. + 1. Return NormalCompletion(~unused~). 1. Return CreateIteratorFromClosure(_closure_, *"%MapIteratorPrototype%"*, %MapIteratorPrototype%). @@ -41978,22 +43904,22 @@

            The %MapIteratorPrototype% Object

            The %MapIteratorPrototype% object:

              -
            • has properties that are inherited by all Map Iterator Objects.
            • +
            • has properties that are inherited by all Map Iterator objects.
            • is an ordinary object.
            • -
            • has a [[Prototype]] internal slot whose value is %IteratorPrototype%.
            • +
            • has a [[Prototype]] internal slot whose value is %Iterator.prototype%.
            • has the following properties:
            - +

            %MapIteratorPrototype%.next ( )

            1. Return ? GeneratorResume(*this* value, ~empty~, *"%MapIteratorPrototype%"*).
            - -

            %MapIteratorPrototype% [ @@toStringTag ]

            -

            The initial value of the @@toStringTag property is the String value *"Map Iterator"*.

            + +

            %MapIteratorPrototype% [ %Symbol.toStringTag% ]

            +

            The initial value of the %Symbol.toStringTag% property is the String value *"Map Iterator"*.

            This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

            @@ -42002,9 +43928,155 @@

            %MapIteratorPrototype% [ @@toStringTag ]

            Set Objects

            -

            Set objects are collections of ECMAScript language values. A distinct value may only occur once as an element of a Set's collection. Distinct values are discriminated using the SameValueZero comparison algorithm.

            +

            Set objects are collections of ECMAScript language values. A Set may contain each distinct value at most once. Distinct values are discriminated using the semantics of the SameValueZero comparison algorithm.

            Set objects must be implemented using either hash tables or other mechanisms that, on average, provide access times that are sublinear on the number of elements in the collection. The data structure used in this specification is only intended to describe the required observable semantics of Set objects. It is not intended to be a viable implementation model.

            + +

            Abstract Operations For Set Objects

            + + +

            Set Records

            +

            A Set Record is a Record value used to encapsulate the interface of a Set or similar object.

            +

            Set Records have the fields listed in .

            + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + Field Name + + Value + + Meaning +
            + [[SetObject]] + + an Object + + the Set or similar object. +
            + [[Size]] + + a non-negative integer or +∞ + + The reported size of the object. +
            + [[Has]] + + a function object + + The `has` method of the object. +
            + [[Keys]] + + a function object + + The `keys` method of the object. +
            +
            +
            + + +

            + GetSetRecord ( + _obj_: an ECMAScript language value, + ): either a normal completion containing a Set Record or a throw completion +

            +
            +
            + + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. Let _rawSize_ be ? Get(_obj_, *"size"*). + 1. Let _numSize_ be ? ToNumber(_rawSize_). + 1. NOTE: If _rawSize_ is *undefined*, then _numSize_ will be *NaN*. + 1. If _numSize_ is *NaN*, throw a *TypeError* exception. + 1. Let _intSize_ be ! ToIntegerOrInfinity(_numSize_). + 1. If _intSize_ < 0, throw a *RangeError* exception. + 1. Let _has_ be ? Get(_obj_, *"has"*). + 1. If IsCallable(_has_) is *false*, throw a *TypeError* exception. + 1. Let _keys_ be ? Get(_obj_, *"keys"*). + 1. If IsCallable(_keys_) is *false*, throw a *TypeError* exception. + 1. Return a new Set Record { [[SetObject]]: _obj_, [[Size]]: _intSize_, [[Has]]: _has_, [[Keys]]: _keys_ }. + +
            + + +

            + SetDataHas ( + _setData_: a List of either ECMAScript language values or ~empty~, + _value_: an ECMAScript language value, + ): a Boolean +

            +
            +
            + + 1. If SetDataIndex(_setData_, _value_) is ~not-found~, return *false*. + 1. Return *true*. + +
            + + +

            + SetDataIndex ( + _setData_: a List of either ECMAScript language values or ~empty~, + _value_: an ECMAScript language value, + ): a non-negative integer or ~not-found~ +

            +
            +
            + + 1. Set _value_ to CanonicalizeKeyedCollectionKey(_value_). + 1. Let _size_ be the number of elements in _setData_. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _size_, + 1. Let _e_ be _setData_[_index_]. + 1. If _e_ is not ~empty~ and _e_ is _value_, then + 1. Return _index_. + 1. Set _index_ to _index_ + 1. + 1. Return ~not-found~. + +
            + + +

            + SetDataSize ( + _setData_: a List of either ECMAScript language values or ~empty~, + ): a non-negative integer +

            +
            +
            + + 1. Let _count_ be 0. + 1. For each element _e_ of _setData_, do + 1. If _e_ is not ~empty~, set _count_ to _count_ + 1. + 1. Return _count_. + +
            +
            +

            The Set Constructor

            The Set constructor:

            @@ -42016,7 +44088,7 @@

            The Set Constructor

          • may be used as the value in an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified Set behaviour must include a `super` call to the Set constructor to create and initialize the subclass instance with the internal state necessary to support the `Set.prototype` built-in methods.
          • - +

            Set ( [ _iterable_ ] )

            This function performs the following steps when called:

            @@ -42050,15 +44122,15 @@

            Set.prototype

            This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

            - -

            get Set [ @@species ]

            -

            `Set[@@species]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            + +

            get Set [ %Symbol.species% ]

            +

            `Set[%Symbol.species%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            1. Return the *this* value.

            The value of the *"name"* property of this function is *"get [Symbol.species]"*.

            -

            Methods that create derived collection objects should call @@species to determine the constructor to use to create the derived objects. Subclass constructor may over-ride @@species to change the default constructor assignment.

            +

            Methods that create derived collection objects should call %Symbol.species% to determine the constructor to use to create the derived objects. Subclass constructor may over-ride %Symbol.species% to change the default constructor assignment.

            @@ -42073,22 +44145,22 @@

            Properties of the Set Prototype Object

          • does not have a [[SetData]] internal slot.
          • - +

            Set.prototype.add ( _value_ )

            This method performs the following steps when called:

            1. Let _S_ be the *this* value. 1. Perform ? RequireInternalSlot(_S_, [[SetData]]). + 1. Set _value_ to CanonicalizeKeyedCollectionKey(_value_). 1. For each element _e_ of _S_.[[SetData]], do - 1. If _e_ is not ~empty~ and SameValueZero(_e_, _value_) is *true*, then + 1. If _e_ is not ~empty~ and SameValue(_e_, _value_) is *true*, then 1. Return _S_. - 1. If _value_ is *-0*𝔽, set _value_ to *+0*𝔽. 1. Append _value_ to _S_.[[SetData]]. 1. Return _S_.
            - +

            Set.prototype.clear ( )

            This method performs the following steps when called:

            @@ -42108,14 +44180,15 @@

            Set.prototype.constructor

            The initial value of `Set.prototype.constructor` is %Set%.

            - +

            Set.prototype.delete ( _value_ )

            This method performs the following steps when called:

            1. Let _S_ be the *this* value. 1. Perform ? RequireInternalSlot(_S_, [[SetData]]). + 1. Set _value_ to CanonicalizeKeyedCollectionKey(_value_). 1. For each element _e_ of _S_.[[SetData]], do - 1. If _e_ is not ~empty~ and SameValueZero(_e_, _value_) is *true*, then + 1. If _e_ is not ~empty~ and SameValue(_e_, _value_) is *true*, then 1. Replace the element of _S_.[[SetData]] whose value is _e_ with an element whose value is ~empty~. 1. Return *true*. 1. Return *false*. @@ -42125,7 +44198,41 @@

            Set.prototype.delete ( _value_ )

            - + +

            Set.prototype.difference ( _other_ )

            +

            This method performs the following steps when called:

            + + 1. Let _O_ be the *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[SetData]]). + 1. Let _otherRec_ be ? GetSetRecord(_other_). + 1. Let _resultSetData_ be a copy of _O_.[[SetData]]. + 1. If SetDataSize(_O_.[[SetData]]) ≤ _otherRec_.[[Size]], then + 1. Let _thisSize_ be the number of elements in _O_.[[SetData]]. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _thisSize_, + 1. Let _e_ be _resultSetData_[_index_]. + 1. If _e_ is not ~empty~, then + 1. Let _inOther_ be ToBoolean(? Call(_otherRec_.[[Has]], _otherRec_.[[SetObject]], « _e_ »)). + 1. If _inOther_ is *true*, then + 1. Set _resultSetData_[_index_] to ~empty~. + 1. Set _index_ to _index_ + 1. + 1. Else, + 1. Let _keysIter_ be ? GetIteratorFromMethod(_otherRec_.[[SetObject]], _otherRec_.[[Keys]]). + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIter_). + 1. If _next_ is not ~done~, then + 1. Set _next_ to CanonicalizeKeyedCollectionKey(_next_). + 1. Let _valueIndex_ be SetDataIndex(_resultSetData_, _next_). + 1. If _valueIndex_ is not ~not-found~, then + 1. Set _resultSetData_[_valueIndex_] to ~empty~. + 1. Let _result_ be OrdinaryObjectCreate(%Set.prototype%, « [[SetData]] »). + 1. Set _result_.[[SetData]] to _resultSetData_. + 1. Return _result_. + +
            + +

            Set.prototype.entries ( )

            This method performs the following steps when called:

            @@ -42137,13 +44244,13 @@

            Set.prototype.entries ( )

            - -

            Set.prototype.forEach ( _callbackfn_ [ , _thisArg_ ] )

            + +

            Set.prototype.forEach ( _callback_ [ , _thisArg_ ] )

            This method performs the following steps when called:

            1. Let _S_ be the *this* value. 1. Perform ? RequireInternalSlot(_S_, [[SetData]]). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _entries_ be _S_.[[SetData]]. 1. Let _numEntries_ be the number of elements in _entries_. 1. Let _index_ be 0. @@ -42151,34 +44258,148 @@

            Set.prototype.forEach ( _callbackfn_ [ , _thisArg_ ] )

            1. Let _e_ be _entries_[_index_]. 1. Set _index_ to _index_ + 1. 1. If _e_ is not ~empty~, then - 1. Perform ? Call(_callbackfn_, _thisArg_, « _e_, _e_, _S_ »). - 1. NOTE: The number of elements in _entries_ may have increased during execution of _callbackfn_. + 1. Perform ? Call(_callback_, _thisArg_, « _e_, _e_, _S_ »). + 1. NOTE: The number of elements in _entries_ may have increased during execution of _callback_. 1. Set _numEntries_ to the number of elements in _entries_. 1. Return *undefined*.
            -

            _callbackfn_ should be a function that accepts three arguments. `forEach` calls _callbackfn_ once for each value present in the Set object, in value insertion order. _callbackfn_ is called only for values of the Set which actually exist; it is not called for keys that have been deleted from the set.

            -

            If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callbackfn_. If it is not provided, *undefined* is used instead.

            -

            _callbackfn_ is called with three arguments: the first two arguments are a value contained in the Set. The same value is passed for both arguments. The Set object being traversed is passed as the third argument.

            -

            The _callbackfn_ is called with three arguments to be consistent with the call back functions used by `forEach` methods for Map and Array. For Sets, each item value is considered to be both the key and the value.

            -

            `forEach` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_.

            +

            _callback_ should be a function that accepts three arguments. `forEach` calls _callback_ once for each value present in the Set object, in value insertion order. _callback_ is called only for values of the Set which actually exist; it is not called for keys that have been deleted from the set.

            +

            If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callback_. If it is not provided, *undefined* is used instead.

            +

            _callback_ is called with three arguments: the first two arguments are a value contained in the Set. The same value is passed for both arguments. The Set object being traversed is passed as the third argument.

            +

            The _callback_ is called with three arguments to be consistent with the call back functions used by `forEach` methods for Map and Array. For Sets, each item value is considered to be both the key and the value.

            +

            `forEach` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_.

            Each value is normally visited only once. However, a value will be revisited if it is deleted after it has been visited and then re-added before the `forEach` call completes. Values that are deleted after the call to `forEach` begins and before being visited are not visited unless the value is added again before the `forEach` call completes. New values added after the call to `forEach` begins are visited.

            - +

            Set.prototype.has ( _value_ )

            This method performs the following steps when called:

            1. Let _S_ be the *this* value. 1. Perform ? RequireInternalSlot(_S_, [[SetData]]). + 1. Set _value_ to CanonicalizeKeyedCollectionKey(_value_). 1. For each element _e_ of _S_.[[SetData]], do - 1. If _e_ is not ~empty~ and SameValueZero(_e_, _value_) is *true*, return *true*. + 1. If _e_ is not ~empty~ and SameValue(_e_, _value_) is *true*, return *true*. 1. Return *false*.
            - + +

            Set.prototype.intersection ( _other_ )

            +

            This method performs the following steps when called:

            + + 1. Let _O_ be the *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[SetData]]). + 1. Let _otherRec_ be ? GetSetRecord(_other_). + 1. Let _resultSetData_ be a new empty List. + 1. If SetDataSize(_O_.[[SetData]]) ≤ _otherRec_.[[Size]], then + 1. Let _thisSize_ be the number of elements in _O_.[[SetData]]. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _thisSize_, + 1. Let _e_ be _O_.[[SetData]][_index_]. + 1. Set _index_ to _index_ + 1. + 1. If _e_ is not ~empty~, then + 1. Let _inOther_ be ToBoolean(? Call(_otherRec_.[[Has]], _otherRec_.[[SetObject]], « _e_ »)). + 1. If _inOther_ is *true*, then + 1. NOTE: It is possible for earlier calls to _otherRec_.[[Has]] to remove and re-add an element of _O_.[[SetData]], which can cause the same element to be visited twice during this iteration. + 1. If SetDataHas(_resultSetData_, _e_) is *false*, then + 1. Append _e_ to _resultSetData_. + 1. NOTE: The number of elements in _O_.[[SetData]] may have increased during execution of _otherRec_.[[Has]]. + 1. Set _thisSize_ to the number of elements in _O_.[[SetData]]. + 1. Else, + 1. Let _keysIter_ be ? GetIteratorFromMethod(_otherRec_.[[SetObject]], _otherRec_.[[Keys]]). + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIter_). + 1. If _next_ is not ~done~, then + 1. Set _next_ to CanonicalizeKeyedCollectionKey(_next_). + 1. Let _inThis_ be SetDataHas(_O_.[[SetData]], _next_). + 1. If _inThis_ is *true*, then + 1. NOTE: Because _other_ is an arbitrary object, it is possible for its *"keys"* iterator to produce the same value more than once. + 1. If SetDataHas(_resultSetData_, _next_) is *false*, then + 1. Append _next_ to _resultSetData_. + 1. Let _result_ be OrdinaryObjectCreate(%Set.prototype%, « [[SetData]] »). + 1. Set _result_.[[SetData]] to _resultSetData_. + 1. Return _result_. + +
            + + +

            Set.prototype.isDisjointFrom ( _other_ )

            +

            This method performs the following steps when called:

            + + 1. Let _O_ be the *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[SetData]]). + 1. Let _otherRec_ be ? GetSetRecord(_other_). + 1. If SetDataSize(_O_.[[SetData]]) ≤ _otherRec_.[[Size]], then + 1. Let _thisSize_ be the number of elements in _O_.[[SetData]]. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _thisSize_, + 1. Let _e_ be _O_.[[SetData]][_index_]. + 1. Set _index_ to _index_ + 1. + 1. If _e_ is not ~empty~, then + 1. Let _inOther_ be ToBoolean(? Call(_otherRec_.[[Has]], _otherRec_.[[SetObject]], « _e_ »)). + 1. If _inOther_ is *true*, return *false*. + 1. NOTE: The number of elements in _O_.[[SetData]] may have increased during execution of _otherRec_.[[Has]]. + 1. Set _thisSize_ to the number of elements in _O_.[[SetData]]. + 1. Else, + 1. Let _keysIter_ be ? GetIteratorFromMethod(_otherRec_.[[SetObject]], _otherRec_.[[Keys]]). + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIter_). + 1. If _next_ is not ~done~, then + 1. If SetDataHas(_O_.[[SetData]], _next_) is *true*, then + 1. Perform ? IteratorClose(_keysIter_, NormalCompletion(~unused~)). + 1. Return *false*. + 1. Return *true*. + +
            + + +

            Set.prototype.isSubsetOf ( _other_ )

            +

            This method performs the following steps when called:

            + + 1. Let _O_ be the *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[SetData]]). + 1. Let _otherRec_ be ? GetSetRecord(_other_). + 1. If SetDataSize(_O_.[[SetData]]) > _otherRec_.[[Size]], return *false*. + 1. Let _thisSize_ be the number of elements in _O_.[[SetData]]. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _thisSize_, + 1. Let _e_ be _O_.[[SetData]][_index_]. + 1. Set _index_ to _index_ + 1. + 1. If _e_ is not ~empty~, then + 1. Let _inOther_ be ToBoolean(? Call(_otherRec_.[[Has]], _otherRec_.[[SetObject]], « _e_ »)). + 1. If _inOther_ is *false*, return *false*. + 1. NOTE: The number of elements in _O_.[[SetData]] may have increased during execution of _otherRec_.[[Has]]. + 1. Set _thisSize_ to the number of elements in _O_.[[SetData]]. + 1. Return *true*. + +
            + + +

            Set.prototype.isSupersetOf ( _other_ )

            +

            This method performs the following steps when called:

            + + 1. Let _O_ be the *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[SetData]]). + 1. Let _otherRec_ be ? GetSetRecord(_other_). + 1. If SetDataSize(_O_.[[SetData]]) < _otherRec_.[[Size]], return *false*. + 1. Let _keysIter_ be ? GetIteratorFromMethod(_otherRec_.[[SetObject]], _otherRec_.[[Keys]]). + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIter_). + 1. If _next_ is not ~done~, then + 1. If SetDataHas(_O_.[[SetData]], _next_) is *false*, then + 1. Perform ? IteratorClose(_keysIter_, NormalCompletion(~unused~)). + 1. Return *false*. + 1. Return *true*. + +
            + +

            Set.prototype.keys ( )

            The initial value of the *"keys"* property is %Set.prototype.values%, defined in .

            @@ -42186,20 +44407,66 @@

            Set.prototype.keys ( )

            - +

            get Set.prototype.size

            `Set.prototype.size` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            1. Let _S_ be the *this* value. 1. Perform ? RequireInternalSlot(_S_, [[SetData]]). - 1. Let _count_ be 0. - 1. For each element _e_ of _S_.[[SetData]], do - 1. If _e_ is not ~empty~, set _count_ to _count_ + 1. - 1. Return 𝔽(_count_). + 1. Let _size_ be SetDataSize(_S_.[[SetData]]). + 1. Return 𝔽(_size_).
            - + +

            Set.prototype.symmetricDifference ( _other_ )

            +

            This method performs the following steps when called:

            + + 1. Let _O_ be the *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[SetData]]). + 1. Let _otherRec_ be ? GetSetRecord(_other_). + 1. Let _keysIter_ be ? GetIteratorFromMethod(_otherRec_.[[SetObject]], _otherRec_.[[Keys]]). + 1. Let _resultSetData_ be a copy of _O_.[[SetData]]. + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIter_). + 1. If _next_ is not ~done~, then + 1. Set _next_ to CanonicalizeKeyedCollectionKey(_next_). + 1. Let _resultIndex_ be SetDataIndex(_resultSetData_, _next_). + 1. If _resultIndex_ is ~not-found~, let _alreadyInResult_ be *false*; else let _alreadyInResult_ be *true*. + 1. If SetDataHas(_O_.[[SetData]], _next_) is *true*, then + 1. If _alreadyInResult_ is *true*, set _resultSetData_[_resultIndex_] to ~empty~. + 1. Else, + 1. If _alreadyInResult_ is *false*, append _next_ to _resultSetData_. + 1. Let _result_ be OrdinaryObjectCreate(%Set.prototype%, « [[SetData]] »). + 1. Set _result_.[[SetData]] to _resultSetData_. + 1. Return _result_. + +
            + + +

            Set.prototype.union ( _other_ )

            +

            This method performs the following steps when called:

            + + 1. Let _O_ be the *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[SetData]]). + 1. Let _otherRec_ be ? GetSetRecord(_other_). + 1. Let _keysIter_ be ? GetIteratorFromMethod(_otherRec_.[[SetObject]], _otherRec_.[[Keys]]). + 1. Let _resultSetData_ be a copy of _O_.[[SetData]]. + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIter_). + 1. If _next_ is not ~done~, then + 1. Set _next_ to CanonicalizeKeyedCollectionKey(_next_). + 1. If SetDataHas(_resultSetData_, _next_) is *false*, then + 1. Append _next_ to _resultSetData_. + 1. Let _result_ be OrdinaryObjectCreate(%Set.prototype%, « [[SetData]] »). + 1. Set _result_.[[SetData]] to _resultSetData_. + 1. Return _result_. + +
            + +

            Set.prototype.values ( )

            This method performs the following steps when called:

            @@ -42208,26 +44475,26 @@

            Set.prototype.values ( )

            - -

            Set.prototype [ @@iterator ] ( )

            -

            The initial value of the @@iterator property is %Set.prototype.values%, defined in .

            + +

            Set.prototype [ %Symbol.iterator% ] ( )

            +

            The initial value of the %Symbol.iterator% property is %Set.prototype.values%, defined in .

            - -

            Set.prototype [ @@toStringTag ]

            -

            The initial value of the @@toStringTag property is the String value *"Set"*.

            + +

            Set.prototype [ %Symbol.toStringTag% ]

            +

            The initial value of the %Symbol.toStringTag% property is the String value *"Set"*.

            This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

            Properties of Set Instances

            -

            Set instances are ordinary objects that inherit properties from the Set prototype. Set instances also have a [[SetData]] internal slot.

            +

            Set instances are ordinary objects that inherit properties from the Set prototype object. Set instances also have a [[SetData]] internal slot.

            Set Iterator Objects

            -

            A Set Iterator is an ordinary object, with the structure defined below, that represents a specific iteration over some specific Set instance object. There is not a named constructor for Set Iterator objects. Instead, set iterator objects are created by calling certain methods of Set instance objects.

            +

            A Set Iterator is an ordinary object, with the structure defined below, that represents a specific iteration over some specific Set instance object. There is not a named constructor for Set Iterator objects. Instead, Set Iterator objects are created by calling certain methods of Set instance objects.

            @@ -42252,13 +44519,13 @@

            1. If _e_ is not ~empty~, then 1. If _kind_ is ~key+value~, then 1. Let _result_ be CreateArrayFromList(« _e_, _e_ »). - 1. Perform ? GeneratorYield(CreateIterResultObject(_result_, *false*)). + 1. Perform ? GeneratorYield(CreateIteratorResultObject(_result_, *false*)). 1. Else, 1. Assert: _kind_ is ~value~. - 1. Perform ? GeneratorYield(CreateIterResultObject(_e_, *false*)). - 1. NOTE: The number of elements in _entries_ may have increased while execution of this abstract operation was paused by Yield. + 1. Perform ? GeneratorYield(CreateIteratorResultObject(_e_, *false*)). + 1. NOTE: The number of elements in _entries_ may have increased while execution of this abstract operation was paused by GeneratorYield. 1. Set _numEntries_ to the number of elements in _entries_. - 1. Return *undefined*. + 1. Return NormalCompletion(~unused~). 1. Return CreateIteratorFromClosure(_closure_, *"%SetIteratorPrototype%"*, %SetIteratorPrototype%). @@ -42267,22 +44534,22 @@

            The %SetIteratorPrototype% Object

            The %SetIteratorPrototype% object:

              -
            • has properties that are inherited by all Set Iterator Objects.
            • +
            • has properties that are inherited by all Set Iterator objects.
            • is an ordinary object.
            • -
            • has a [[Prototype]] internal slot whose value is %IteratorPrototype%.
            • +
            • has a [[Prototype]] internal slot whose value is %Iterator.prototype%.
            • has the following properties:
            - +

            %SetIteratorPrototype%.next ( )

            1. Return ? GeneratorResume(*this* value, ~empty~, *"%SetIteratorPrototype%"*).
            - -

            %SetIteratorPrototype% [ @@toStringTag ]

            -

            The initial value of the @@toStringTag property is the String value *"Set Iterator"*.

            + +

            %SetIteratorPrototype% [ %Symbol.toStringTag% ]

            +

            The initial value of the %Symbol.toStringTag% property is the String value *"Set Iterator"*.

            This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

            @@ -42311,7 +44578,7 @@

            The WeakMap Constructor

          • may be used as the value in an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified WeakMap behaviour must include a `super` call to the WeakMap constructor to create and initialize the subclass instance with the internal state necessary to support the `WeakMap.prototype` built-in methods.
          • - +

            WeakMap ( [ _iterable_ ] )

            This function performs the following steps when called:

            @@ -42324,7 +44591,7 @@

            WeakMap ( [ _iterable_ ] )

            1. Return ? AddEntriesFromIterable(_map_, _iterable_, _adder_).
            -

            If the parameter _iterable_ is present, it is expected to be an object that implements an @@iterator method that returns an iterator object that produces a two element array-like object whose first element is a value that will be used as a WeakMap key and whose second element is the value to associate with that key.

            +

            If the parameter _iterable_ is present, it is expected to be an object that implements a %Symbol.iterator% method that returns an iterator object that produces a two element array-like object whose first element is a value that will be used as a WeakMap key and whose second element is the value to associate with that key.

            @@ -42359,7 +44626,7 @@

            WeakMap.prototype.constructor

            The initial value of `WeakMap.prototype.constructor` is %WeakMap%.

            - +

            WeakMap.prototype.delete ( _key_ )

            This method performs the following steps when called:

            @@ -42378,7 +44645,7 @@

            WeakMap.prototype.delete ( _key_ )

            - +

            WeakMap.prototype.get ( _key_ )

            This method performs the following steps when called:

            @@ -42391,7 +44658,44 @@

            WeakMap.prototype.get ( _key_ )

            - + +

            WeakMap.prototype.getOrInsert ( _key_, _value_ )

            +

            This method performs the following steps when called:

            + + 1. Let _M_ be the *this* value. + 1. Perform ? RequireInternalSlot(_M_, [[WeakMapData]]). + 1. If CanBeHeldWeakly(_key_) is *false*, throw a *TypeError* exception. + 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[WeakMapData]], do + 1. If _p_.[[Key]] is not ~empty~ and SameValue(_p_.[[Key]], _key_) is *true*, return _p_.[[Value]]. + 1. Let _p_ be the Record { [[Key]]: _key_, [[Value]]: _value_ }. + 1. Append _p_ to _M_.[[WeakMapData]]. + 1. Return _value_. + +
            + + +

            WeakMap.prototype.getOrInsertComputed ( _key_, _callback_ )

            +

            This method performs the following steps when called:

            + + 1. Let _M_ be the *this* value. + 1. Perform ? RequireInternalSlot(_M_, [[WeakMapData]]). + 1. If CanBeHeldWeakly(_key_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. + 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[WeakMapData]], do + 1. If _p_.[[Key]] is not ~empty~ and SameValue(_p_.[[Key]], _key_) is *true*, return _p_.[[Value]]. + 1. Let _value_ be ? Call(_callback_, *undefined*, « _key_ »). + 1. NOTE: The WeakMap may have been modified during execution of _callback_. + 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[WeakMapData]], do + 1. If _p_.[[Key]] is not ~empty~ and SameValue(_p_.[[Key]], _key_) is *true*, then + 1. Set _p_.[[Value]] to _value_. + 1. Return _value_. + 1. Let _p_ be the Record { [[Key]]: _key_, [[Value]]: _value_ }. + 1. Append _p_ to _M_.[[WeakMapData]]. + 1. Return _value_. + +
            + +

            WeakMap.prototype.has ( _key_ )

            This method performs the following steps when called:

            @@ -42404,7 +44708,7 @@

            WeakMap.prototype.has ( _key_ )

            - +

            WeakMap.prototype.set ( _key_, _value_ )

            This method performs the following steps when called:

            @@ -42421,16 +44725,16 @@

            WeakMap.prototype.set ( _key_, _value_ )

            - -

            WeakMap.prototype [ @@toStringTag ]

            -

            The initial value of the @@toStringTag property is the String value *"WeakMap"*.

            + +

            WeakMap.prototype [ %Symbol.toStringTag% ]

            +

            The initial value of the %Symbol.toStringTag% property is the String value *"WeakMap"*.

            This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

            Properties of WeakMap Instances

            -

            WeakMap instances are ordinary objects that inherit properties from the WeakMap prototype. WeakMap instances also have a [[WeakMapData]] internal slot.

            +

            WeakMap instances are ordinary objects that inherit properties from the WeakMap prototype object. WeakMap instances also have a [[WeakMapData]] internal slot.

            @@ -42454,7 +44758,7 @@

            The WeakSet Constructor

          • may be used as the value in an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified WeakSet behaviour must include a `super` call to the WeakSet constructor to create and initialize the subclass instance with the internal state necessary to support the `WeakSet.prototype` built-in methods.
          • - +

            WeakSet ( [ _iterable_ ] )

            This function performs the following steps when called:

            @@ -42499,7 +44803,7 @@

            Properties of the WeakSet Prototype Object

          • does not have a [[WeakSetData]] internal slot.
          • - +

            WeakSet.prototype.add ( _value_ )

            This method performs the following steps when called:

            @@ -42519,7 +44823,7 @@

            WeakSet.prototype.constructor

            The initial value of `WeakSet.prototype.constructor` is %WeakSet%.

            - +

            WeakSet.prototype.delete ( _value_ )

            This method performs the following steps when called:

            @@ -42537,7 +44841,7 @@

            WeakSet.prototype.delete ( _value_ )

            - +

            WeakSet.prototype.has ( _value_ )

            This method performs the following steps when called:

            @@ -42550,16 +44854,34 @@

            WeakSet.prototype.has ( _value_ )

            - -

            WeakSet.prototype [ @@toStringTag ]

            -

            The initial value of the @@toStringTag property is the String value *"WeakSet"*.

            + +

            WeakSet.prototype [ %Symbol.toStringTag% ]

            +

            The initial value of the %Symbol.toStringTag% property is the String value *"WeakSet"*.

            This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

            Properties of WeakSet Instances

            -

            WeakSet instances are ordinary objects that inherit properties from the WeakSet prototype. WeakSet instances also have a [[WeakSetData]] internal slot.

            +

            WeakSet instances are ordinary objects that inherit properties from the WeakSet prototype object. WeakSet instances also have a [[WeakSetData]] internal slot.

            +
            +
            + + +

            Abstract Operations for Keyed Collections

            + + +

            + CanonicalizeKeyedCollectionKey ( + _key_: an ECMAScript language value, + ): an ECMAScript language value +

            +
            +
            + + 1. If _key_ is *-0*𝔽, return *+0*𝔽. + 1. Return _key_. +
            @@ -42573,7 +44895,7 @@

            ArrayBuffer Objects

            Notation

            The descriptions below in this section, , and use the read-modify-write modification function internal data structure.

            -

            A read-modify-write modification function is a mathematical function that is notationally represented as an abstract closure that takes two Lists of byte values as arguments and returns a List of byte values. These abstract closures satisfy all of the following properties:

            +

            A read-modify-write modification function is a mathematical function that is represented as an Abstract Closure that takes two Lists of byte values as arguments and returns a List of byte values. These Abstract Closures satisfy all of the following properties:

            • They perform all their algorithm steps atomically.
            • Their individual algorithm steps are not observable.
            • @@ -42581,7 +44903,8 @@

              Notation

              To aid verifying that a read-modify-write modification function's algorithm steps constitute a pure, mathematical function, the following editorial conventions are recommended:

                -
              • They do not access, directly or transitively via invoked abstract operations and abstract closures, any language or specification values except their parameters and captured values.
              • +
              • They do not access, directly or transitively via invoked abstract operations and Abstract Closures, any language or specification values except their parameters and captured values.
              • +
              • They do not invoke, directly or transitively, abstract operations and Abstract Closures that return Completion Records.
              • They do not return Completion Records.
              @@ -42611,7 +44934,7 @@

              1. Let _slots_ be « [[ArrayBufferData]], [[ArrayBufferByteLength]], [[ArrayBufferDetachKey]] ». - 1. If _maxByteLength_ is present and _maxByteLength_ is not ~empty~, let _allocatingResizableBuffer_ be *true*; otherwise let _allocatingResizableBuffer_ be *false*. + 1. If _maxByteLength_ is present and _maxByteLength_ is not ~empty~, let _allocatingResizableBuffer_ be *true*; else let _allocatingResizableBuffer_ be *false*. 1. If _allocatingResizableBuffer_ is *true*, then 1. If _byteLength_ > _maxByteLength_, throw a *RangeError* exception. 1. Append [[ArrayBufferMaxByteLength]] to _slots_. @@ -42637,10 +44960,11 @@

              - 1. If IsSharedArrayBuffer(_arrayBuffer_) is *true* and _arrayBuffer_ has an [[ArrayBufferByteLengthData]] internal slot, then + 1. If IsGrowableSharedArrayBuffer(_arrayBuffer_) is *true*, then 1. Let _bufferByteLengthBlock_ be _arrayBuffer_.[[ArrayBufferByteLengthData]]. 1. Let _rawLength_ be GetRawBytesFromSharedBlock(_bufferByteLengthBlock_, 0, ~biguint64~, *true*, _order_). - 1. Let _isLittleEndian_ be the value of the [[LittleEndian]] field of the surrounding agent's Agent Record. + 1. Let _AR_ be the Agent Record of the surrounding agent. + 1. Let _isLittleEndian_ be _AR_.[[LittleEndian]]. 1. Return ℝ(RawBytesToNumeric(~biguint64~, _rawLength_, _isLittleEndian_)). 1. Assert: IsDetachedBuffer(_arrayBuffer_) is *false*. 1. Return _arrayBuffer_.[[ArrayBufferByteLength]]. @@ -42869,20 +45193,24 @@

              1. Let _elementSize_ be the Element Size value specified in for Element Type _type_. 1. If _isLittleEndian_ is *false*, reverse the order of the elements of _rawBytes_. + 1. If _type_ is ~float16~, then + 1. Let _value_ be the byte elements of _rawBytes_ concatenated and interpreted as a little-endian bit string encoding of an IEEE 754-2019 binary16 value. + 1. If _value_ is a NaN, return *NaN*. + 1. Return the Number value that corresponds to _value_. 1. If _type_ is ~float32~, then 1. Let _value_ be the byte elements of _rawBytes_ concatenated and interpreted as a little-endian bit string encoding of an IEEE 754-2019 binary32 value. - 1. If _value_ is an IEEE 754-2019 binary32 NaN value, return the *NaN* Number value. + 1. If _value_ is a NaN, return *NaN*. 1. Return the Number value that corresponds to _value_. 1. If _type_ is ~float64~, then 1. Let _value_ be the byte elements of _rawBytes_ concatenated and interpreted as a little-endian bit string encoding of an IEEE 754-2019 binary64 value. - 1. If _value_ is an IEEE 754-2019 binary64 NaN value, return the *NaN* Number value. + 1. If _value_ is a NaN, return *NaN*. 1. Return the Number value that corresponds to _value_. 1. If IsUnsignedElementType(_type_) is *true*, then 1. Let _intValue_ be the byte elements of _rawBytes_ concatenated and interpreted as a bit string encoding of an unsigned little-endian binary number. 1. Else, 1. Let _intValue_ be the byte elements of _rawBytes_ concatenated and interpreted as a bit string encoding of a binary little-endian two's complement number of bit length _elementSize_ × 8. 1. If IsBigIntElementType(_type_) is *true*, return the BigInt value that corresponds to _intValue_. - 1. Otherwise, return the Number value that corresponds to _intValue_. + 1. Return the Number value that corresponds to _intValue_. @@ -42900,9 +45228,10 @@

              1. Let _elementSize_ be the Element Size value specified in for Element Type _type_. - 1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record. + 1. Let _AR_ be the Agent Record of the surrounding agent. + 1. Let _execution_ be _AR_.[[CandidateExecution]]. 1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier(). - 1. If _isTypedArray_ is *true* and IsNoTearConfiguration(_type_, _order_) is *true*, let _noTear_ be *true*; otherwise let _noTear_ be *false*. + 1. If _isTypedArray_ is *true* and IsNoTearConfiguration(_type_, _order_) is *true*, let _noTear_ be *true*; else let _noTear_ be *false*. 1. Let _rawValue_ be a List of length _elementSize_ whose elements are nondeterministically chosen byte values. 1. NOTE: In implementations, _rawValue_ is the result of a non-atomic or atomic read instruction on the underlying hardware. The nondeterminism is a semantic prescription of the memory model to describe observable behaviour of hardware with weak consistency. 1. Let _readEvent_ be ReadSharedMemory { [[Order]]: _order_, [[NoTear]]: _noTear_, [[Block]]: _block_, [[ByteIndex]]: _byteIndex_, [[ElementSize]]: _elementSize_ }. @@ -42936,7 +45265,9 @@

              1. Else, 1. Let _rawValue_ be a List whose elements are bytes from _block_ at indices in the interval from _byteIndex_ (inclusive) to _byteIndex_ + _elementSize_ (exclusive). 1. Assert: The number of elements in _rawValue_ is _elementSize_. - 1. If _isLittleEndian_ is not present, set _isLittleEndian_ to the value of the [[LittleEndian]] field of the surrounding agent's Agent Record. + 1. If _isLittleEndian_ is not present, then + 1. Let _AR_ be the Agent Record of the surrounding agent. + 1. Set _isLittleEndian_ to _AR_.[[LittleEndian]]. 1. Return RawBytesToNumeric(_type_, _rawValue_, _isLittleEndian_). @@ -42952,14 +45283,16 @@

              - 1. If _type_ is ~float32~, then - 1. Let _rawBytes_ be a List whose elements are the 4 bytes that are the result of converting _value_ to IEEE 754-2019 binary32 format using roundTiesToEven mode. The bytes are arranged in little endian order. If _value_ is *NaN*, _rawBytes_ may be set to any implementation chosen IEEE 754-2019 binary32 format Not-a-Number encoding. An implementation must always choose the same encoding for each implementation distinguishable *NaN* value. + 1. If _type_ is ~float16~, then + 1. Let _rawBytes_ be a List whose elements are the 2 bytes that are the result of converting _value_ to IEEE 754-2019 binary16 format using roundTiesToEven mode. The bytes are arranged in little endian order. If _value_ is *NaN*, _rawBytes_ may be set to any implementation chosen IEEE 754-2019 binary16 format NaN encoding. An implementation must always choose the same encoding for each implementation distinguishable *NaN* value. + 1. Else if _type_ is ~float32~, then + 1. Let _rawBytes_ be a List whose elements are the 4 bytes that are the result of converting _value_ to IEEE 754-2019 binary32 format using roundTiesToEven mode. The bytes are arranged in little endian order. If _value_ is *NaN*, _rawBytes_ may be set to any implementation chosen IEEE 754-2019 binary32 format NaN encoding. An implementation must always choose the same encoding for each implementation distinguishable *NaN* value. 1. Else if _type_ is ~float64~, then - 1. Let _rawBytes_ be a List whose elements are the 8 bytes that are the IEEE 754-2019 binary64 format encoding of _value_. The bytes are arranged in little endian order. If _value_ is *NaN*, _rawBytes_ may be set to any implementation chosen IEEE 754-2019 binary64 format Not-a-Number encoding. An implementation must always choose the same encoding for each implementation distinguishable *NaN* value. + 1. Let _rawBytes_ be a List whose elements are the 8 bytes that are the IEEE 754-2019 binary64 format encoding of _value_. The bytes are arranged in little endian order. If _value_ is *NaN*, _rawBytes_ may be set to any implementation chosen IEEE 754-2019 binary64 format NaN encoding. An implementation must always choose the same encoding for each implementation distinguishable *NaN* value. 1. Else, 1. Let _n_ be the Element Size value specified in for Element Type _type_. - 1. Let _convOp_ be the abstract operation named in the Conversion Operation column in for Element Type _type_. - 1. Let _intValue_ be ℝ(_convOp_(_value_)). + 1. Let _conversionOperation_ be the abstract operation named in the “Conversion Operation” column of for Element Type _type_. + 1. Let _intValue_ be ℝ(! _conversionOperation_(_value_)). 1. If _intValue_ ≥ 0, then 1. Let _rawBytes_ be a List whose elements are the _n_-byte binary encoding of _intValue_. The bytes are ordered in little endian order. 1. Else, @@ -42986,15 +45319,17 @@

              1. Assert: IsDetachedBuffer(_arrayBuffer_) is *false*. 1. Assert: There are sufficient bytes in _arrayBuffer_ starting at _byteIndex_ to represent a value of _type_. - 1. Assert: _value_ is a BigInt if IsBigIntElementType(_type_) is *true*; otherwise, _value_ is a Number. + 1. Assert: _value_ is a BigInt if IsBigIntElementType(_type_) is *true*; else, _value_ is a Number. 1. Let _block_ be _arrayBuffer_.[[ArrayBufferData]]. 1. Let _elementSize_ be the Element Size value specified in for Element Type _type_. - 1. If _isLittleEndian_ is not present, set _isLittleEndian_ to the value of the [[LittleEndian]] field of the surrounding agent's Agent Record. + 1. Let _AR_ be the Agent Record of the surrounding agent. + 1. If _isLittleEndian_ is not present, then + 1. Set _isLittleEndian_ to _AR_.[[LittleEndian]]. 1. Let _rawBytes_ be NumericToRawBytes(_type_, _value_, _isLittleEndian_). 1. If IsSharedArrayBuffer(_arrayBuffer_) is *true*, then - 1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record. + 1. Let _execution_ be _AR_.[[CandidateExecution]]. 1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier(). - 1. If _isTypedArray_ is *true* and IsNoTearConfiguration(_type_, _order_) is *true*, let _noTear_ be *true*; otherwise let _noTear_ be *false*. + 1. If _isTypedArray_ is *true* and IsNoTearConfiguration(_type_, _order_) is *true*, let _noTear_ be *true*; else let _noTear_ be *false*. 1. Append WriteSharedMemory { [[Order]]: _order_, [[NoTear]]: _noTear_, [[Block]]: _block_, [[ByteIndex]]: _byteIndex_, [[ElementSize]]: _elementSize_, [[Payload]]: _rawBytes_ } to _eventsRecord_.[[EventList]]. 1. Else, 1. Store the individual bytes of _rawBytes_ into _block_, starting at _block_[_byteIndex_]. @@ -43017,13 +45352,14 @@

              1. Assert: IsDetachedBuffer(_arrayBuffer_) is *false*. 1. Assert: There are sufficient bytes in _arrayBuffer_ starting at _byteIndex_ to represent a value of _type_. - 1. Assert: _value_ is a BigInt if IsBigIntElementType(_type_) is *true*; otherwise, _value_ is a Number. + 1. Assert: _value_ is a BigInt if IsBigIntElementType(_type_) is *true*; else, _value_ is a Number. 1. Let _block_ be _arrayBuffer_.[[ArrayBufferData]]. 1. Let _elementSize_ be the Element Size value specified in for Element Type _type_. - 1. Let _isLittleEndian_ be the value of the [[LittleEndian]] field of the surrounding agent's Agent Record. + 1. Let _AR_ be the Agent Record of the surrounding agent. + 1. Let _isLittleEndian_ be _AR_.[[LittleEndian]]. 1. Let _rawBytes_ be NumericToRawBytes(_type_, _value_, _isLittleEndian_). 1. If IsSharedArrayBuffer(_arrayBuffer_) is *true*, then - 1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record. + 1. Let _execution_ be _AR_.[[CandidateExecution]]. 1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier(). 1. Let _rawBytesRead_ be a List of length _elementSize_ whose elements are nondeterministically chosen byte values. 1. NOTE: In implementations, _rawBytesRead_ is the result of a load-link, of a load-exclusive, or of an operand of a read-modify-write instruction on the underlying hardware. The nondeterminism is a semantic prescription of the memory model to describe observable behaviour of hardware with weak consistency. @@ -43050,7 +45386,7 @@

              The ArrayBuffer Constructor

            • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified ArrayBuffer behaviour must include a `super` call to the ArrayBuffer constructor to create and initialize subclass instances with the internal state necessary to support the `ArrayBuffer.prototype` built-in methods.
            - +

            ArrayBuffer ( _length_ [ , _options_ ] )

            This function performs the following steps when called:

            @@ -43070,7 +45406,7 @@

            Properties of the ArrayBuffer Constructor

          • has the following properties:
          • - +

            ArrayBuffer.isView ( _arg_ )

            This function performs the following steps when called:

            @@ -43086,15 +45422,15 @@

            ArrayBuffer.prototype

            This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

            - -

            get ArrayBuffer [ @@species ]

            -

            `ArrayBuffer[@@species]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            + +

            get ArrayBuffer [ %Symbol.species% ]

            +

            `ArrayBuffer[%Symbol.species%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            1. Return the *this* value.

            The value of the *"name"* property of this function is *"get [Symbol.species]"*.

            -

            normally uses its *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour for the method by redefining its @@species property.

            +

            normally uses its *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour for the method by redefining its %Symbol.species% property.

            @@ -43109,7 +45445,7 @@

            Properties of the ArrayBuffer Prototype Object

          • does not have an [[ArrayBufferData]] or [[ArrayBufferByteLength]] internal slot.
          • - +

            get ArrayBuffer.prototype.byteLength

            `ArrayBuffer.prototype.byteLength` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            @@ -43127,7 +45463,7 @@

            ArrayBuffer.prototype.constructor

            The initial value of `ArrayBuffer.prototype.constructor` is %ArrayBuffer%.

            - +

            get ArrayBuffer.prototype.detached

            `ArrayBuffer.prototype.detached` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            @@ -43138,7 +45474,7 @@

            get ArrayBuffer.prototype.detached

            - +

            get ArrayBuffer.prototype.maxByteLength

            `ArrayBuffer.prototype.maxByteLength` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            @@ -43154,18 +45490,19 @@

            get ArrayBuffer.prototype.maxByteLength

            - +

            get ArrayBuffer.prototype.resizable

            `ArrayBuffer.prototype.resizable` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            1. Let _O_ be the *this* value. 1. Perform ? RequireInternalSlot(_O_, [[ArrayBufferData]]). 1. If IsSharedArrayBuffer(_O_) is *true*, throw a *TypeError* exception. - 1. If IsFixedLengthArrayBuffer(_O_) is *false*, return *true*; otherwise return *false*. + 1. If IsFixedLengthArrayBuffer(_O_) is *false*, return *true*. + 1. Return *false*.
            - +

            ArrayBuffer.prototype.resize ( _newLength_ )

            This method performs the following steps when called:

            @@ -43188,7 +45525,7 @@

            ArrayBuffer.prototype.resize ( _newLength_ )

            - +

            ArrayBuffer.prototype.slice ( _start_, _end_ )

            This method performs the following steps when called:

            @@ -43225,7 +45562,7 @@

            ArrayBuffer.prototype.slice ( _start_, _end_ )

            - +

            ArrayBuffer.prototype.transfer ( [ _newLength_ ] )

            This method performs the following steps when called:

            @@ -43234,7 +45571,7 @@

            ArrayBuffer.prototype.transfer ( [ _newLength_ ] )

            - +

            ArrayBuffer.prototype.transferToFixedLength ( [ _newLength_ ] )

            This method performs the following steps when called:

            @@ -43243,9 +45580,9 @@

            ArrayBuffer.prototype.transferToFixedLength ( [ _newLength_ ] )

            - -

            ArrayBuffer.prototype [ @@toStringTag ]

            -

            The initial value of the @@toStringTag property is the String value *"ArrayBuffer"*.

            + +

            ArrayBuffer.prototype [ %Symbol.toStringTag% ]

            +

            The initial value of the %Symbol.toStringTag% property is the String value *"ArrayBuffer"*.

            This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

            @@ -43270,7 +45607,7 @@

            Resizable ArrayBuffer Guidelines

            The following are guidelines for ECMAScript implementers implementing resizable ArrayBuffer.

            Resizable ArrayBuffer can be implemented as copying upon resize, as in-place growth via reserving virtual memory up front, or as a combination of both for different values of the constructor's *"maxByteLength"* option.

            If a host is multi-tenanted (i.e. it runs many ECMAScript applications simultaneously), such as a web browser, and its implementations choose to implement in-place growth by reserving virtual memory, we recommend that both 32-bit and 64-bit implementations throw for values of *"maxByteLength"* ≥ 1GiB to 1.5GiB. This is to reduce the likelihood a single application can exhaust the virtual memory address space and to reduce interoperability risk.

            -

            If a host does not have virtual memory, such as those running on embedded devices without an MMU, or if a host only implements resizing by copying, it may accept any Number value for the *"maxByteLength"* option. However, we recommend a *RangeError* be thrown if a memory block of the requested size can never be allocated. For example, if the requested size is greater than the maximium amount of usable memory on the device.

            +

            If a host does not have virtual memory, such as those running on embedded devices without an MMU, or if a host only implements resizing by copying, it may accept any Number value for the *"maxByteLength"* option. However, we recommend a *RangeError* be thrown if a memory block of the requested size can never be allocated. For example, if the requested size is greater than the maximum amount of usable memory on the device.

            @@ -43302,14 +45639,14 @@

            1. Let _slots_ be « [[ArrayBufferData]] ». - 1. If _maxByteLength_ is present and _maxByteLength_ is not ~empty~, let _allocatingGrowableBuffer_ be *true*; otherwise let _allocatingGrowableBuffer_ be *false*. + 1. If _maxByteLength_ is present and _maxByteLength_ is not ~empty~, let _allocatingGrowableBuffer_ be *true*; else let _allocatingGrowableBuffer_ be *false*. 1. If _allocatingGrowableBuffer_ is *true*, then 1. If _byteLength_ > _maxByteLength_, throw a *RangeError* exception. 1. Append [[ArrayBufferByteLengthData]] and [[ArrayBufferMaxByteLength]] to _slots_. 1. Else, 1. Append [[ArrayBufferByteLength]] to _slots_. 1. Let _obj_ be ? OrdinaryCreateFromConstructor(_constructor_, *"%SharedArrayBuffer.prototype%"*, _slots_). - 1. If _allocatingGrowableBuffer_ is *true*, let _allocLength_ be _maxByteLength_; otherwise let _allocLength_ be _byteLength_. + 1. If _allocatingGrowableBuffer_ is *true*, let _allocLength_ be _maxByteLength_; else let _allocLength_ be _byteLength_. 1. Let _block_ be ? CreateSharedByteDataBlock(_allocLength_). 1. Set _obj_.[[ArrayBufferData]] to _block_. 1. If _allocatingGrowableBuffer_ is *true*, then @@ -43332,14 +45669,27 @@

            description
            -
            It tests whether an object is an ArrayBuffer, a SharedArrayBuffer, or a subtype of either.
            +
            It tests whether an object is a SharedArrayBuffer.
            - 1. Let _bufferData_ be _obj_.[[ArrayBufferData]]. - 1. If _bufferData_ is *null*, return *false*. - 1. If _bufferData_ is a Data Block, return *false*. - 1. Assert: _bufferData_ is a Shared Data Block. - 1. Return *true*. + 1. If _obj_.[[ArrayBufferData]] is a Shared Data Block, return *true*. + 1. Return *false*. + + + + +

            + IsGrowableSharedArrayBuffer ( + _obj_: an ArrayBuffer or a SharedArrayBuffer, + ): a Boolean +

            +
            +
            description
            +
            It tests whether an object is a growable SharedArrayBuffer.
            +
            + + 1. If IsSharedArrayBuffer(_obj_) is *true* and _obj_ has an [[ArrayBufferByteLengthData]] internal slot, return *true*. + 1. Return *false*.
            @@ -43357,12 +45707,12 @@

            The implementation of HostGrowSharedArrayBuffer must conform to the following requirements:

            • If the abstract operation does not complete normally with ~unhandled~, and _newByteLength_ < the current byte length of the _buffer_ or _newByteLength_ > _buffer_.[[ArrayBufferMaxByteLength]], throw a *RangeError* exception.
            • -
            • Let _isLittleEndian_ be the value of the [[LittleEndian]] field of the surrounding agent's Agent Record. If the abstract operation completes normally with ~handled~, a WriteSharedMemory or ReadModifyWriteSharedMemory event whose [[Order]] is ~seq-cst~, [[Payload]] is NumericToRawBytes(~biguint64~, _newByteLength_, _isLittleEndian_), [[Block]] is _buffer_.[[ArrayBufferByteLengthData]], [[ByteIndex]] is 0, and [[ElementSize]] is 8 is added to the surrounding agent's candidate execution such that racing calls to `SharedArrayBuffer.prototype.grow` are not "lost", i.e. silently do nothing.
            • +
            • Let _AR_ be the Agent Record of the surrounding agent. Let _isLittleEndian_ be _AR_.[[LittleEndian]]. If the abstract operation completes normally with ~handled~, a WriteSharedMemory or ReadModifyWriteSharedMemory event whose [[Order]] is ~seq-cst~, [[Payload]] is NumericToRawBytes(~biguint64~, _newByteLength_, _isLittleEndian_), [[Block]] is _buffer_.[[ArrayBufferByteLengthData]], [[ByteIndex]] is 0, and [[ElementSize]] is 8 is added to the surrounding agent's candidate execution such that racing calls to are not "lost", i.e. silently do nothing.
            -

            The second requirement above is intentionally vague about how or when the current byte length of _buffer_ is read. Because the byte length must be updated via an atomic read-modify-write operation on the underlying hardware, architectures that use load-link/store-conditional or load-exclusive/store-exclusive instruction pairs may wish to keep the paired instructions close in the instruction stream. As such, SharedArrayBuffer.prototype.grow itself does not perform bounds checking on _newByteLength_ before calling HostGrowSharedArrayBuffer, nor is there a requirement on when the current byte length is read.

            -

            This is in contrast with HostResizeArrayBuffer, which is guaranteed that the value of _newByteLength_ is ≥ 0 and ≤ _buffer_.[[ArrayBufferMaxByteLength]].

            +

            The second requirement above is intentionally vague about how or when the current byte length of _buffer_ is read. Because the byte length must be updated via an atomic read-modify-write operation on the underlying hardware, architectures that use load-link/store-conditional or load-exclusive/store-exclusive instruction pairs may wish to keep the paired instructions close in the instruction stream. As such, itself does not perform bounds checking on _newByteLength_ before calling HostGrowSharedArrayBuffer, nor is there a requirement on when the current byte length is read.

            +

            This is in contrast with HostResizeArrayBuffer, which is guaranteed that 0 ≤ _newByteLength_ ≤ _buffer_.[[ArrayBufferMaxByteLength]].

            The default implementation of HostGrowSharedArrayBuffer is to return NormalCompletion(~unhandled~).

            @@ -43386,7 +45736,7 @@

            The SharedArrayBuffer Constructor

            Unlike an `ArrayBuffer`, a `SharedArrayBuffer` cannot become detached, and its internal [[ArrayBufferData]] slot is never *null*.

            - +

            SharedArrayBuffer ( _length_ [ , _options_ ] )

            This function performs the following steps when called:

            @@ -43412,9 +45762,9 @@

            SharedArrayBuffer.prototype

            This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

            - -

            get SharedArrayBuffer [ @@species ]

            -

            `SharedArrayBuffer[@@species]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            + +

            get SharedArrayBuffer [ %Symbol.species% ]

            +

            `SharedArrayBuffer[%Symbol.species%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            1. Return the *this* value. @@ -43432,7 +45782,7 @@

            Properties of the SharedArrayBuffer Prototype Object

          • does not have an [[ArrayBufferData]] or [[ArrayBufferByteLength]] internal slot.
          • - +

            get SharedArrayBuffer.prototype.byteLength

            `SharedArrayBuffer.prototype.byteLength` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            @@ -43449,7 +45799,7 @@

            SharedArrayBuffer.prototype.constructor

            The initial value of `SharedArrayBuffer.prototype.constructor` is %SharedArrayBuffer%.

            - +

            SharedArrayBuffer.prototype.grow ( _newLength_ )

            This method performs the following steps when called:

            @@ -43459,7 +45809,8 @@

            SharedArrayBuffer.prototype.grow ( _newLength_ )

            1. Let _newByteLength_ be ? ToIndex(_newLength_). 1. Let _hostHandled_ be ? HostGrowSharedArrayBuffer(_O_, _newByteLength_). 1. If _hostHandled_ is ~handled~, return *undefined*. - 1. Let _isLittleEndian_ be the value of the [[LittleEndian]] field of the surrounding agent's Agent Record. + 1. Let _AR_ be the Agent Record of the surrounding agent. + 1. Let _isLittleEndian_ be _AR_.[[LittleEndian]]. 1. Let _byteLengthBlock_ be _O_.[[ArrayBufferByteLengthData]]. 1. Let _currentByteLengthRawBytes_ be GetRawBytesFromSharedBlock(_byteLengthBlock_, 0, ~biguint64~, *true*, ~seq-cst~). 1. Let _newByteLengthRawBytes_ be NumericToRawBytes(~biguint64~, ℤ(_newByteLength_), _isLittleEndian_). @@ -43481,18 +45832,19 @@

            SharedArrayBuffer.prototype.grow ( _newLength_ )

            - +

            get SharedArrayBuffer.prototype.growable

            `SharedArrayBuffer.prototype.growable` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            1. Let _O_ be the *this* value. 1. Perform ? RequireInternalSlot(_O_, [[ArrayBufferData]]). 1. If IsSharedArrayBuffer(_O_) is *false*, throw a *TypeError* exception. - 1. If IsFixedLengthArrayBuffer(_O_) is *false*, return *true*; otherwise return *false*. + 1. If IsFixedLengthArrayBuffer(_O_) is *false*, return *true*. + 1. Return *false*.
            - +

            get SharedArrayBuffer.prototype.maxByteLength

            `SharedArrayBuffer.prototype.maxByteLength` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            @@ -43507,7 +45859,7 @@

            get SharedArrayBuffer.prototype.maxByteLength

            - +

            SharedArrayBuffer.prototype.slice ( _start_, _end_ )

            This method performs the following steps when called:

            @@ -43537,9 +45889,9 @@

            SharedArrayBuffer.prototype.slice ( _start_, _end_ )

            - -

            SharedArrayBuffer.prototype [ @@toStringTag ]

            -

            The initial value of the @@toStringTag property is the String value *"SharedArrayBuffer"*.

            + +

            SharedArrayBuffer.prototype [ %Symbol.toStringTag% ]

            +

            The initial value of the %Symbol.toStringTag% property is the String value *"SharedArrayBuffer"*.

            This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

            @@ -43582,21 +45934,23 @@

            Abstract Operations For DataView Objects

            DataView With Buffer Witness Records

            -

            A DataView With Buffer Witness Record is a Record value used to encapsulate a DataView along with a cached byte length of the viewed buffer. It is used to help ensure there is a single shared memory read event of the byte length data block when the viewed buffer is a growable SharedArrayBuffers.

            +

            A DataView With Buffer Witness Record is a Record value used to encapsulate a DataView along with a cached byte length of the viewed buffer. It is used to help ensure there is a single ReadSharedMemory event of the byte length data block when the viewed buffer is a growable SharedArrayBuffer.

            DataView With Buffer Witness Records have the fields listed in .

            - - - - - + + + + + + +
            - Field Name - - Value - - Meaning -
            + Field Name + + Value + + Meaning +
            [[Object]] @@ -43673,15 +46027,17 @@

            1. Let _view_ be _viewRecord_.[[Object]]. 1. Let _bufferByteLength_ be _viewRecord_.[[CachedBufferByteLength]]. - 1. Assert: IsDetachedBuffer(_view_.[[ViewedArrayBuffer]]) is *true* if and only if _bufferByteLength_ is ~detached~. - 1. If _bufferByteLength_ is ~detached~, return *true*. + 1. If IsDetachedBuffer(_view_.[[ViewedArrayBuffer]]) is *true*, then + 1. Assert: _bufferByteLength_ is ~detached~. + 1. Return *true*. + 1. Assert: _bufferByteLength_ is a non-negative integer. 1. Let _byteOffsetStart_ be _view_.[[ByteOffset]]. 1. If _view_.[[ByteLength]] is ~auto~, then 1. Let _byteOffsetEnd_ be _bufferByteLength_. 1. Else, 1. Let _byteOffsetEnd_ be _byteOffsetStart_ + _view_.[[ByteLength]]. + 1. NOTE: A 0-length DataView whose [[ByteOffset]] is _bufferByteLength_ is not considered out-of-bounds. 1. If _byteOffsetStart_ > _bufferByteLength_ or _byteOffsetEnd_ > _bufferByteLength_, return *true*. - 1. NOTE: 0-length DataViews are not considered out-of-bounds. 1. Return *false*. @@ -43735,7 +46091,7 @@

            1. Assert: _view_ has a [[ViewedArrayBuffer]] internal slot. 1. Let _getIndex_ be ? ToIndex(_requestIndex_). 1. If IsBigIntElementType(_type_) is *true*, let _numberValue_ be ? ToBigInt(_value_). - 1. Otherwise, let _numberValue_ be ? ToNumber(_value_). + 1. Else, let _numberValue_ be ? ToNumber(_value_). 1. Set _isLittleEndian_ to ToBoolean(_isLittleEndian_). 1. Let _viewOffset_ be _view_.[[ByteOffset]]. 1. Let _viewRecord_ be MakeDataViewWithBufferWitnessRecord(_view_, ~unordered~). @@ -43762,7 +46118,7 @@

            The DataView Constructor

          • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified DataView behaviour must include a `super` call to the DataView constructor to create and initialize subclass instances with the internal state necessary to support the `DataView.prototype` built-in methods.
          • - +

            DataView ( _buffer_ [ , _byteOffset_ [ , _byteLength_ ] ] )

            This function performs the following steps when called:

            @@ -43820,7 +46176,7 @@

            Properties of the DataView Prototype Object

          • does not have a [[DataView]], [[ViewedArrayBuffer]], [[ByteLength]], or [[ByteOffset]] internal slot.
          • - +

            get DataView.prototype.buffer

            `DataView.prototype.buffer` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            @@ -43832,7 +46188,7 @@

            get DataView.prototype.buffer

            - +

            get DataView.prototype.byteLength

            `DataView.prototype.byteLength` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            @@ -43846,7 +46202,7 @@

            get DataView.prototype.byteLength

            - +

            get DataView.prototype.byteOffset

            `DataView.prototype.byteOffset` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

            @@ -43865,201 +46221,221 @@

            DataView.prototype.constructor

            The initial value of `DataView.prototype.constructor` is %DataView%.

            - +

            DataView.prototype.getBigInt64 ( _byteOffset_ [ , _littleEndian_ ] )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. - 1. Return ? GetViewValue(_v_, _byteOffset_, _littleEndian_, ~bigint64~). + 1. Let _view_ be the *this* value. + 1. Return ? GetViewValue(_view_, _byteOffset_, _littleEndian_, ~bigint64~).
            - +

            DataView.prototype.getBigUint64 ( _byteOffset_ [ , _littleEndian_ ] )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. - 1. Return ? GetViewValue(_v_, _byteOffset_, _littleEndian_, ~biguint64~). + 1. Let _view_ be the *this* value. + 1. Return ? GetViewValue(_view_, _byteOffset_, _littleEndian_, ~biguint64~).
            - + +

            DataView.prototype.getFloat16 ( _byteOffset_ [ , _littleEndian_ ] )

            +

            This method performs the following steps when called:

            + + 1. Let _view_ be the *this* value. + 1. If _littleEndian_ is not present, set _littleEndian_ to *false*. + 1. Return ? GetViewValue(_view_, _byteOffset_, _littleEndian_, ~float16~). + +
            + +

            DataView.prototype.getFloat32 ( _byteOffset_ [ , _littleEndian_ ] )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. + 1. Let _view_ be the *this* value. 1. If _littleEndian_ is not present, set _littleEndian_ to *false*. - 1. Return ? GetViewValue(_v_, _byteOffset_, _littleEndian_, ~float32~). + 1. Return ? GetViewValue(_view_, _byteOffset_, _littleEndian_, ~float32~).
            - +

            DataView.prototype.getFloat64 ( _byteOffset_ [ , _littleEndian_ ] )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. + 1. Let _view_ be the *this* value. 1. If _littleEndian_ is not present, set _littleEndian_ to *false*. - 1. Return ? GetViewValue(_v_, _byteOffset_, _littleEndian_, ~float64~). + 1. Return ? GetViewValue(_view_, _byteOffset_, _littleEndian_, ~float64~).
            - +

            DataView.prototype.getInt8 ( _byteOffset_ )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. - 1. Return ? GetViewValue(_v_, _byteOffset_, *true*, ~int8~). + 1. Let _view_ be the *this* value. + 1. Return ? GetViewValue(_view_, _byteOffset_, *true*, ~int8~).
            - +

            DataView.prototype.getInt16 ( _byteOffset_ [ , _littleEndian_ ] )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. + 1. Let _view_ be the *this* value. 1. If _littleEndian_ is not present, set _littleEndian_ to *false*. - 1. Return ? GetViewValue(_v_, _byteOffset_, _littleEndian_, ~int16~). + 1. Return ? GetViewValue(_view_, _byteOffset_, _littleEndian_, ~int16~).
            - +

            DataView.prototype.getInt32 ( _byteOffset_ [ , _littleEndian_ ] )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. + 1. Let _view_ be the *this* value. 1. If _littleEndian_ is not present, set _littleEndian_ to *false*. - 1. Return ? GetViewValue(_v_, _byteOffset_, _littleEndian_, ~int32~). + 1. Return ? GetViewValue(_view_, _byteOffset_, _littleEndian_, ~int32~).
            - +

            DataView.prototype.getUint8 ( _byteOffset_ )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. - 1. Return ? GetViewValue(_v_, _byteOffset_, *true*, ~uint8~). + 1. Let _view_ be the *this* value. + 1. Return ? GetViewValue(_view_, _byteOffset_, *true*, ~uint8~).
            - +

            DataView.prototype.getUint16 ( _byteOffset_ [ , _littleEndian_ ] )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. + 1. Let _view_ be the *this* value. 1. If _littleEndian_ is not present, set _littleEndian_ to *false*. - 1. Return ? GetViewValue(_v_, _byteOffset_, _littleEndian_, ~uint16~). + 1. Return ? GetViewValue(_view_, _byteOffset_, _littleEndian_, ~uint16~).
            - +

            DataView.prototype.getUint32 ( _byteOffset_ [ , _littleEndian_ ] )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. + 1. Let _view_ be the *this* value. 1. If _littleEndian_ is not present, set _littleEndian_ to *false*. - 1. Return ? GetViewValue(_v_, _byteOffset_, _littleEndian_, ~uint32~). + 1. Return ? GetViewValue(_view_, _byteOffset_, _littleEndian_, ~uint32~).
            - +

            DataView.prototype.setBigInt64 ( _byteOffset_, _value_ [ , _littleEndian_ ] )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. - 1. Return ? SetViewValue(_v_, _byteOffset_, _littleEndian_, ~bigint64~, _value_). + 1. Let _view_ be the *this* value. + 1. Return ? SetViewValue(_view_, _byteOffset_, _littleEndian_, ~bigint64~, _value_).
            - +

            DataView.prototype.setBigUint64 ( _byteOffset_, _value_ [ , _littleEndian_ ] )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. - 1. Return ? SetViewValue(_v_, _byteOffset_, _littleEndian_, ~biguint64~, _value_). + 1. Let _view_ be the *this* value. + 1. Return ? SetViewValue(_view_, _byteOffset_, _littleEndian_, ~biguint64~, _value_). + +
            + + +

            DataView.prototype.setFloat16 ( _byteOffset_, _value_ [ , _littleEndian_ ] )

            +

            This method performs the following steps when called:

            + + 1. Let _view_ be the *this* value. + 1. If _littleEndian_ is not present, set _littleEndian_ to *false*. + 1. Return ? SetViewValue(_view_, _byteOffset_, _littleEndian_, ~float16~, _value_).
            - +

            DataView.prototype.setFloat32 ( _byteOffset_, _value_ [ , _littleEndian_ ] )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. + 1. Let _view_ be the *this* value. 1. If _littleEndian_ is not present, set _littleEndian_ to *false*. - 1. Return ? SetViewValue(_v_, _byteOffset_, _littleEndian_, ~float32~, _value_). + 1. Return ? SetViewValue(_view_, _byteOffset_, _littleEndian_, ~float32~, _value_).
            - +

            DataView.prototype.setFloat64 ( _byteOffset_, _value_ [ , _littleEndian_ ] )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. + 1. Let _view_ be the *this* value. 1. If _littleEndian_ is not present, set _littleEndian_ to *false*. - 1. Return ? SetViewValue(_v_, _byteOffset_, _littleEndian_, ~float64~, _value_). + 1. Return ? SetViewValue(_view_, _byteOffset_, _littleEndian_, ~float64~, _value_).
            - +

            DataView.prototype.setInt8 ( _byteOffset_, _value_ )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. - 1. Return ? SetViewValue(_v_, _byteOffset_, *true*, ~int8~, _value_). + 1. Let _view_ be the *this* value. + 1. Return ? SetViewValue(_view_, _byteOffset_, *true*, ~int8~, _value_).
            - +

            DataView.prototype.setInt16 ( _byteOffset_, _value_ [ , _littleEndian_ ] )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. + 1. Let _view_ be the *this* value. 1. If _littleEndian_ is not present, set _littleEndian_ to *false*. - 1. Return ? SetViewValue(_v_, _byteOffset_, _littleEndian_, ~int16~, _value_). + 1. Return ? SetViewValue(_view_, _byteOffset_, _littleEndian_, ~int16~, _value_).
            - +

            DataView.prototype.setInt32 ( _byteOffset_, _value_ [ , _littleEndian_ ] )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. + 1. Let _view_ be the *this* value. 1. If _littleEndian_ is not present, set _littleEndian_ to *false*. - 1. Return ? SetViewValue(_v_, _byteOffset_, _littleEndian_, ~int32~, _value_). + 1. Return ? SetViewValue(_view_, _byteOffset_, _littleEndian_, ~int32~, _value_).
            - +

            DataView.prototype.setUint8 ( _byteOffset_, _value_ )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. - 1. Return ? SetViewValue(_v_, _byteOffset_, *true*, ~uint8~, _value_). + 1. Let _view_ be the *this* value. + 1. Return ? SetViewValue(_view_, _byteOffset_, *true*, ~uint8~, _value_).
            - +

            DataView.prototype.setUint16 ( _byteOffset_, _value_ [ , _littleEndian_ ] )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. + 1. Let _view_ be the *this* value. 1. If _littleEndian_ is not present, set _littleEndian_ to *false*. - 1. Return ? SetViewValue(_v_, _byteOffset_, _littleEndian_, ~uint16~, _value_). + 1. Return ? SetViewValue(_view_, _byteOffset_, _littleEndian_, ~uint16~, _value_).
            - +

            DataView.prototype.setUint32 ( _byteOffset_, _value_ [ , _littleEndian_ ] )

            This method performs the following steps when called:

            - 1. Let _v_ be the *this* value. + 1. Let _view_ be the *this* value. 1. If _littleEndian_ is not present, set _littleEndian_ to *false*. - 1. Return ? SetViewValue(_v_, _byteOffset_, _littleEndian_, ~uint32~, _value_). + 1. Return ? SetViewValue(_view_, _byteOffset_, _littleEndian_, ~uint32~, _value_).
            - -

            DataView.prototype [ @@toStringTag ]

            -

            The initial value of the @@toStringTag property is the String value *"DataView"*.

            + +

            DataView.prototype [ %Symbol.toStringTag% ]

            +

            The initial value of the %Symbol.toStringTag% property is the String value *"DataView"*.

            This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

            @@ -44095,17 +46471,19 @@

            Waiter Record

            A Waiter Record has fields listed in .

            - - - - - + + + + + + +
            - Field Name - - Value - - Meaning -
            + Field Name + + Value + + Meaning +
            [[AgentSignifier]] @@ -44160,17 +46538,19 @@

            WaiterList Records

            A WaiterList Record has fields listed in .

            - - - - - + + + + + + +
            - Field Name - - Value - - Meaning -
            + Field Name + + Value + + Meaning +
            [[Waiters]] @@ -44250,14 +46630,12 @@

            ValidateAtomicAccessOnIntegerTypedArray ( _typedArray_: an ECMAScript language value, _requestIndex_: an ECMAScript language value, - optional _waitable_: a Boolean, ): either a normal completion containing an integer or a throw completion

            - 1. If _waitable_ is not present, set _waitable_ to *false*. - 1. Let _taRecord_ be ? ValidateIntegerTypedArray(_typedArray_, _waitable_). + 1. Let _taRecord_ be ? ValidateIntegerTypedArray(_typedArray_, *false*). 1. Return ? ValidateAtomicAccess(_taRecord_, _requestIndex_). @@ -44311,7 +46689,8 @@

            1. Wait until no agent is in the critical section for _WL_, then enter the critical section for _WL_ (without allowing any other agent to enter). 1. If _WL_.[[MostRecentLeaveEvent]] is not ~empty~, then 1. NOTE: A _WL_ whose critical section has been entered at least once has a Synchronize event set by LeaveCriticalSection. - 1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record. + 1. Let _AR_ be the Agent Record of the surrounding agent. + 1. Let _execution_ be _AR_.[[CandidateExecution]]. 1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier(). 1. Let _enterEvent_ be a new Synchronize event. 1. Append _enterEvent_ to _eventsRecord_.[[EventList]]. @@ -44331,7 +46710,8 @@

            1. Assert: The surrounding agent is in the critical section for _WL_. - 1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record. + 1. Let _AR_ be the Agent Record of the surrounding agent. + 1. Let _execution_ be _AR_.[[CandidateExecution]]. 1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier(). 1. Let _leaveEvent_ be a new Synchronize event. 1. Append _leaveEvent_ to _eventsRecord_.[[EventList]]. @@ -44447,7 +46827,7 @@

            EnqueueResolveInAgentJob ( _agentSignifier_: an agent signifier, _promiseCapability_: a PromiseCapability Record, - _resolution_: an ECMAScript language value, + _resolution_: *"ok"* or *"timed-out"*, ): ~unused~

            @@ -44480,16 +46860,16 @@

            1. Let _taRecord_ be ? ValidateIntegerTypedArray(_typedArray_, *true*). 1. Let _buffer_ be _taRecord_.[[Object]].[[ViewedArrayBuffer]]. 1. If IsSharedArrayBuffer(_buffer_) is *false*, throw a *TypeError* exception. - 1. Let _i_ be ? ValidateAtomicAccess(_taRecord_, _index_). + 1. Let _byteIndexInBuffer_ be ? ValidateAtomicAccess(_taRecord_, _index_). 1. Let _arrayTypeName_ be _typedArray_.[[TypedArrayName]]. 1. If _arrayTypeName_ is *"BigInt64Array"*, let _v_ be ? ToBigInt64(_value_). 1. Else, let _v_ be ? ToInt32(_value_). 1. Let _q_ be ? ToNumber(_timeout_). - 1. If _q_ is either *NaN* or *+∞*𝔽, let _t_ be +∞; else if _q_ is *-∞*𝔽, let _t_ be 0; else let _t_ be max(ℝ(_q_), 0). + 1. If _q_ is either *NaN* or *+∞*𝔽, let _t_ be +∞. + 1. Else if _q_ is *-∞*𝔽, let _t_ be 0. + 1. Else, let _t_ be max(ℝ(_q_), 0). 1. If _mode_ is ~sync~ and AgentCanSuspend() is *false*, throw a *TypeError* exception. 1. Let _block_ be _buffer_.[[ArrayBufferData]]. - 1. Let _offset_ be _typedArray_.[[ByteOffset]]. - 1. Let _byteIndexInBuffer_ be (_i_ × 4) + _offset_. 1. Let _WL_ be GetWaiterList(_block_, _byteIndexInBuffer_). 1. If _mode_ is ~sync~, then 1. Let _promiseCapability_ be ~blocking~. @@ -44574,7 +46954,8 @@

            - 1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record. + 1. Let _AR_ be the Agent Record of the surrounding agent. + 1. Let _execution_ be _AR_.[[CandidateExecution]]. 1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier(). 1. Let _rawBytesRead_ be a List of length _elementSize_ whose elements are nondeterministically chosen byte values. 1. NOTE: In implementations, _rawBytesRead_ is the result of a load-link, of a load-exclusive, or of an operand of a read-modify-write instruction on the underlying hardware. The nondeterminism is a semantic prescription of the memory model to describe observable behaviour of hardware with weak consistency. @@ -44602,12 +46983,12 @@

            description
            -
            _op_ takes two List of byte values arguments and returns a List of byte values. This operation atomically loads a value, combines it with another value, and stores the result of the combination. It returns the loaded value.
            +
            _op_ takes two List of byte values arguments and returns a List of byte values. This operation atomically loads a value, combines it with another value, and stores the combination. It returns the loaded value.
            1. Let _byteIndexInBuffer_ be ? ValidateAtomicAccessOnIntegerTypedArray(_typedArray_, _index_). 1. If _typedArray_.[[ContentType]] is ~bigint~, let _v_ be ? ToBigInt(_value_). - 1. Otherwise, let _v_ be 𝔽(? ToIntegerOrInfinity(_value_)). + 1. Else, let _v_ be 𝔽(? ToIntegerOrInfinity(_value_)). 1. Perform ? RevalidateAtomicAccess(_typedArray_, _byteIndexInBuffer_). 1. Let _buffer_ be _typedArray_.[[ViewedArrayBuffer]]. 1. Let _elementType_ be TypedArrayElementType(_typedArray_). @@ -44667,13 +47048,14 @@

            - +

            Atomics.add ( _typedArray_, _index_, _value_ )

            This function performs the following steps when called:

            - 1. Let _type_ be TypedArrayElementType(_typedArray_). - 1. Let _isLittleEndian_ be the value of the [[LittleEndian]] field of the surrounding agent's Agent Record. - 1. Let _add_ be a new read-modify-write modification function with parameters (_xBytes_, _yBytes_) that captures _type_ and _isLittleEndian_ and performs the following steps atomically when called: + 1. Let _add_ be a new read-modify-write modification function with parameters (_xBytes_, _yBytes_) that captures _typedArray_ and performs the following steps atomically when called: + 1. Let _type_ be TypedArrayElementType(_typedArray_). + 1. Let _AR_ be the Agent Record of the surrounding agent. + 1. Let _isLittleEndian_ be _AR_.[[LittleEndian]]. 1. Let _x_ be RawBytesToNumeric(_type_, _xBytes_, _isLittleEndian_). 1. Let _y_ be RawBytesToNumeric(_type_, _yBytes_, _isLittleEndian_). 1. If _x_ is a Number, then @@ -44688,7 +47070,7 @@

            Atomics.add ( _typedArray_, _index_, _value_ )

            - +

            Atomics.and ( _typedArray_, _index_, _value_ )

            This function performs the following steps when called:

            @@ -44698,7 +47080,7 @@

            Atomics.and ( _typedArray_, _index_, _value_ )

            - +

            Atomics.compareExchange ( _typedArray_, _index_, _expectedValue_, _replacementValue_ )

            This function performs the following steps when called:

            @@ -44714,7 +47096,8 @@

            Atomics.compareExchange ( _typedArray_, _index_, _expectedValue_, _replaceme 1. Perform ? RevalidateAtomicAccess(_typedArray_, _byteIndexInBuffer_). 1. Let _elementType_ be TypedArrayElementType(_typedArray_). 1. Let _elementSize_ be TypedArrayElementSize(_typedArray_). - 1. Let _isLittleEndian_ be the value of the [[LittleEndian]] field of the surrounding agent's Agent Record. + 1. Let _AR_ be the Agent Record of the surrounding agent. + 1. Let _isLittleEndian_ be _AR_.[[LittleEndian]]. 1. Let _expectedBytes_ be NumericToRawBytes(_elementType_, _expected_, _isLittleEndian_). 1. Let _replacementBytes_ be NumericToRawBytes(_elementType_, _replacement_, _isLittleEndian_). 1. If IsSharedArrayBuffer(_buffer_) is *true*, then @@ -44727,7 +47110,7 @@

            Atomics.compareExchange ( _typedArray_, _index_, _expectedValue_, _replaceme - +

            Atomics.exchange ( _typedArray_, _index_, _value_ )

            This function performs the following steps when called:

            @@ -44737,7 +47120,7 @@

            Atomics.exchange ( _typedArray_, _index_, _value_ )

            - +

            Atomics.isLockFree ( _size_ )

            This function performs the following steps when called:

            @@ -44756,7 +47139,7 @@

            Atomics.isLockFree ( _size_ )

            - +

            Atomics.load ( _typedArray_, _index_ )

            This function performs the following steps when called:

            @@ -44768,7 +47151,7 @@

            Atomics.load ( _typedArray_, _index_ )

            - +

            Atomics.or ( _typedArray_, _index_, _value_ )

            This function performs the following steps when called:

            @@ -44778,13 +47161,13 @@

            Atomics.or ( _typedArray_, _index_, _value_ )

            - +

            Atomics.store ( _typedArray_, _index_, _value_ )

            This function performs the following steps when called:

            1. Let _byteIndexInBuffer_ be ? ValidateAtomicAccessOnIntegerTypedArray(_typedArray_, _index_). 1. If _typedArray_.[[ContentType]] is ~bigint~, let _v_ be ? ToBigInt(_value_). - 1. Otherwise, let _v_ be 𝔽(? ToIntegerOrInfinity(_value_)). + 1. Else, let _v_ be 𝔽(? ToIntegerOrInfinity(_value_)). 1. Perform ? RevalidateAtomicAccess(_typedArray_, _byteIndexInBuffer_). 1. Let _buffer_ be _typedArray_.[[ViewedArrayBuffer]]. 1. Let _elementType_ be TypedArrayElementType(_typedArray_). @@ -44793,13 +47176,14 @@

            Atomics.store ( _typedArray_, _index_, _value_ )

            - +

            Atomics.sub ( _typedArray_, _index_, _value_ )

            This function performs the following steps when called:

            - 1. Let _type_ be TypedArrayElementType(_typedArray_). - 1. Let _isLittleEndian_ be the value of the [[LittleEndian]] field of the surrounding agent's Agent Record. - 1. Let _subtract_ be a new read-modify-write modification function with parameters (_xBytes_, _yBytes_) that captures _type_ and _isLittleEndian_ and performs the following steps atomically when called: + 1. Let _subtract_ be a new read-modify-write modification function with parameters (_xBytes_, _yBytes_) that captures _typedArray_ and performs the following steps atomically when called: + 1. Let _type_ be TypedArrayElementType(_typedArray_). + 1. Let _AR_ be the Agent Record of the surrounding agent. + 1. Let _isLittleEndian_ be _AR_.[[LittleEndian]]. 1. Let _x_ be RawBytesToNumeric(_type_, _xBytes_, _isLittleEndian_). 1. Let _y_ be RawBytesToNumeric(_type_, _yBytes_, _isLittleEndian_). 1. If _x_ is a Number, then @@ -44814,7 +47198,7 @@

            Atomics.sub ( _typedArray_, _index_, _value_ )

            - +

            Atomics.wait ( _typedArray_, _index_, _value_, _timeout_ )

            This function puts the surrounding agent in a wait queue and suspends it until notified or until the wait times out, returning a String differentiating those cases.

            It performs the following steps when called:

            @@ -44823,21 +47207,22 @@

            Atomics.wait ( _typedArray_, _index_, _value_, _timeout_ )

            - +

            Atomics.waitAsync ( _typedArray_, _index_, _value_, _timeout_ )

            -

            This function returns a Promise that is resolved when the calling agent is notified or the the timeout is reached.

            +

            This function returns a Promise that is resolved when the calling agent is notified or the timeout is reached.

            It performs the following steps when called:

            1. Return ? DoWait(~async~, _typedArray_, _index_, _value_, _timeout_).
            - +

            Atomics.notify ( _typedArray_, _index_, _count_ )

            This function notifies some agents that are sleeping in the wait queue.

            It performs the following steps when called:

            - 1. Let _byteIndexInBuffer_ be ? ValidateAtomicAccessOnIntegerTypedArray(_typedArray_, _index_, *true*). + 1. Let _taRecord_ be ? ValidateIntegerTypedArray(_typedArray_, *true*). + 1. Let _byteIndexInBuffer_ be ? ValidateAtomicAccess(_taRecord_, _index_). 1. If _count_ is *undefined*, then 1. Let _c_ be +∞. 1. Else, @@ -44857,7 +47242,7 @@

            Atomics.notify ( _typedArray_, _index_, _count_ )

            - +

            Atomics.xor ( _typedArray_, _index_, _value_ )

            This function performs the following steps when called:

            @@ -44867,9 +47252,9 @@

            Atomics.xor ( _typedArray_, _index_, _value_ )

            - -

            Atomics [ @@toStringTag ]

            -

            The initial value of the @@toStringTag property is the String value *"Atomics"*.

            + +

            Atomics [ %Symbol.toStringTag% ]

            +

            The initial value of the %Symbol.toStringTag% property is the String value *"Atomics"*.

            This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

            @@ -44888,34 +47273,152 @@

            The JSON Object

            The JSON Data Interchange Format is defined in ECMA-404. The JSON interchange format used in this specification is exactly that described by ECMA-404. Conforming implementations of `JSON.parse` and `JSON.stringify` must support the exact interchange format described in the ECMA-404 specification without any deletions or extensions to the format.

            - + +

            JSON.isRawJSON ( _O_ )

            +

            This function performs the following steps when called:

            + + 1. If _O_ is an Object and _O_ has an [[IsRawJSON]] internal slot, return *true*. + 1. Return *false*. + +
            + +

            JSON.parse ( _text_ [ , _reviver_ ] )

            This function parses a JSON text (a JSON-formatted String) and produces an ECMAScript language value. The JSON format represents literals, arrays, and objects with a syntax similar to the syntax for ECMAScript literals, Array Initializers, and Object Initializers. After parsing, JSON objects are realized as ECMAScript objects. JSON arrays are realized as ECMAScript Array instances. JSON strings, numbers, booleans, and null are realized as ECMAScript Strings, Numbers, Booleans, and *null*.

            -

            The optional _reviver_ parameter is a function that takes two parameters, _key_ and _value_. It can filter and transform the results. It is called with each of the _key_/_value_ pairs produced by the parse, and its return value is used instead of the original value. If it returns what it received, the structure is not modified. If it returns *undefined* then the property is deleted from the result.

            +

            The optional _reviver_ parameter is a function that can filter and transform the results. For each value produced by the parse, _reviver_ is called with three arguments (the associated property key, the value, and a context object). If the property is unmodified and its value is primitive, the provided context object has a *"source"* property containing source text of the corresponding Parse Node. If the call returns *undefined*, the property is deleted. Otherwise, the property is redefined to use the return value.

            1. Let _jsonString_ be ? ToString(_text_). - 1. [id="step-json-parse-validate"] Parse StringToCodePoints(_jsonString_) as a JSON text as specified in ECMA-404. Throw a *SyntaxError* exception if it is not a valid JSON text as defined in that specification. - 1. Let _scriptString_ be the string-concatenation of *"("*, _jsonString_, and *");"*. - 1. [id="step-json-parse-parse"] Let _script_ be ParseText(_scriptString_, |Script|). - 1. NOTE: The early error rules defined in have special handling for the above invocation of ParseText. - 1. Assert: _script_ is a Parse Node. - 1. [id="step-json-parse-eval"] Let _completion_ be Completion(Evaluation of _script_). - 1. NOTE: The PropertyDefinitionEvaluation semantics defined in have special handling for the above evaluation. - 1. Let _unfiltered_ be _completion_.[[Value]]. - 1. [id="step-json-parse-assert-type"] Assert: _unfiltered_ is either a String, a Number, a Boolean, an Object that is defined by either an |ArrayLiteral| or an |ObjectLiteral|, or *null*. - 1. If IsCallable(_reviver_) is *true*, then - 1. Let _root_ be OrdinaryObjectCreate(%Object.prototype%). - 1. Let _rootName_ be the empty String. - 1. Perform ! CreateDataPropertyOrThrow(_root_, _rootName_, _unfiltered_). - 1. Return ? InternalizeJSONProperty(_root_, _rootName_, _reviver_). - 1. Else, - 1. Return _unfiltered_. + 1. Let _parseResult_ be ? ParseJSON(_jsonString_). + 1. Let _unfiltered_ be _parseResult_.[[Value]]. + 1. If IsCallable(_reviver_) is *false*, return _unfiltered_. + 1. Let _root_ be OrdinaryObjectCreate(%Object.prototype%). + 1. Let _rootName_ be the empty String. + 1. Perform ! CreateDataPropertyOrThrow(_root_, _rootName_, _unfiltered_). + 1. Let _snapshot_ be CreateJSONParseRecord(_parseResult_.[[ParseNode]], _rootName_, _unfiltered_). + 1. Return ? InternalizeJSONProperty(_root_, _rootName_, _reviver_, _snapshot_).

            The *"length"* property of this function is *2*𝔽.

            - -

            Valid JSON text is a subset of the ECMAScript |PrimaryExpression| syntax. Step verifies that _jsonString_ conforms to that subset, and step asserts that that parsing and evaluation returns a value of an appropriate type.

            -

            However, because behaves differently during `JSON.parse`, the same source text can produce different results when evaluated as a |PrimaryExpression| rather than as JSON. Furthermore, the Early Error for duplicate *"__proto__"* properties in object literals, which likewise does not apply during `JSON.parse`, means that not all texts accepted by `JSON.parse` are valid as a |PrimaryExpression|, despite matching the grammar.

            -
            + + +

            + ParseJSON ( + _text_: a String, + ): either a normal completion containing a Record with fields [[ParseNode]] (a Parse Node) and [[Value]] (an ECMAScript language value), or a throw completion +

            +
            +
            + + 1. [id="step-json-parse-validate"] If StringToCodePoints(_text_) is not a valid JSON text as specified in ECMA-404, throw a *SyntaxError* exception. + 1. Let _scriptString_ be the string-concatenation of *"("*, _text_, and *");"*. + 1. [id="step-json-parse-parse"] Let _script_ be ParseText(_scriptString_, |Script|). + 1. NOTE: The early error rules defined in have special handling for the above invocation of ParseText. + 1. Assert: _script_ is a Parse Node. + 1. [id="step-json-parse-eval"] Let _result_ be ! Evaluation of _script_. + 1. NOTE: The PropertyDefinitionEvaluation semantics defined in have special handling for the above evaluation. + 1. [id="step-json-parse-assert-type"] Assert: _result_ is either a String, a Number, a Boolean, an Object that is defined by either an |ArrayLiteral| or an |ObjectLiteral|, or *null*. + 1. Return the Record { [[ParseNode]]: _script_, [[Value]]: _result_ }. + +

            It is not permitted for a conforming implementation of `JSON.parse` to extend the JSON grammars. If an implementation wishes to support a modified or extended JSON interchange format it must do so by defining a different parse function.

            + +

            Valid JSON text is a subset of the ECMAScript |PrimaryExpression| syntax. Step verifies that _jsonString_ conforms to that subset, and step asserts that evaluation returns a value of an appropriate type.

            +

            However, because behaves differently during ParseJSON, the same source text can produce different results when evaluated as a |PrimaryExpression| rather than as JSON. Furthermore, the Early Error for duplicate *"__proto__"* properties in object literals, which likewise does not apply during ParseJSON, means that not all texts accepted by ParseJSON are valid as a |PrimaryExpression|, despite matching the grammar.

            +
            + +

            In the case where there are duplicate name Strings within an object, lexically preceding values for the same key shall be overwritten.

            +
            +
            + + +

            JSON Parse Record

            +

            A JSON Parse Record is a Record value used to describe the initial state of a value parsed from JSON text.

            +

            JSON Parse Records have the fields listed in .

            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            Field NameValueMeaning
            [[ParseNode]]a Parse NodeThe context Parse Node.
            [[Key]]a property nameThe property name with which [[Value]] is associated.
            [[Value]]an ECMAScript language valueThe value produced by evaluation of [[ParseNode]].
            [[Elements]]a List of JSON Parse RecordsIf [[Value]] is an Array, this contains the JSON Parse Records corresponding with the elements of [[Value]]. Otherwise, this is an empty List.
            [[Entries]]a List of JSON Parse RecordsIf [[Value]] is a non-Array Object, this contains the JSON Parse Records corresponding with the entries of [[Value]]. Otherwise, this is an empty List.
            +
            +
            + + +

            + CreateJSONParseRecord ( + _parseNode_: a Parse Node, + _key_: a property name, + _val_: an ECMAScript language value, + ): a JSON Parse Record +

            +
            +
            description
            +
            It recursively combines a _parseNode_ parsed from JSON text and the _val_ produced by its evaluation.
            +
            + + 1. Let _typedValNode_ be ShallowestContainedJSONValue(_parseNode_). + 1. Assert: _typedValNode_ is not ~empty~. + 1. Let _elements_ be a new empty List. + 1. Let _entries_ be a new empty List. + 1. If _val_ is an Object, then + 1. Let _isArray_ be ! IsArray(_val_). + 1. If _isArray_ is *true*, then + 1. Assert: _typedValNode_ is an |ArrayLiteral| Parse Node. + 1. Let _contentNodes_ be the JSONArrayLiteralContentNodes of _typedValNode_. + 1. Let _len_ be the number of elements in _contentNodes_. + 1. Let _valLen_ be ! LengthOfArrayLike(_val_). + 1. Assert: _valLen_ is _len_. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _len_, + 1. Let _propName_ be ! ToString(𝔽(_index_)). + 1. Let _elementParseRecord_ be CreateJSONParseRecord(_contentNodes_[_index_], _propName_, ! Get(_val_, _propName_)). + 1. Append _elementParseRecord_ to _elements_. + 1. Set _index_ to _index_ + 1. + 1. Else, + 1. Assert: _typedValNode_ is an |ObjectLiteral| Parse Node. + 1. Let _propertyNodes_ be the PropertyDefinitionNodes of _typedValNode_. + 1. NOTE: Because _val_ was produced from JSON text and has not been modified, all of its property keys are Strings and will be exhaustively enumerated. + 1. Let _keys_ be ! EnumerableOwnProperties(_val_, ~key~). + 1. For each String _P_ of _keys_, do + 1. NOTE: In the case of JSON text specifying multiple name/value pairs with the same name for a single object (such as {"a":"lost","a":"kept"}), the value for the corresponding property of the resulting ECMAScript object is specified by the last pair with that name. + 1. Let _propertyDefinition_ be ~empty~. + 1. For each Parse Node _propertyNode_ of _propertyNodes_, do + 1. Let _propName_ be the PropName of _propertyNode_. + 1. If _propName_ is _P_, set _propertyDefinition_ to _propertyNode_. + 1. Assert: _propertyDefinition_ is PropertyDefinition : PropertyName `:` AssignmentExpression. + 1. Let _propertyValueNode_ be the |AssignmentExpression| of _propertyDefinition_. + 1. Let _entryParseRecord_ be CreateJSONParseRecord(_propertyValueNode_, _P_, ! Get(_val_, _P_)). + 1. Append _entryParseRecord_ to _entries_. + 1. Else, + 1. Assert: _typedValNode_ is neither an |ArrayLiteral| Parse Node nor an |ObjectLiteral| Parse Node. + 1. Return the JSON Parse Record { [[ParseNode]]: _typedValNode_, [[Key]]: _key_, [[Value]]: _val_, [[Elements]]: _elements_, [[Entries]]: _entries_ }. + +

            @@ -44923,6 +47426,7 @@

            _holder_: an Object, _name_: a String, _reviver_: a function object, + _parseRecord_: a JSON Parse Record or ~empty~, ): either a normal completion containing an ECMAScript language value or a throw completion

            @@ -44933,37 +47437,144 @@

            It performs the following steps when called:

            1. Let _val_ be ? Get(_holder_, _name_). + 1. Let _context_ be OrdinaryObjectCreate(%Object.prototype%). + 1. If _parseRecord_ is a JSON Parse Record and SameValue(_parseRecord_.[[Value]], _val_) is *true*, then + 1. If _val_ is not an Object, then + 1. Let _parseNode_ be _parseRecord_.[[ParseNode]]. + 1. Assert: _parseNode_ is neither an |ArrayLiteral| Parse Node nor an |ObjectLiteral| Parse Node. + 1. Let _sourceText_ be the source text matched by _parseNode_. + 1. Perform ! CreateDataPropertyOrThrow(_context_, *"source"*, CodePointsToString(_sourceText_)). + 1. Let _elementRecords_ be _parseRecord_.[[Elements]]. + 1. Let _entryRecords_ be _parseRecord_.[[Entries]]. + 1. Else, + 1. Let _elementRecords_ be a new empty List. + 1. Let _entryRecords_ be a new empty List. 1. If _val_ is an Object, then 1. Let _isArray_ be ? IsArray(_val_). 1. If _isArray_ is *true*, then + 1. Let _elementRecordsLen_ be the number of elements in _elementRecords_. 1. Let _len_ be ? LengthOfArrayLike(_val_). - 1. Let _I_ be 0. - 1. Repeat, while _I_ < _len_, - 1. Let _prop_ be ! ToString(𝔽(_I_)). - 1. Let _newElement_ be ? InternalizeJSONProperty(_val_, _prop_, _reviver_). + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _len_, + 1. Let _prop_ be ! ToString(𝔽(_index_)). + 1. If _index_ < _elementRecordsLen_, let _elementRecord_ be _elementRecords_[_index_]; else let _elementRecord_ be ~empty~. + 1. Let _newElement_ be ? InternalizeJSONProperty(_val_, _prop_, _reviver_, _elementRecord_). 1. If _newElement_ is *undefined*, then - 1. Perform ? _val_.[[Delete]](_prop_). + 1. Perform ? _val_.[[Delete]](_prop_). 1. Else, 1. Perform ? CreateDataProperty(_val_, _prop_, _newElement_). - 1. Set _I_ to _I_ + 1. + 1. Set _index_ to _index_ + 1. 1. Else, 1. Let _keys_ be ? EnumerableOwnProperties(_val_, ~key~). 1. For each String _P_ of _keys_, do - 1. Let _newElement_ be ? InternalizeJSONProperty(_val_, _P_, _reviver_). + 1. If there exists an element _e_ of _entryRecords_ such that _e_.[[Key]] is _P_, let _entryRecord_ be _e_; else let _entryRecord_ be ~empty~. + 1. Let _newElement_ be ? InternalizeJSONProperty(_val_, _P_, _reviver_, _entryRecord_). 1. If _newElement_ is *undefined*, then - 1. Perform ? _val_.[[Delete]](_P_). + 1. Perform ? _val_.[[Delete]](_P_). 1. Else, 1. Perform ? CreateDataProperty(_val_, _P_, _newElement_). - 1. Return ? Call(_reviver_, _holder_, « _name_, _val_ »). + 1. Return ? Call(_reviver_, _holder_, « _name_, _val_, _context_ »). + + + + +

            + Static Semantics: ShallowestContainedJSONValue ( + _root_: a Parse Node, + ): a Parse Node or ~empty~ +

            +
            +
            description
            +
            It performs a breadth-first search of the parse tree rooted at _root_, and returns the first node that is an instance of a nonterminal corresponding to a JSON value, or ~empty~ if there is no such node.
            +
            + + 1. Let _F_ be the active function object. + 1. Assert: _F_ is a `JSON.parse` built-in function object (see JSON.parse). + 1. Let _types_ be « |NullLiteral|, |BooleanLiteral|, |NumericLiteral|, |StringLiteral|, |ArrayLiteral|, |ObjectLiteral|, |UnaryExpression| ». + 1. Let _unaryExpression_ be ~empty~. + 1. Let _queue_ be « _root_ ». + 1. Repeat, while _queue_ is not empty, + 1. Let _candidate_ be the first element of _queue_. + 1. Remove the first element from _queue_. + 1. Let _queuedChildren_ be *false*. + 1. For each nonterminal _type_ of _types_, do + 1. If _candidate_ is an instance of _type_, then + 1. NOTE: In the JSON grammar, a number token may represent a negative value. In ECMAScript, negation is represented as a unary operation in which a |UnaryExpression| parses to a `-` followed by a derived |UnaryExpression|. + 1. If _type_ is |UnaryExpression|, then + 1. If the parent of _candidate_ is not a |UnaryExpression| Parse Node, set _unaryExpression_ to _candidate_. + 1. Else if _type_ is |NumericLiteral|, then + 1. Assert: _candidate_ is contained within _unaryExpression_. + 1. Return _unaryExpression_. + 1. Else, + 1. Return _candidate_. + 1. If _queuedChildren_ is *false*, _candidate_ is an instance of a nonterminal, and _candidate_ Contains _type_ is *true*, then + 1. Let _children_ be a List containing each child node of _candidate_, in order. + 1. Set _queue_ to the list-concatenation of _queue_ and _children_. + 1. Set _queuedChildren_ to *true*. + 1. Return ~empty~. + +
            + + +

            Static Semantics: JSONArrayLiteralContentNodes ( ): a List of Parse Nodes

            +
            +
            + + ArrayLiteral : + `[` Elision? `]` + `[` ElementList `]` + `[` ElementList `,` Elision? `]` + + + 1. Assert: |Elision| is not present. + 1. If |ElementList| is not present, return a new empty List. + 1. Return the the JSONArrayLiteralContentNodes of |ElementList|. + + + ElementList : Elision? AssignmentExpression + + 1. Assert: |Elision| is not present. + 1. Return « |AssignmentExpression| ». + + + ElementList : ElementList `,` Elision? AssignmentExpression + + 1. Assert: |Elision| is not present. + 1. Let _elements_ be the JSONArrayLiteralContentNodes of the derived |ElementList|. + 1. Return the list-concatenation of _elements_ and « |AssignmentExpression| ». + + + + ElementList : + Elision? SpreadElement + ElementList `,` Elision? SpreadElement + + + 1. NOTE: JSON text as specified in ECMA-404 does not include |SpreadElement|. + 1. Assert: This step is never reached. -

            It is not permitted for a conforming implementation of `JSON.parse` to extend the JSON grammars. If an implementation wishes to support a modified or extended JSON interchange format it must do so by defining a different parse function.

            - -

            In the case where there are duplicate name Strings within an object, lexically preceding values for the same key shall be overwritten.

            -
            - + +

            JSON.rawJSON ( _text_ )

            +

            This function returns an object representing raw JSON text of a string, number, boolean, or null value.

            + + 1. Let _jsonString_ be ? ToString(_text_). + 1. If _jsonString_ is the empty String, throw a *SyntaxError* exception. + 1. If the first code unit of _jsonString_ is not either an ASCII lowercase letter code unit (0x0061 through 0x007A, inclusive), an ASCII digit code unit (0x0030 through 0x0039, inclusive), 0x0022 (QUOTATION MARK), or 0x002D (HYPHEN-MINUS), throw a *SyntaxError* exception. + 1. If the last code unit of _jsonString_ is not either an ASCII lowercase letter code unit (0x0061 through 0x007A, inclusive), an ASCII digit code unit (0x0030 through 0x0039, inclusive), or 0x0022 (QUOTATION MARK), throw a *SyntaxError* exception. + 1. Let _parseResult_ be ? ParseJSON(_jsonString_). + 1. Assert: _parseResult_.[[Value]] is either a String, a Number, a Boolean, or *null*. + 1. Let _internalSlotsList_ be « [[IsRawJSON]] ». + 1. Let _obj_ be OrdinaryObjectCreate(*null*, _internalSlotsList_). + 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"rawJSON"*, _jsonString_). + 1. Perform ! SetIntegrityLevel(_obj_, ~frozen~). + 1. Return _obj_. + +
            + +

            JSON.stringify ( _value_ [ , _replacer_ [ , _space_ ] ] )

            This function returns a String in UTF-16 encoded JSON format representing an ECMAScript language value, or *undefined*. It can take three parameters. The _value_ parameter is an ECMAScript language value, which is usually an object or array, although it can also be a String, Boolean, Number or *null*. The optional _replacer_ parameter is either a function that alters the way objects and arrays are stringified, or an array of Strings and Numbers that acts as an inclusion list for selecting the object properties that will be stringified. The optional _space_ parameter is a String or Number that allows the result to have white space injected into it to improve human readability.

            It performs the following steps when called:

            @@ -45002,9 +47613,9 @@

            JSON.stringify ( _value_ [ , _replacer_ [ , _space_ ] ] )

            1. If _space_ is a Number, then 1. Let _spaceMV_ be ! ToIntegerOrInfinity(_space_). 1. Set _spaceMV_ to min(10, _spaceMV_). - 1. If _spaceMV_ < 1, let _gap_ be the empty String; otherwise let _gap_ be the String value containing _spaceMV_ occurrences of the code unit 0x0020 (SPACE). + 1. If _spaceMV_ < 1, let _gap_ be the empty String; else let _gap_ be the String value containing _spaceMV_ occurrences of the code unit 0x0020 (SPACE). 1. Else if _space_ is a String, then - 1. If the length of _space_ ≤ 10, let _gap_ be _space_; otherwise let _gap_ be the substring of _space_ from 0 to 10. + 1. If the length of _space_ ≤ 10, let _gap_ be _space_; else let _gap_ be the substring of _space_ from 0 to 10. 1. Else, 1. Let _gap_ be the empty String. 1. Let _wrapper_ be OrdinaryObjectCreate(%Object.prototype%). @@ -45057,11 +47668,13 @@

            JSON Serialization Record

            JSON Serialization Records have the fields listed in .

            - - - - - + + + + + + + @@ -45110,6 +47723,10 @@

            1. If _state_.[[ReplacerFunction]] is not *undefined*, then 1. Set _value_ to ? Call(_state_.[[ReplacerFunction]], _holder_, « _key_, _value_ »). 1. If _value_ is an Object, then + 1. If _value_ has an [[IsRawJSON]] internal slot, then + 1. Let _rawJSON_ be ! Get(_value_, *"rawJSON"*). + 1. Assert: _rawJSON_ is a String. + 1. Return _rawJSON_. 1. If _value_ has a [[NumberData]] internal slot, then 1. Set _value_ to ? ToNumber(_value_). 1. Else if _value_ has a [[StringData]] internal slot, then @@ -45159,17 +47776,19 @@

            Field NameValueMeaning
            Field NameValueMeaning
            [[ReplacerFunction]] a function object or *undefined*
            - - - - - + + + + + + +
            - Code Point - - Unicode Character Name - - Escape Sequence -
            + Code Point + + Unicode Character Name + + Escape Sequence +
            U+0008 @@ -45283,7 +47902,7 @@

            1. If _state_.[[Stack]] contains _value_, throw a *TypeError* exception because the structure is cyclical. 1. Append _value_ to _state_.[[Stack]]. - 1. Let _stepback_ be _state_.[[Indent]]. + 1. Let _stepBack_ be _state_.[[Indent]]. 1. Set _state_.[[Indent]] to the string-concatenation of _state_.[[Indent]] and _state_.[[Gap]]. 1. If _state_.[[PropertyList]] is not *undefined*, then 1. Let _K_ be _state_.[[PropertyList]]. @@ -45308,9 +47927,9 @@

            1. Else, 1. Let _separator_ be the string-concatenation of the code unit 0x002C (COMMA), the code unit 0x000A (LINE FEED), and _state_.[[Indent]]. 1. Let _properties_ be the String value formed by concatenating all the element Strings of _partial_ with each adjacent pair of Strings separated with _separator_. The _separator_ String is not inserted either before the first String or after the last String. - 1. Let _final_ be the string-concatenation of *"{"*, the code unit 0x000A (LINE FEED), _state_.[[Indent]], _properties_, the code unit 0x000A (LINE FEED), _stepback_, and *"}"*. + 1. Let _final_ be the string-concatenation of *"{"*, the code unit 0x000A (LINE FEED), _state_.[[Indent]], _properties_, the code unit 0x000A (LINE FEED), _stepBack_, and *"}"*. 1. Remove the last element of _state_.[[Stack]]. - 1. Set _state_.[[Indent]] to _stepback_. + 1. Set _state_.[[Indent]] to _stepBack_. 1. Return _final_. @@ -45329,7 +47948,7 @@

            1. If _state_.[[Stack]] contains _value_, throw a *TypeError* exception because the structure is cyclical. 1. Append _value_ to _state_.[[Stack]]. - 1. Let _stepback_ be _state_.[[Indent]]. + 1. Let _stepBack_ be _state_.[[Indent]]. 1. Set _state_.[[Indent]] to the string-concatenation of _state_.[[Indent]] and _state_.[[Gap]]. 1. Let _partial_ be a new empty List. 1. Let _len_ be ? LengthOfArrayLike(_value_). @@ -45350,9 +47969,9 @@

            1. Else, 1. Let _separator_ be the string-concatenation of the code unit 0x002C (COMMA), the code unit 0x000A (LINE FEED), and _state_.[[Indent]]. 1. Let _properties_ be the String value formed by concatenating all the element Strings of _partial_ with each adjacent pair of Strings separated with _separator_. The _separator_ String is not inserted either before the first String or after the last String. - 1. Let _final_ be the string-concatenation of *"["*, the code unit 0x000A (LINE FEED), _state_.[[Indent]], _properties_, the code unit 0x000A (LINE FEED), _stepback_, and *"]"*. + 1. Let _final_ be the string-concatenation of *"["*, the code unit 0x000A (LINE FEED), _state_.[[Indent]], _properties_, the code unit 0x000A (LINE FEED), _stepBack_, and *"]"*. 1. Remove the last element of _state_.[[Stack]]. - 1. Set _state_.[[Indent]] to _stepback_. + 1. Set _state_.[[Indent]] to _stepBack_. 1. Return _final_. @@ -45361,9 +47980,9 @@

            - -

            JSON [ @@toStringTag ]

            -

            The initial value of the @@toStringTag property is the String value *"JSON"*.

            + +

            JSON [ %Symbol.toStringTag% ]

            +

            The initial value of the %Symbol.toStringTag% property is the String value *"JSON"*.

            This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

            @@ -45395,7 +48014,7 @@

            The WeakRef Constructor

            - +

            WeakRef ( _target_ )

            This function performs the following steps when called:

            @@ -45428,7 +48047,7 @@

            WeakRef.prototype

            Properties of the WeakRef Prototype Object

            -

            The WeakRef prototype object:

            +

            The WeakRef prototype object:

            • is %WeakRef.prototype%.
            • @@ -45442,11 +48061,9 @@

              Properties of the WeakRef Prototype Object

              WeakRef.prototype.constructor

              The initial value of `WeakRef.prototype.constructor` is %WeakRef%.

              - -

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              - +

              WeakRef.prototype.deref ( )

              This method performs the following steps when called:

              @@ -45473,9 +48090,9 @@

              WeakRef.prototype.deref ( )

              - -

              WeakRef.prototype [ @@toStringTag ]

              -

              The initial value of the @@toStringTag property is the String value *"WeakRef"*.

              + +

              WeakRef.prototype [ %Symbol.toStringTag% ]

              +

              The initial value of the %Symbol.toStringTag% property is the String value *"WeakRef"*.

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              @@ -45506,7 +48123,7 @@

              Properties of WeakRef Instances

              -

              WeakRef instances are ordinary objects that inherit properties from the WeakRef prototype. WeakRef instances also have a [[WeakRefTarget]] internal slot.

              +

              WeakRef instances are ordinary objects that inherit properties from the WeakRef prototype object. WeakRef instances also have a [[WeakRefTarget]] internal slot.

              @@ -45533,7 +48150,7 @@

              The FinalizationRegistry Constructor

            - +

            FinalizationRegistry ( _cleanupCallback_ )

            This function performs the following steps when called:

            @@ -45568,7 +48185,7 @@

            FinalizationRegistry.prototype

            Properties of the FinalizationRegistry Prototype Object

            -

            The FinalizationRegistry prototype object:

            +

            The FinalizationRegistry prototype object:

            • is %FinalizationRegistry.prototype%.
            • @@ -45585,7 +48202,7 @@

              FinalizationRegistry.prototype.constructor

              The initial value of `FinalizationRegistry.prototype.constructor` is %FinalizationRegistry%.

              - +

              FinalizationRegistry.prototype.register ( _target_, _heldValue_ [ , _unregisterToken_ ] )

              This method performs the following steps when called:

              @@ -45606,7 +48223,7 @@

              FinalizationRegistry.prototype.register ( _target_, _heldValue_ [ , _unregis - +

              FinalizationRegistry.prototype.unregister ( _unregisterToken_ )

              This method performs the following steps when called:

              @@ -45622,16 +48239,16 @@

              FinalizationRegistry.prototype.unregister ( _unregisterToken_ )

              - -

              FinalizationRegistry.prototype [ @@toStringTag ]

              -

              The initial value of the @@toStringTag property is the String value *"FinalizationRegistry"*.

              + +

              FinalizationRegistry.prototype [ %Symbol.toStringTag% ]

              +

              The initial value of the %Symbol.toStringTag% property is the String value *"FinalizationRegistry"*.

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              Properties of FinalizationRegistry Instances

              -

              FinalizationRegistry instances are ordinary objects that inherit properties from the FinalizationRegistry prototype. FinalizationRegistry instances also have [[Cells]] and [[CleanupCallback]] internal slots.

              +

              FinalizationRegistry instances are ordinary objects that inherit properties from the FinalizationRegistry prototype object. FinalizationRegistry instances also have [[Cells]] and [[CleanupCallback]] internal slots.

              @@ -45647,30 +48264,32 @@

              Common Iteration Interfaces

              An interface is a set of property keys whose associated values match a specific specification. Any object that provides all the properties as described by an interface's specification conforms to that interface. An interface is not represented by a distinct object. There may be many separately implemented objects that conform to any interface. An individual object may conform to multiple interfaces.

              -

              The Iterable Interface

              -

              The Iterable interface includes the property described in :

              - +

              The Iterable Interface

              +

              The iterable interface includes the property described in :

              + - - - - - + + + + + + +
              - Property - - Value - - Requirements -
              + Property + + Value + + Requirements +
              - `@@iterator` + `%Symbol.iterator%` - a function that returns an Iterator object + a function that returns an iterator object - The returned object must conform to the Iterator interface. + The returned object must conform to the iterator interface.
              @@ -45678,59 +48297,63 @@

              The Iterable Interface

              -

              The Iterator Interface

              -

              An object that implements the Iterator interface must include the property in . Such objects may also implement the properties in .

              - +

              The Iterator Interface

              +

              An object that implements the iterator interface must include the property in . Such objects may also implement the properties in .

              + - - - - - + + + + + + +
              - Property - - Value - - Requirements -
              + Property + + Value + + Requirements +
              *"next"* - a function that returns an IteratorResult object + a function that returns an IteratorResult object - The returned object must conform to the IteratorResult interface. If a previous call to the `next` method of an Iterator has returned an IteratorResult object whose *"done"* property is *true*, then all subsequent calls to the `next` method of that object should also return an IteratorResult object whose *"done"* property is *true*. However, this requirement is not enforced. + The returned object must conform to the IteratorResult interface. If a previous call to the `next` method of an iterator has returned an IteratorResult object whose *"done"* property is *true*, then all subsequent calls to the `next` method of that object should also return an IteratorResult object whose *"done"* property is *true*. However, this requirement is not enforced.
              -

              Arguments may be passed to the `next` function but their interpretation and validity is dependent upon the target Iterator. The for-of statement and other common users of Iterators do not pass any arguments, so Iterator objects that expect to be used in such a manner must be prepared to deal with being called with no arguments.

              +

              Arguments may be passed to the `next` function but their interpretation and validity is dependent upon the target iterator. The for-of statement and other common users of iterators do not pass any arguments, so iterator objects that expect to be used in such a manner must be prepared to deal with being called with no arguments.

              - + - - - - - + + + + + + + @@ -45738,85 +48361,91 @@

              The Iterator Interface

              *"throw"*
              - Property - - Value - - Requirements -
              + Property + + Value + + Requirements +
              *"return"* - a function that returns an IteratorResult object + a function that returns an IteratorResult object - The returned object must conform to the IteratorResult interface. Invoking this method notifies the Iterator object that the caller does not intend to make any more `next` method calls to the Iterator. The returned IteratorResult object will typically have a *"done"* property whose value is *true*, and a *"value"* property with the value passed as the argument of the `return` method. However, this requirement is not enforced. + The returned object must conform to the IteratorResult interface. Invoking this method notifies the iterator object that the caller does not intend to make any more `next` method calls to the iterator. The returned IteratorResult object will typically have a *"done"* property whose value is *true*, and a *"value"* property with the value passed as the argument of the `return` method. However, this requirement is not enforced.
              - a function that returns an IteratorResult object + a function that returns an IteratorResult object - The returned object must conform to the IteratorResult interface. Invoking this method notifies the Iterator object that the caller has detected an error condition. The argument may be used to identify the error condition and typically will be an exception object. A typical response is to `throw` the value passed as the argument. If the method does not `throw`, the returned IteratorResult object will typically have a *"done"* property whose value is *true*. + The returned object must conform to the IteratorResult interface. Invoking this method notifies the iterator object that the caller has detected an error condition. The argument may be used to identify the error condition and typically will be an exception object. A typical response is to `throw` the value passed as the argument. If the method does not `throw`, the returned IteratorResult object will typically have a *"done"* property whose value is *true*.
              -

              Typically callers of these methods should check for their existence before invoking them. Certain ECMAScript language features including `for`-`of`, `yield*`, and array destructuring call these methods after performing an existence check. Most ECMAScript library functions that accept Iterable objects as arguments also conditionally call them.

              +

              Typically callers of these methods should check for their existence before invoking them. Certain ECMAScript language features including `for`-`of`, `yield*`, and array destructuring call these methods after performing an existence check. Most ECMAScript library functions that accept iterable objects as arguments also conditionally call them.

              -

              The AsyncIterable Interface

              -

              The AsyncIterable interface includes the properties described in :

              - +

              The Async Iterable Interface

              +

              The async iterable interface includes the properties described in :

              + + + + + + + + - - - - - - - - + + +
              PropertyValueRequirements
              PropertyValueRequirements
              `@@asyncIterator`a function that returns an AsyncIterator objectThe returned object must conform to the AsyncIterator interface.`%Symbol.asyncIterator%`a function that returns an async iterator objectThe returned object must conform to the async iterator interface.
              -

              The AsyncIterator Interface

              -

              An object that implements the AsyncIterator interface must include the properties in . Such objects may also implement the properties in .

              - +

              The Async Iterator Interface

              +

              An object that implements the async iterator interface must include the properties in . Such objects may also implement the properties in .

              + - - - - - + + + + + + + - +
              PropertyValueRequirements
              PropertyValueRequirements
              *"next"*a function that returns a promise for an IteratorResult objecta function that returns a promise for an IteratorResult object -

              The returned promise, when fulfilled, must fulfill with an object that conforms to the IteratorResult interface. If a previous call to the `next` method of an AsyncIterator has returned a promise for an IteratorResult object whose *"done"* property is *true*, then all subsequent calls to the `next` method of that object should also return a promise for an IteratorResult object whose *"done"* property is *true*. However, this requirement is not enforced.

              +

              The returned promise, when fulfilled, must fulfill with an object that conforms to the IteratorResult interface. If a previous call to the `next` method of an async iterator has returned a promise for an IteratorResult object whose *"done"* property is *true*, then all subsequent calls to the `next` method of that object should also return a promise for an IteratorResult object whose *"done"* property is *true*. However, this requirement is not enforced.

              -

              Additionally, the IteratorResult object that serves as a fulfillment value should have a *"value"* property whose value is not a promise (or "thenable"). However, this requirement is also not enforced.

              +

              Additionally, the IteratorResult object that serves as a fulfillment value should have a *"value"* property whose value is not a promise (or "thenable"). However, this requirement is also not enforced.

              -

              Arguments may be passed to the `next` function but their interpretation and validity is dependent upon the target AsyncIterator. The `for`-`await`-`of` statement and other common users of AsyncIterators do not pass any arguments, so AsyncIterator objects that expect to be used in such a manner must be prepared to deal with being called with no arguments.

              +

              Arguments may be passed to the `next` function but their interpretation and validity is dependent upon the target async iterator. The `for`-`await`-`of` statement and other common users of async iterators do not pass any arguments, so async iterator objects that expect to be used in such a manner must be prepared to deal with being called with no arguments.

              - + - - - - - + + + + + + + - + - +
              PropertyValueRequirements
              PropertyValueRequirements
              *"return"*a function that returns a promise for an IteratorResult objecta function that returns a promise for an IteratorResult object -

              The returned promise, when fulfilled, must fulfill with an object that conforms to the IteratorResult interface. Invoking this method notifies the AsyncIterator object that the caller does not intend to make any more `next` method calls to the AsyncIterator. The returned promise will fulfill with an IteratorResult object which will typically have a *"done"* property whose value is *true*, and a *"value"* property with the value passed as the argument of the `return` method. However, this requirement is not enforced.

              +

              The returned promise, when fulfilled, must fulfill with an object that conforms to the IteratorResult interface. Invoking this method notifies the async iterator object that the caller does not intend to make any more `next` method calls to the async iterator. The returned promise will fulfill with an IteratorResult object which will typically have a *"done"* property whose value is *true*, and a *"value"* property with the value passed as the argument of the `return` method. However, this requirement is not enforced.

              -

              Additionally, the IteratorResult object that serves as a fulfillment value should have a *"value"* property whose value is not a promise (or "thenable"). If the argument value is used in the typical manner, then if it is a rejected promise, a promise rejected with the same reason should be returned; if it is a fulfilled promise, then its fulfillment value should be used as the *"value"* property of the returned promise's IteratorResult object fulfillment value. However, these requirements are also not enforced.

              +

              Additionally, the IteratorResult object that serves as a fulfillment value should have a *"value"* property whose value is not a promise (or "thenable"). If the argument value is used in the typical manner, then if it is a rejected promise, a promise rejected with the same reason should be returned; if it is a fulfilled promise, then its fulfillment value should be used as the *"value"* property of the returned promise's IteratorResult object fulfillment value. However, these requirements are also not enforced.

              *"throw"*a function that returns a promise for an IteratorResult objecta function that returns a promise for an IteratorResult object -

              The returned promise, when fulfilled, must fulfill with an object that conforms to the IteratorResult interface. Invoking this method notifies the AsyncIterator object that the caller has detected an error condition. The argument may be used to identify the error condition and typically will be an exception object. A typical response is to return a rejected promise which rejects with the value passed as the argument.

              +

              The returned promise, when fulfilled, must fulfill with an object that conforms to the IteratorResult interface. Invoking this method notifies the async iterator object that the caller has detected an error condition. The argument may be used to identify the error condition and typically will be an exception object. A typical response is to return a rejected promise which rejects with the value passed as the argument.

              -

              If the returned promise is fulfilled, the IteratorResult fulfillment value will typically have a *"done"* property whose value is *true*. Additionally, it should have a *"value"* property whose value is not a promise (or "thenable"), but this requirement is not enforced.

              +

              If the returned promise is fulfilled, the IteratorResult object fulfillment value will typically have a *"done"* property whose value is *true*. Additionally, it should have a *"value"* property whose value is not a promise (or "thenable"), but this requirement is not enforced.

              @@ -45827,21 +48456,23 @@

              The AsyncIterator Interface

              -

              The IteratorResult Interface

              -

              The IteratorResult interface includes the properties listed in :

              - +

              The IteratorResult Interface

              +

              The IteratorResult interface includes the properties listed in :

              + - - - - - + + + + + + + @@ -45869,26 +48500,531 @@

              The IteratorResult Interface

              - -

              The %IteratorPrototype% Object

              -

              The %IteratorPrototype% object:

              -
                -
              • has a [[Prototype]] internal slot whose value is %Object.prototype%.
              • -
              • is an ordinary object.
              • -
              - -

              All objects defined in this specification that implement the Iterator interface also inherit from %IteratorPrototype%. ECMAScript code may also define objects that inherit from %IteratorPrototype%. The %IteratorPrototype% object provides a place where additional methods that are applicable to all iterator objects may be added.

              -

              The following expression is one way that ECMAScript code can access the %IteratorPrototype% object:

              -
              Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
              -
              + +

              Iterator Helper Objects

              +

              An Iterator Helper object is an ordinary object that represents a lazy transformation of some specific source iterator object. There is not a named constructor for Iterator Helper objects. Instead, Iterator Helper objects are created by calling certain methods of Iterator instance objects.

              - -

              %IteratorPrototype% [ @@iterator ] ( )

              -

              This function performs the following steps when called:

              - - 1. Return the *this* value. - -

              The value of the *"name"* property of this function is *"[Symbol.iterator]"*.

              + +

              The %IteratorHelperPrototype% Object

              +

              The %IteratorHelperPrototype% object:

              +
                +
              • has properties that are inherited by all Iterator Helper objects.
              • +
              • is an ordinary object.
              • +
              • has a [[Prototype]] internal slot whose value is %Iterator.prototype%.
              • +
              • has the following properties:
              • +
              + + +

              %IteratorHelperPrototype%.next ( )

              + + 1. Return ? GeneratorResume(*this* value, *undefined*, *"Iterator Helper"*). + +
              + + +

              %IteratorHelperPrototype%.return ( )

              + + 1. Let _O_ be *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[UnderlyingIterators]]). + 1. Assert: _O_ has a [[GeneratorState]] internal slot. + 1. If _O_.[[GeneratorState]] is ~suspended-start~, then + 1. Set _O_.[[GeneratorState]] to ~completed~. + 1. NOTE: Once a generator enters the completed state it never leaves it and its associated execution context is never resumed. Any execution state associated with _O_ can be discarded at this point. + 1. Perform ? IteratorCloseAll(_O_.[[UnderlyingIterators]], NormalCompletion(~unused~)). + 1. Return CreateIteratorResultObject(*undefined*, *true*). + 1. Let _C_ be ReturnCompletion(*undefined*). + 1. Return ? GeneratorResumeAbrupt(_O_, _C_, *"Iterator Helper"*). + +
              + + +

              %IteratorHelperPrototype% [ %Symbol.toStringTag% ]

              +

              The initial value of the %Symbol.toStringTag% property is the String value *"Iterator Helper"*.

              +

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              +
              +
              +
              + + +

              Iterator Objects

              + + +

              The Iterator Constructor

              +

              The Iterator constructor:

              +
                +
              • is %Iterator%.
              • +
              • is the initial value of the *"Iterator"* property of the global object.
              • +
              • is designed to be subclassable. It may be used as the value of an *extends* clause of a class definition.
              • +
              + + +

              Iterator ( )

              +

              This function performs the following steps when called:

              + + 1. If NewTarget is either *undefined* or the active function object, throw a *TypeError* exception. + 1. Return ? OrdinaryCreateFromConstructor(NewTarget, *"%Iterator.prototype%"*). + +
              +
              + + +

              Properties of the Iterator Constructor

              +

              The Iterator constructor:

              +
                +
              • has a [[Prototype]] internal slot whose value is %Function.prototype%.
              • +
              • has the following properties:
              • +
              + + +

              Iterator.concat ( ..._items_ )

              + + 1. Let _iterables_ be a new empty List. + 1. For each element _item_ of _items_, do + 1. If _item_ is not an Object, throw a *TypeError* exception. + 1. Let _method_ be ? GetMethod(_item_, %Symbol.iterator%). + 1. If _method_ is *undefined*, throw a *TypeError* exception. + 1. Append the Record { [[OpenMethod]]: _method_, [[Iterable]]: _item_ } to _iterables_. + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterables_ and performs the following steps when called: + 1. For each Record _iterable_ of _iterables_, do + 1. Let _iter_ be ? Call(_iterable_.[[OpenMethod]], _iterable_.[[Iterable]]). + 1. If _iter_ is not an Object, throw a *TypeError* exception. + 1. Let _iteratorRecord_ be ? GetIteratorDirect(_iter_). + 1. Let _innerAlive_ be *true*. + 1. Repeat, while _innerAlive_ is *true*, + 1. Let _innerValue_ be ? IteratorStepValue(_iteratorRecord_). + 1. If _innerValue_ is ~done~, then + 1. Set _innerAlive_ to *false*. + 1. Else, + 1. Let _completion_ be Completion(Yield(_innerValue_)). + 1. If _completion_ is an abrupt completion, then + 1. Return ? IteratorClose(_iteratorRecord_, _completion_). + 1. Return ReturnCompletion(*undefined*). + 1. Let _gen_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterators]] »). + 1. Set _gen_.[[UnderlyingIterators]] to a new empty List. + 1. Return _gen_. + +
              + + +

              Iterator.from ( _O_ )

              + + 1. Let _iteratorRecord_ be ? GetIteratorFlattenable(_O_, ~iterate-string-primitives~). + 1. Let _hasInstance_ be ? OrdinaryHasInstance(%Iterator%, _iteratorRecord_.[[Iterator]]). + 1. If _hasInstance_ is *true*, then + 1. Return _iteratorRecord_.[[Iterator]]. + 1. Let _wrapper_ be OrdinaryObjectCreate(%WrapForValidIteratorPrototype%, « [[Iterated]] »). + 1. Set _wrapper_.[[Iterated]] to _iteratorRecord_. + 1. Return _wrapper_. + + + +

              The %WrapForValidIteratorPrototype% Object

              +

              The %WrapForValidIteratorPrototype% object:

              +
                +
              • is an ordinary object.
              • +
              • has a [[Prototype]] internal slot whose value is %Iterator.prototype%.
              • +
              + + +

              %WrapForValidIteratorPrototype%.next ( )

              + + 1. Let _O_ be *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[Iterated]]). + 1. Let _iteratorRecord_ be _O_.[[Iterated]]. + 1. Return ? Call(_iteratorRecord_.[[NextMethod]], _iteratorRecord_.[[Iterator]]). + +
              + + +

              %WrapForValidIteratorPrototype%.return ( )

              + + 1. Let _O_ be *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[Iterated]]). + 1. Let _iterator_ be _O_.[[Iterated]].[[Iterator]]. + 1. Assert: _iterator_ is an Object. + 1. Let _returnMethod_ be ? GetMethod(_iterator_, *"return"*). + 1. If _returnMethod_ is *undefined*, then + 1. Return CreateIteratorResultObject(*undefined*, *true*). + 1. Return ? Call(_returnMethod_, _iterator_). + +
              +
              +
              + + +

              Iterator.prototype

              +

              The initial value of Iterator.prototype is the Iterator prototype object.

              +

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

              +
              +
              + + +

              Properties of the Iterator Prototype Object

              +

              The Iterator prototype object:

              +
                +
              • is %Iterator.prototype%.
              • +
              • has a [[Prototype]] internal slot whose value is %Object.prototype%.
              • +
              • is an ordinary object.
              • +
              + +

              All objects defined in this specification that implement the iterator interface also inherit from %Iterator.prototype%. ECMAScript code may also define objects that inherit from %Iterator.prototype%. %Iterator.prototype% provides a place where additional methods that are applicable to all iterator objects may be added.

              +

              The following expression is one way that ECMAScript code can access the %Iterator.prototype% object:

              +
              Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
              +
              + + +

              Iterator.prototype.constructor

              +

              `Iterator.prototype.constructor` is an accessor property with attributes { [[Enumerable]]: *false*, [[Configurable]]: *true* }. The [[Get]] and [[Set]] attributes are defined as follows:

              + + +

              get Iterator.prototype.constructor

              +

              The value of the [[Get]] attribute is a built-in function that requires no arguments. It performs the following steps when called:

              + + 1. Return %Iterator%. + +
              + + +

              set Iterator.prototype.constructor

              +

              The value of the [[Set]] attribute is a built-in function that takes an argument _v_. It performs the following steps when called:

              + + 1. Perform ? SetterThatIgnoresPrototypeProperties(*this* value, %Iterator.prototype%, *"constructor"*, _v_). + 1. Return *undefined*. + +
              + + +

              Unlike the *"constructor"* property on most built-in prototypes, for web-compatibility reasons this property must be an accessor.

              +
              +
              + + +

              Iterator.prototype.drop ( _limit_ )

              +

              This method performs the following steps when called:

              + + 1. Let _O_ be the *this* value. + 1. If _O_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }. + 1. Let _numLimit_ be Completion(ToNumber(_limit_)). + 1. IfAbruptCloseIterator(_numLimit_, _iterated_). + 1. If _numLimit_ is *NaN*, then + 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Let _integerLimit_ be ! ToIntegerOrInfinity(_numLimit_). + 1. If _integerLimit_ < 0, then + 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Set _iterated_ to ? GetIteratorDirect(_O_). + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _integerLimit_ and performs the following steps when called: + 1. Let _remaining_ be _integerLimit_. + 1. Repeat, while _remaining_ > 0, + 1. If _remaining_ ≠ +∞, then + 1. Set _remaining_ to _remaining_ - 1. + 1. Let _next_ be ? IteratorStep(_iterated_). + 1. If _next_ is ~done~, return ReturnCompletion(*undefined*). + 1. Repeat, + 1. Let _value_ be ? IteratorStepValue(_iterated_). + 1. If _value_ is ~done~, return ReturnCompletion(*undefined*). + 1. Let _completion_ be Completion(Yield(_value_)). + 1. IfAbruptCloseIterator(_completion_, _iterated_). + 1. Let _result_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterators]] »). + 1. Set _result_.[[UnderlyingIterators]] to « _iterated_ ». + 1. Return _result_. + +
              + + +

              Iterator.prototype.every ( _predicate_ )

              +

              This method performs the following steps when called:

              + + 1. Let _O_ be the *this* value. + 1. If _O_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }. + 1. If IsCallable(_predicate_) is *false*, then + 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Set _iterated_ to ? GetIteratorDirect(_O_). + 1. Let _counter_ be 0. + 1. Repeat, + 1. Let _value_ be ? IteratorStepValue(_iterated_). + 1. If _value_ is ~done~, return *true*. + 1. Let _result_ be Completion(Call(_predicate_, *undefined*, « _value_, 𝔽(_counter_) »)). + 1. IfAbruptCloseIterator(_result_, _iterated_). + 1. If ToBoolean(_result_) is *false*, return ? IteratorClose(_iterated_, NormalCompletion(*false*)). + 1. Set _counter_ to _counter_ + 1. + +
              + + +

              Iterator.prototype.filter ( _predicate_ )

              +

              This method performs the following steps when called:

              + + 1. Let _O_ be the *this* value. + 1. If _O_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }. + 1. If IsCallable(_predicate_) is *false*, then + 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Set _iterated_ to ? GetIteratorDirect(_O_). + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _predicate_ and performs the following steps when called: + 1. Let _counter_ be 0. + 1. Repeat, + 1. Let _value_ be ? IteratorStepValue(_iterated_). + 1. If _value_ is ~done~, return ReturnCompletion(*undefined*). + 1. Let _selected_ be Completion(Call(_predicate_, *undefined*, « _value_, 𝔽(_counter_) »)). + 1. IfAbruptCloseIterator(_selected_, _iterated_). + 1. If ToBoolean(_selected_) is *true*, then + 1. Let _completion_ be Completion(Yield(_value_)). + 1. IfAbruptCloseIterator(_completion_, _iterated_). + 1. Set _counter_ to _counter_ + 1. + 1. Let _result_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterators]] »). + 1. Set _result_.[[UnderlyingIterators]] to « _iterated_ ». + 1. Return _result_. + +
              + + +

              Iterator.prototype.find ( _predicate_ )

              +

              This method performs the following steps when called:

              + + 1. Let _O_ be the *this* value. + 1. If _O_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }. + 1. If IsCallable(_predicate_) is *false*, then + 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Set _iterated_ to ? GetIteratorDirect(_O_). + 1. Let _counter_ be 0. + 1. Repeat, + 1. Let _value_ be ? IteratorStepValue(_iterated_). + 1. If _value_ is ~done~, return *undefined*. + 1. Let _result_ be Completion(Call(_predicate_, *undefined*, « _value_, 𝔽(_counter_) »)). + 1. IfAbruptCloseIterator(_result_, _iterated_). + 1. If ToBoolean(_result_) is *true*, return ? IteratorClose(_iterated_, NormalCompletion(_value_)). + 1. Set _counter_ to _counter_ + 1. + +
              + + +

              Iterator.prototype.flatMap ( _mapper_ )

              +

              This method performs the following steps when called:

              + + 1. Let _O_ be the *this* value. + 1. If _O_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }. + 1. If IsCallable(_mapper_) is *false*, then + 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Set _iterated_ to ? GetIteratorDirect(_O_). + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _mapper_ and performs the following steps when called: + 1. Let _counter_ be 0. + 1. Repeat, + 1. Let _value_ be ? IteratorStepValue(_iterated_). + 1. If _value_ is ~done~, return ReturnCompletion(*undefined*). + 1. Let _mapped_ be Completion(Call(_mapper_, *undefined*, « _value_, 𝔽(_counter_) »)). + 1. IfAbruptCloseIterator(_mapped_, _iterated_). + 1. Let _innerIterator_ be Completion(GetIteratorFlattenable(_mapped_, ~reject-primitives~)). + 1. IfAbruptCloseIterator(_innerIterator_, _iterated_). + 1. Let _innerAlive_ be *true*. + 1. Repeat, while _innerAlive_ is *true*, + 1. Let _innerValue_ be Completion(IteratorStepValue(_innerIterator_)). + 1. IfAbruptCloseIterator(_innerValue_, _iterated_). + 1. If _innerValue_ is ~done~, then + 1. Set _innerAlive_ to *false*. + 1. Else, + 1. Let _completion_ be Completion(Yield(_innerValue_)). + 1. If _completion_ is an abrupt completion, then + 1. Let _backupCompletion_ be Completion(IteratorClose(_innerIterator_, _completion_)). + 1. IfAbruptCloseIterator(_backupCompletion_, _iterated_). + 1. Return ? IteratorClose(_iterated_, _completion_). + 1. Set _counter_ to _counter_ + 1. + 1. Let _result_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterators]] »). + 1. Set _result_.[[UnderlyingIterators]] to « _iterated_ ». + 1. Return _result_. + +
              + + +

              Iterator.prototype.forEach ( _procedure_ )

              +

              This method performs the following steps when called:

              + + 1. Let _O_ be the *this* value. + 1. If _O_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }. + 1. If IsCallable(_procedure_) is *false*, then + 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Set _iterated_ to ? GetIteratorDirect(_O_). + 1. Let _counter_ be 0. + 1. Repeat, + 1. Let _value_ be ? IteratorStepValue(_iterated_). + 1. If _value_ is ~done~, return *undefined*. + 1. Let _result_ be Completion(Call(_procedure_, *undefined*, « _value_, 𝔽(_counter_) »)). + 1. IfAbruptCloseIterator(_result_, _iterated_). + 1. Set _counter_ to _counter_ + 1. + +
              + + +

              Iterator.prototype.map ( _mapper_ )

              +

              This method performs the following steps when called:

              + + 1. Let _O_ be the *this* value. + 1. If _O_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }. + 1. If IsCallable(_mapper_) is *false*, then + 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Set _iterated_ to ? GetIteratorDirect(_O_). + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _mapper_ and performs the following steps when called: + 1. Let _counter_ be 0. + 1. Repeat, + 1. Let _value_ be ? IteratorStepValue(_iterated_). + 1. If _value_ is ~done~, return ReturnCompletion(*undefined*). + 1. Let _mapped_ be Completion(Call(_mapper_, *undefined*, « _value_, 𝔽(_counter_) »)). + 1. IfAbruptCloseIterator(_mapped_, _iterated_). + 1. Let _completion_ be Completion(Yield(_mapped_)). + 1. IfAbruptCloseIterator(_completion_, _iterated_). + 1. Set _counter_ to _counter_ + 1. + 1. Let _result_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterators]] »). + 1. Set _result_.[[UnderlyingIterators]] to « _iterated_ ». + 1. Return _result_. + +
              + + +

              Iterator.prototype.reduce ( _reducer_ [ , _initialValue_ ] )

              +

              This method performs the following steps when called:

              + + 1. Let _O_ be the *this* value. + 1. If _O_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }. + 1. If IsCallable(_reducer_) is *false*, then + 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Set _iterated_ to ? GetIteratorDirect(_O_). + 1. If _initialValue_ is not present, then + 1. Let _accumulator_ be ? IteratorStepValue(_iterated_). + 1. If _accumulator_ is ~done~, throw a *TypeError* exception. + 1. Let _counter_ be 1. + 1. Else, + 1. Let _accumulator_ be _initialValue_. + 1. Let _counter_ be 0. + 1. Repeat, + 1. Let _value_ be ? IteratorStepValue(_iterated_). + 1. If _value_ is ~done~, return _accumulator_. + 1. Let _result_ be Completion(Call(_reducer_, *undefined*, « _accumulator_, _value_, 𝔽(_counter_) »)). + 1. IfAbruptCloseIterator(_result_, _iterated_). + 1. Set _accumulator_ to _result_. + 1. Set _counter_ to _counter_ + 1. + +
              + + +

              Iterator.prototype.some ( _predicate_ )

              +

              This method performs the following steps when called:

              + + 1. Let _O_ be the *this* value. + 1. If _O_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }. + 1. If IsCallable(_predicate_) is *false*, then + 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Set _iterated_ to ? GetIteratorDirect(_O_). + 1. Let _counter_ be 0. + 1. Repeat, + 1. Let _value_ be ? IteratorStepValue(_iterated_). + 1. If _value_ is ~done~, return *false*. + 1. Let _result_ be Completion(Call(_predicate_, *undefined*, « _value_, 𝔽(_counter_) »)). + 1. IfAbruptCloseIterator(_result_, _iterated_). + 1. If ToBoolean(_result_) is *true*, return ? IteratorClose(_iterated_, NormalCompletion(*true*)). + 1. Set _counter_ to _counter_ + 1. + +
              + + +

              Iterator.prototype.take ( _limit_ )

              +

              This method performs the following steps when called:

              + + 1. Let _O_ be the *this* value. + 1. If _O_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }. + 1. Let _numLimit_ be Completion(ToNumber(_limit_)). + 1. IfAbruptCloseIterator(_numLimit_, _iterated_). + 1. If _numLimit_ is *NaN*, then + 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Let _integerLimit_ be ! ToIntegerOrInfinity(_numLimit_). + 1. If _integerLimit_ < 0, then + 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Set _iterated_ to ? GetIteratorDirect(_O_). + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _integerLimit_ and performs the following steps when called: + 1. Let _remaining_ be _integerLimit_. + 1. Repeat, + 1. If _remaining_ = 0, then + 1. Return ? IteratorClose(_iterated_, ReturnCompletion(*undefined*)). + 1. If _remaining_ ≠ +∞, then + 1. Set _remaining_ to _remaining_ - 1. + 1. Let _value_ be ? IteratorStepValue(_iterated_). + 1. If _value_ is ~done~, return ReturnCompletion(*undefined*). + 1. Let _completion_ be Completion(Yield(_value_)). + 1. IfAbruptCloseIterator(_completion_, _iterated_). + 1. Let _result_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterators]] »). + 1. Set _result_.[[UnderlyingIterators]] to « _iterated_ ». + 1. Return _result_. + +
              + + +

              Iterator.prototype.toArray ( )

              +

              This method performs the following steps when called:

              + + 1. Let _O_ be the *this* value. + 1. If _O_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be ? GetIteratorDirect(_O_). + 1. Let _items_ be a new empty List. + 1. Repeat, + 1. Let _value_ be ? IteratorStepValue(_iterated_). + 1. If _value_ is ~done~, return CreateArrayFromList(_items_). + 1. Append _value_ to _items_. + +
              + + +

              Iterator.prototype [ %Symbol.iterator% ] ( )

              +

              This function performs the following steps when called:

              + + 1. Return the *this* value. + +

              The value of the *"name"* property of this function is *"[Symbol.iterator]"*.

              +
              + + +

              Iterator.prototype [ %Symbol.toStringTag% ]

              +

              `Iterator.prototype[%Symbol.toStringTag%]` is an accessor property with attributes { [[Enumerable]]: *false*, [[Configurable]]: *true* }. The [[Get]] and [[Set]] attributes are defined as follows:

              + + +

              get Iterator.prototype [ %Symbol.toStringTag% ]

              +

              The value of the [[Get]] attribute is a built-in function that requires no arguments. It performs the following steps when called:

              + + 1. Return *"Iterator"*. + +
              + + +

              set Iterator.prototype [ %Symbol.toStringTag% ]

              +

              The value of the [[Set]] attribute is a built-in function that takes an argument _v_. It performs the following steps when called:

              + + 1. Perform ? SetterThatIgnoresPrototypeProperties(*this* value, %Iterator.prototype%, %Symbol.toStringTag%, _v_). + 1. Return *undefined*. + +
              + + +

              Unlike the %Symbol.toStringTag% property on most built-in prototypes, for web-compatibility reasons this property must be an accessor.

              +
              +
              @@ -45900,11 +49036,11 @@

              The %AsyncIteratorPrototype% Object

            • is an ordinary object.
            • -

              All objects defined in this specification that implement the AsyncIterator interface also inherit from %AsyncIteratorPrototype%. ECMAScript code may also define objects that inherit from %AsyncIteratorPrototype%. The %AsyncIteratorPrototype% object provides a place where additional methods that are applicable to all async iterator objects may be added.

              +

              All objects defined in this specification that implement the async iterator interface also inherit from %AsyncIteratorPrototype%. ECMAScript code may also define objects that inherit from %AsyncIteratorPrototype%. The %AsyncIteratorPrototype% object provides a place where additional methods that are applicable to all async iterator objects may be added.

              - -

              %AsyncIteratorPrototype% [ @@asyncIterator ] ( )

              + +

              %AsyncIteratorPrototype% [ %Symbol.asyncIterator% ] ( )

              This function performs the following steps when called:

              1. Return the *this* value. @@ -45915,7 +49051,7 @@

              %AsyncIteratorPrototype% [ @@asyncIterator ] ( )

              Async-from-Sync Iterator Objects

              -

              An Async-from-Sync Iterator object is an async iterator that adapts a specific synchronous iterator. Async-from-Sync Iterator objects are never directly accessible to ECMAScript code. There is not a named constructor for Async-from-Sync Iterator objects. Instead, Async-from-Sync iterator objects are created by the CreateAsyncFromSyncIterator abstract operation as needed.

              +

              An Async-from-Sync Iterator object is an async iterator that adapts a specific synchronous iterator. Async-from-Sync Iterator objects are never directly accessible to ECMAScript code. There is not a named constructor for Async-from-Sync Iterator objects. Instead, Async-from-Sync Iterator objects are created by the CreateAsyncFromSyncIterator abstract operation as needed.

              @@ -45940,14 +49076,14 @@

              The %AsyncFromSyncIteratorPrototype% Object

              The %AsyncFromSyncIteratorPrototype% object:

                -
              • has properties that are inherited by all Async-from-Sync Iterator Objects.
              • +
              • has properties that are inherited by all Async-from-Sync Iterator objects.
              • is an ordinary object.
              • has a [[Prototype]] internal slot whose value is %AsyncIteratorPrototype%.
              • is never directly accessible to ECMAScript code.
              • has the following properties:
              - +

              %AsyncFromSyncIteratorPrototype%.next ( [ _value_ ] )

              1. Let _O_ be the *this* value. @@ -45959,23 +49095,24 @@

              %AsyncFromSyncIteratorPrototype%.next ( [ _value_ ] )

              1. Else, 1. Let _result_ be Completion(IteratorNext(_syncIteratorRecord_)). 1. IfAbruptRejectPromise(_result_, _promiseCapability_). - 1. Return AsyncFromSyncIteratorContinuation(_result_, _promiseCapability_). + 1. Return AsyncFromSyncIteratorContinuation(_result_, _promiseCapability_, _syncIteratorRecord_, *true*).
              - +

              %AsyncFromSyncIteratorPrototype%.return ( [ _value_ ] )

              1. Let _O_ be the *this* value. 1. Assert: _O_ is an Object that has a [[SyncIteratorRecord]] internal slot. 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). - 1. Let _syncIterator_ be _O_.[[SyncIteratorRecord]].[[Iterator]]. + 1. Let _syncIteratorRecord_ be _O_.[[SyncIteratorRecord]]. + 1. Let _syncIterator_ be _syncIteratorRecord_.[[Iterator]]. 1. Let _return_ be Completion(GetMethod(_syncIterator_, *"return"*)). 1. IfAbruptRejectPromise(_return_, _promiseCapability_). 1. If _return_ is *undefined*, then - 1. Let _iterResult_ be CreateIterResultObject(_value_, *true*). - 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _iterResult_ »). + 1. Let _iteratorResult_ be CreateIteratorResultObject(_value_, *true*). + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _iteratorResult_ »). 1. Return _promiseCapability_.[[Promise]]. 1. If _value_ is present, then 1. Let _result_ be Completion(Call(_return_, _syncIterator_, « _value_ »)). @@ -45985,11 +49122,11 @@

              %AsyncFromSyncIteratorPrototype%.return ( [ _value_ ] )

              1. If _result_ is not an Object, then 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « a newly created *TypeError* object »). 1. Return _promiseCapability_.[[Promise]]. - 1. Return AsyncFromSyncIteratorContinuation(_result_, _promiseCapability_). + 1. Return AsyncFromSyncIteratorContinuation(_result_, _promiseCapability_, _syncIteratorRecord_, *false*).
              - +

              %AsyncFromSyncIteratorPrototype%.throw ( [ _value_ ] )

              In this specification, _value_ is always provided, but is left optional for consistency with . @@ -45997,11 +49134,18 @@

              %AsyncFromSyncIteratorPrototype%.throw ( [ _value_ ] )

              1. Let _O_ be the *this* value. 1. Assert: _O_ is an Object that has a [[SyncIteratorRecord]] internal slot. 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). - 1. Let _syncIterator_ be _O_.[[SyncIteratorRecord]].[[Iterator]]. + 1. Let _syncIteratorRecord_ be _O_.[[SyncIteratorRecord]]. + 1. Let _syncIterator_ be _syncIteratorRecord_.[[Iterator]]. 1. Let _throw_ be Completion(GetMethod(_syncIterator_, *"throw"*)). 1. IfAbruptRejectPromise(_throw_, _promiseCapability_). 1. If _throw_ is *undefined*, then - 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _value_ »). + 1. NOTE: If _syncIterator_ does not have a `throw` method, close it to give it a chance to clean up before we reject the capability. + 1. Let _closeCompletion_ be NormalCompletion(~empty~). + 1. Let _result_ be Completion(IteratorClose(_syncIteratorRecord_, _closeCompletion_)). + 1. IfAbruptRejectPromise(_result_, _promiseCapability_). + 1. NOTE: The next step throws a *TypeError* to indicate that there was a protocol violation: _syncIterator_ does not have a `throw` method. + 1. NOTE: If closing _syncIterator_ does not throw then the result of that operation is ignored, even if it yields a rejected promise. + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « a newly created *TypeError* object »). 1. Return _promiseCapability_.[[Promise]]. 1. If _value_ is present, then 1. Let _result_ be Completion(Call(_throw_, _syncIterator_, « _value_ »)). @@ -46011,7 +49155,7 @@

              %AsyncFromSyncIteratorPrototype%.throw ( [ _value_ ] )

              1. If _result_ is not an Object, then 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « a newly created *TypeError* object »). 1. Return _promiseCapability_.[[Promise]]. - 1. Return AsyncFromSyncIteratorContinuation(_result_, _promiseCapability_). + 1. Return AsyncFromSyncIteratorContinuation(_result_, _promiseCapability_, _syncIteratorRecord_, *true*).
              @@ -46054,6 +49198,8 @@

              AsyncFromSyncIteratorContinuation ( _result_: an Object, _promiseCapability_: a PromiseCapability Record for an intrinsic %Promise%, + _syncIteratorRecord_: an Iterator Record, + _closeOnRejection_: a Boolean, ): a Promise

              @@ -46066,12 +49212,21 @@

              1. Let _value_ be Completion(IteratorValue(_result_)). 1. IfAbruptRejectPromise(_value_, _promiseCapability_). 1. Let _valueWrapper_ be Completion(PromiseResolve(%Promise%, _value_)). + 1. If _valueWrapper_ is an abrupt completion, _done_ is *false*, and _closeOnRejection_ is *true*, then + 1. Set _valueWrapper_ to Completion(IteratorClose(_syncIteratorRecord_, _valueWrapper_)). 1. IfAbruptRejectPromise(_valueWrapper_, _promiseCapability_). 1. Let _unwrap_ be a new Abstract Closure with parameters (_v_) that captures _done_ and performs the following steps when called: - 1. Return CreateIterResultObject(_v_, _done_). + 1. Return CreateIteratorResultObject(_v_, _done_). 1. Let _onFulfilled_ be CreateBuiltinFunction(_unwrap_, 1, *""*, « »). 1. NOTE: _onFulfilled_ is used when processing the *"value"* property of an IteratorResult object in order to wait for its value if it is a promise and re-package the result in a new "unwrapped" IteratorResult object. - 1. Perform PerformPromiseThen(_valueWrapper_, _onFulfilled_, *undefined*, _promiseCapability_). + 1. If _done_ is *true*, or if _closeOnRejection_ is *false*, then + 1. Let _onRejected_ be *undefined*. + 1. Else, + 1. Let _closeIterator_ be a new Abstract Closure with parameters (_error_) that captures _syncIteratorRecord_ and performs the following steps when called: + 1. Return ? IteratorClose(_syncIteratorRecord_, ThrowCompletion(_error_)). + 1. Let _onRejected_ be CreateBuiltinFunction(_closeIterator_, 1, *""*, « »). + 1. NOTE: _onRejected_ is used to close the Iterator when the *"value"* property of an IteratorResult object it yields is a rejected promise. + 1. Perform PerformPromiseThen(_valueWrapper_, _onFulfilled_, _onRejected_, _promiseCapability_). 1. Return _promiseCapability_.[[Promise]]. @@ -46105,17 +49260,19 @@

              PromiseCapability Records

              PromiseCapability Records have the fields listed in .

              - Property - - Value - - Requirements -
              + Property + + Value + + Requirements +
              *"done"* @@ -45850,7 +48481,7 @@

              The IteratorResult Interface

              a Boolean
              - This is the result status of an iterator `next` method call. If the end of the iterator was reached *"done"* is *true*. If the end was not reached *"done"* is *false* and a value is available. If a *"done"* property (either own or inherited) does not exist, it is considered to have the value *false*. + This is the result status of an iterator `next` method call. If the end of the iterator was reached *"done"* is *true*. If the end was not reached *"done"* is *false* and a value is available. If a *"done"* property (either own or inherited) does not exist, it is considered to have the value *false*.
              - - - - - + + + + + + +
              - Field Name - - Value - - Meaning -
              + Field Name + + Value + + Meaning +
              [[Promise]] @@ -46164,8 +49321,7 @@

              IfAbruptRejectPromise ( _value_, _capability_ )

              1. If _value_ is an abrupt completion, then 1. Perform ? Call(_capability_.[[Reject]], *undefined*, « _value_.[[Value]] »). 1. Return _capability_.[[Promise]]. - 1. Else, - 1. Set _value_ to ! _value_. + 1. Set _value_ to ! _value_. @@ -46176,17 +49332,19 @@

              PromiseReaction Records

              PromiseReaction Records have the fields listed in .

              - - - - - + + + + + + +
              - Field Name - - Value - - Meaning -
              + Field Name + + Value + + Meaning +
              [[Capability]] @@ -46224,57 +49382,20 @@

              PromiseReaction Records

              - +

              CreateResolvingFunctions ( - _promise_: a Promise, + _toResolve_: a Promise, ): a Record with fields [[Resolve]] (a function object) and [[Reject]] (a function object)

              - 1. Let _alreadyResolved_ be the Record { [[Value]]: *false* }. - 1. Let _stepsResolve_ be the algorithm steps defined in . - 1. Let _lengthResolve_ be the number of non-optional parameters of the function definition in . - 1. Let _resolve_ be CreateBuiltinFunction(_stepsResolve_, _lengthResolve_, *""*, « [[Promise]], [[AlreadyResolved]] »). - 1. Set _resolve_.[[Promise]] to _promise_. - 1. Set _resolve_.[[AlreadyResolved]] to _alreadyResolved_. - 1. Let _stepsReject_ be the algorithm steps defined in . - 1. Let _lengthReject_ be the number of non-optional parameters of the function definition in . - 1. Let _reject_ be CreateBuiltinFunction(_stepsReject_, _lengthReject_, *""*, « [[Promise]], [[AlreadyResolved]] »). - 1. Set _reject_.[[Promise]] to _promise_. - 1. Set _reject_.[[AlreadyResolved]] to _alreadyResolved_. - 1. Return the Record { [[Resolve]]: _resolve_, [[Reject]]: _reject_ }. - - - -

              Promise Reject Functions

              -

              A promise reject function is an anonymous built-in function that has [[Promise]] and [[AlreadyResolved]] internal slots.

              -

              When a promise reject function is called with argument _reason_, the following steps are taken:

              - - 1. Let _F_ be the active function object. - 1. Assert: _F_ has a [[Promise]] internal slot whose value is an Object. - 1. Let _promise_ be _F_.[[Promise]]. - 1. Let _alreadyResolved_ be _F_.[[AlreadyResolved]]. - 1. If _alreadyResolved_.[[Value]] is *true*, return *undefined*. - 1. Set _alreadyResolved_.[[Value]] to *true*. - 1. Perform RejectPromise(_promise_, _reason_). - 1. Return *undefined*. - -

              The *"length"* property of a promise reject function is *1*𝔽.

              -
              - - -

              Promise Resolve Functions

              -

              A promise resolve function is an anonymous built-in function that has [[Promise]] and [[AlreadyResolved]] internal slots.

              -

              When a promise resolve function is called with argument _resolution_, the following steps are taken:

              - - 1. Let _F_ be the active function object. - 1. Assert: _F_ has a [[Promise]] internal slot whose value is an Object. - 1. Let _promise_ be _F_.[[Promise]]. - 1. Let _alreadyResolved_ be _F_.[[AlreadyResolved]]. - 1. If _alreadyResolved_.[[Value]] is *true*, return *undefined*. - 1. Set _alreadyResolved_.[[Value]] to *true*. + 1. Let _promiseOrEmpty_ be the Record { [[Value]]: _toResolve_ }. + 1. Let _resolveSteps_ be a new Abstract Closure with parameters (_resolution_) that captures _promiseOrEmpty_ and performs the following steps when called: + 1. If _promiseOrEmpty_.[[Value]] is ~empty~, return *undefined*. + 1. Let _promise_ be _promiseOrEmpty_.[[Value]]. + 1. Set _promiseOrEmpty_.[[Value]] to ~empty~. 1. If SameValue(_resolution_, _promise_) is *true*, then 1. Let _selfResolutionError_ be a newly created *TypeError* object. 1. Perform RejectPromise(_promise_, _selfResolutionError_). @@ -46294,9 +49415,16 @@

              Promise Resolve Functions

              1. Let _job_ be NewPromiseResolveThenableJob(_promise_, _resolution_, _thenJobCallback_). 1. Perform HostEnqueuePromiseJob(_job_.[[Job]], _job_.[[Realm]]). 1. Return *undefined*. -
              -

              The *"length"* property of a promise resolve function is *1*𝔽.

              -
              + 1. Let _resolve_ be CreateBuiltinFunction(_resolveSteps_, 1, *""*, « »). + 1. Let _rejectSteps_ be a new Abstract Closure with parameters (_reason_) that captures _promiseOrEmpty_ and performs the following steps when called: + 1. If _promiseOrEmpty_.[[Value]] is ~empty~, return *undefined*. + 1. Let _promise_ be _promiseOrEmpty_.[[Value]]. + 1. Set _promiseOrEmpty_.[[Value]] to ~empty~. + 1. Perform RejectPromise(_promise_, _reason_). + 1. Return *undefined*. + 1. Let _reject_ be CreateBuiltinFunction(_rejectSteps_, 1, *""*, « »). + 1. Return the Record { [[Resolve]]: _resolve_, [[Reject]]: _reject_ }. +
              @@ -46309,7 +49437,7 @@

              - 1. Assert: The value of _promise_.[[PromiseState]] is ~pending~. + 1. Assert: _promise_.[[PromiseState]] is ~pending~. 1. Let _reactions_ be _promise_.[[PromiseFulfillReactions]]. 1. Set _promise_.[[PromiseResult]] to _value_. 1. Set _promise_.[[PromiseFulfillReactions]] to *undefined*. @@ -46339,7 +49467,7 @@

              1. If _resolvingFunctions_.[[Reject]] is not *undefined*, throw a *TypeError* exception. 1. Set _resolvingFunctions_.[[Resolve]] to _resolve_. 1. Set _resolvingFunctions_.[[Reject]] to _reject_. - 1. Return *undefined*. + 1. Return NormalCompletion(*undefined*). 1. Let _executor_ be CreateBuiltinFunction(_executorClosure_, 2, *""*, « »). 1. Let _promise_ be ? Construct(_C_, « _executor_ »). 1. If IsCallable(_resolvingFunctions_.[[Resolve]]) is *false*, throw a *TypeError* exception. @@ -46378,7 +49506,7 @@

              - 1. Assert: The value of _promise_.[[PromiseState]] is ~pending~. + 1. Assert: _promise_.[[PromiseState]] is ~pending~. 1. Let _reactions_ be _promise_.[[PromiseRejectReactions]]. 1. Set _promise_.[[PromiseResult]] to _reason_. 1. Set _promise_.[[PromiseFulfillReactions]] to *undefined*. @@ -46472,8 +49600,7 @@

              1. Assert: _promiseCapability_ is a PromiseCapability Record. 1. If _handlerResult_ is an abrupt completion, then 1. Return ? Call(_promiseCapability_.[[Reject]], *undefined*, « _handlerResult_.[[Value]] »). - 1. Else, - 1. Return ? Call(_promiseCapability_.[[Resolve]], *undefined*, « _handlerResult_.[[Value]] »). + 1. Return ? Call(_promiseCapability_.[[Resolve]], *undefined*, « _handlerResult_.[[Value]] »). 1. Let _handlerRealm_ be *null*. 1. If _reaction_.[[Handler]] is not ~empty~, then 1. Let _getHandlerRealmResult_ be Completion(GetFunctionRealm(_reaction_.[[Handler]].[[Callback]])). @@ -46500,7 +49627,7 @@

              1. Let _thenCallResult_ be Completion(HostCallJobCallback(_then_, _thenable_, « _resolvingFunctions_.[[Resolve]], _resolvingFunctions_.[[Reject]] »)). 1. If _thenCallResult_ is an abrupt completion, then 1. Return ? Call(_resolvingFunctions_.[[Reject]], *undefined*, « _thenCallResult_.[[Value]] »). - 1. Return ? _thenCallResult_. + 1. Return ! _thenCallResult_. 1. Let _getThenRealmResult_ be Completion(GetFunctionRealm(_then_.[[Callback]])). 1. If _getThenRealmResult_ is a normal completion, let _thenRealm_ be _getThenRealmResult_.[[Value]]. 1. Else, let _thenRealm_ be the current Realm Record. @@ -46524,7 +49651,7 @@

              The Promise Constructor

            • may be used as the value in an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified Promise behaviour must include a `super` call to the Promise constructor to create and initialize the subclass instance with the internal state necessary to support the `Promise` and `Promise.prototype` built-in methods.
            • - +

              Promise ( _executor_ )

              This function performs the following steps when called:

              @@ -46532,6 +49659,7 @@

              Promise ( _executor_ )

              1. If IsCallable(_executor_) is *false*, throw a *TypeError* exception. 1. Let _promise_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%Promise.prototype%"*, « [[PromiseState]], [[PromiseResult]], [[PromiseFulfillReactions]], [[PromiseRejectReactions]], [[PromiseIsHandled]] »). 1. Set _promise_.[[PromiseState]] to ~pending~. + 1. Set _promise_.[[PromiseResult]] to ~empty~. 1. Set _promise_.[[PromiseFulfillReactions]] to a new empty List. 1. Set _promise_.[[PromiseRejectReactions]] to a new empty List. 1. Set _promise_.[[PromiseIsHandled]] to *false*. @@ -46558,7 +49686,7 @@

              Properties of the Promise Constructor

            • has the following properties:
            • - +

              Promise.all ( _iterable_ )

              This function returns a new promise which is fulfilled with an array of fulfillment values for the passed promises, or rejects with the reason of the first passed promise that rejects. It resolves all elements of the passed iterable to promises as it runs this algorithm.

              @@ -46572,7 +49700,7 @@

              Promise.all ( _iterable_ )

              1. If _result_ is an abrupt completion, then 1. If _iteratorRecord_.[[Done]] is *false*, set _result_ to Completion(IteratorClose(_iteratorRecord_, _result_)). 1. IfAbruptRejectPromise(_result_, _promiseCapability_). - 1. Return ? _result_. + 1. Return ! _result_.

              This function requires its *this* value to be a constructor function that supports the parameter conventions of the Promise constructor.

              @@ -46593,7 +49721,7 @@

              - +

              PerformPromiseAll ( _iteratorRecord_: an Iterator Record, @@ -46606,6 +49734,7 @@

              1. Let _values_ be a new empty List. + 1. [declared="remainingElementsCount"] NOTE: _remainingElementsCount_ starts at 1 instead of 0 to ensure _resultCapability_.[[Resolve]] is only called once, even in the presence of a misbehaving *"then"* which calls the passed callback before the input iterator is exhausted. 1. Let _remainingElementsCount_ be the Record { [[Value]]: 1 }. 1. Let _index_ be 0. 1. Repeat, @@ -46618,44 +49747,28 @@

              1. Return _resultCapability_.[[Promise]]. 1. Append *undefined* to _values_. 1. Let _nextPromise_ be ? Call(_promiseResolve_, _constructor_, « _next_ »). - 1. Let _steps_ be the algorithm steps defined in . - 1. Let _length_ be the number of non-optional parameters of the function definition in . - 1. Let _onFulfilled_ be CreateBuiltinFunction(_steps_, _length_, *""*, « [[AlreadyCalled]], [[Index]], [[Values]], [[Capability]], [[RemainingElements]] »). + 1. Let _fulfilledSteps_ be a new Abstract Closure with parameters (_value_) that captures _values_, _resultCapability_, and _remainingElementsCount_ and performs the following steps when called: + 1. Let _F_ be the active function object. + 1. If _F_.[[AlreadyCalled]] is *true*, return *undefined*. + 1. Set _F_.[[AlreadyCalled]] to *true*. + 1. Let _thisIndex_ be _F_.[[Index]]. + 1. Set _values_[_thisIndex_] to _value_. + 1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1. + 1. If _remainingElementsCount_.[[Value]] = 0, then + 1. Let _valuesArray_ be CreateArrayFromList(_values_). + 1. Return ? Call(_resultCapability_.[[Resolve]], *undefined*, « _valuesArray_ »). + 1. Return *undefined*. + 1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledSteps_, 1, *""*, « [[AlreadyCalled]], [[Index]] »). 1. Set _onFulfilled_.[[AlreadyCalled]] to *false*. 1. Set _onFulfilled_.[[Index]] to _index_. - 1. Set _onFulfilled_.[[Values]] to _values_. - 1. Set _onFulfilled_.[[Capability]] to _resultCapability_. - 1. Set _onFulfilled_.[[RemainingElements]] to _remainingElementsCount_. + 1. Set _index_ to _index_ + 1. 1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] + 1. 1. Perform ? Invoke(_nextPromise_, *"then"*, « _onFulfilled_, _resultCapability_.[[Reject]] »). - 1. Set _index_ to _index_ + 1. - - -

              `Promise.all` Resolve Element Functions

              -

              A `Promise.all` resolve element function is an anonymous built-in function that is used to resolve a specific `Promise.all` element. Each `Promise.all` resolve element function has [[Index]], [[Values]], [[Capability]], [[RemainingElements]], and [[AlreadyCalled]] internal slots.

              -

              When a `Promise.all` resolve element function is called with argument _x_, the following steps are taken:

              - - 1. Let _F_ be the active function object. - 1. If _F_.[[AlreadyCalled]] is *true*, return *undefined*. - 1. Set _F_.[[AlreadyCalled]] to *true*. - 1. Let _index_ be _F_.[[Index]]. - 1. Let _values_ be _F_.[[Values]]. - 1. Let _promiseCapability_ be _F_.[[Capability]]. - 1. Let _remainingElementsCount_ be _F_.[[RemainingElements]]. - 1. Set _values_[_index_] to _x_. - 1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1. - 1. If _remainingElementsCount_.[[Value]] = 0, then - 1. Let _valuesArray_ be CreateArrayFromList(_values_). - 1. Return ? Call(_promiseCapability_.[[Resolve]], *undefined*, « _valuesArray_ »). - 1. Return *undefined*. - -

              The *"length"* property of a `Promise.all` resolve element function is *1*𝔽.

              -
              - +

              Promise.allSettled ( _iterable_ )

              This function returns a promise that is fulfilled with an array of promise state snapshots, but only after all the original promises have settled, i.e. become either fulfilled or rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.

              @@ -46669,13 +49782,13 @@

              Promise.allSettled ( _iterable_ )

              1. If _result_ is an abrupt completion, then 1. If _iteratorRecord_.[[Done]] is *false*, set _result_ to Completion(IteratorClose(_iteratorRecord_, _result_)). 1. IfAbruptRejectPromise(_result_, _promiseCapability_). - 1. Return ? _result_. + 1. Return ! _result_.

              This function requires its *this* value to be a constructor function that supports the parameter conventions of the Promise constructor.

              - +

              PerformPromiseAllSettled ( _iteratorRecord_: an Iterator Record, @@ -46688,6 +49801,7 @@

              1. Let _values_ be a new empty List. + 1. [declared="remainingElementsCount"] NOTE: _remainingElementsCount_ starts at 1 instead of 0 to ensure _resultCapability_.[[Resolve]] is only called once, even in the presence of a misbehaving *"then"* which calls one of the passed callbacks before the input iterator is exhausted. 1. Let _remainingElementsCount_ be the Record { [[Value]]: 1 }. 1. Let _index_ be 0. 1. Repeat, @@ -46700,83 +49814,49 @@

              1. Return _resultCapability_.[[Promise]]. 1. Append *undefined* to _values_. 1. Let _nextPromise_ be ? Call(_promiseResolve_, _constructor_, « _next_ »). - 1. Let _stepsFulfilled_ be the algorithm steps defined in . - 1. Let _lengthFulfilled_ be the number of non-optional parameters of the function definition in . - 1. Let _onFulfilled_ be CreateBuiltinFunction(_stepsFulfilled_, _lengthFulfilled_, *""*, « [[AlreadyCalled]], [[Index]], [[Values]], [[Capability]], [[RemainingElements]] »). 1. Let _alreadyCalled_ be the Record { [[Value]]: *false* }. + 1. Let _fulfilledSteps_ be a new Abstract Closure with parameters (_value_) that captures _values_, _resultCapability_, and _remainingElementsCount_ and performs the following steps when called: + 1. Let _F_ be the active function object. + 1. If _F_.[[AlreadyCalled]].[[Value]] is *true*, return *undefined*. + 1. Set _F_.[[AlreadyCalled]].[[Value]] to *true*. + 1. Let _obj_ be OrdinaryObjectCreate(%Object.prototype%). + 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"status"*, *"fulfilled"*). + 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"value"*, _value_). + 1. Let _thisIndex_ be _F_.[[Index]]. + 1. Set _values_[_thisIndex_] to _obj_. + 1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1. + 1. If _remainingElementsCount_.[[Value]] = 0, then + 1. Let _valuesArray_ be CreateArrayFromList(_values_). + 1. Return ? Call(_resultCapability_.[[Resolve]], *undefined*, « _valuesArray_ »). + 1. Return *undefined*. + 1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledSteps_, 1, *""*, « [[AlreadyCalled]], [[Index]] »). 1. Set _onFulfilled_.[[AlreadyCalled]] to _alreadyCalled_. 1. Set _onFulfilled_.[[Index]] to _index_. - 1. Set _onFulfilled_.[[Values]] to _values_. - 1. Set _onFulfilled_.[[Capability]] to _resultCapability_. - 1. Set _onFulfilled_.[[RemainingElements]] to _remainingElementsCount_. - 1. Let _stepsRejected_ be the algorithm steps defined in . - 1. Let _lengthRejected_ be the number of non-optional parameters of the function definition in . - 1. Let _onRejected_ be CreateBuiltinFunction(_stepsRejected_, _lengthRejected_, *""*, « [[AlreadyCalled]], [[Index]], [[Values]], [[Capability]], [[RemainingElements]] »). + 1. Let _rejectedSteps_ be a new Abstract Closure with parameters (_error_) that captures _values_, _resultCapability_, and _remainingElementsCount_ and performs the following steps when called: + 1. Let _F_ be the active function object. + 1. If _F_.[[AlreadyCalled]].[[Value]] is *true*, return *undefined*. + 1. Set _F_.[[AlreadyCalled]].[[Value]] to *true*. + 1. Let _obj_ be OrdinaryObjectCreate(%Object.prototype%). + 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"status"*, *"rejected"*). + 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"reason"*, _error_). + 1. Let _thisIndex_ be _F_.[[Index]]. + 1. Set _values_[_thisIndex_] to _obj_. + 1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1. + 1. If _remainingElementsCount_.[[Value]] = 0, then + 1. Let _valuesArray_ be CreateArrayFromList(_values_). + 1. Return ? Call(_resultCapability_.[[Resolve]], *undefined*, « _valuesArray_ »). + 1. Return *undefined*. + 1. Let _onRejected_ be CreateBuiltinFunction(_rejectedSteps_, 1, *""*, « [[AlreadyCalled]], [[Index]] »). 1. Set _onRejected_.[[AlreadyCalled]] to _alreadyCalled_. 1. Set _onRejected_.[[Index]] to _index_. - 1. Set _onRejected_.[[Values]] to _values_. - 1. Set _onRejected_.[[Capability]] to _resultCapability_. - 1. Set _onRejected_.[[RemainingElements]] to _remainingElementsCount_. + 1. Set _index_ to _index_ + 1. 1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] + 1. 1. Perform ? Invoke(_nextPromise_, *"then"*, « _onFulfilled_, _onRejected_ »). - 1. Set _index_ to _index_ + 1. - - - - -

              `Promise.allSettled` Resolve Element Functions

              -

              A `Promise.allSettled` resolve element function is an anonymous built-in function that is used to resolve a specific `Promise.allSettled` element. Each `Promise.allSettled` resolve element function has [[Index]], [[Values]], [[Capability]], [[RemainingElements]], and [[AlreadyCalled]] internal slots.

              -

              When a `Promise.allSettled` resolve element function is called with argument _x_, the following steps are taken:

              - - 1. Let _F_ be the active function object. - 1. Let _alreadyCalled_ be _F_.[[AlreadyCalled]]. - 1. If _alreadyCalled_.[[Value]] is *true*, return *undefined*. - 1. Set _alreadyCalled_.[[Value]] to *true*. - 1. Let _index_ be _F_.[[Index]]. - 1. Let _values_ be _F_.[[Values]]. - 1. Let _promiseCapability_ be _F_.[[Capability]]. - 1. Let _remainingElementsCount_ be _F_.[[RemainingElements]]. - 1. Let _obj_ be OrdinaryObjectCreate(%Object.prototype%). - 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"status"*, *"fulfilled"*). - 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"value"*, _x_). - 1. Set _values_[_index_] to _obj_. - 1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1. - 1. If _remainingElementsCount_.[[Value]] = 0, then - 1. Let _valuesArray_ be CreateArrayFromList(_values_). - 1. Return ? Call(_promiseCapability_.[[Resolve]], *undefined*, « _valuesArray_ »). - 1. Return *undefined*. - -

              The *"length"* property of a `Promise.allSettled` resolve element function is *1*𝔽.

              -
              - - -

              `Promise.allSettled` Reject Element Functions

              -

              A `Promise.allSettled` reject element function is an anonymous built-in function that is used to reject a specific `Promise.allSettled` element. Each `Promise.allSettled` reject element function has [[Index]], [[Values]], [[Capability]], [[RemainingElements]], and [[AlreadyCalled]] internal slots.

              -

              When a `Promise.allSettled` reject element function is called with argument _x_, the following steps are taken:

              - - 1. Let _F_ be the active function object. - 1. Let _alreadyCalled_ be _F_.[[AlreadyCalled]]. - 1. If _alreadyCalled_.[[Value]] is *true*, return *undefined*. - 1. Set _alreadyCalled_.[[Value]] to *true*. - 1. Let _index_ be _F_.[[Index]]. - 1. Let _values_ be _F_.[[Values]]. - 1. Let _promiseCapability_ be _F_.[[Capability]]. - 1. Let _remainingElementsCount_ be _F_.[[RemainingElements]]. - 1. Let _obj_ be OrdinaryObjectCreate(%Object.prototype%). - 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"status"*, *"rejected"*). - 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"reason"*, _x_). - 1. Set _values_[_index_] to _obj_. - 1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1. - 1. If _remainingElementsCount_.[[Value]] = 0, then - 1. Let _valuesArray_ be CreateArrayFromList(_values_). - 1. Return ? Call(_promiseCapability_.[[Resolve]], *undefined*, « _valuesArray_ »). - 1. Return *undefined*. -

              The *"length"* property of a `Promise.allSettled` reject element function is *1*𝔽.

              - +

              Promise.any ( _iterable_ )

              This function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an `AggregateError` holding the rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.

              @@ -46790,13 +49870,13 @@

              Promise.any ( _iterable_ )

              1. If _result_ is an abrupt completion, then 1. If _iteratorRecord_.[[Done]] is *false*, set _result_ to Completion(IteratorClose(_iteratorRecord_, _result_)). 1. IfAbruptRejectPromise(_result_, _promiseCapability_). - 1. Return ? _result_. + 1. Return ! _result_.

              This function requires its *this* value to be a constructor function that supports the parameter conventions of the `Promise` constructor.

              - +

              PerformPromiseAny ( _iteratorRecord_: an Iterator Record, @@ -46809,6 +49889,7 @@

              1. Let _errors_ be a new empty List. + 1. [declared="remainingElementsCount"] NOTE: _remainingElementsCount_ starts at 1 instead of 0 to ensure _resultCapability_.[[Reject]] is only called once, even in the presence of a misbehaving *"then"* which calls the passed callback before the input iterator is exhausted. 1. Let _remainingElementsCount_ be the Record { [[Value]]: 1 }. 1. Let _index_ be 0. 1. Repeat, @@ -46816,48 +49897,32 @@

              1. If _next_ is ~done~, then 1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1. 1. If _remainingElementsCount_.[[Value]] = 0, then - 1. Let _error_ be a newly created *AggregateError* object. - 1. Perform ! DefinePropertyOrThrow(_error_, *"errors"*, PropertyDescriptor { [[Configurable]]: *true*, [[Enumerable]]: *false*, [[Writable]]: *true*, [[Value]]: CreateArrayFromList(_errors_) }). - 1. Return ThrowCompletion(_error_). + 1. Let _aggregateError_ be a newly created *AggregateError* object. + 1. Perform ! DefinePropertyOrThrow(_aggregateError_, *"errors"*, PropertyDescriptor { [[Configurable]]: *true*, [[Enumerable]]: *false*, [[Writable]]: *true*, [[Value]]: CreateArrayFromList(_errors_) }). + 1. Perform ? Call(_resultCapability_.[[Reject]], *undefined*, « _aggregateError_ »). 1. Return _resultCapability_.[[Promise]]. 1. Append *undefined* to _errors_. 1. Let _nextPromise_ be ? Call(_promiseResolve_, _constructor_, « _next_ »). - 1. Let _stepsRejected_ be the algorithm steps defined in . - 1. Let _lengthRejected_ be the number of non-optional parameters of the function definition in . - 1. Let _onRejected_ be CreateBuiltinFunction(_stepsRejected_, _lengthRejected_, *""*, « [[AlreadyCalled]], [[Index]], [[Errors]], [[Capability]], [[RemainingElements]] »). + 1. Let _rejectedSteps_ be a new Abstract Closure with parameters (_error_) that captures _errors_, _resultCapability_, and _remainingElementsCount_ and performs the following steps when called: + 1. Let _F_ be the active function object. + 1. If _F_.[[AlreadyCalled]] is *true*, return *undefined*. + 1. Set _F_.[[AlreadyCalled]] to *true*. + 1. Let _thisIndex_ be _F_.[[Index]]. + 1. Set _errors_[_thisIndex_] to _error_. + 1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1. + 1. If _remainingElementsCount_.[[Value]] = 0, then + 1. Let _aggregateError_ be a newly created *AggregateError* object. + 1. Perform ! DefinePropertyOrThrow(_aggregateError_, *"errors"*, PropertyDescriptor { [[Configurable]]: *true*, [[Enumerable]]: *false*, [[Writable]]: *true*, [[Value]]: CreateArrayFromList(_errors_) }). + 1. Return ? Call(_resultCapability_.[[Reject]], *undefined*, « _aggregateError_ »). + 1. Return *undefined*. + 1. Let _onRejected_ be CreateBuiltinFunction(_rejectedSteps_, 1, *""*, « [[AlreadyCalled]], [[Index]] »). 1. Set _onRejected_.[[AlreadyCalled]] to *false*. 1. Set _onRejected_.[[Index]] to _index_. - 1. Set _onRejected_.[[Errors]] to _errors_. - 1. Set _onRejected_.[[Capability]] to _resultCapability_. - 1. Set _onRejected_.[[RemainingElements]] to _remainingElementsCount_. + 1. Set _index_ to _index_ + 1. 1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] + 1. 1. Perform ? Invoke(_nextPromise_, *"then"*, « _resultCapability_.[[Resolve]], _onRejected_ »). - 1. Set _index_ to _index_ + 1. - - -

              `Promise.any` Reject Element Functions

              -

              A `Promise.any` reject element function is an anonymous built-in function that is used to reject a specific `Promise.any` element. Each `Promise.any` reject element function has [[Index]], [[Errors]], [[Capability]], [[RemainingElements]], and [[AlreadyCalled]] internal slots.

              -

              When a `Promise.any` reject element function is called with argument _x_, the following steps are taken:

              - - 1. Let _F_ be the active function object. - 1. If _F_.[[AlreadyCalled]] is *true*, return *undefined*. - 1. Set _F_.[[AlreadyCalled]] to *true*. - 1. Let _index_ be _F_.[[Index]]. - 1. Let _errors_ be _F_.[[Errors]]. - 1. Let _promiseCapability_ be _F_.[[Capability]]. - 1. Let _remainingElementsCount_ be _F_.[[RemainingElements]]. - 1. Set _errors_[_index_] to _x_. - 1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1. - 1. If _remainingElementsCount_.[[Value]] = 0, then - 1. Let _error_ be a newly created *AggregateError* object. - 1. Perform ! DefinePropertyOrThrow(_error_, *"errors"*, PropertyDescriptor { [[Configurable]]: *true*, [[Enumerable]]: *false*, [[Writable]]: *true*, [[Value]]: CreateArrayFromList(_errors_) }). - 1. Return ? Call(_promiseCapability_.[[Reject]], *undefined*, « _error_ »). - 1. Return *undefined*. - -

              The *"length"* property of a `Promise.any` reject element function is *1*𝔽.

              -
              @@ -46866,7 +49931,7 @@

              Promise.prototype

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

              - +

              Promise.race ( _iterable_ )

              This function returns a new promise which is settled in the same way as the first passed promise to settle. It resolves all elements of the passed _iterable_ to promises as it runs this algorithm.

              @@ -46880,7 +49945,7 @@

              Promise.race ( _iterable_ )

              1. If _result_ is an abrupt completion, then 1. If _iteratorRecord_.[[Done]] is *false*, set _result_ to Completion(IteratorClose(_iteratorRecord_, _result_)). 1. IfAbruptRejectPromise(_result_, _promiseCapability_). - 1. Return ? _result_. + 1. Return ! _result_.

              If the _iterable_ argument yields no values or if none of the promises yielded by _iterable_ ever settle, then the pending promise returned by this method will never be settled.

              @@ -46911,7 +49976,7 @@

              - +

              Promise.reject ( _r_ )

              This function returns a new promise rejected with the passed argument.

              @@ -46925,7 +49990,7 @@

              Promise.reject ( _r_ )

              - +

              Promise.resolve ( _x_ )

              This function returns either a new promise resolved with the passed argument, or the argument itself if the argument is a promise produced by this constructor.

              @@ -46940,7 +50005,7 @@

              Promise.resolve ( _x_ )

              PromiseResolve ( - _C_: a constructor, + _C_: an Object, _x_: an ECMAScript language value, ): either a normal completion containing an ECMAScript language value or a throw completion

              @@ -46959,7 +50024,26 @@

              - + +

              Promise.try ( _callback_, ..._args_ )

              +

              This function performs the following steps when called:

              + + 1. Let _C_ be the *this* value. + 1. If _C_ is not an Object, throw a *TypeError* exception. + 1. Let _promiseCapability_ be ? NewPromiseCapability(_C_). + 1. Let _status_ be Completion(Call(_callback_, *undefined*, _args_)). + 1. If _status_ is an abrupt completion, then + 1. Perform ? Call(_promiseCapability_.[[Reject]], *undefined*, « _status_.[[Value]] »). + 1. Else, + 1. Perform ? Call(_promiseCapability_.[[Resolve]], *undefined*, « _status_.[[Value]] »). + 1. Return _promiseCapability_.[[Promise]]. + + +

              This function expects its *this* value to be a constructor function that supports the parameter conventions of the Promise constructor.

              +
              +
              + +

              Promise.withResolvers ( )

              This function returns an object with three properties: a new promise together with the `resolve` and `reject` functions associated with it.

              @@ -46973,15 +50057,15 @@

              Promise.withResolvers ( )

              - -

              get Promise [ @@species ]

              -

              `Promise[@@species]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

              + +

              get Promise [ %Symbol.species% ]

              +

              `Promise[%Symbol.species%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

              1. Return the *this* value.

              The value of the *"name"* property of this function is *"get [Symbol.species]"*.

              -

              Promise prototype methods normally use their *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour by redefining its @@species property.

              +

              Promise prototype methods normally use their *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour by redefining its %Symbol.species% property.

              @@ -46996,7 +50080,7 @@

              Properties of the Promise Prototype Object

            • does not have a [[PromiseState]] internal slot or any of the other internal slots of Promise instances.
            • - +

              Promise.prototype.catch ( _onRejected_ )

              This method performs the following steps when called:

              @@ -47010,7 +50094,7 @@

              Promise.prototype.constructor

              The initial value of `Promise.prototype.constructor` is %Promise%.

              - +

              Promise.prototype.finally ( _onFinally_ )

              This method performs the following steps when called:

              @@ -47026,7 +50110,7 @@

              Promise.prototype.finally ( _onFinally_ )

              1. Let _result_ be ? Call(_onFinally_, *undefined*). 1. Let _p_ be ? PromiseResolve(_C_, _result_). 1. Let _returnValue_ be a new Abstract Closure with no parameters that captures _value_ and performs the following steps when called: - 1. Return _value_. + 1. Return NormalCompletion(_value_). 1. Let _valueThunk_ be CreateBuiltinFunction(_returnValue_, 0, *""*, « »). 1. Return ? Invoke(_p_, *"then"*, « _valueThunk_ »). 1. Let _thenFinally_ be CreateBuiltinFunction(_thenFinallyClosure_, 1, *""*, « »). @@ -47042,7 +50126,7 @@

              Promise.prototype.finally ( _onFinally_ )

              - +

              Promise.prototype.then ( _onFulfilled_, _onRejected_ )

              This method performs the following steps when called:

              @@ -47088,23 +50172,21 @@

              1. Let _fulfillJob_ be NewPromiseReactionJob(_fulfillReaction_, _value_). 1. Perform HostEnqueuePromiseJob(_fulfillJob_.[[Job]], _fulfillJob_.[[Realm]]). 1. Else, - 1. Assert: The value of _promise_.[[PromiseState]] is ~rejected~. + 1. Assert: _promise_.[[PromiseState]] is ~rejected~. 1. Let _reason_ be _promise_.[[PromiseResult]]. 1. If _promise_.[[PromiseIsHandled]] is *false*, perform HostPromiseRejectionTracker(_promise_, *"handle"*). 1. Let _rejectJob_ be NewPromiseReactionJob(_rejectReaction_, _reason_). 1. Perform HostEnqueuePromiseJob(_rejectJob_.[[Job]], _rejectJob_.[[Realm]]). 1. Set _promise_.[[PromiseIsHandled]] to *true*. - 1. If _resultCapability_ is *undefined*, then - 1. Return *undefined*. - 1. Else, - 1. Return _resultCapability_.[[Promise]]. + 1. If _resultCapability_ is *undefined*, return *undefined*. + 1. Return _resultCapability_.[[Promise]]. - -

              Promise.prototype [ @@toStringTag ]

              -

              The initial value of the @@toStringTag property is the String value *"Promise"*.

              + +

              Promise.prototype [ %Symbol.toStringTag% ]

              +

              The initial value of the %Symbol.toStringTag% property is the String value *"Promise"*.

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              @@ -47114,17 +50196,19 @@

              Properties of Promise Instances

              Promise instances are ordinary objects that inherit properties from the Promise prototype object (the intrinsic, %Promise.prototype%). Promise instances are initially created with the internal slots described in .

              - - - - - + + + + + + + @@ -47202,7 +50286,7 @@

              The GeneratorFunction Constructor

            • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified GeneratorFunction behaviour must include a `super` call to the GeneratorFunction constructor to create and initialize subclass instances with the internal slots necessary for built-in GeneratorFunction behaviour. All ECMAScript syntactic forms for defining generator function objects create direct instances of GeneratorFunction. There is no syntactic means to create instances of GeneratorFunction subclasses.
            • - +

              GeneratorFunction ( ..._parameterArgs_, _bodyArg_ )

              The last argument (if any) specifies the body (executable code) of a generator function; any preceding arguments specify formal parameters.

              This function performs the following steps when called:

              @@ -47257,9 +50341,9 @@

              GeneratorFunction.prototype.prototype

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              - -

              GeneratorFunction.prototype [ @@toStringTag ]

              -

              The initial value of the @@toStringTag property is the String value *"GeneratorFunction"*.

              + +

              GeneratorFunction.prototype [ %Symbol.toStringTag% ]

              +

              The initial value of the %Symbol.toStringTag% property is the String value *"GeneratorFunction"*.

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              @@ -47304,7 +50388,7 @@

              The AsyncGeneratorFunction Constructor

            • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified AsyncGeneratorFunction behaviour must include a `super` call to the AsyncGeneratorFunction constructor to create and initialize subclass instances with the internal slots necessary for built-in AsyncGeneratorFunction behaviour. All ECMAScript syntactic forms for defining async generator function objects create direct instances of AsyncGeneratorFunction. There is no syntactic means to create instances of AsyncGeneratorFunction subclasses.
            • - +

              AsyncGeneratorFunction ( ..._parameterArgs_, _bodyArg_ )

              The last argument (if any) specifies the body (executable code) of an async generator function; any preceding arguments specify formal parameters.

              This function performs the following steps when called:

              @@ -47359,9 +50443,9 @@

              AsyncGeneratorFunction.prototype.prototype

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              - -

              AsyncGeneratorFunction.prototype [ @@toStringTag ]

              -

              The initial value of the @@toStringTag property is the String value *"AsyncGeneratorFunction"*.

              + +

              AsyncGeneratorFunction.prototype [ %Symbol.toStringTag% ]

              +

              The initial value of the %Symbol.toStringTag% property is the String value *"AsyncGeneratorFunction"*.

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              @@ -47395,7 +50479,7 @@

              prototype

              Generator Objects

              -

              A Generator is created by calling a generator function and conforms to both the Iterator and Iterable interfaces.

              +

              A Generator is created by calling a generator function and conforms to both the iterator interface and the iterable interface.

              Generator instances directly inherit properties from the initial value of the *"prototype"* property of the generator function that created the instance. Generator instances indirectly inherit properties from %GeneratorPrototype%.

              @@ -47405,7 +50489,7 @@

              The %GeneratorPrototype% Object

            • is %GeneratorFunction.prototype.prototype%.
            • is an ordinary object.
            • is not a Generator instance and does not have a [[GeneratorState]] internal slot.
            • -
            • has a [[Prototype]] internal slot whose value is %IteratorPrototype%.
            • +
            • has a [[Prototype]] internal slot whose value is %Iterator.prototype%.
            • has properties that are indirectly inherited by all Generator instances.
            • @@ -47415,24 +50499,24 @@

              %GeneratorPrototype%.constructor

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              - +

              %GeneratorPrototype%.next ( _value_ )

              1. Return ? GeneratorResume(*this* value, _value_, ~empty~).
              - +

              %GeneratorPrototype%.return ( _value_ )

              This method performs the following steps when called:

              1. Let _g_ be the *this* value. - 1. Let _C_ be Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. + 1. Let _C_ be ReturnCompletion(_value_). 1. Return ? GeneratorResumeAbrupt(_g_, _C_, ~empty~).
              - +

              %GeneratorPrototype%.throw ( _exception_ )

              This method performs the following steps when called:

              @@ -47442,9 +50526,9 @@

              %GeneratorPrototype%.throw ( _exception_ )

              - -

              %GeneratorPrototype% [ @@toStringTag ]

              -

              The initial value of the @@toStringTag property is the String value *"Generator"*.

              + +

              %GeneratorPrototype% [ %Symbol.toStringTag% ]

              +

              The initial value of the %Symbol.toStringTag% property is the String value *"Generator"*.

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              @@ -47454,23 +50538,25 @@

              Properties of Generator Instances

              Generator instances are initially created with the internal slots described in .

              - Internal Slot - - Type - - Description -
              + Internal Slot + + Type + + Description +
              [[PromiseState]] @@ -47141,10 +50225,10 @@

              Properties of Promise Instances

              [[PromiseResult]]
              - an ECMAScript language value + an ECMAScript language value or ~empty~ - The value with which the promise has been fulfilled or rejected, if any. Only meaningful if [[PromiseState]] is not ~pending~. + The value with which the promise has been fulfilled or rejected, if any. ~empty~ if and only if the [[PromiseState]] is ~pending~.
              - - - - - + + + + + + +
              - Internal Slot - - Type - - Description -
              + Internal Slot + + Type + + Description +
              [[GeneratorState]] - *undefined*, ~suspended-start~, ~suspended-yield~, ~executing~, or ~completed~ + ~suspended-start~, ~suspended-yield~, ~executing~, or ~completed~ The current execution state of the generator. @@ -47515,7 +50601,7 @@

              - 1. Assert: The value of _generator_.[[GeneratorState]] is *undefined*. + 1. Assert: _generator_.[[GeneratorState]] is ~suspended-start~. 1. Let _genContext_ be the running execution context. 1. Set the Generator component of _genContext_ to _generator_. 1. Let _closure_ be a new Abstract Closure with no parameters that captures _generatorBody_ and performs the following steps when called: @@ -47525,7 +50611,7 @@

              1. Let _result_ be Completion(Evaluation of _generatorBody_). 1. Else, 1. Assert: _generatorBody_ is an Abstract Closure with no parameters. - 1. Let _result_ be _generatorBody_(). + 1. Let _result_ be Completion(_generatorBody_()). 1. Assert: If we return here, the generator either threw an exception or performed either an implicit or explicit return. 1. Remove _acGenContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context. 1. Set _acGenerator_.[[GeneratorState]] to ~completed~. @@ -47537,10 +50623,9 @@

              1. Else, 1. Assert: _result_ is a throw completion. 1. Return ? _result_. - 1. Return CreateIterResultObject(_resultValue_, *true*). + 1. Return NormalCompletion(CreateIteratorResultObject(_resultValue_, *true*)). 1. Set the code evaluation state of _genContext_ such that when evaluation is resumed for that execution context, _closure_ will be called with no arguments. 1. Set _generator_.[[GeneratorContext]] to _genContext_. - 1. Set _generator_.[[GeneratorState]] to ~suspended-start~. 1. Return ~unused~. @@ -47558,7 +50643,7 @@

              1. Perform ? RequireInternalSlot(_generator_, [[GeneratorState]]). 1. Perform ? RequireInternalSlot(_generator_, [[GeneratorBrand]]). 1. If _generator_.[[GeneratorBrand]] is not _generatorBrand_, throw a *TypeError* exception. - 1. Assert: _generator_ also has a [[GeneratorContext]] internal slot. + 1. Assert: _generator_ has a [[GeneratorContext]] internal slot. 1. Let _state_ be _generator_.[[GeneratorState]]. 1. If _state_ is ~executing~, throw a *TypeError* exception. 1. Return _state_. @@ -47577,7 +50662,7 @@

              1. Let _state_ be ? GeneratorValidate(_generator_, _generatorBrand_). - 1. If _state_ is ~completed~, return CreateIterResultObject(*undefined*, *true*). + 1. If _state_ is ~completed~, return CreateIteratorResultObject(*undefined*, *true*). 1. Assert: _state_ is either ~suspended-start~ or ~suspended-yield~. 1. Let _genContext_ be _generator_.[[GeneratorContext]]. 1. Let _methodContext_ be the running execution context. @@ -47608,7 +50693,7 @@

              1. Set _state_ to ~completed~. 1. If _state_ is ~completed~, then 1. If _abruptCompletion_ is a return completion, then - 1. Return CreateIterResultObject(_abruptCompletion_.[[Value]], *true*). + 1. Return CreateIteratorResultObject(_abruptCompletion_.[[Value]], *true*). 1. Return ? _abruptCompletion_. 1. Assert: _state_ is ~suspended-yield~. 1. Let _genContext_ be _generator_.[[GeneratorContext]]. @@ -47631,17 +50716,19 @@

              GetGeneratorKind ( ): ~non-generator~, ~sync~, or ~async~

              1. If _genContext_ does not have a Generator component, return ~non-generator~. 1. Let _generator_ be the Generator component of _genContext_. 1. If _generator_ has an [[AsyncGeneratorState]] internal slot, return ~async~. - 1. Else, return ~sync~. + 1. Return ~sync~.

              GeneratorYield ( - _iterNextObj_: an Object that conforms to the IteratorResult interface, + _iteratorResult_: an Object that conforms to the IteratorResult interface, ): either a normal completion containing an ECMAScript language value or an abrupt completion

              +
              skip return checks
              +
              true
              1. Let _genContext_ be the running execution context. @@ -47651,7 +50738,7 @@

              1. Set _generator_.[[GeneratorState]] to ~suspended-yield~. 1. Remove _genContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context. 1. Let _callerContext_ be the running execution context. - 1. Resume _callerContext_ passing NormalCompletion(_iterNextObj_). If _genContext_ is ever resumed again, let _resumptionValue_ be the Completion Record with which it is resumed. + 1. Resume _callerContext_ passing NormalCompletion(_iteratorResult_). If _genContext_ is ever resumed again, let _resumptionValue_ be the Completion Record with which it is resumed. 1. Assert: If control reaches here, then _genContext_ is the running execution context again. 1. Return _resumptionValue_. @@ -47668,7 +50755,7 @@

              1. Let _generatorKind_ be GetGeneratorKind(). 1. If _generatorKind_ is ~async~, return ? AsyncGeneratorYield(? Await(_value_)). - 1. Otherwise, return ? GeneratorYield(CreateIterResultObject(_value_, *false*)). + 1. Return ? GeneratorYield(CreateIteratorResultObject(_value_, *false*)). @@ -47678,16 +50765,18 @@

              _closure_: an Abstract Closure with no parameters, _generatorBrand_: a String or ~empty~, _generatorPrototype_: an Object, + optional _extraSlots_: a List of names of internal slots, ): a Generator

              1. NOTE: _closure_ can contain uses of the Yield operation to yield an IteratorResult object. - 1. Let _internalSlotsList_ be « [[GeneratorState]], [[GeneratorContext]], [[GeneratorBrand]] ». + 1. If _extraSlots_ is not present, set _extraSlots_ to a new empty List. + 1. Let _internalSlotsList_ be the list-concatenation of _extraSlots_ and « [[GeneratorState]], [[GeneratorContext]], [[GeneratorBrand]] ». 1. Let _generator_ be OrdinaryObjectCreate(_generatorPrototype_, _internalSlotsList_). 1. Set _generator_.[[GeneratorBrand]] to _generatorBrand_. - 1. Set _generator_.[[GeneratorState]] to *undefined*. + 1. Set _generator_.[[GeneratorState]] to ~suspended-start~. 1. Let _callerContext_ be the running execution context. 1. Let _calleeContext_ be a new execution context. 1. Set the Function of _calleeContext_ to *null*. @@ -47705,7 +50794,7 @@

              AsyncGenerator Objects

              -

              An AsyncGenerator is created by calling an async generator function and conforms to both the AsyncIterator and AsyncIterable interfaces.

              +

              An AsyncGenerator is created by calling an async generator function and conforms to both the async iterator interface and the async iterable interface.

              AsyncGenerator instances directly inherit properties from the initial value of the *"prototype"* property of the async generator function that created the instance. AsyncGenerator instances indirectly inherit properties from %AsyncGeneratorPrototype%.

              @@ -47726,7 +50815,7 @@

              %AsyncGeneratorPrototype%.constructor

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              - +

              %AsyncGeneratorPrototype%.next ( _value_ )

              1. Let _generator_ be the *this* value. @@ -47735,41 +50824,41 @@

              %AsyncGeneratorPrototype%.next ( _value_ )

              1. IfAbruptRejectPromise(_result_, _promiseCapability_). 1. Let _state_ be _generator_.[[AsyncGeneratorState]]. 1. If _state_ is ~completed~, then - 1. Let _iteratorResult_ be CreateIterResultObject(*undefined*, *true*). - 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _iteratorResult_ »). + 1. Let _iteratorResult_ be CreateIteratorResultObject(*undefined*, *true*). + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _iteratorResult_ »). 1. Return _promiseCapability_.[[Promise]]. 1. Let _completion_ be NormalCompletion(_value_). 1. Perform AsyncGeneratorEnqueue(_generator_, _completion_, _promiseCapability_). 1. If _state_ is either ~suspended-start~ or ~suspended-yield~, then 1. Perform AsyncGeneratorResume(_generator_, _completion_). 1. Else, - 1. Assert: _state_ is either ~executing~ or ~awaiting-return~. + 1. Assert: _state_ is either ~executing~ or ~draining-queue~. 1. Return _promiseCapability_.[[Promise]].
              - +

              %AsyncGeneratorPrototype%.return ( _value_ )

              1. Let _generator_ be the *this* value. 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). 1. Let _result_ be Completion(AsyncGeneratorValidate(_generator_, ~empty~)). 1. IfAbruptRejectPromise(_result_, _promiseCapability_). - 1. Let _completion_ be Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. + 1. Let _completion_ be ReturnCompletion(_value_). 1. Perform AsyncGeneratorEnqueue(_generator_, _completion_, _promiseCapability_). 1. Let _state_ be _generator_.[[AsyncGeneratorState]]. 1. If _state_ is either ~suspended-start~ or ~completed~, then - 1. Set _generator_.[[AsyncGeneratorState]] to ~awaiting-return~. - 1. Perform ! AsyncGeneratorAwaitReturn(_generator_). + 1. Set _generator_.[[AsyncGeneratorState]] to ~draining-queue~. + 1. Perform AsyncGeneratorAwaitReturn(_generator_). 1. Else if _state_ is ~suspended-yield~, then 1. Perform AsyncGeneratorResume(_generator_, _completion_). 1. Else, - 1. Assert: _state_ is either ~executing~ or ~awaiting-return~. + 1. Assert: _state_ is either ~executing~ or ~draining-queue~. 1. Return _promiseCapability_.[[Promise]].
              - +

              %AsyncGeneratorPrototype%.throw ( _exception_ )

              1. Let _generator_ be the *this* value. @@ -47788,14 +50877,14 @@

              %AsyncGeneratorPrototype%.throw ( _exception_ )

              1. If _state_ is ~suspended-yield~, then 1. Perform AsyncGeneratorResume(_generator_, _completion_). 1. Else, - 1. Assert: _state_ is either ~executing~ or ~awaiting-return~. + 1. Assert: _state_ is either ~executing~ or ~draining-queue~. 1. Return _promiseCapability_.[[Promise]].
              - -

              %AsyncGeneratorPrototype% [ @@toStringTag ]

              -

              The initial value of the @@toStringTag property is the String value *"AsyncGenerator"*.

              + +

              %AsyncGeneratorPrototype% [ %Symbol.toStringTag% ]

              +

              The initial value of the %Symbol.toStringTag% property is the String value *"AsyncGenerator"*.

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              @@ -47805,14 +50894,16 @@

              Properties of AsyncGenerator Instances

              AsyncGenerator instances are initially created with the internal slots described below:

              - - - - - + + + + + + + - + @@ -47823,7 +50914,7 @@

              Properties of AsyncGenerator Instances

              - + @@ -47843,11 +50934,13 @@

              AsyncGeneratorRequest Records

              They have the following fields:

              Internal SlotTypeDescription
              Internal SlotTypeDescription
              [[AsyncGeneratorState]]*undefined*, ~suspended-start~, ~suspended-yield~, ~executing~, ~awaiting-return~, or ~completed~~suspended-start~, ~suspended-yield~, ~executing~, ~draining-queue~, or ~completed~ The current execution state of the async generator.
              [[AsyncGeneratorQueue]] a List of AsyncGeneratorRequest RecordsRecords which represent requests to resume the async generator. Except during state transitions, it is non-empty if and only if [[AsyncGeneratorState]] is either ~executing~ or ~awaiting-return~.Records which represent requests to resume the async generator. Except during state transitions, it is non-empty if and only if [[AsyncGeneratorState]] is either ~executing~ or ~draining-queue~.
              [[GeneratorBrand]]
              - - - - - + + + + + + + @@ -47872,7 +50965,7 @@

              - 1. Assert: _generator_.[[AsyncGeneratorState]] is *undefined*. + 1. Assert: _generator_.[[AsyncGeneratorState]] is ~suspended-start~. 1. Let _genContext_ be the running execution context. 1. Set the Generator component of _genContext_ to _generator_. 1. Let _closure_ be a new Abstract Closure with no parameters that captures _generatorBody_ and performs the following steps when called: @@ -47885,15 +50978,14 @@

              1. Let _result_ be Completion(_generatorBody_()). 1. Assert: If we return here, the async generator either threw an exception or performed either an implicit or explicit return. 1. Remove _acGenContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context. - 1. Set _acGenerator_.[[AsyncGeneratorState]] to ~completed~. + 1. Set _acGenerator_.[[AsyncGeneratorState]] to ~draining-queue~. 1. If _result_ is a normal completion, set _result_ to NormalCompletion(*undefined*). 1. If _result_ is a return completion, set _result_ to NormalCompletion(_result_.[[Value]]). 1. Perform AsyncGeneratorCompleteStep(_acGenerator_, _result_, *true*). 1. Perform AsyncGeneratorDrainQueue(_acGenerator_). - 1. Return *undefined*. + 1. Return NormalCompletion(*undefined*). 1. Set the code evaluation state of _genContext_ such that when evaluation is resumed for that execution context, _closure_ will be called with no arguments. 1. Set _generator_.[[AsyncGeneratorContext]] to _genContext_. - 1. Set _generator_.[[AsyncGeneratorState]] to ~suspended-start~. 1. Set _generator_.[[AsyncGeneratorQueue]] to a new empty List. 1. Return ~unused~. @@ -47958,11 +51050,11 @@

              1. If _realm_ is present, then 1. Let _oldRealm_ be the running execution context's Realm. 1. Set the running execution context's Realm to _realm_. - 1. Let _iteratorResult_ be CreateIterResultObject(_value_, _done_). + 1. Let _iteratorResult_ be CreateIteratorResultObject(_value_, _done_). 1. Set the running execution context's Realm to _oldRealm_. 1. Else, - 1. Let _iteratorResult_ be CreateIterResultObject(_value_, _done_). - 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _iteratorResult_ »). + 1. Let _iteratorResult_ be CreateIteratorResultObject(_value_, _done_). + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _iteratorResult_ »). 1. Return ~unused~. @@ -48003,7 +51095,7 @@

              1. Let _awaited_ be Completion(Await(_resumptionValue_.[[Value]])). 1. If _awaited_ is a throw completion, return ? _awaited_. 1. Assert: _awaited_ is a normal completion. - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _awaited_.[[Value]], [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_awaited_.[[Value]]). @@ -48031,13 +51123,12 @@

              1. Let _toYield_ be the first element of _queue_. 1. Let _resumptionValue_ be Completion(_toYield_.[[Completion]]). 1. Return ? AsyncGeneratorUnwrapYieldResumption(_resumptionValue_). - 1. Else, - 1. Set _generator_.[[AsyncGeneratorState]] to ~suspended-yield~. - 1. Remove _genContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context. - 1. Let _callerContext_ be the running execution context. - 1. Resume _callerContext_ passing *undefined*. If _genContext_ is ever resumed again, let _resumptionValue_ be the Completion Record with which it is resumed. - 1. Assert: If control reaches here, then _genContext_ is the running execution context again. - 1. Return ? AsyncGeneratorUnwrapYieldResumption(_resumptionValue_). + 1. Set _generator_.[[AsyncGeneratorState]] to ~suspended-yield~. + 1. Remove _genContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context. + 1. Let _callerContext_ be the running execution context. + 1. Resume _callerContext_ passing *undefined*. If _genContext_ is ever resumed again, let _resumptionValue_ be the Completion Record with which it is resumed. + 1. Assert: If control reaches here, then _genContext_ is the running execution context again. + 1. Return ? AsyncGeneratorUnwrapYieldResumption(_resumptionValue_). @@ -48045,30 +51136,37 @@

              AsyncGeneratorAwaitReturn ( _generator_: an AsyncGenerator, - ): either a normal completion containing ~unused~ or a throw completion + ): ~unused~

              + 1. Assert: _generator_.[[AsyncGeneratorState]] is ~draining-queue~. 1. Let _queue_ be _generator_.[[AsyncGeneratorQueue]]. 1. Assert: _queue_ is not empty. 1. Let _next_ be the first element of _queue_. 1. Let _completion_ be Completion(_next_.[[Completion]]). 1. Assert: _completion_ is a return completion. - 1. Let _promise_ be ? PromiseResolve(%Promise%, _completion_.[[Value]]). + 1. Let _promiseCompletion_ be Completion(PromiseResolve(%Promise%, _completion_.[[Value]])). + 1. If _promiseCompletion_ is an abrupt completion, then + 1. Perform AsyncGeneratorCompleteStep(_generator_, _promiseCompletion_, *true*). + 1. Perform AsyncGeneratorDrainQueue(_generator_). + 1. Return ~unused~. + 1. Assert: _promiseCompletion_ is a normal completion. + 1. Let _promise_ be _promiseCompletion_.[[Value]]. 1. Let _fulfilledClosure_ be a new Abstract Closure with parameters (_value_) that captures _generator_ and performs the following steps when called: - 1. Set _generator_.[[AsyncGeneratorState]] to ~completed~. + 1. Assert: _generator_.[[AsyncGeneratorState]] is ~draining-queue~. 1. Let _result_ be NormalCompletion(_value_). 1. Perform AsyncGeneratorCompleteStep(_generator_, _result_, *true*). 1. Perform AsyncGeneratorDrainQueue(_generator_). - 1. Return *undefined*. + 1. Return NormalCompletion(*undefined*). 1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 1, *""*, « »). 1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _generator_ and performs the following steps when called: - 1. Set _generator_.[[AsyncGeneratorState]] to ~completed~. + 1. Assert: _generator_.[[AsyncGeneratorState]] is ~draining-queue~. 1. Let _result_ be ThrowCompletion(_reason_). 1. Perform AsyncGeneratorCompleteStep(_generator_, _result_, *true*). 1. Perform AsyncGeneratorDrainQueue(_generator_). - 1. Return *undefined*. + 1. Return NormalCompletion(*undefined*). 1. Let _onRejected_ be CreateBuiltinFunction(_rejectedClosure_, 1, *""*, « »). 1. Perform PerformPromiseThen(_promise_, _onFulfilled_, _onRejected_). 1. Return ~unused~. @@ -48086,54 +51184,21 @@

              It drains the generator's AsyncGeneratorQueue until it encounters an AsyncGeneratorRequest which holds a return completion.
              - 1. Assert: _generator_.[[AsyncGeneratorState]] is ~completed~. + 1. Assert: _generator_.[[AsyncGeneratorState]] is ~draining-queue~. 1. Let _queue_ be _generator_.[[AsyncGeneratorQueue]]. - 1. If _queue_ is empty, return ~unused~. - 1. Let _done_ be *false*. - 1. Repeat, while _done_ is *false*, + 1. Repeat, while _queue_ is not empty, 1. Let _next_ be the first element of _queue_. 1. Let _completion_ be Completion(_next_.[[Completion]]). 1. If _completion_ is a return completion, then - 1. Set _generator_.[[AsyncGeneratorState]] to ~awaiting-return~. - 1. Perform ! AsyncGeneratorAwaitReturn(_generator_). - 1. Set _done_ to *true*. - 1. Else, - 1. If _completion_ is a normal completion, then - 1. Set _completion_ to NormalCompletion(*undefined*). - 1. Perform AsyncGeneratorCompleteStep(_generator_, _completion_, *true*). - 1. If _queue_ is empty, set _done_ to *true*. + 1. Perform AsyncGeneratorAwaitReturn(_generator_). + 1. Return ~unused~. + 1. If _completion_ is a normal completion, then + 1. Set _completion_ to NormalCompletion(*undefined*). + 1. Perform AsyncGeneratorCompleteStep(_generator_, _completion_, *true*). + 1. Set _generator_.[[AsyncGeneratorState]] to ~completed~. 1. Return ~unused~. - - -

              - CreateAsyncIteratorFromClosure ( - _closure_: an Abstract Closure with no parameters, - _generatorBrand_: a String or ~empty~, - _generatorPrototype_: an Object, - ): an AsyncGenerator -

              -
              -
              - - 1. NOTE: _closure_ can contain uses of the Await operation and uses of the Yield operation to yield an IteratorResult object. - 1. Let _internalSlotsList_ be « [[AsyncGeneratorState]], [[AsyncGeneratorContext]], [[AsyncGeneratorQueue]], [[GeneratorBrand]] ». - 1. Let _generator_ be OrdinaryObjectCreate(_generatorPrototype_, _internalSlotsList_). - 1. Set _generator_.[[GeneratorBrand]] to _generatorBrand_. - 1. Set _generator_.[[AsyncGeneratorState]] to *undefined*. - 1. Let _callerContext_ be the running execution context. - 1. Let _calleeContext_ be a new execution context. - 1. Set the Function of _calleeContext_ to *null*. - 1. Set the Realm of _calleeContext_ to the current Realm Record. - 1. Set the ScriptOrModule of _calleeContext_ to _callerContext_'s ScriptOrModule. - 1. If _callerContext_ is not already suspended, suspend _callerContext_. - 1. Push _calleeContext_ onto the execution context stack; _calleeContext_ is now the running execution context. - 1. Perform AsyncGeneratorStart(_generator_, _closure_). - 1. Remove _calleeContext_ from the execution context stack and restore _callerContext_ as the running execution context. - 1. Return _generator_. - -
              @@ -48152,7 +51217,7 @@

              The AsyncFunction Constructor

            • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified AsyncFunction behaviour must include a `super` call to the AsyncFunction constructor to create and initialize a subclass instance with the internal slots necessary for built-in async function behaviour. All ECMAScript syntactic forms for defining async function objects create direct instances of AsyncFunction. There is no syntactic means to create instances of AsyncFunction subclasses.
            • - +

              AsyncFunction ( ..._parameterArgs_, _bodyArg_ )

              The last argument (if any) specifies the body (executable code) of an async function. Any preceding arguments specify formal parameters.

              This function performs the following steps when called:

              @@ -48205,10 +51270,10 @@

              AsyncFunction.prototype.constructor

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              - -

              AsyncFunction.prototype [ @@toStringTag ]

              + +

              AsyncFunction.prototype [ %Symbol.toStringTag% ]

              -

              The initial value of the @@toStringTag property is the String value *"AsyncFunction"*.

              +

              The initial value of the %Symbol.toStringTag% property is the String value *"AsyncFunction"*.

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              @@ -48217,7 +51282,7 @@

              AsyncFunction.prototype [ @@toStringTag ]

              AsyncFunction Instances

              -

              Every AsyncFunction instance is an ECMAScript function object and has the internal slots listed in . The value of the [[IsClassConstructor]] internal slot for all such instances is *false*. AsyncFunction instances are not constructors and do not have a [[Construct]] internal method. AsyncFunction instances do not have a prototype property as they are not constructible.

              +

              Every AsyncFunction instance is an ECMAScript function object and has the internal slots listed in . The value of the [[IsClassConstructor]] internal slot for all such instances is *false*. AsyncFunction instances are not constructors and do not have a [[Construct]] internal method. AsyncFunction instances do not have a prototype property as they are not constructable.

              Each AsyncFunction instance has the following own properties:

              @@ -48238,7 +51303,7 @@

              Async Functions Abstract Operations

              AsyncFunctionStart ( _promiseCapability_: a PromiseCapability Record, - _asyncFunctionBody_: a |FunctionBody| Parse Node or an |ExpressionBody| Parse Node, + _asyncFunctionBody_: a |FunctionBody| Parse Node, an |ExpressionBody| Parse Node, or an Abstract Closure with no parameters, ): ~unused~

              @@ -48256,7 +51321,7 @@

              AsyncBlockStart ( _promiseCapability_: a PromiseCapability Record, - _asyncBody_: a Parse Node, + _asyncBody_: a Parse Node or an Abstract Closure with no parameters, _asyncContext_: an execution context, ): ~unused~

              @@ -48266,17 +51331,21 @@

              1. Let _runningContext_ be the running execution context. 1. Let _closure_ be a new Abstract Closure with no parameters that captures _promiseCapability_ and _asyncBody_ and performs the following steps when called: 1. Let _acAsyncContext_ be the running execution context. - 1. Let _result_ be Completion(Evaluation of _asyncBody_). + 1. If _asyncBody_ is a Parse Node, then + 1. Let _result_ be Completion(Evaluation of _asyncBody_). + 1. Else, + 1. Assert: _asyncBody_ is an Abstract Closure with no parameters. + 1. Let _result_ be Completion(_asyncBody_()). 1. Assert: If we return here, the async function either threw an exception or performed an implicit or explicit return; all awaiting is done. 1. Remove _acAsyncContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context. 1. If _result_ is a normal completion, then 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « *undefined* »). 1. Else if _result_ is a return completion, then - 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _result_.[[Value]] »). + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _result_.[[Value]] »). 1. Else, 1. Assert: _result_ is a throw completion. 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _result_.[[Value]] »). - 1. [id="step-asyncblockstart-return-undefined"] Return ~unused~. + 1. [id="step-asyncblockstart-return-undefined"] Return NormalCompletion(~unused~). 1. Set the code evaluation state of _asyncContext_ such that when evaluation is resumed for that execution context, _closure_ will be called with no arguments. 1. Push _asyncContext_ onto the execution context stack; _asyncContext_ is now the running execution context. 1. Resume the suspended evaluation of _asyncContext_. Let _result_ be the value returned by the resumed computation. @@ -48303,7 +51372,7 @@

              1. Push _asyncContext_ onto the execution context stack; _asyncContext_ is now the running execution context. 1. Resume the suspended evaluation of _asyncContext_ using NormalCompletion(_v_) as the result of the operation that suspended it. 1. Assert: When we reach this step, _asyncContext_ has already been removed from the execution context stack and _prevContext_ is the currently running execution context. - 1. Return *undefined*. + 1. Return NormalCompletion(*undefined*). 1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 1, *""*, « »). 1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _asyncContext_ and performs the following steps when called: 1. Let _prevContext_ be the running execution context. @@ -48311,7 +51380,7 @@

              1. Push _asyncContext_ onto the execution context stack; _asyncContext_ is now the running execution context. 1. Resume the suspended evaluation of _asyncContext_ using ThrowCompletion(_reason_) as the result of the operation that suspended it. 1. Assert: When we reach this step, _asyncContext_ has already been removed from the execution context stack and _prevContext_ is the currently running execution context. - 1. Return *undefined*. + 1. Return NormalCompletion(*undefined*). 1. Let _onRejected_ be CreateBuiltinFunction(_rejectedClosure_, 1, *""*, « »). 1. Perform PerformPromiseThen(_promise_, _onFulfilled_, _onRejected_). 1. Remove _asyncContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context. @@ -48341,7 +51410,7 @@

              The Reflect Object

            • does not have a [[Call]] internal method; it cannot be invoked as a function.
            • - +

              Reflect.apply ( _target_, _thisArgument_, _argumentsList_ )

              This function performs the following steps when called:

              @@ -48352,7 +51421,7 @@

              Reflect.apply ( _target_, _thisArgument_, _argumentsList_ )

              - +

              Reflect.construct ( _target_, _argumentsList_ [ , _newTarget_ ] )

              This function performs the following steps when called:

              @@ -48364,28 +51433,28 @@

              Reflect.construct ( _target_, _argumentsList_ [ , _newTarget_ ] )

              - +

              Reflect.defineProperty ( _target_, _propertyKey_, _attributes_ )

              This function performs the following steps when called:

              1. If _target_ is not an Object, throw a *TypeError* exception. 1. Let _key_ be ? ToPropertyKey(_propertyKey_). 1. Let _desc_ be ? ToPropertyDescriptor(_attributes_). - 1. Return ? _target_.[[DefineOwnProperty]](_key_, _desc_). + 1. Return ? _target_.[[DefineOwnProperty]](_key_, _desc_).
              - +

              Reflect.deleteProperty ( _target_, _propertyKey_ )

              This function performs the following steps when called:

              1. If _target_ is not an Object, throw a *TypeError* exception. 1. Let _key_ be ? ToPropertyKey(_propertyKey_). - 1. Return ? _target_.[[Delete]](_key_). + 1. Return ? _target_.[[Delete]](_key_).
              - +

              Reflect.get ( _target_, _propertyKey_ [ , _receiver_ ] )

              This function performs the following steps when called:

              @@ -48393,22 +51462,22 @@

              Reflect.get ( _target_, _propertyKey_ [ , _receiver_ ] )

              1. Let _key_ be ? ToPropertyKey(_propertyKey_). 1. If _receiver_ is not present, then 1. Set _receiver_ to _target_. - 1. Return ? _target_.[[Get]](_key_, _receiver_). + 1. Return ? _target_.[[Get]](_key_, _receiver_).
              - +

              Reflect.getOwnPropertyDescriptor ( _target_, _propertyKey_ )

              This function performs the following steps when called:

              1. If _target_ is not an Object, throw a *TypeError* exception. 1. Let _key_ be ? ToPropertyKey(_propertyKey_). - 1. Let _desc_ be ? _target_.[[GetOwnProperty]](_key_). + 1. Let _desc_ be ? _target_.[[GetOwnProperty]](_key_). 1. Return FromPropertyDescriptor(_desc_).
              - +

              Reflect.getPrototypeOf ( _target_ )

              This function performs the following steps when called:

              @@ -48417,17 +51486,17 @@

              Reflect.getPrototypeOf ( _target_ )

              - +

              Reflect.has ( _target_, _propertyKey_ )

              This function performs the following steps when called:

              1. If _target_ is not an Object, throw a *TypeError* exception. 1. Let _key_ be ? ToPropertyKey(_propertyKey_). - 1. Return ? _target_.[[HasProperty]](_key_). + 1. Return ? _target_.[[HasProperty]](_key_).
              - +

              Reflect.isExtensible ( _target_ )

              This function performs the following steps when called:

              @@ -48436,7 +51505,7 @@

              Reflect.isExtensible ( _target_ )

              - +

              Reflect.ownKeys ( _target_ )

              This function performs the following steps when called:

              @@ -48446,7 +51515,7 @@

              Reflect.ownKeys ( _target_ )

              - +

              Reflect.preventExtensions ( _target_ )

              This function performs the following steps when called:

              @@ -48455,7 +51524,7 @@

              Reflect.preventExtensions ( _target_ )

              - +

              Reflect.set ( _target_, _propertyKey_, _V_ [ , _receiver_ ] )

              This function performs the following steps when called:

              @@ -48463,23 +51532,23 @@

              Reflect.set ( _target_, _propertyKey_, _V_ [ , _receiver_ ] )

              1. Let _key_ be ? ToPropertyKey(_propertyKey_). 1. If _receiver_ is not present, then 1. Set _receiver_ to _target_. - 1. Return ? _target_.[[Set]](_key_, _V_, _receiver_). + 1. Return ? _target_.[[Set]](_key_, _V_, _receiver_).
              - +

              Reflect.setPrototypeOf ( _target_, _proto_ )

              This function performs the following steps when called:

              1. If _target_ is not an Object, throw a *TypeError* exception. 1. If _proto_ is not an Object and _proto_ is not *null*, throw a *TypeError* exception. - 1. Return ? _target_.[[SetPrototypeOf]](_proto_). + 1. Return ? _target_.[[SetPrototypeOf]](_proto_).
              - -

              Reflect [ @@toStringTag ]

              -

              The initial value of the @@toStringTag property is the String value *"Reflect"*.

              + +

              Reflect [ %Symbol.toStringTag% ]

              +

              The initial value of the %Symbol.toStringTag% property is the String value *"Reflect"*.

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              @@ -48497,7 +51566,7 @@

              The Proxy Constructor

            • is not intended to be called as a function and will throw an exception when called in that manner.
            • - +

              Proxy ( _target_, _handler_ )

              This function performs the following steps when called:

              @@ -48516,7 +51585,7 @@

              Properties of the Proxy Constructor

            • has the following properties:
            • - +

              Proxy.revocable ( _target_, _handler_ )

              This function creates a revocable Proxy object.

              It performs the following steps when called:

              @@ -48525,12 +51594,12 @@

              Proxy.revocable ( _target_, _handler_ )

              1. Let _revokerClosure_ be a new Abstract Closure with no parameters that captures nothing and performs the following steps when called: 1. Let _F_ be the active function object. 1. Let _p_ be _F_.[[RevocableProxy]]. - 1. If _p_ is *null*, return *undefined*. + 1. If _p_ is *null*, return NormalCompletion(*undefined*). 1. Set _F_.[[RevocableProxy]] to *null*. 1. Assert: _p_ is a Proxy exotic object. 1. Set _p_.[[ProxyTarget]] to *null*. 1. Set _p_.[[ProxyHandler]] to *null*. - 1. Return *undefined*. + 1. Return NormalCompletion(*undefined*). 1. Let _revoker_ be CreateBuiltinFunction(_revokerClosure_, 0, *""*, « [[RevocableProxy]] »). 1. Set _revoker_.[[RevocableProxy]] to _proxy_. 1. Let _result_ be OrdinaryObjectCreate(%Object.prototype%). @@ -48547,9 +51616,9 @@

              Module Namespace Objects

              A Module Namespace Object is a module namespace exotic object that provides runtime property-based access to a module's exported bindings. There is no constructor function for Module Namespace Objects. Instead, such an object is created for each module that is imported by an |ImportDeclaration| that contains a |NameSpaceImport|.

              In addition to the properties specified in each Module Namespace Object has the following own property:

              - -

              @@toStringTag

              -

              The initial value of the @@toStringTag property is the String value *"Module"*.

              + +

              %Symbol.toStringTag%

              +

              The initial value of the %Symbol.toStringTag% property is the String value *"Module"*.

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

              @@ -48558,9 +51627,9 @@

              @@toStringTag

              Memory Model

              The memory consistency model, or memory model, specifies the possible orderings of Shared Data Block events, arising via accessing TypedArray instances backed by a SharedArrayBuffer and via methods on the Atomics object. When the program has no data races (defined below), the ordering of events appears as sequentially consistent, i.e., as an interleaving of actions from each agent. When the program has data races, shared memory operations may appear sequentially inconsistent. For example, programs may exhibit causality-violating behaviour and other astonishments. These astonishments arise from compiler transforms and the design of CPUs (e.g., out-of-order execution and speculation). The memory model defines both the precise conditions under which a program exhibits sequentially consistent behaviour as well as the possible values read from data races. To wit, there is no undefined behaviour.

              -

              The memory model is defined as relational constraints on events introduced by abstract operations on SharedArrayBuffer or by methods on the Atomics object during an evaluation.

              +

              The memory model is defined as relational constraints on Memory events introduced by abstract operations on SharedArrayBuffer or by methods on the Atomics object during an evaluation.

              -

              This section provides an axiomatic model on events introduced by the abstract operations on SharedArrayBuffers. It bears stressing that the model is not expressible algorithmically, unlike the rest of this specification. The nondeterministic introduction of events by abstract operations is the interface between the operational semantics of ECMAScript evaluation and the axiomatic semantics of the memory model. The semantics of these events is defined by considering graphs of all events in an evaluation. These are neither Static Semantics nor Runtime Semantics. There is no demonstrated algorithmic implementation, but instead a set of constraints that determine if a particular event graph is allowed or disallowed.

              +

              This section provides an axiomatic model on Memory events introduced by the abstract operations on SharedArrayBuffers. It bears stressing that the model is not expressible algorithmically, unlike the rest of this specification. The nondeterministic introduction of events by abstract operations is the interface between the operational semantics of ECMAScript evaluation and the axiomatic semantics of the memory model. The semantics of these events is defined by considering graphs of all events in an evaluation. These are neither Static Semantics nor Runtime Semantics. There is no demonstrated algorithmic implementation, but instead a set of constraints that determine if a particular event graph is allowed or disallowed.

              @@ -48569,15 +51638,17 @@

              Memory Model Fundamentals

              No orderings weaker than sequentially consistent and stronger than unordered, such as release-acquire, are supported.

              -

              A Shared Data Block event is either a ReadSharedMemory, WriteSharedMemory, or ReadModifyWriteSharedMemory Record.

              +

              A Shared Data Block event is either a ReadSharedMemory, WriteSharedMemory, or ReadModifyWriteSharedMemory Record. A read event is either a ReadSharedMemory or a ReadModifyWriteSharedMemory. A write event is either a WriteSharedMemory or a ReadModifyWriteSharedMemory.

              Field NameValueMeaning
              Field NameValueMeaning
              [[Completion]] a Completion Record
              - - - - - + + + + + + + @@ -48586,7 +51657,7 @@

              Memory Model Fundamentals

              - + @@ -48608,11 +51679,13 @@

              Memory Model Fundamentals

              Field NameValueMeaning
              Field NameValueMeaning
              [[Order]] ~seq-cst~ or ~unordered~
              [[NoTear]] a BooleanWhether this event is allowed to read from multiple write events with equal range as this event.Whether this event is allowed to read from multiple write events with equal memory range as this event.
              [[Block]]
              - - - - - + + + + + + + @@ -48621,7 +51694,7 @@

              Memory Model Fundamentals

              - + @@ -48648,11 +51721,13 @@

              Memory Model Fundamentals

              Field NameValueMeaning
              Field NameValueMeaning
              [[Order]] ~seq-cst~, ~unordered~, or ~init~
              [[NoTear]] a BooleanWhether this event is allowed to be read from multiple read events with equal range as this event.Whether this event is allowed to be read from multiple read events with equal memory range as this event.
              [[Block]]
              - - - - - + + + + + + + @@ -48686,15 +51761,13 @@

              Memory Model Fundamentals

              - +
              Field NameValueMeaning
              Field NameValueMeaning
              [[Order]] ~seq-cst~
              [[ModifyOp]] a read-modify-write modification functionAn abstract closure that returns a modified List of byte values from a read List of byte values and [[Payload]].An Abstract Closure that returns a modified List of byte values from a read List of byte values and [[Payload]].
              -

              These events are introduced by abstract operations or by methods on the Atomics object.

              -

              Some operations may also introduce Synchronize events. A Synchronize event has no fields, and exists purely to directly constrain the permitted orderings of other events.

              -

              In addition to Shared Data Block and Synchronize events, there are host-specific events.

              -

              Let the range of a ReadSharedMemory, WriteSharedMemory, or ReadModifyWriteSharedMemory event be the Set of contiguous integers from its [[ByteIndex]] to [[ByteIndex]] + [[ElementSize]] - 1. Two events' ranges are equal when the events have the same [[Block]], and the ranges are element-wise equal. Two events' ranges are overlapping when the events have the same [[Block]], the ranges are not equal and their intersection is non-empty. Two events' ranges are disjoint when the events do not have the same [[Block]] or their ranges are neither equal nor overlapping.

              +

              Shared Data Block events are introduced to candidate execution Agent Events Records by abstract operations or by methods on the Atomics object. Some operations also introduce Synchronize events, which have no fields and exist purely to directly constrain the permitted orderings of other events. And finally, there are host-specific events. A Memory event is either a Shared Data Block event, Synchronize event, or such a host-specific event.

              +

              Let the memory range of a Shared Data Block event _e_ be the Set of all integers in the interval from _e_.[[ByteIndex]] (inclusive) to _e_.[[ByteIndex]] + _e_.[[ElementSize]] (exclusive). Two events' memory ranges are equal when the events have the same [[Block]], [[ByteIndex]], and [[ElementSize]]. Two events' memory ranges are overlapping when the events have the same [[Block]], the ranges are not equal, and their intersection is non-empty. Two events' memory ranges are disjoint when the events do not have the same [[Block]] or their ranges are neither equal nor overlapping.

              Examples of host-specific synchronizing events that should be accounted for are: sending a SharedArrayBuffer from one agent to another (e.g., by `postMessage` in a browser), starting and stopping agents, and communicating within the agent cluster via channels other than shared memory. For a particular execution _execution_, those events are provided by the host via the host-synchronizes-with strict partial order. Additionally, hosts can add host-specific synchronizing events to _execution_.[[EventList]] so as to participate in the is-agent-order-before Relation.

              @@ -48706,11 +51779,13 @@

              Agent Events Records

              An Agent Events Record is a Record with the following fields.

              - - - - - + + + + + + + @@ -48718,7 +51793,7 @@

              Agent Events Records

              - + @@ -48735,11 +51810,13 @@

              Chosen Value Records

              A Chosen Value Record is a Record with the following fields.

              Field NameValueMeaning
              Field NameValueMeaning
              [[AgentSignifier]] an agent signifier
              [[EventList]]a List of eventsa List of Memory events Events are appended to the list during evaluation.
              - - - - - + + + + + + + @@ -48759,15 +51836,17 @@

              Candidate Executions

              A candidate execution of the evaluation of an agent cluster is a Record with the following fields.

              Field NameValueMeaning
              Field NameValueMeaning
              [[Event]] a Shared Data Block event
              - - - - - + + + + + + + - + @@ -48787,14 +51866,14 @@

              Abstract Operations for the Memory Model

              EventSet ( _execution_: a candidate execution, - ): a Set of events + ): a Set of Memory events

              1. Let _events_ be an empty Set. 1. For each Agent Events Record _aer_ of _execution_.[[EventsRecords]], do - 1. For each event _E_ of _aer_.[[EventList]], do + 1. For each Memory event _E_ of _aer_.[[EventList]], do 1. Add _E_ to _events_. 1. Return _events_. @@ -48804,14 +51883,14 @@

              SharedDataBlockEventSet ( _execution_: a candidate execution, - ): a Set of events + ): a Set of Shared Data Block events

              1. Let _events_ be an empty Set. - 1. For each event _E_ of EventSet(_execution_), do - 1. If _E_ is a ReadSharedMemory, WriteSharedMemory, or ReadModifyWriteSharedMemory event, add _E_ to _events_. + 1. For each Memory event _E_ of EventSet(_execution_), do + 1. If _E_ is a Shared Data Block event, add _E_ to _events_. 1. Return _events_. @@ -48820,15 +51899,12 @@

              HostEventSet ( _execution_: a candidate execution, - ): a Set of events + ): a Set of Memory events

              - 1. Let _events_ be an empty Set. - 1. For each event _E_ of EventSet(_execution_), do - 1. If _E_ is not in SharedDataBlockEventSet(_execution_), add _E_ to _events_. - 1. Return _events_. + 1. Return a new Set containing all elements of EventSet(_execution_) that are not in SharedDataBlockEventSet(_execution_). @@ -48846,7 +51922,7 @@

              1. Let _byteLocation_ be _byteIndex_. 1. Let _bytesRead_ be a new empty List. 1. For each element _W_ of _Ws_, do - 1. Assert: _W_ has _byteLocation_ in its range. + 1. Assert: _W_ has _byteLocation_ in its memory range. 1. Let _payloadIndex_ be _byteLocation_ - _W_.[[ByteIndex]]. 1. If _W_ is a WriteSharedMemory event, then 1. Let _byte_ be _W_.[[Payload]][_payloadIndex_]. @@ -48887,11 +51963,11 @@

              Relations of Candidate Executions

              -

              The following relations and mathematical functions are parameterized over a particular candidate execution and order its events.

              +

              The following relations and mathematical functions are parameterized over a particular candidate execution and order its Memory events.

              is-agent-order-before

              -

              For a candidate execution _execution_, its is-agent-order-before Relation is the least Relation on events that satisfies the following.

              +

              For a candidate execution _execution_, its is-agent-order-before Relation is the least Relation on Memory events that satisfies the following.

              • For events _E_ and _D_, _E_ is-agent-order-before _D_ in _execution_ if there is some Agent Events Record _aer_ in _execution_.[[EventsRecords]] such that _aer_.[[EventList]] contains both _E_ and _D_ and _E_ is before _D_ in List order of _aer_.[[EventList]].
              @@ -48903,12 +51979,12 @@

              is-agent-order-before

              reads-bytes-from

              -

              For a candidate execution _execution_, its reads-bytes-from function is a mathematical function mapping events in SharedDataBlockEventSet(_execution_) to Lists of events in SharedDataBlockEventSet(_execution_) that satisfies the following conditions.

              +

              For a candidate execution _execution_, its reads-bytes-from function is a mathematical function mapping Memory events in SharedDataBlockEventSet(_execution_) to Lists of events in SharedDataBlockEventSet(_execution_) that satisfies the following conditions.

              • For each ReadSharedMemory or ReadModifyWriteSharedMemory event _R_ in SharedDataBlockEventSet(_execution_), reads-bytes-from(_R_) in _execution_ is a List of length _R_.[[ElementSize]] whose elements are WriteSharedMemory or ReadModifyWriteSharedMemory events _Ws_ such that all of the following are true.

                  -
                • Each event _W_ with index _i_ in _Ws_ has _R_.[[ByteIndex]] + _i_ in its range.
                • +
                • Each event _W_ with index _i_ in _Ws_ has _R_.[[ByteIndex]] + _i_ in its memory range.
                • _R_ is not in _Ws_.
              • @@ -48918,7 +51994,7 @@

                reads-bytes-from

                reads-from

                -

                For a candidate execution _execution_, its reads-from Relation is the least Relation on events that satisfies the following.

                +

                For a candidate execution _execution_, its reads-from Relation is the least Relation on Memory events that satisfies the following.

                • For events _R_ and _W_, _R_ reads-from _W_ in _execution_ if SharedDataBlockEventSet(_execution_) contains both _R_ and _W_, and reads-bytes-from(_R_) in _execution_ contains _W_.
                @@ -48926,7 +52002,7 @@

                reads-from

                host-synchronizes-with

                -

                For a candidate execution _execution_, its host-synchronizes-with Relation is a host-provided strict partial order on host-specific events that satisfies at least the following.

                +

                For a candidate execution _execution_, its host-synchronizes-with Relation is a host-provided strict partial order on host-specific Memory events that satisfies at least the following.

                • If _E_ host-synchronizes-with _D_ in _execution_, HostEventSet(_execution_) contains _E_ and _D_.
                • There is no cycle in the union of host-synchronizes-with and is-agent-order-before in _execution_.
                • @@ -48942,10 +52018,10 @@

                  host-synchronizes-with

                  synchronizes-with

                  -

                  For a candidate execution _execution_, its synchronizes-with Relation is the least Relation on events that satisfies the following.

                  +

                  For a candidate execution _execution_, its synchronizes-with Relation is the least Relation on Memory events that satisfies the following.

                  • - For events _R_ and _W_, _W_ synchronizes-with _R_ in _execution_ if _R_ reads-from _W_ in _execution_, _R_.[[Order]] is ~seq-cst~, _W_.[[Order]] is ~seq-cst~, and _R_ and _W_ have equal ranges. + For events _R_ and _W_, _W_ synchronizes-with _R_ in _execution_ if _R_ reads-from _W_ in _execution_, _R_.[[Order]] is ~seq-cst~, _W_.[[Order]] is ~seq-cst~, and _R_ and _W_ have equal memory ranges.
                  • For each element _eventsRecord_ of _execution_.[[EventsRecords]], the following is true. @@ -48965,7 +52041,7 @@

                    synchronizes-with

                    -

                    In a candidate execution _execution_, not all ~seq-cst~ events related by reads-from are related by synchronizes-with. Only events that also have equal ranges are related by synchronizes-with.

                    +

                    In a candidate execution _execution_, not all ~seq-cst~ events related by reads-from are related by synchronizes-with. Only events that also have equal memory ranges are related by synchronizes-with.

                    @@ -48975,7 +52051,7 @@

                    synchronizes-with

                    happens-before

                    -

                    For a candidate execution _execution_, its happens-before Relation is the least Relation on events that satisfies the following.

                    +

                    For a candidate execution _execution_, its happens-before Relation is the least Relation on Memory events that satisfies the following.

                    • @@ -48983,7 +52059,7 @@

                      happens-before

                      • _E_ is-agent-order-before _D_ in _execution_.
                      • _E_ synchronizes-with _D_ in _execution_.
                      • -
                      • SharedDataBlockEventSet(_execution_) contains both _E_ and _D_, _E_.[[Order]] is ~init~, and _E_ and _D_ have overlapping ranges.
                      • +
                      • SharedDataBlockEventSet(_execution_) contains both _E_ and _D_, _E_.[[Order]] is ~init~, and _E_ and _D_ have overlapping memory ranges.
                      • There is an event _F_ such that _E_ happens-before _F_ and _F_ happens-before _D_ in _execution_.
                    • @@ -49026,7 +52102,7 @@

                      Coherent Reads

                      1. For each element _W_ of _Ws_, do 1. If _R_ happens-before _W_ in _execution_, then 1. Return *false*. - 1. If there exists a WriteSharedMemory or ReadModifyWriteSharedMemory event _V_ that has _byteLocation_ in its range such that _W_ happens-before _V_ in _execution_ and _V_ happens-before _R_ in _execution_, then + 1. If there exists a WriteSharedMemory or ReadModifyWriteSharedMemory event _V_ that has _byteLocation_ in its memory range such that _W_ happens-before _V_ in _execution_ and _V_ happens-before _R_ in _execution_, then 1. Return *false*. 1. Set _byteLocation_ to _byteLocation_ + 1. 1. Return *true*. @@ -49040,38 +52116,38 @@

                      Tear Free Reads

                      1. For each ReadSharedMemory or ReadModifyWriteSharedMemory event _R_ of SharedDataBlockEventSet(_execution_), do 1. If _R_.[[NoTear]] is *true*, then 1. Assert: The remainder of dividing _R_.[[ByteIndex]] by _R_.[[ElementSize]] is 0. - 1. For each event _W_ such that _R_ reads-from _W_ in _execution_ and _W_.[[NoTear]] is *true*, do - 1. If _R_ and _W_ have equal ranges and there exists an event _V_ such that _V_ and _W_ have equal ranges, _V_.[[NoTear]] is *true*, _W_ and _V_ are not the same Shared Data Block event, and _R_ reads-from _V_ in _execution_, then + 1. For each Memory event _W_ such that _R_ reads-from _W_ in _execution_ and _W_.[[NoTear]] is *true*, do + 1. If _R_ and _W_ have equal memory ranges and there exists a Memory event _V_ such that _V_ and _W_ have equal memory ranges, _V_.[[NoTear]] is *true*, _W_ and _V_ are not the same Shared Data Block event, and _R_ reads-from _V_ in _execution_, then 1. Return *false*. 1. Return *true*. -

                      An event's [[NoTear]] field is *true* when that event was introduced via accessing an integer TypedArray, and *false* when introduced via accessing a floating point TypedArray or DataView.

                      +

                      A Shared Data Block event's [[NoTear]] field is *true* when that event was introduced via accessing an integer TypedArray, and *false* when introduced via accessing a floating point TypedArray or DataView.

                      Intuitively, this requirement says when a memory range is accessed in an aligned fashion via an integer TypedArray, a single write event on that range must "win" when in a data race with other write events with equal ranges. More precisely, this requirement says an aligned read event cannot read a value composed of bytes from multiple, different write events all with equal ranges. It is possible, however, for an aligned read event to read from multiple write events with overlapping ranges.

                      Sequentially Consistent Atomics

                      -

                      For a candidate execution _execution_, is-memory-order-before is a strict total order of all events in EventSet(_execution_) that satisfies the following.

                      +

                      For a candidate execution _execution_, is-memory-order-before is a strict total order of all Memory events in EventSet(_execution_) that satisfies the following.

                      • For events _E_ and _D_, _E_ is-memory-order-before _D_ in _execution_ if _E_ happens-before _D_ in _execution_.
                      • For events _R_ and _W_ such that _R_ reads-from _W_ in _execution_, there is no WriteSharedMemory or ReadModifyWriteSharedMemory event _V_ in SharedDataBlockEventSet(_execution_) such that _V_.[[Order]] is ~seq-cst~, _W_ is-memory-order-before _V_ in _execution_, _V_ is-memory-order-before _R_ in _execution_, and any of the following conditions are true.

                          -
                        • _W_ synchronizes-with _R_ in _execution_, and _V_ and _R_ have equal ranges.
                        • -
                        • _W_ happens-before _R_ and _V_ happens-before _R_ in _execution_, _W_.[[Order]] is ~seq-cst~, and _W_ and _V_ have equal ranges.
                        • -
                        • _W_ happens-before _R_ and _W_ happens-before _V_ in _execution_, _R_.[[Order]] is ~seq-cst~, and _V_ and _R_ have equal ranges.
                        • +
                        • _W_ synchronizes-with _R_ in _execution_, and _V_ and _R_ have equal memory ranges.
                        • +
                        • _W_ happens-before _R_ and _V_ happens-before _R_ in _execution_, _W_.[[Order]] is ~seq-cst~, and _W_ and _V_ have equal memory ranges.
                        • +
                        • _W_ happens-before _R_ and _W_ happens-before _V_ in _execution_, _R_.[[Order]] is ~seq-cst~, and _V_ and _R_ have equal memory ranges.
                        -

                        This clause additionally constrains ~seq-cst~ events on equal ranges.

                        +

                        This clause additionally constrains ~seq-cst~ events on equal memory ranges.

                      • -

                        For each WriteSharedMemory or ReadModifyWriteSharedMemory event _W_ in SharedDataBlockEventSet(_execution_), if _W_.[[Order]] is ~seq-cst~, then it is not the case that there is an infinite number of ReadSharedMemory or ReadModifyWriteSharedMemory events in SharedDataBlockEventSet(_execution_) with equal range that is memory-order before _W_.

                        +

                        For each WriteSharedMemory or ReadModifyWriteSharedMemory event _W_ in SharedDataBlockEventSet(_execution_), if _W_.[[Order]] is ~seq-cst~, then it is not the case that there is an infinite number of ReadSharedMemory or ReadModifyWriteSharedMemory events in SharedDataBlockEventSet(_execution_) with equal memory range that is memory-order before _W_.

                        -

                        This clause together with the forward progress guarantee on agents ensure the liveness condition that ~seq-cst~ writes become visible to ~seq-cst~ reads with equal range in finite time.

                        +

                        This clause together with the forward progress guarantee on agents ensure the liveness condition that ~seq-cst~ writes become visible to ~seq-cst~ reads with equal memory range in finite time.

                      @@ -49103,7 +52179,7 @@

                      Races

                      1. If _E_ and _D_ are not the same Shared Data Block event, then 1. If it is not the case that both _E_ happens-before _D_ in _execution_ and _D_ happens-before _E_ in _execution_, then - 1. If _E_ and _D_ are both WriteSharedMemory or ReadModifyWriteSharedMemory events and _E_ and _D_ do not have disjoint ranges, then + 1. If _E_ and _D_ are both WriteSharedMemory or ReadModifyWriteSharedMemory events and _E_ and _D_ do not have disjoint memory ranges, then 1. Return *true*. 1. If _E_ reads-from _D_ in _execution_ or _D_ reads-from _E_ in _execution_, then 1. Return *true*. @@ -49118,7 +52194,7 @@

                      Data Races

                      1. If _E_ and _D_ are in a race in _execution_, then 1. If _E_.[[Order]] is not ~seq-cst~ or _D_.[[Order]] is not ~seq-cst~, then 1. Return *true*. - 1. If _E_ and _D_ have overlapping ranges, then + 1. If _E_ and _D_ have overlapping memory ranges, then 1. Return *true*. 1. Return *false*.
                      @@ -49141,13 +52217,13 @@

                      Shared Memory Guidelines

                      The following are guidelines for ECMAScript implementers writing compiler transformations for programs using shared memory.

                      -

                      It is desirable to allow most program transformations that are valid in a single-agent setting in a multi-agent setting, to ensure that the performance of each agent in a multi-agent program is as good as it would be in a single-agent setting. Frequently these transformations are hard to judge. We outline some rules about program transformations that are intended to be taken as normative (in that they are implied by the memory model or stronger than what the memory model implies) but which are likely not exhaustive. These rules are intended to apply to program transformations that precede the introductions of the events that make up the is-agent-order-before Relation.

                      +

                      It is desirable to allow most program transformations that are valid in a single-agent setting in a multi-agent setting, to ensure that the performance of each agent in a multi-agent program is as good as it would be in a single-agent setting. Frequently these transformations are hard to judge. We outline some rules about program transformations that are intended to be taken as normative (in that they are implied by the memory model or stronger than what the memory model implies) but which are likely not exhaustive. These rules are intended to apply to program transformations that precede the introductions of the Memory events that make up the is-agent-order-before Relation.

                      Let an agent-order slice be the subset of the is-agent-order-before Relation pertaining to a single agent.

                      Let possible read values of a read event be the set of all values of ValueOfReadEvent for that event across all valid executions.

                      Any transformation of an agent-order slice that is valid in the absence of shared memory is valid in the presence of shared memory, with the following exceptions.

                      • -

                        Atomics are carved in stone: Program transformations must not cause the ~seq-cst~ events in an agent-order slice to be reordered with its ~unordered~ operations, nor its ~seq-cst~ operations to be reordered with each other, nor may a program transformation remove a ~seq-cst~ operation from the is-agent-order-before Relation.

                        +

                        Atomics are carved in stone: Program transformations must not cause any Shared Data Block events whose [[Order]] is ~seq-cst~ to be removed from the is-agent-order-before Relation, nor to be reordered with respect to each other, nor to be reordered inside an agent-order slice with respect to events whose [[Order]] is ~unordered~.

                        (In practice, the prohibition on reorderings forces a compiler to assume that every ~seq-cst~ operation is a synchronization and included in the final is-memory-order-before Relation, which it would usually have to assume anyway in the absence of inter-agent program analysis. It also forces the compiler to assume that every call where the callee's effects on the memory-order are unknown may contain ~seq-cst~ operations.)

                      • @@ -49183,7 +52259,7 @@

                        Shared Memory Guidelines

                      • Lock-free atomic read-modify-write accesses compile to a full fence, an atomic read-modify-write instruction sequence, and a full fence.
                      • Non-lock-free atomics compile to a spinlock acquire, a full fence, a series of non-atomic load and store instructions, a full fence, and a spinlock release.
                      -

                      That mapping is correct so long as an atomic operation on an address range does not race with a non-atomic write or with an atomic operation of different size. However, that is all we need: the memory model effectively demotes the atomic operations involved in a race to non-atomic status. On the other hand, the naive mapping is quite strong: it allows atomic operations to be used as sequentially consistent fences, which the memory model does not actually guarantee.

                      +

                      That mapping is correct so long as an atomic operation on a memory range does not race with a non-atomic write or with an atomic operation of different size. However, that is all we need: the memory model effectively demotes the atomic operations involved in a race to non-atomic status. On the other hand, the naive mapping is quite strong: it allows atomic operations to be used as sequentially consistent fences, which the memory model does not actually guarantee.

                      Local improvements to those basic patterns are also allowed, subject to the constraints of the memory model. For example:

                      • There are obvious platform-dependent improvements that remove redundant fences. For example, on x86 the fences around lock-free atomic loads and stores can always be omitted except for the fence following a store, and no fence is needed for lock-free read-modify-write instructions, as these all use LOCK-prefixed instructions. On many platforms there are fences of several strengths, and weaker fences can be used in certain contexts without destroying sequential consistency.
                      • @@ -49538,6 +52614,9 @@

                        Scripts and Modules

                        + + + @@ -49561,7 +52640,6 @@

                        Number Conversions

                        Time Zone Offset String Format

                        - @@ -49581,6 +52659,8 @@

                        Regular Expressions

                        + + @@ -49638,6 +52718,8 @@

                        Regular Expressions

                        Additional ECMAScript Features for Web Browsers

                        The ECMAScript language syntax and semantics defined in this annex are required when the ECMAScript host is a web browser. The content of this annex is normative but optional if the ECMAScript host is not a web browser.

                        +

                        Some features defined in this annex are specified in this annex, and some are specified in the main body of this document.

                        +

                        When a feature is specified in the main body, each point where it affects the document is marked with the words "Normative Optional" in a coloured box. Moreover, where the feature involves particular wording in an algorithm or early error rule, this is guarded by the condition that “the host supports” the relevant feature. Web browsers are required to support all such features.

                        This annex describes various legacy features and other characteristics of web browser ECMAScript hosts. All of the language features and behaviours specified in this annex have one or more undesirable characteristics and in the absence of legacy usage would be removed from this specification. However, the usage of these features by large numbers of existing web pages means that web browsers must continue to support them. The specifications in this annex define the requirements for interoperable implementations of these legacy features.

                        These features are not considered part of the core ECMAScript language. Programmers should not use or assume the existence of these features and behaviours when writing new ECMAScript code. ECMAScript implementations are discouraged from implementing these features unless the implementation is part of a web browser or is required to run the same legacy ECMAScript code that web browsers encounter.

                        @@ -49744,7 +52826,8 @@

                        Syntax

                        `\` [lookahead == `c`] CharacterClass[~UnicodeMode, ~UnicodeSetsMode] `(` GroupSpecifier[~UnicodeMode]? Disjunction[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups] `)` - `(?:` Disjunction[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups] `)` + `(?` RegularExpressionModifiers `:` Disjunction[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups] `)` + `(?` RegularExpressionModifiers `-` RegularExpressionModifiers `:` Disjunction[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups] `)` InvalidBracedQuantifier ExtendedPatternCharacter @@ -49984,17 +53067,19 @@

                        Additional Properties of the Global Object

                        The entries in are added to .

              Field NameValueMeaning
              Field NameValueMeaning
              [[EventsRecords]] a List of Agent Events RecordsMaps an agent to Lists of events appended during the evaluation.Maps an agent to Lists of Memory events appended during the evaluation.
              [[ChosenValues]]
              - - - - - + + + + + + +
              - Intrinsic Name - - Global Name - - ECMAScript Language Association -
              + Intrinsic Name + + Global Name + + ECMAScript Language Association +
              %escape% @@ -50020,7 +53105,7 @@

              Additional Properties of the Global Object

              - +

              escape ( _string_ )

              This function is a property of the global object. It computes a new version of a String value in which certain code units have been replaced by a hexadecimal escape sequence.

              When replacing a code unit of numeric value less than or equal to 0x00FF, a two-digit escape sequence of the form %xx is used. When replacing a code unit of numeric value strictly greater than 0x00FF, a four-digit escape sequence of the form %uxxxx is used.

              @@ -50053,7 +53138,7 @@

              escape ( _string_ )

              - +

              unescape ( _string_ )

              This function is a property of the global object. It computes a new version of a String value in which each escape sequence of the sort that might be introduced by the `escape` function is replaced with the code unit that it represents.

              It is the %unescape% intrinsic object.

              @@ -50089,19 +53174,20 @@

              unescape ( _string_ )

              Additional Properties of the String.prototype Object

              - +

              String.prototype.substr ( _start_, _length_ )

              This method returns a substring of the result of converting the *this* value to a String, starting from index _start_ and running for _length_ code units (or through the end of the String if _length_ is *undefined*). If _start_ is negative, it is treated as _sourceLength_ + _start_ where _sourceLength_ is the length of the String. The result is a String value, not a String object.

              It performs the following steps when called:

              - 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_O_). 1. Let _S_ be ? ToString(_O_). 1. Let _size_ be the length of _S_. 1. Let _intStart_ be ? ToIntegerOrInfinity(_start_). 1. If _intStart_ = -∞, set _intStart_ to 0. 1. Else if _intStart_ < 0, set _intStart_ to max(_size_ + _intStart_, 0). 1. Else, set _intStart_ to min(_intStart_, _size_). - 1. If _length_ is *undefined*, let _intLength_ be _size_; otherwise let _intLength_ be ? ToIntegerOrInfinity(_length_). + 1. If _length_ is *undefined*, let _intLength_ be _size_; else let _intLength_ be ? ToIntegerOrInfinity(_length_). 1. Set _intLength_ to the result of clamping _intLength_ between 0 and _size_. 1. Let _intEnd_ be min(_intStart_ + _intLength_, _size_). 1. Return the substring of _S_ from _intStart_ to _intEnd_. @@ -50111,7 +53197,7 @@

              String.prototype.substr ( _start_, _length_ )

              - +

              String.prototype.anchor ( _name_ )

              This method performs the following steps when called:

              @@ -50131,8 +53217,8 @@

              - 1. Let _str_ be ? RequireObjectCoercible(_string_). - 1. Let _S_ be ? ToString(_str_). + 1. Perform ? RequireObjectCoercible(_string_). + 1. Let _S_ be ? ToString(_string_). 1. Let _p1_ be the string-concatenation of *"<"* and _tag_. 1. If _attribute_ is not the empty String, then 1. Let _V_ be ? ToString(_value_). @@ -50153,7 +53239,7 @@

              - +

              String.prototype.big ( )

              This method performs the following steps when called:

              @@ -50162,7 +53248,7 @@

              String.prototype.big ( )

              - +

              String.prototype.blink ( )

              This method performs the following steps when called:

              @@ -50171,7 +53257,7 @@

              String.prototype.blink ( )

              - +

              String.prototype.bold ( )

              This method performs the following steps when called:

              @@ -50180,7 +53266,7 @@

              String.prototype.bold ( )

              - +

              String.prototype.fixed ( )

              This method performs the following steps when called:

              @@ -50189,16 +53275,16 @@

              String.prototype.fixed ( )

              - -

              String.prototype.fontcolor ( _color_ )

              + +

              String.prototype.fontcolor ( _colour_ )

              This method performs the following steps when called:

              1. Let _S_ be the *this* value. - 1. Return ? CreateHTML(_S_, *"font"*, *"color"*, _color_). + 1. Return ? CreateHTML(_S_, *"font"*, *"color"*, _colour_).
              - +

              String.prototype.fontsize ( _size_ )

              This method performs the following steps when called:

              @@ -50207,7 +53293,7 @@

              String.prototype.fontsize ( _size_ )

              - +

              String.prototype.italics ( )

              This method performs the following steps when called:

              @@ -50216,7 +53302,7 @@

              String.prototype.italics ( )

              - +

              String.prototype.link ( _url_ )

              This method performs the following steps when called:

              @@ -50225,7 +53311,7 @@

              String.prototype.link ( _url_ )

              - +

              String.prototype.small ( )

              This method performs the following steps when called:

              @@ -50234,7 +53320,7 @@

              String.prototype.small ( )

              - +

              String.prototype.strike ( )

              This method performs the following steps when called:

              @@ -50243,7 +53329,7 @@

              String.prototype.strike ( )

              - +

              String.prototype.sub ( )

              This method performs the following steps when called:

              @@ -50252,7 +53338,7 @@

              String.prototype.sub ( )

              - +

              String.prototype.sup ( )

              This method performs the following steps when called:

              @@ -50261,7 +53347,7 @@

              String.prototype.sup ( )

              - +

              String.prototype.trimLeft ( )

              The property *"trimStart"* is preferred. The *"trimLeft"* property is provided principally for compatibility with old code. It is recommended that the *"trimStart"* property be used in new ECMAScript code.

              @@ -50269,7 +53355,7 @@

              String.prototype.trimLeft ( )

              The initial value of the *"trimLeft"* property is %String.prototype.trimStart%, defined in .

              - +

              String.prototype.trimRight ( )

              The property *"trimEnd"* is preferred. The *"trimRight"* property is provided principally for compatibility with old code. It is recommended that the *"trimEnd"* property be used in new ECMAScript code.

              @@ -50281,7 +53367,7 @@

              String.prototype.trimRight ( )

              Additional Properties of the Date.prototype Object

              - +

              Date.prototype.getYear ( )

              The `getFullYear` method is preferred for nearly all purposes, because it avoids the “year 2000 problem.”

              @@ -50296,7 +53382,7 @@

              Date.prototype.getYear ( )

              - +

              Date.prototype.setYear ( _year_ )

              The `setFullYear` method is preferred for nearly all purposes, because it avoids the “year 2000 problem.”

              @@ -50307,7 +53393,7 @@

              Date.prototype.setYear ( _year_ )

              1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). 1. Let _t_ be _dateObject_.[[DateValue]]. 1. Let _y_ be ? ToNumber(_year_). - 1. If _t_ is *NaN*, set _t_ to *+0*𝔽; otherwise, set _t_ to LocalTime(_t_). + 1. If _t_ is *NaN*, set _t_ to *+0*𝔽; else set _t_ to LocalTime(_t_). 1. Let _yyyy_ be MakeFullYear(_y_). 1. Let _d_ be MakeDay(_yyyy_, MonthFromTime(_t_), DateFromTime(_t_)). 1. Let _date_ be MakeDate(_d_, TimeWithinDay(_t_)). @@ -50317,7 +53403,7 @@

              Date.prototype.setYear ( _year_ )

              - +

              Date.prototype.toGMTString ( )

              The `toUTCString` method is preferred. This method is provided principally for compatibility with old code.

              @@ -50329,7 +53415,7 @@

              Date.prototype.toGMTString ( )

              Additional Properties of the RegExp.prototype Object

              - +

              RegExp.prototype.compile ( _pattern_, _flags_ )

              This method performs the following steps when called:

              @@ -50356,13 +53442,7 @@

              Other Additional Features

              Labelled Function Declarations

              -

              Prior to ECMAScript 2015, the specification of |LabelledStatement| did not allow for the association of a statement label with a |FunctionDeclaration|. However, a labelled |FunctionDeclaration| was an allowable extension for non-strict code and most browser-hosted ECMAScript implementations supported that extension. In ECMAScript 2015 and later, the grammar production for |LabelledStatement| permits use of |FunctionDeclaration| as a |LabelledItem| but includes an Early Error rule that produces a Syntax Error if that occurs. That rule is modified with the addition of the highlighted text:

              - LabelledItem : FunctionDeclaration -
                -
              • - It is a Syntax Error if any source text that is strict mode code is matched by this production. -
              • -
              +

              Prior to ECMAScript 2015, the specification of |LabelledStatement| did not allow for the association of a statement label with a |FunctionDeclaration|. However, a labelled |FunctionDeclaration| was an allowable extension for non-strict code and most browser-hosted ECMAScript implementations supported that extension. In ECMAScript 2015 and later, the grammar production for |LabelledStatement| permits use of |FunctionDeclaration| as a |LabelledItem| but includes an Early Error rule that produces a Syntax Error if that occurs. That rule is then modified to suppress the Syntax Error in non-strict code if the host supports this feature.

              The early error rules for |WithStatement|, |IfStatement|, and |IterationStatement| prevent these statements from containing a labelled |FunctionDeclaration| in non-strict code.

              @@ -50427,144 +53507,16 @@

              Block-Level Function Declarations Web Legacy Compatibility Semantics

              The first use case is interoperable with the semantics of |Block| level function declarations provided by ECMAScript 2015. Any pre-existing ECMAScript source text that employs that use case will operate using the Block level function declarations semantics defined by clauses , , and .

              ECMAScript 2015 interoperability for the second and third use cases requires the following extensions to the clause , clause , clause and clause semantics.

              If an ECMAScript implementation has a mechanism for reporting diagnostic warning messages, a warning should be produced when code contains a |FunctionDeclaration| for which these compatibility semantics are applied and introduce observable differences from non-compatibility semantics. For example, if a var binding is not introduced because its introduction would create an early error, a warning message should not be produced.

              - - -

              Changes to FunctionDeclarationInstantiation

              -

              During FunctionDeclarationInstantiation the following steps are performed in place of step :

              - - 1. If _strict_ is *false*, then - 1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of a |Block|, |CaseClause|, or |DefaultClause|, do - 1. Let _F_ be the StringValue of the |BindingIdentifier| of _f_. - 1. If replacing the |FunctionDeclaration| _f_ with a |VariableStatement| that has _F_ as a |BindingIdentifier| would not produce any Early Errors for _func_ and _parameterNames_ does not contain _F_, then - 1. NOTE: A var binding for _F_ is only instantiated here if it is neither a VarDeclaredName, the name of a formal parameter, or another |FunctionDeclaration|. - 1. If _instantiatedVarNames_ does not contain _F_ and _F_ is not *"arguments"*, then - 1. Perform ! _varEnv_.CreateMutableBinding(_F_, *false*). - 1. Perform ! _varEnv_.InitializeBinding(_F_, *undefined*). - 1. Append _F_ to _instantiatedVarNames_. - 1. When the |FunctionDeclaration| _f_ is evaluated, perform the following steps in place of the |FunctionDeclaration| Evaluation algorithm provided in : - 1. Let _fenv_ be the running execution context's VariableEnvironment. - 1. Let _benv_ be the running execution context's LexicalEnvironment. - 1. Let _fobj_ be ! _benv_.GetBindingValue(_F_, *false*). - 1. Perform ! _fenv_.SetMutableBinding(_F_, _fobj_, *false*). - 1. Return ~unused~. - -
              - - -

              Changes to GlobalDeclarationInstantiation

              -

              During GlobalDeclarationInstantiation the following steps are performed in place of step :

              - - 1. Perform the following steps: - 1. Let _strict_ be ScriptIsStrict of _script_. - 1. If _strict_ is *false*, then - 1. Let _declaredFunctionOrVarNames_ be the list-concatenation of _declaredFunctionNames_ and _declaredVarNames_. - 1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of a |Block|, |CaseClause|, or |DefaultClause| Contained within _script_, do - 1. Let _F_ be the StringValue of the |BindingIdentifier| of _f_. - 1. If replacing the |FunctionDeclaration| _f_ with a |VariableStatement| that has _F_ as a |BindingIdentifier| would not produce any Early Errors for _script_, then - 1. If _env_.HasLexicalDeclaration(_F_) is *false*, then - 1. Let _fnDefinable_ be ? _env_.CanDeclareGlobalVar(_F_). - 1. If _fnDefinable_ is *true*, then - 1. NOTE: A var binding for _F_ is only instantiated here if it is neither a VarDeclaredName nor the name of another |FunctionDeclaration|. - 1. If _declaredFunctionOrVarNames_ does not contain _F_, then - 1. Perform ? _env_.CreateGlobalVarBinding(_F_, *false*). - 1. Append _F_ to _declaredFunctionOrVarNames_. - 1. When the |FunctionDeclaration| _f_ is evaluated, perform the following steps in place of the |FunctionDeclaration| Evaluation algorithm provided in : - 1. Let _genv_ be the running execution context's VariableEnvironment. - 1. Let _benv_ be the running execution context's LexicalEnvironment. - 1. Let _fobj_ be ! _benv_.GetBindingValue(_F_, *false*). - 1. Perform ? _genv_.SetMutableBinding(_F_, _fobj_, *false*). - 1. Return ~unused~. - -
              - - -

              Changes to EvalDeclarationInstantiation

              -

              During EvalDeclarationInstantiation the following steps are performed in place of step :

              - - 1. If _strict_ is *false*, then - 1. Let _declaredFunctionOrVarNames_ be the list-concatenation of _declaredFunctionNames_ and _declaredVarNames_. - 1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of a |Block|, |CaseClause|, or |DefaultClause| Contained within _body_, do - 1. Let _F_ be the StringValue of the |BindingIdentifier| of _f_. - 1. If replacing the |FunctionDeclaration| _f_ with a |VariableStatement| that has _F_ as a |BindingIdentifier| would not produce any Early Errors for _body_, then - 1. Let _bindingExists_ be *false*. - 1. Let _thisEnv_ be _lexEnv_. - 1. Assert: The following loop will terminate. - 1. Repeat, while _thisEnv_ is not _varEnv_, - 1. If _thisEnv_ is not an Object Environment Record, then - 1. If ! _thisEnv_.HasBinding(_F_) is *true*, then - 1. [id="step-evaldeclarationinstantiation-web-compat-bindingexists"] Let _bindingExists_ be *true*. - 1. Set _thisEnv_ to _thisEnv_.[[OuterEnv]]. - 1. If _bindingExists_ is *false* and _varEnv_ is a Global Environment Record, then - 1. If _varEnv_.HasLexicalDeclaration(_F_) is *false*, then - 1. Let _fnDefinable_ be ? _varEnv_.CanDeclareGlobalVar(_F_). - 1. Else, - 1. Let _fnDefinable_ be *false*. - 1. Else, - 1. Let _fnDefinable_ be *true*. - 1. If _bindingExists_ is *false* and _fnDefinable_ is *true*, then - 1. If _declaredFunctionOrVarNames_ does not contain _F_, then - 1. If _varEnv_ is a Global Environment Record, then - 1. Perform ? _varEnv_.CreateGlobalVarBinding(_F_, *true*). - 1. Else, - 1. Let _bindingExists_ be ! _varEnv_.HasBinding(_F_). - 1. If _bindingExists_ is *false*, then - 1. Perform ! _varEnv_.CreateMutableBinding(_F_, *true*). - 1. Perform ! _varEnv_.InitializeBinding(_F_, *undefined*). - 1. Append _F_ to _declaredFunctionOrVarNames_. - 1. When the |FunctionDeclaration| _f_ is evaluated, perform the following steps in place of the |FunctionDeclaration| Evaluation algorithm provided in : - 1. Let _genv_ be the running execution context's VariableEnvironment. - 1. Let _benv_ be the running execution context's LexicalEnvironment. - 1. Let _fobj_ be ! _benv_.GetBindingValue(_F_, *false*). - 1. Perform ? _genv_.SetMutableBinding(_F_, _fobj_, *false*). - 1. Return ~unused~. - -
              - - -

              Changes to Block Static Semantics: Early Errors

              -

              The rules for the following production in are modified with the addition of the highlighted text:

              - Block : `{` StatementList `}` -
                -
              • - It is a Syntax Error if the LexicallyDeclaredNames of |StatementList| contains any duplicate entries, unless IsStrict(this production) is *false* and the duplicate entries are only bound by FunctionDeclarations. -
              • -
              • - It is a Syntax Error if any element of the LexicallyDeclaredNames of |StatementList| also occurs in the VarDeclaredNames of |StatementList|. -
              • -
              -
              - - -

              Changes to `switch` Statement Static Semantics: Early Errors

              -

              The rules for the following production in are modified with the addition of the highlighted text:

              - SwitchStatement : `switch` `(` Expression `)` CaseBlock -
                -
              • - It is a Syntax Error if the LexicallyDeclaredNames of |CaseBlock| contains any duplicate entries, unless IsStrict(this production) is *false* and the duplicate entries are only bound by FunctionDeclarations. -
              • -
              • - It is a Syntax Error if any element of the LexicallyDeclaredNames of |CaseBlock| also occurs in the VarDeclaredNames of |CaseBlock|. -
              • -
              -
              - - -

              Changes to BlockDeclarationInstantiation

              -

              During BlockDeclarationInstantiation the following steps are performed in place of step :

              - - 1. If ! _env_.HasBinding(_dn_) is *false*, then - 1. Perform ! _env_.CreateMutableBinding(_dn_, *false*). - -

              During BlockDeclarationInstantiation the following steps are performed in place of step :

              - - 1. Perform the following steps: - 1. If the binding for _fn_ in _env_ is an uninitialized binding, then - 1. Perform ! _env_.InitializeBinding(_fn_, _fo_). - 1. Else, - 1. Assert: _d_ is a |FunctionDeclaration|. - 1. Perform ! _env_.SetMutableBinding(_fn_, _fo_, *false*). - -
              +

              This feature involves special semantics at the following points:

              +
                +
              • one of the early error rules for Block : `{` StatementList `}` in
              • +
              • one of the early error rules for SwitchStatement : `switch` `(` Expression `)` CaseBlock in
              • +
              • step in FunctionDeclarationInstantiation
              • +
              • step in BlockDeclarationInstantiation
              • +
              • step in BlockDeclarationInstantiation
              • +
              • step in GlobalDeclarationInstantiation
              • +
              • step in EvalDeclarationInstantiation
              • +
              @@ -50582,31 +53534,11 @@

              FunctionDeclarations in IfStatement Statement Clauses

              VariableStatements in Catch Blocks

              -

              The content of subclause is replaced with the following:

              - Catch : `catch` `(` CatchParameter `)` Block -
                -
              • - It is a Syntax Error if the BoundNames of |CatchParameter| contains any duplicate elements. -
              • -
              • - It is a Syntax Error if any element of the BoundNames of |CatchParameter| also occurs in the LexicallyDeclaredNames of |Block|. -
              • -
              • - It is a Syntax Error if any element of the BoundNames of |CatchParameter| also occurs in the VarDeclaredNames of |Block| unless |CatchParameter| is CatchParameter : BindingIdentifier. -
              • -
              +

              In this feature, the |Block| of a |Catch| clause may contain `var` declarations that bind a name that is also bound by the |CatchParameter|. This is accomplished by modifying an early error rule for Catch : `catch` `(` CatchParameter `)` Block in .

              -

              The |Block| of a |Catch| clause may contain `var` declarations that bind a name that is also bound by the |CatchParameter|. At runtime, such bindings are instantiated in the VariableDeclarationEnvironment. They do not shadow the same-named bindings introduced by the |CatchParameter| and hence the |Initializer| for such `var` declarations will assign to the corresponding catch parameter rather than the `var` binding.

              +

              At runtime, such bindings are instantiated in the VariableDeclarationEnvironment. They do not shadow the same-named bindings introduced by the |CatchParameter| and hence the |Initializer| for such `var` declarations will assign to the corresponding catch parameter rather than the `var` binding.

              -

              This modified behaviour also applies to `var` and `function` declarations introduced by direct eval calls contained within the |Block| of a |Catch| clause. This change is accomplished by modifying the algorithm of as follows:

              -

              Step is replaced by:

              - - 1. If _thisEnv_ is not the Environment Record for a |Catch| clause, throw a *SyntaxError* exception. - -

              Step is replaced by:

              - - 1. If _thisEnv_ is not the Environment Record for a |Catch| clause, let _bindingExists_ be *true*. - +

              This modified behaviour also applies to `var` and `function` declarations introduced by direct eval calls contained within the |Block| of a |Catch| clause. This change is accomplished by modifying steps and in EvalDeclarationInstantiation.

              @@ -50678,32 +53610,12 @@

              The [[IsHTMLDDA]] Internal Slot

              Objects with an [[IsHTMLDDA]] internal slot are never created by this specification. However, the document.all object in web browsers is a host-defined exotic object with this slot that exists for web compatibility purposes. There are no other known examples of this type of object and implementations should not create any with the exception of `document.all`.

              - - -

              Changes to ToBoolean

              -

              The following step replaces step of ToBoolean:

              - - 1. If _argument_ is an Object and _argument_ has an [[IsHTMLDDA]] internal slot, return *false*. - -
              - - -

              Changes to IsLooselyEqual

              -

              The following steps replace step of IsLooselyEqual:

              - - 1. Perform the following steps: - 1. If _x_ is an Object, _x_ has an [[IsHTMLDDA]] internal slot, and _y_ is either *undefined* or *null*, return *true*. - 1. If _x_ is either *undefined* or *null*, _y_ is an Object, and _y_ has an [[IsHTMLDDA]] internal slot, return *true*. - -
              - - -

              Changes to the `typeof` Operator

              -

              The following step replaces step of the evaluation semantics for `typeof`:

              - - 1. If _val_ has an [[IsHTMLDDA]] internal slot, return *"undefined"*. - -
              +

              This feature involves special semantics at the following points:

              +
                +
              • step in ToBoolean
              • +
              • step in IsLooselyEqual
              • +
              • step in the evaluation semantics for `typeof`
              • +
              @@ -50715,6 +53627,15 @@

              Non-default behaviour in HostMakeJobCallback

              Non-default behaviour in HostEnsureCanAddPrivateElement

              The HostEnsureCanAddPrivateElement abstract operation allows hosts which are web browsers to specify non-default behaviour.

              + + +

              Runtime Errors for Function Call Assignment Targets

              +

              When a function call () is used as an assignment target in non-strict code, instead of producing an early error, a *ReferenceError* exception is thrown during evaluation of the assignment.

              + +

              When the assignment target is the |LeftHandSideExpression| of an |AssignmentExpression|, the assignment operator must be `=` or an |AssignmentOperator|; in particular, the allowance here does not apply to the logical assignment operators (`??=`, `&&=`, `||=`).

              +
              +

              See step of AssignmentTargetType for CallExpression : CoverCallExpressionAndAsyncArrowHead and CallExpression : CallExpression Arguments.

              +
              @@ -50793,6 +53714,7 @@

              Host Hooks

              HostGrowSharedArrayBuffer(...)

              HostHasSourceTextAvailable(...)

              HostLoadImportedModule(...)

              +

              HostGetSupportedImportAttributes(...)

              HostMakeJobCallback(...)

              HostPromiseRejectionTracker(...)

              HostResizeArrayBuffer(...)

              @@ -50839,8 +53761,8 @@

              Corrections and Clarifications in ECMAScript 2015 with Possible Compatibilit

              : If the year cannot be represented using the Date Time String Format specified in a RangeError exception is thrown. Previous editions did not specify the behaviour for that case.

              : Previous editions did not specify the value returned by `Date.prototype.toString` when the time value is *NaN*. ECMAScript 2015 specifies the result to be the String value *"Invalid Date"*.

              , : Any LineTerminator code points in the value of the *"source"* property of a RegExp instance must be expressed using an escape sequence. Edition 5.1 only required the escaping of `/`.

              -

              , : In previous editions, the specifications for `String.prototype.match` and `String.prototype.replace` was incorrect for cases where the pattern argument was a RegExp value whose `global` flag is set. The previous specifications stated that for each attempt to match the pattern, if `lastIndex` did not change, it should be incremented by 1. The correct behaviour is that `lastIndex` should be incremented by 1 only if the pattern matched the empty String.

              -

              : Previous editions did not specify how a *NaN* value returned by a _comparefn_ was interpreted by `Array.prototype.sort`. ECMAScript 2015 specifies that such as value is treated as if *+0*𝔽 was returned from the _comparefn_. ECMAScript 2015 also specifies that ToNumber is applied to the result returned by a _comparefn_. In previous editions, the effect of a _comparefn_ result that is not a Number value was implementation-defined. In practice, implementations call ToNumber.

              +

              , : In previous editions, the specifications for `String.prototype.match` and `String.prototype.replace` was incorrect for cases where the pattern argument was a RegExp value whose `global` flag is set. The previous specifications stated that for each attempt to match the pattern, if `lastIndex` did not change, it should be incremented by 1. The correct behaviour is that `lastIndex` should be incremented by 1 only if the pattern matched the empty String.

              +

              : Previous editions did not specify how a *NaN* value returned by a _comparator_ was interpreted by `Array.prototype.sort`. ECMAScript 2015 specifies that such as value is treated as if *+0*𝔽 was returned from the _comparator_. ECMAScript 2015 also specifies that ToNumber is applied to the result returned by a _comparator_. In previous editions, the effect of a _comparator_ result that is not a Number value was implementation-defined. In practice, implementations call ToNumber.

              @@ -50890,13 +53812,7 @@

              Additions and Changes That Introduce Incompatibilities with Prior Editions, : In ECMAScript 2019, the number of Jobs enqueued by `await` was reduced, which could create an observable difference in resolution order between a `then()` call and an `await` expression.

              - -

              Colophon

              -

              This specification is authored on GitHub in a plaintext source format called Ecmarkup. Ecmarkup is an HTML and Markdown dialect that provides a framework and toolset for authoring ECMAScript specifications in plaintext and processing the specification into a full-featured HTML rendering that follows the editorial conventions for this document. Ecmarkup builds on and integrates a number of other formats and technologies including Grammarkdown for defining syntax and Ecmarkdown for authoring algorithm steps. PDF renderings of this specification are produced by printing the HTML rendering to a PDF.

              -

              Prior editions of this specification were authored using Word—the Ecmarkup source text that formed the basis of this edition was produced by converting the ECMAScript 2015 Word document to Ecmarkup using an automated conversion tool.

              -
              - - +

              Bibliography

              1. @@ -50952,3 +53868,9 @@

                Bibliography

              + + +

              Colophon

              +

              This specification is authored on GitHub in a plaintext source format called Ecmarkup. Ecmarkup is an HTML and Markdown dialect that provides a framework and toolset for authoring Ecma specifications in plaintext and processing the specification into a full-featured HTML rendering that follows the editorial conventions for this document. Ecmarkup builds on and integrates a number of other formats and technologies including Grammarkdown for defining syntax and Ecmarkdown for authoring algorithm steps. PDF renderings of this specification are produced using a print stylesheet which takes advantage of the CSS Paged Media specification and is converted using PrinceXML.

              +

              Prior editions of this specification were authored using Word—the Ecmarkup source text that formed the basis of this edition was produced by converting the ECMAScript 2015 Word document to Ecmarkup using an automated conversion tool.

              +
              diff --git a/table-binary-unicode-properties-of-strings.html b/table-binary-unicode-properties-of-strings.html index 3bafffaee3..1b6479a126 100644 --- a/table-binary-unicode-properties-of-strings.html +++ b/table-binary-unicode-properties-of-strings.html @@ -3,7 +3,7 @@ - + diff --git a/table-binary-unicode-properties.html b/table-binary-unicode-properties.html index 169823b7b9..8ab11640ed 100644 --- a/table-binary-unicode-properties.html +++ b/table-binary-unicode-properties.html @@ -1,10 +1,10 @@ - Binary Unicode property aliases and their canonical property names + Binary Unicode property aliases and their canonical property names
              Property nameProperty name
              - - + + diff --git a/table-nonbinary-unicode-properties.html b/table-nonbinary-unicode-properties.html index b8af3e7b4d..2bf328116d 100644 --- a/table-nonbinary-unicode-properties.html +++ b/table-nonbinary-unicode-properties.html @@ -1,10 +1,10 @@ - Non-binary Unicode property aliases and their canonical property names + Non-binary Unicode property aliases and their canonical property names
              Property name and aliasesCanonical property nameProperty name and aliasesCanonical property name
              - - + +
              Property name and aliasesCanonical property nameProperty name and aliasesCanonical property name