diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5676f2b220e..b963a5530c1 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 237f4c9cc3e..6a14def1f97 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 424c2d3f974..9856f276255 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 d2358e0e477..ea456fd544d 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 00000000000..d540b5b4572 --- /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 6dc93259424..247254dda1f 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 00000000000..d45ba03cdc9 --- /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 608b514867c..4abe4a61479 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 00000000000..30d088cdc06 --- /dev/null +++ b/.github/workflows/pr-preview.yml @@ -0,0 +1,120 @@ +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: Acquire mutex + uses: ben-z/gh-action-mutex@v1.0.0-alpha.10 + with: + branch: pr-preview-mutex + - 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 --pr ${{ github.event.number }} + - 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 d2dd361ea53..00000000000 --- 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 c3ab4f7f835..00000000000 --- 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 dad842ff86b..436913a490e 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 9021ca22efb..d38d96743b1 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 00000000000..2c6a20177cf --- /dev/null +++ b/.github/workflows/spellcheck.yml @@ -0,0 +1,32 @@ +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}" + + alias-abbreviations: + name: 'check that aliases use all required abbreviations' + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v4 + - run: node scripts/check-alias-abbreviations.mjs diff --git a/.gitignore b/.gitignore index 1d3e390a130..21fcbc8f9d2 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 9fbc383dd7a..f2a4e6bfca0 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 00000000000..f69554b9bc7 --- /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 31ec63fc834..5fb010ec7fb 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 dcb61015962..0d84cfb4ad1 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 9fee7c8f3b4..32020be0a59 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 abb4252cb04..0605417e462 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 fe1ac95e653..0afff6683c2 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 d9da548aa38..76bd0290fda 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 ecf7d58520d..12628e8ed67 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 e37d9f76143..a23f0eeb25b 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 055ad7a6601..527bcd83075 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 bd2ac49ed18..44d533c1f1b 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.1.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", @@ -122,12 +271,6 @@ "tslib": "^2.4.0" } }, - "node_modules/@esfx/async-canceltoken/node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true - }, "node_modules/@esfx/cancelable": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@esfx/cancelable/-/cancelable-1.0.0.tgz", @@ -148,18 +291,62 @@ "tslib": "^2.4.0" } }, - "node_modules/@esfx/canceltoken/node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true - }, "node_modules/@esfx/disposable": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@esfx/disposable/-/disposable-1.0.0.tgz", "integrity": "sha512-hu7EI+YxlEWEKrb2himbS13HNaq5mlUePASf99KeQqkiNeqiAZbKqG4w59uDcLZs8JrV3qJqS/NYib5ZMhbfTQ==", "dev": true }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -195,3361 +382,1153 @@ "node": ">= 8" } }, - "node_modules/@pdf-lib/standard-fonts": { - "version": "1.0.0", + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "dev": true, "license": "MIT", - "dependencies": { - "pako": "^1.0.6" + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" } }, - "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/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@types/node": "*" - } - }, - "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 + "license": "ISC" }, - "node_modules/accepts": { - "version": "1.3.8", + "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", "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" + "fill-range": "^7.1.1" }, "engines": { - "node": ">= 0.6" + "node": ">=8" } }, - "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/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } + "license": "MIT" }, - "node_modules/acorn-globals": { - "version": "4.3.4", + "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": { - "acorn": "^6.0.1", - "acorn-walk": "^6.0.1" - } - }, - "node_modules/acorn-globals/node_modules/acorn": { - "version": "6.4.1", - "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" }, "engines": { - "node": ">=0.4.0" + "node": ">= 0.4" } }, - "node_modules/acorn-walk": { - "version": "6.2.0", + "node_modules/camel-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", + "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", "dev": true, "license": "MIT", - "engines": { - "node": ">=0.4.0" + "dependencies": { + "pascal-case": "^3.1.2", + "tslib": "^2.0.3" } }, - "node_modules/agent-base": { - "version": "7.1.0", + "node_modules/clean-css": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.3.tgz", + "integrity": "sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==", "dev": true, "license": "MIT", "dependencies": { - "debug": "^4.3.4" + "source-map": "~0.6.0" }, "engines": { - "node": ">= 14" + "node": ">= 10.0" } }, - "node_modules/agent-base/node_modules/debug": { - "version": "4.3.4", + "node_modules/color-convert": { + "version": "2.0.1", "dev": true, "license": "MIT", "dependencies": { - "ms": "2.1.2" + "color-name": "~1.1.4" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=7.0.0" } }, - "node_modules/agent-base/node_modules/ms": { - "version": "2.1.2", + "node_modules/color-name": { + "version": "1.1.4", "dev": true, "license": "MIT" }, - "node_modules/ajv": { - "version": "6.12.6", + "node_modules/combined-stream": { + "version": "1.0.8", "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" + "delayed-stream": "~1.0.0" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "6.0.1", - "dev": true, - "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "node": ">= 0.8" } }, - "node_modules/ansi-styles": { - "version": "4.3.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": { - "color-convert": "^2.0.1" + "array-back": "^3.1.0", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": ">=4.0.0" } }, - "node_modules/argparse": { - "version": "2.0.1", - "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==", + "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, + "dependencies": { + "array-back": "^4.0.2", + "chalk": "^2.4.2", + "table-layout": "^1.0.2", + "typical": "^5.2.0" + }, "engines": { - "node": ">=6" + "node": ">=8.0.0" } }, - "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/asn1": { - "version": "0.2.4", + "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": { - "safer-buffer": "~2.1.0" + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/assert-plus": { - "version": "1.0.0", + "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": ">=0.8" + "node": ">=8" } }, - "node_modules/ast-types": { - "version": "0.13.4", + "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": { - "tslib": "^2.0.1" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" }, "engines": { "node": ">=4" } }, - "node_modules/ast-types/node_modules/tslib": { - "version": "2.6.2", + "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": "0BSD" + "dependencies": { + "color-name": "1.1.3" + } }, - "node_modules/asynckit": { - "version": "0.4.0", - "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/aws-sign2": { - "version": "0.7.0", + "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": "Apache-2.0", "engines": { - "node": "*" + "node": ">=8" } }, - "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", - "dev": true, - "license": "MIT" - }, - "node_modules/bare-events": { - "version": "2.2.1", - "dev": true, - "license": "Apache-2.0", - "optional": true - }, - "node_modules/base64-js": { - "version": "1.5.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" - }, - "node_modules/basic-ftp": { - "version": "5.0.5", + "node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "dev": true, "license": "MIT", "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "tweetnacl": "^0.14.3" + "node": ">=14" } }, - "node_modules/bl": { - "version": "4.1.0", + "node_modules/css-select": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.2.2.tgz", + "integrity": "sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==", "dev": true, - "license": "MIT", + "license": "BSD-2-Clause", "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" } }, - "node_modules/body-parser": { - "version": "1.20.2", + "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": { - "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" + "mdn-data": "2.12.2", + "source-map-js": "^1.0.1" }, "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" } }, - "node_modules/body-parser/node_modules/qs": { - "version": "6.11.0", + "node_modules/css-what": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.2.2.tgz", + "integrity": "sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==", "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "side-channel": "^1.0.4" - }, + "license": "BSD-2-Clause", "engines": { - "node": ">=0.6" + "node": ">= 6" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/fb55" } }, - "node_modules/brace-expansion": { - "version": "1.1.11", + "node_modules/csso": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", + "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", "dev": true, "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "css-tree": "~2.2.0" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" } }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "node_modules/csso/node_modules/css-tree": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", + "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", "dev": true, + "license": "MIT", "dependencies": { - "fill-range": "^7.0.1" + "mdn-data": "2.0.28", + "source-map-js": "^1.0.1" }, "engines": { - "node": ">=8" + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" } }, - "node_modules/browser-process-hrtime": { - "version": "1.0.0", + "node_modules/csso/node_modules/mdn-data": { + "version": "2.0.28", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", + "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==", "dev": true, - "license": "BSD-2-Clause" + "license": "CC0-1.0" }, - "node_modules/buffer": { - "version": "5.7.1", + "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, - "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" - } - }, - "node_modules/buffer-crc32": { - "version": "0.2.13", - "dev": true, - "license": "MIT", + "@asamuzakjp/css-color": "^4.0.3", + "@csstools/css-syntax-patches-for-csstree": "^1.0.14", + "css-tree": "^3.1.0" + }, "engines": { - "node": "*" + "node": ">=20" } }, - "node_modules/bytes": { - "version": "3.1.2", + "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", - "engines": { - "node": ">= 0.8" + "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/call-bind": { - "version": "1.0.7", + "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": "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" + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^15.0.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=20" } }, - "node_modules/callsites": { - "version": "3.1.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", - "engines": { - "node": ">=6" - } + "license": "MIT" + }, + "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/caseless": { - "version": "0.12.0", + "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, - "license": "Apache-2.0" + "engines": { + "node": ">=4.0.0" + } }, - "node_modules/chalk": { - "version": "5.3.0", + "node_modules/delayed-stream": { + "version": "1.0.0", "dev": true, "license": "MIT", "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=0.4.0" } }, - "node_modules/chromium-bidi": { - "version": "0.4.16", + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", "dev": true, - "license": "Apache-2.0", + "license": "MIT", "dependencies": { - "mitt": "3.0.0" + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" }, - "peerDependencies": { - "devtools-protocol": "*" + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" } }, - "node_modules/clear-cut": { - "version": "2.0.2", + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", "dev": true, - "license": "MIT" + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "BSD-2-Clause" }, - "node_modules/cli-cursor": { - "version": "4.0.0", + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", "dev": true, - "license": "MIT", + "license": "BSD-2-Clause", "dependencies": { - "restore-cursor": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "domelementtype": "^2.3.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-spinners": { - "version": "2.9.2", - "dev": true, - "license": "MIT", "engines": { - "node": ">=6" + "node": ">= 4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/fb55/domhandler?sponsor=1" } }, - "node_modules/cliui": { - "version": "8.0.1", + "node_modules/domutils": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", + "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", "dev": true, - "license": "ISC", + "license": "BSD-2-Clause", "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" }, - "engines": { - "node": ">=12" + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" } }, - "node_modules/cliui/node_modules/ansi-regex": { - "version": "5.0.1", + "node_modules/dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", "dev": true, "license": "MIT", - "engines": { - "node": ">=8" + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" } }, - "node_modules/cliui/node_modules/strip-ansi": { - "version": "6.0.1", + "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": "MIT", "dependencies": { - "ansi-regex": "^5.0.1" + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" }, "engines": { - "node": ">=8" + "node": ">= 0.4" } }, - "node_modules/clone": { - "version": "1.0.4", + "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", - "engines": { - "node": ">=0.8" + "dependencies": { + "escape-html": "^1.0.1" } }, - "node_modules/color-convert": { - "version": "2.0.1", + "node_modules/ecmarkup": { + "version": "24.1.0", + "resolved": "https://registry.npmjs.org/ecmarkup/-/ecmarkup-24.1.0.tgz", + "integrity": "sha512-mdS/6VB9WKdEOeR3SEMl6u1ML7T1A6dif+8q5XxSTK73F2JXjJwpY04FoM+a3w/S3acepb2cvFxB+0r3yIE0xg==", "dev": true, "license": "MIT", "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "dev": true, - "license": "MIT", - "dependencies": { - "delayed-stream": "~1.0.0" + "chalk": "^4.1.2", + "clean-css": "^5.3.3", + "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", + "html-minifier-terser": "^7.2.0", + "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", + "svgo": "^4.0.1", + "terser": "^5.46.1" }, - "engines": { - "node": ">= 0.8" - } - }, - "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, - "dependencies": { - "array-back": "^3.1.0", - "find-replace": "^3.0.0", - "lodash.camelcase": "^4.3.0", - "typical": "^4.0.0" + "bin": { + "ecmarkup": "bin/ecmarkup.js", + "emu-format": "bin/emu-format.js" }, "engines": { - "node": ">=4.0.0" + "node": ">= 24" } }, - "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/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": { - "array-back": "^4.0.2", - "chalk": "^2.4.2", - "table-layout": "^1.0.2", - "typical": "^5.2.0" - }, - "engines": { - "node": ">=8.0.0" + "sprintf-js": "~1.0.2" } }, - "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/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": { - "color-convert": "^1.9.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=4" - } - }, - "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, - "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==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "node": ">=10" }, - "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_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==", - "dev": true, - "engines": { - "node": ">=8" + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/commander": { - "version": "11.1.0", + "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": { + "@asamuzakjp/css-color": "^2.8.2", + "rrweb-cssom": "^0.8.0" + }, "engines": { - "node": ">=16" + "node": ">=18" } }, - "node_modules/concat-map": { - "version": "0.0.1", + "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": "MIT" }, - "node_modules/content-disposition": { - "version": "0.5.4", + "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, "license": "MIT", "dependencies": { - "safe-buffer": "5.2.1" + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" }, "engines": { - "node": ">= 0.6" + "node": ">=18" } }, - "node_modules/content-type": { - "version": "1.0.5", + "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": ">= 0.6" + "node": ">= 6" } }, - "node_modules/cookie": { - "version": "0.5.0", + "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.6" + "node": ">=8" } }, - "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/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": { - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=14" + "argparse": "^1.0.7", + "esprima": "^4.0.0" }, - "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" + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/cross-fetch/node_modules/node-fetch": { - "version": "2.7.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": { - "whatwg-url": "^5.0.0" + "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": "4.x || >=6.0.0" + "node": ">=18" }, "peerDependencies": { - "encoding": "^0.1.0" + "canvas": "^2.11.2" }, "peerDependenciesMeta": { - "encoding": { + "canvas": { "optional": true } } }, - "node_modules/css-tree": { - "version": "1.1.3", - "dev": true, - "license": "MIT", - "dependencies": { - "mdn-data": "2.0.14", - "source-map": "^0.6.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "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", - "dev": true, - "license": "MIT", - "dependencies": { - "cssom": "~0.3.6" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cssstyle/node_modules/cssom": { - "version": "0.3.8", + "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": "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", + "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", "dependencies": { - "assert-plus": "^1.0.0" + "entities": "^4.5.0" }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/data-uri-to-buffer": { - "version": "4.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 12" - } - }, - "node_modules/data-urls": { - "version": "1.1.0", - "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" + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "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==", + "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/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" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/define-data-property": { - "version": "1.1.4", - "dev": true, - "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/degenerator": { - "version": "5.0.1", - "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" - }, - "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_modules/destroy": { - "version": "1.2.0", - "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_modules/ecc-jsbn": { - "version": "0.1.2", - "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" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "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/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==", - "dev": true, - "dependencies": { - "tr46": "^3.0.0", - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/ecmarkup/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, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "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", - "dev": true, - "dependencies": { - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/ecmarkup/node_modules/escodegen": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", - "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", - "dev": true, - "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" - }, - "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_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==", - "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": { + "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": "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", + "dependencies": { + "has-flag": "^4.0.0" + }, "engines": { - "node": ">= 0.6" + "node": ">=8" } }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "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": "BSD-3-Clause", "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" + "tldts": "^6.1.32" }, "engines": { - "node": ">=8.6" + "node": ">=16" } }, - "node_modules/mime": { - "version": "1.6.0", + "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", - "bin": { - "mime": "cli.js" + "dependencies": { + "punycode": "^2.3.1" }, "engines": { - "node": ">=4" + "node": ">=18" } }, - "node_modules/mime-db": { - "version": "1.52.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": "MIT", + "license": "BSD-2-Clause", "engines": { - "node": ">= 0.6" + "node": ">=12" } }, - "node_modules/mime-types": { - "version": "2.1.35", + "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": { - "mime-db": "1.52.0" + "tr46": "^5.0.0", + "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">= 0.6" + "node": ">=18" } }, - "node_modules/mimic-fn": { - "version": "2.1.0", + "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", + "license": "BSD-2-Clause", "engines": { - "node": ">=6" - } - }, - "node_modules/minimatch": { - "version": "3.0.4", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" + "node": ">=0.12" }, - "engines": { - "node": "*" + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" } }, - "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", + "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": ">= 0.6" + "node": ">= 0.4" } }, - "node_modules/netmask": { - "version": "2.0.2", + "node_modules/es-errors": { + "version": "1.3.0", "dev": true, "license": "MIT", "engines": { - "node": ">= 0.4.0" + "node": ">= 0.4" } }, - "node_modules/next-tick": { - "version": "1.1.0", - "dev": true, - "license": "ISC" - }, - "node_modules/node-domexception": { - "version": "1.0.0", + "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, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, "engines": { - "node": ">=10.5.0" + "node": ">= 0.4" } }, - "node_modules/node-fetch": { - "version": "3.3.2", + "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": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" + "node": ">= 0.4" } }, - "node_modules/nwsapi": { - "version": "2.2.0", + "node_modules/escape-html": { + "version": "1.0.3", "dev": true, "license": "MIT" }, - "node_modules/oauth-sign": { - "version": "0.9.0", + "node_modules/escape-string-regexp": { + "version": "1.0.5", "dev": true, - "license": "Apache-2.0", + "license": "MIT", "engines": { - "node": "*" + "node": ">=0.8.0" } }, - "node_modules/object-inspect": { - "version": "1.13.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, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" + "dependencies": { + "@babel/code-frame": "7.12.11", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/on-finished": { - "version": "2.4.1", + "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, - "license": "MIT", "dependencies": { - "ee-first": "1.1.1" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">= 0.8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/once": { - "version": "1.4.0", + "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, - "license": "ISC", - "dependencies": { - "wrappy": "1" + "engines": { + "node": ">=8" } }, - "node_modules/onetime": { - "version": "5.1.2", + "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, - "license": "MIT", "dependencies": { - "mimic-fn": "^2.1.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/optionator": { - "version": "0.8.3", + "node_modules/esprima": { + "version": "4.0.1", "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" + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" }, "engines": { - "node": ">= 0.8.0" + "node": ">=4" } }, - "node_modules/ora": { - "version": "6.3.1", + "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": { - "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" + "@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": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8.6.0" } }, - "node_modules/pac-proxy-agent": { - "version": "7.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": { - "@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" + "reusify": "^1.0.4" } }, - "node_modules/pac-proxy-agent/node_modules/debug": { - "version": "4.3.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": { - "ms": "2.1.2" + "to-regex-range": "^5.0.1" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=8" } }, - "node_modules/pac-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/pac-resolver": { - "version": "7.0.1", + "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": { - "degenerator": "^5.0.0", - "netmask": "^2.0.2" + "array-back": "^3.0.1" }, "engines": { - "node": ">= 14" + "node": ">=4.0.0" } }, - "node_modules/pagedjs": { - "version": "0.4.3", + "node_modules/function-bind": { + "version": "1.1.2", "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" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/pagedjs-cli": { - "version": "0.4.3", + "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": { - "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" + "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" }, - "bin": { - "pagedjs-cli": "src/cli.js" + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/pako": { - "version": "1.0.11", - "dev": true, - "license": "(MIT AND Zlib)" - }, - "node_modules/parent-module": { + "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": { - "callsites": "^3.0.0" + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" }, "engines": { - "node": ">=6" + "node": ">= 0.4" } }, - "node_modules/parse-json": { - "version": "5.2.0", + "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": { - "@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" + "is-glob": "^4.0.1" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">= 6" } }, - "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", + "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", "engines": { - "node": ">= 0.8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "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/path-is-absolute": { - "version": "1.0.1", + "node_modules/has-flag": { + "version": "3.0.0", "dev": true, "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, - "node_modules/path-to-regexp": { - "version": "0.1.7", - "dev": true, - "license": "MIT" - }, - "node_modules/path-type": { - "version": "4.0.0", + "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", "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/pdf-lib": { - "version": "1.17.1", + "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": { - "@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, + "has-symbols": "^1.0.3" + }, "engines": { - "node": ">=8.6" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/pn": { - "version": "1.1.0", - "dev": true, - "license": "MIT" - }, - "node_modules/prelude-ls": { - "version": "1.1.2", + "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": { + "function-bind": "^1.1.2" + }, "engines": { - "node": ">= 0.8.0" + "node": ">= 0.4" } }, - "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", + "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, - "dependencies": { - "@esfx/cancelable": "^1.0.0 || >=1.0.0-pre.13", - "@esfx/disposable": "^1.0.0 || >=1.0.0-pre.13" + "engines": { + "node": ">=12.0.0" } }, - "node_modules/progress": { - "version": "2.0.3", + "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": { + "whatwg-encoding": "^3.1.1" + }, "engines": { - "node": ">=0.4.0" + "node": ">=18" } }, - "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==", + "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/proxy-addr": { - "version": "2.0.7", + "node_modules/html-minifier-terser": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-7.2.0.tgz", + "integrity": "sha512-tXgn3QfqPIpGl9o+K5tpcj3/MN4SfLtsx2GWwBC3SSd0tXQGyF3gsSqad8loJgKZGM3ZxbYDd5yhiBIdWpmvLA==", "dev": true, "license": "MIT", "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" + "camel-case": "^4.1.2", + "clean-css": "~5.3.2", + "commander": "^10.0.0", + "entities": "^4.4.0", + "param-case": "^3.0.4", + "relateurl": "^0.2.7", + "terser": "^5.15.1" + }, + "bin": { + "html-minifier-terser": "cli.js" }, "engines": { - "node": ">= 0.10" + "node": "^14.13.1 || >=16.0.0" } }, - "node_modules/proxy-agent": { - "version": "6.3.0", + "node_modules/http-proxy-agent": { + "version": "7.0.2", "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" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { "node": ">= 14" } }, - "node_modules/proxy-agent/node_modules/debug": { + "node_modules/http-proxy-agent/node_modules/debug": { "version": "4.3.4", "dev": true, "license": "MIT", @@ -3565,77 +1544,26 @@ } } }, - "node_modules/proxy-agent/node_modules/ms": { + "node_modules/http-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", + "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", - "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" + "agent-base": "^7.1.2", + "debug": "4" }, "engines": { - "node": ">=16.3.0" - }, - "peerDependencies": { - "typescript": ">= 4.7.4" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "node": ">= 14" } }, - "node_modules/puppeteer-core/node_modules/debug": { + "node_modules/https-proxy-agent/node_modules/debug": { "version": "4.3.4", "dev": true, "license": "MIT", @@ -3651,484 +1579,449 @@ } } }, - "node_modules/puppeteer-core/node_modules/ms": { + "node_modules/https-proxy-agent/node_modules/ms": { "version": "2.1.2", "dev": true, "license": "MIT" }, - "node_modules/qs": { - "version": "6.5.2", + "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": "BSD-3-Clause", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, "engines": { - "node": ">=0.6" + "node": ">=0.10.0" } }, - "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", + "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, - "license": "MIT", "engines": { - "node": ">= 0.6" + "node": ">=0.10.0" } }, - "node_modules/raw-body": { - "version": "2.5.2", + "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": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" + "is-extglob": "^2.1.1" }, "engines": { - "node": ">= 0.8" + "node": ">=0.10.0" } }, - "node_modules/readable-stream": { - "version": "3.6.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", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, "engines": { - "node": ">= 6" + "node": ">=0.12.0" } }, - "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==", + "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, - "engines": { - "node": ">=6" - } + "license": "MIT" }, - "node_modules/regenerator-runtime": { - "version": "0.13.11", + "node_modules/js-tokens": { + "version": "4.0.0", "dev": true, "license": "MIT" }, - "node_modules/replace-ext": { - "version": "2.0.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": { + "@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": ">= 10" + "node": ">=20" + }, + "peerDependencies": { + "canvas": "^3.0.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } } }, - "node_modules/request": { - "version": "2.88.2", + "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": "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" - }, + "license": "BSD-2-Clause", "engines": { - "node": ">= 6" + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/request-promise-core": { - "version": "1.1.3", + "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": "ISC", + "license": "MIT", "dependencies": { - "lodash": "^4.17.15" - }, - "engines": { - "node": ">=0.10.0" + "entities": "^6.0.0" }, - "peerDependencies": { - "request": "^2.34" + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/request-promise-native": { - "version": "1.0.8", + "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/lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "dev": true, + "license": "MIT", "dependencies": { - "request-promise-core": "1.1.3", - "stealthy-require": "^1.1.1", - "tough-cookie": "^2.3.3" - }, + "tslib": "^2.0.3" + } + }, + "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": ">=0.12.0" - }, - "peerDependencies": { - "request": "^2.34" + "node": "20 || >=22" } }, - "node_modules/require-directory": { - "version": "2.1.1", + "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", "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" } }, - "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/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": "CC0-1.0" }, - "node_modules/resolve-from": { - "version": "4.0.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": ">=4" + "node": ">= 8" } }, - "node_modules/restore-cursor": { - "version": "4.0.0", + "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": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" + "braces": "^3.0.3", + "picomatch": "^2.3.1" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8.6" } }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "node_modules/mime-db": { + "version": "1.52.0", "dev": true, + "license": "MIT", "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" + "node": ">= 0.6" } }, - "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==", + "node_modules/mime-types": { + "version": "2.1.35", "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": { - "queue-microtask": "^1.2.2" + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" } }, - "node_modules/safe-buffer": { - "version": "5.2.1", + "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/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" + "url": "https://github.com/sponsors/ai" } ], - "license": "MIT" - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/saxes": { - "version": "3.1.11", - "dev": true, - "license": "ISC", - "dependencies": { - "xmlchars": "^2.1.1" + "license": "MIT", + "peer": true, + "bin": { + "nanoid": "bin/nanoid.cjs" }, "engines": { - "node": ">=8" + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/send": { - "version": "0.18.0", + "node_modules/no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", "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" - }, - "engines": { - "node": ">= 0.8.0" + "lower-case": "^2.0.2", + "tslib": "^2.0.3" } }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "dev": true, - "license": "MIT" - }, - "node_modules/serve-static": { - "version": "1.15.0", + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", "dev": true, - "license": "MIT", + "license": "BSD-2-Clause", "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" + "boolbase": "^1.0.0" }, - "engines": { - "node": ">= 0.8.0" + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" } }, - "node_modules/set-function-length": { - "version": "1.2.1", + "node_modules/nwsapi": { + "version": "2.2.0", + "dev": true, + "license": "MIT" + }, + "node_modules/param-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", + "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", "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" - }, - "engines": { - "node": ">= 0.4" + "dot-case": "^3.0.4", + "tslib": "^2.0.3" } }, - "node_modules/setprototypeof": { - "version": "1.2.0", + "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": "ISC" + "license": "MIT" }, - "node_modules/side-channel": { - "version": "1.0.6", + "node_modules/pascal-case": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", + "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", "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" + "no-case": "^3.0.4", + "tslib": "^2.0.3" } }, - "node_modules/signal-exit": { - "version": "3.0.7", + "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": "ISC" }, - "node_modules/smart-buffer": { - "version": "4.2.0", + "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", "engines": { - "node": ">= 6.0.0", - "npm": ">= 3.0.0" + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/socks": { - "version": "2.8.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": { - "ip-address": "^9.0.5", - "smart-buffer": "^4.2.0" + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" }, "engines": { - "node": ">= 10.0.0", - "npm": ">= 3.0.0" + "node": "^10 || ^12 || >=14" } }, - "node_modules/socks-proxy-agent": { - "version": "8.0.2", + "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": { - "agent-base": "^7.0.2", - "debug": "^4.3.4", - "socks": "^2.7.1" - }, - "engines": { - "node": ">= 14" + "@esfx/cancelable": "^1.0.0 || >=1.0.0-pre.13", + "@esfx/disposable": "^1.0.0 || >=1.0.0-pre.13" } }, - "node_modules/socks-proxy-agent/node_modules/debug": { - "version": "4.3.4", + "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": { - "ms": "2.1.2" - }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=6" } }, - "node_modules/socks-proxy-agent/node_modules/ms": { - "version": "2.1.2", + "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, - "license": "MIT" + "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/source-map": { - "version": "0.6.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": "BSD-3-Clause", "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/sprintf-js": { - "version": "1.1.3", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/sshpk": { - "version": "1.16.1", + "node_modules/relateurl": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", + "integrity": "sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==", "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": ">= 0.10" } }, - "node_modules/statuses": { - "version": "2.0.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", "engines": { - "node": ">= 0.8" + "node": ">=0.10.0" } }, - "node_modules/stdin-discarder": { - "version": "0.1.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": { - "bl": "^5.0.0" - }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "iojs": ">=1.0.0", + "node": ">=0.10.0" } }, - "node_modules/stdin-discarder/node_modules/bl": { - "version": "5.1.0", + "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", - "dependencies": { - "buffer": "^6.0.3", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } + "license": "MIT" }, - "node_modules/stdin-discarder/node_modules/buffer": { - "version": "6.0.3", + "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": [ { @@ -4144,95 +2037,116 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" + "queue-microtask": "^1.2.2" } }, - "node_modules/stealthy-require": { - "version": "1.1.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": "ISC", + "license": "MIT" + }, + "node_modules/sax": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.6.0.tgz", + "integrity": "sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA==", + "dev": true, + "license": "BlueOak-1.0.0", "engines": { - "node": ">=0.10.0" + "node": ">=11.0.0" } }, - "node_modules/streamx": { - "version": "2.16.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": { - "fast-fifo": "^1.1.0", - "queue-tick": "^1.0.1" + "xmlchars": "^2.2.0" }, - "optionalDependencies": { - "bare-events": "^2.2.0" + "engines": { + "node": ">=v12.22.7" } }, - "node_modules/string_decoder": { - "version": "1.3.0", + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.2.0" + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" } }, - "node_modules/string-width": { - "version": "4.2.3", + "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": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, + "license": "BSD-3-Clause", "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "5.0.1", + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, "license": "MIT", - "engines": { - "node": ">=8" + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" } }, - "node_modules/string-width/node_modules/strip-ansi": { - "version": "6.0.1", + "node_modules/supports-color": { + "version": "5.5.0", "dev": true, "license": "MIT", "dependencies": { - "ansi-regex": "^5.0.1" + "has-flag": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/strip-ansi": { - "version": "7.1.0", + "node_modules/svgo": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-4.0.1.tgz", + "integrity": "sha512-XDpWUOPC6FEibaLzjfe0ucaV0YrOjYotGJO1WpF0Zd+n6ZGEQUsSugaoLq9QkEZtAfQIxT42UChcssDVPP3+/w==", "dev": true, "license": "MIT", "dependencies": { - "ansi-regex": "^6.0.1" + "commander": "^11.1.0", + "css-select": "^5.1.0", + "css-tree": "^3.0.1", + "css-what": "^6.1.0", + "csso": "^5.0.5", + "picocolors": "^1.1.1", + "sax": "^1.5.0" + }, + "bin": { + "svgo": "bin/svgo.js" }, "engines": { - "node": ">=12" + "node": ">=16" }, "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "type": "opencollective", + "url": "https://opencollective.com/svgo" } }, - "node_modules/supports-color": { - "version": "5.5.0", + "node_modules/svgo/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", "dev": true, "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, "engines": { - "node": ">=4" + "node": ">=16" } }, "node_modules/symbol-tree": { @@ -4273,56 +2187,58 @@ "node": ">=8" } }, - "node_modules/tar-fs": { - "version": "3.0.4", + "node_modules/terser": { + "version": "5.46.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.46.1.tgz", + "integrity": "sha512-vzCjQO/rgUuK9sf8VJZvjqiqiHFaZLnOiimmUuOKODxWL8mm/xua7viT7aqX7dgPY60otQjUotzFMmCB4VdmqQ==", "dev": true, - "license": "MIT", + "license": "BSD-2-Clause", "dependencies": { - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^3.1.5" + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.15.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" } }, - "node_modules/tar-fs/node_modules/tar-stream": { - "version": "3.1.7", + "node_modules/terser/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, - "license": "MIT", - "dependencies": { - "b4a": "^1.6.4", - "fast-fifo": "^1.2.0", - "streamx": "^2.15.0" - } + "license": "MIT" }, - "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,82 +2246,58 @@ "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", + "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": "ISC" + "license": "MIT" }, - "node_modules/type-check": { - "version": "0.3.2", + "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": { - "prelude-ls": "~1.1.2" + "punycode": "^2.3.1" }, "engines": { - "node": ">= 0.8.0" + "node": ">=20" } }, - "node_modules/type-is": { - "version": "1.6.18", + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "dev": true, - "license": "MIT", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } + "license": "0BSD" }, "node_modules/typical": { "version": "4.0.0", @@ -4416,174 +2308,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 +2390,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 +2413,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 99a69bd79c0..65dc32b74c0 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.1.0", + "jsdom": "^27.0.0" } } diff --git a/scripts/check-alias-abbreviations.csv b/scripts/check-alias-abbreviations.csv new file mode 100644 index 00000000000..a501fccdabe --- /dev/null +++ b/scripts/check-alias-abbreviations.csv @@ -0,0 +1,24 @@ +root word,chosen abbreviation +argument,arg +asynchronous,async +attribute,attr +boolean,bool +character,char +constructor,ctor +declaration,decl +declarative,decl +descriptor,desc +environment,env +expression,expr +function,func +generator,gen +integer,int +object,obj +parameter,param +prototype,proto +reference,ref +regularExpression,regexp +statement,stmt +synchronous,sync +timeValue,tv +typedArray,ta diff --git a/scripts/check-alias-abbreviations.mjs b/scripts/check-alias-abbreviations.mjs new file mode 100644 index 00000000000..5aea572a272 --- /dev/null +++ b/scripts/check-alias-abbreviations.mjs @@ -0,0 +1,268 @@ +#!/usr/bin/env node + +import fs from 'node:fs'; +import path from 'node:path'; +import {fileURLToPath} from 'node:url'; + +const DEFAULT_SPEC_PATH = fileURLToPath(new URL('../spec.html', import.meta.url)); +const ROOT_WORD_REPLACEMENTS_PATH = new URL('./check-alias-abbreviations.csv', import.meta.url); + +const aliasPattern = /\b_([A-Za-z][A-Za-z0-9]*)_\b/g; + +const allowedAliases = new Set([ + 'TypedArray', + 'argumentListNode', + 'argumentsNode', + 'argumentsObj', + 'argumentsObjNeeded', + 'isTypedArray', +]); + +const rootWordReplacements = readRootWordReplacements(ROOT_WORD_REPLACEMENTS_PATH); + +const args = parseArgs(process.argv.slice(2)); +const source = fs.readFileSync(args.specPath, 'utf8'); +const relativeSpecPath = path.relative(process.cwd(), args.specPath) || path.basename(args.specPath); +const warnings = []; + +for (const [lineIndex, line] of source.split(/\r?\n/).entries()) { + for (const match of line.matchAll(aliasPattern)) { + const alias = match[1]; + if (allowedAliases.has(alias)) { + continue; + } + + const underscoreOffset = match.index; + const hits = findDisallowedRootWords(alias); + if (hits.length === 0) { + continue; + } + + const suggestedAlias = suggestAlias(alias, hits); + for (const hit of hits) { + const column = underscoreOffset + hit.start + 2; + warnings.push({ + alias, + column, + endColumn: column + hit.matchedText.length, + hit, + lineNumber: lineIndex + 1, + suggestedAlias, + }); + } + } +} + +for (const warning of warnings) { + const {alias, column, endColumn, hit, lineNumber, suggestedAlias} = warning; + const title = 'Disallowed Alias Root Word'; + const message = + `Alias _${alias}_ contains disallowed component ${JSON.stringify(hit.matchedText)}; ` + + `use ${JSON.stringify(hit.abbreviation)} instead (suggested alias: _${suggestedAlias}_).`; + console.log( + `::warning file=${escapeProperty(relativeSpecPath)},line=${lineNumber},endLine=${lineNumber},` + + `col=${column},endColumn=${endColumn},title=${escapeProperty(title)}::${escapeData(message)}`, + ); +} + +if (warnings.length === 0) { + console.log(`No disallowed alias root words found in ${relativeSpecPath}.`); +} + +function parseArgs(argv) { + let specPath = undefined; + + for (const arg of argv) { + if (arg === '--help') { + console.log('Usage: node scripts/check-alias-abbreviations.mjs [path/to/spec.html]'); + process.exit(1); + } + if (arg.startsWith('-')) { + throw new Error(`Unknown option: ${arg}`); + } + if (specPath !== undefined) { + throw new Error(`Unexpected argument: ${arg}`); + } + specPath = path.resolve(arg); + } + + specPath ||= DEFAULT_SPEC_PATH; + return {specPath}; +} + +function readRootWordReplacements(csvPath) { + const lines = fs.readFileSync(csvPath, 'utf8') + .split(/\r?\n/) + .filter((line) => line.trim() !== ''); + + const [header, ...rows] = lines; + if (header !== 'root word,chosen abbreviation') { + throw new Error('Expected check-alias-abbreviations.csv to start with "root word,chosen abbreviation".'); + } + + return rows.map((line, index) => { + const rowNumber = index + 2; + const [rootWord, abbreviation, ...extraColumns] = parseCsvRow(line); + if (!rootWord || !abbreviation || extraColumns.length > 0) { + throw new Error(`Invalid check-alias-abbreviations.csv row ${rowNumber}: expected two columns.`); + } + + return { + abbreviation, + parts: splitName(rootWord).map((part) => part.text.toLowerCase()), + rootWord, + }; + }); +} + +function parseCsvRow(row) { + const cells = []; + let cell = ''; + let inQuotes = false; + + for (let index = 0; index < row.length; index += 1) { + const character = row[index]; + + if (inQuotes) { + if (character === '"' && row[index + 1] === '"') { + cell += '"'; + index += 1; + } else if (character === '"') { + inQuotes = false; + } else { + cell += character; + } + continue; + } + + if (character === ',') { + cells.push(cell); + cell = ''; + } else if (character === '"' && cell === '') { + inQuotes = true; + } else { + cell += character; + } + } + + if (inQuotes) { + throw new Error(`Invalid CSV row with unterminated quoted field: ${row}`); + } + + cells.push(cell); + return cells; +} + +function splitName(name) { + const parts = []; + const partPattern = /[A-Z]+(?=[A-Z][a-z]|[0-9]|$)|[A-Z]?[a-z]+|[0-9]+/g; + + for (const match of name.matchAll(partPattern)) { + parts.push({ + end: match.index + match[0].length, + start: match.index, + text: match[0], + }); + } + + return parts; +} + +function findDisallowedRootWords(alias) { + const parts = splitName(alias); + const candidates = []; + + for (const root of rootWordReplacements) { + for (let index = 0; index <= parts.length - root.parts.length; index += 1) { + const candidate = matchRootAtPart(alias, parts, root, index); + if (candidate) { + candidates.push(candidate); + } + } + } + + candidates.sort((a, b) => + a.start - b.start || + (b.end - b.start) - (a.end - a.start) || + a.rootWord.localeCompare(b.rootWord), + ); + + const hits = []; + for (const candidate of candidates) { + if (hits.some((hit) => rangesOverlap(hit, candidate))) { + continue; + } + hits.push(candidate); + } + + return hits; +} + +function matchRootAtPart(alias, parts, root, startPartIndex) { + let end = null; + + for (let offset = 0; offset < root.parts.length; offset += 1) { + const part = parts[startPartIndex + offset]; + const partText = part.text.toLowerCase(); + const rootPart = root.parts[offset]; + const isLastPart = offset === root.parts.length - 1; + + if (partText === rootPart) { + if (isLastPart) { + end = part.end; + } + continue; + } + + if (isLastPart && partText === `${rootPart}s`) { + end = part.end - 1; + continue; + } + + return null; + } + + const start = parts[startPartIndex].start; + const matchedText = alias.slice(start, end); + const replacement = formatReplacement(alias, start, matchedText, root.abbreviation); + return { + abbreviation: root.abbreviation, + end, + matchedText, + replacement, + rootWord: root.rootWord, + start, + }; +} + +function formatReplacement(alias, start, matchedText, abbreviation) { + if (start > 0 && /^[A-Z]/.test(matchedText)) { + return abbreviation[0].toUpperCase() + abbreviation.slice(1); + } + return abbreviation; +} + +function rangesOverlap(a, b) { + return a.start < b.end && b.start < a.end; +} + +function suggestAlias(alias, hits) { + let suggested = alias; + for (const hit of [...hits].sort((a, b) => b.start - a.start)) { + suggested = `${suggested.slice(0, hit.start)}${hit.replacement}${suggested.slice(hit.end)}`; + } + return suggested; +} + +function escapeData(value) { + return value + .replace(/%/g, '%25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A'); +} + +function escapeProperty(value) { + return escapeData(value) + .replace(/:/g, '%3A') + .replace(/,/g, '%2C'); +} diff --git a/scripts/check-form.js b/scripts/check-form.js index 2282f625400..823e0dd2b9d 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,9 +227,8 @@ const legacy = new Set([ 'himsngh', 'angleKH', 'ivan-pan', - 'szuend', 'chrikrah', - 'viktmv', + '0xfirelight', // 'viktmv' (renamed) 'bathos', 'johnnyrainbow', 'Kriyszig', @@ -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 41657f2f0fe..00578b6f242 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 00000000000..f38aa9ead44 --- /dev/null +++ b/scripts/insert-snapshot-warning.js @@ -0,0 +1,183 @@ +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const util = require('util'); +const { JSDOM, VirtualConsole } = require('jsdom'); +const { execSync } = require('child_process'); + +const makeHref = (parentHref, path) => + new URL(path, parentHref.replace(/\/?$/, '/')).href; + +// https://docs.github.com/en/actions/reference/workflows-and-actions/variables +const { + GITHUB_EVENT_PATH, + GITHUB_SERVER_URL = 'https://github.com', + GITHUB_REPOSITORY = 'tc39/ecma262', +} = process.env; +const REPO_URL = makeHref(GITHUB_SERVER_URL, GITHUB_REPOSITORY); + +const COMMIT = String(execSync('git rev-parse --verify HEAD')).trim(); +const PR = (() => { + const cliOptions = { + pr: { type: 'string' }, + }; + const args = util.parseArgs({ options: cliOptions }).values; + if (args.pr) return args.pr; + + try { + const ghEventJson = fs.readFileSync(GITHUB_EVENT_PATH, 'utf8'); + const ghEvent = JSON.parse(ghEventJson); + // https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target + // https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request + return ghEvent.number; + } catch (_err) {} +})(); +const SUMMARY = PR ? `PR #${PR}` : `commit ${COMMIT.slice(0, 8)}`; + +const WARNING_HTML = ` +
+ ${SUMMARY} +

+ This document is a preview of the specification for + ${PR ? `PR #${PR}` : ''} + 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 + ${REPO_URL.replaceAll('<', '<')} 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: 2px solid white; + color: rgba(255, 255, 255, 0.95); + opacity: .95; + position: fixed; + top: 0; + right: 0; + z-index: 10; +} + +details.annoying-warning[open] { + top: 10%; + top: calc(5vw + 5vh); + left: 5%; + right: 5%; + margin: 0 auto; + max-width: 800px; + outline: solid 10000px rgba(255, 255, 255, 0.6); + border: 1px solid rgba(0, 0, 0, 0.4); + border-radius: 3px; + box-shadow: 0 0 0.5em rgba(0, 0, 0, 0.5); +} + +details.annoying-warning > summary { + display: list-item; /* polyfill */ + font-size: 0.875em; + font-weight: bold; + letter-spacing: 0.02em; + padding: 0.5ex 1ex; + text-align: center; + text-transform: uppercase; + text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.85); + cursor: default; +} + +details.annoying-warning[open] > summary::after { + content: " Collapse"; + position: absolute; + top: 0; + right: 5px; + font-size: smaller; + font-weight: bold; +} + +details.annoying-warning p { + line-height: 1.4; + margin: 1em; + 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 e2d02e6bfc1..00000000000 --- 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 2f7ac07ba02..b658a5d9214 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 212d1df8132..00000000000 --- 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 399d56d42f3..00000000000 --- 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 3e2043ea2f5..00000000000 --- 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 00000000000..7b9c5ac7398 --- /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 b53a6a0c3b2..88ad3c37caa 100644 --- a/spec.html +++ b/spec.html @@ -3,6 +3,12 @@ +

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 +138,12 @@

Contributing to this Specification

  • Editors:
  • @@ -68,8 +160,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 +170,15 @@

    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.

    +

    ECMAScript 2026, the 17th edition, added `Math.sumPrecise` for summing an iterable of Numbers of varying magnitude while minimizing precision loss; `Iterator.concat` for sequencing iterators; `Array.fromAsync` for constructing Arrays from async iterables and other async sources; `Error.isError` for identifying error objects; methods to `Map.prototype` and `WeakMap.prototype` for providing a default value to use during retrieval when a key is not already present; methods to `Uint8Array` for converting to and from Strings of hexadecimal- and base64-encoded binary data; a parameter to `JSON.parse` revivers to access the matched segment of JSON source; and `JSON.rawJSON` for fine control over `JSON.stringify` output for primitive values.

    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 +192,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 +236,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 +495,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 +513,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

    @@ -557,13 +666,14 @@

    The Syntactic Grammar

    Parse Nodes are specification artefacts, and implementations are not required to use an analogous data structure.

    Productions of the syntactic grammar are distinguished by having just one colon “:” as punctuation.

    The syntactic grammar as presented in clauses through is not a complete account of which token sequences are accepted as a correct ECMAScript |Script| or |Module|. Certain additional token sequences are also accepted, namely, those that would be described by the grammar if only semicolons were added to the sequence in certain places (such as before line terminator characters). Furthermore, certain token sequences that are described by the grammar are not considered acceptable if a line terminator character appears in certain “awkward” places.

    -

    In certain cases, in order to avoid ambiguities, the syntactic grammar uses generalized productions that permit token sequences that do not form a valid ECMAScript |Script| or |Module|. For example, this technique is used for object literals and object destructuring patterns. In such cases a more restrictive supplemental grammar is provided that further restricts the acceptable token sequences. Typically, an early error rule will then state that, in certain contexts, "_P_ must cover an _N_", where _P_ is a Parse Node (an instance of the generalized production) and _N_ is a nonterminal from the supplemental grammar. This means:

    +

    In certain cases, in order to avoid ambiguities, the syntactic grammar uses generalized productions that permit token sequences that do not form a valid ECMAScript |Script| or |Module|. For example, this technique is used for object literals and object destructuring patterns. In such cases a more restrictive supplemental grammar is provided that further restricts the acceptable token sequences. Typically, an early error rule will then state that, in certain contexts, “_p_ must cover an _n_”, where _p_ is a Parse Node (an instance of the generalized production) and _n_ is a nonterminal from the supplemental grammar. This means:

      -
    1. The sequence of tokens originally matched by _P_ is parsed again using _N_ as the goal symbol. If _N_ takes grammatical parameters, then they are set to the same values used when _P_ was originally parsed.
    2. -
    3. If the sequence of tokens can be parsed as a single instance of _N_, with no tokens left over, then: +
    4. No early error rules are applied to _p_ or any of its descendants.
    5. +
    6. The sequence of tokens originally matched by _p_ is parsed again using _n_ as the goal symbol. If _n_ takes grammatical parameters, then they are set to the same values used when _p_ was originally parsed.
    7. +
    8. If the sequence of tokens can be parsed as a single instance of _n_, with no tokens left over, then:
        -
      1. We refer to that instance of _N_ (a Parse Node, unique for a given _P_) as "the _N_ that is covered by _P_".
      2. -
      3. All Early Error rules for _N_ and its derived productions also apply to the _N_ that is covered by _P_.
      4. +
      5. We refer to that instance of _n_ (a Parse Node, unique for a given _p_) as “the _n_ that is covered by _p_”.
      6. +
      7. Early error rules are applied to the _n_ that is covered by _p_ and to its descendants, as modified by further cases of "must cover".
    9. Otherwise (if the parse fails), it is an early Syntax Error.
    10. @@ -588,7 +698,7 @@

      Terminal Symbols

      In contrast, in the syntactic grammar, a contiguous run of fixed-width code points is a single terminal symbol.

      Terminal symbols come in two other forms:

        -
      • In the lexical and RegExp grammars, Unicode code points without a conventional printed representation are instead shown in the form "<ABBREV>" where "ABBREV" is a mnemonic for the code point or set of code points. These forms are defined in , , and .
      • +
      • In the lexical and RegExp grammars, Unicode code points without a conventional printed representation are instead shown in the form “<ABBREV>” where “ABBREV” is a mnemonic for the code point or set of code points. These forms are defined in , , and .
      • In the syntactic grammar, certain terminal symbols (e.g. |IdentifierName| and |RegularExpressionLiteral|) are shown in italics, as they refer to the nonterminals of the same name in the lexical grammar.
      @@ -686,7 +796,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 : @@ -864,11 +974,30 @@

      Algorithm Conventions

      1. Subsubsubsubsubstep

      A step or substep may be written as an “if” predicate that conditions its substeps. In this case, the substeps are only applied if the predicate is true. If a step or substep begins with the word “else”, it is a predicate that is the negation of the preceding “if” predicate step at the same level.

      -

      A step may specify the iterative application of its substeps.

      -

      A step that begins with “Assert:” asserts an invariant condition of its algorithm. Such assertions are used to make explicit algorithmic invariants that would otherwise be implicit. Such assertions add no additional semantic requirements and hence need not be checked by an implementation. They are used simply to clarify algorithms.

      +

      A step may begin with “For each” or “Repeat” to specify the iterative application of its substeps.

      +

      A step that begins with “Assert:” asserts an invariant condition of its algorithm. Such assertions are used to make explicit algorithmic invariants that would otherwise be implicit. Similarly, a step that begins with “NOTE:” provides pertinent context for nearby steps. Assertion steps and note steps are strictly informative; they add no additional semantic requirements and hence need not be checked by an implementation.

      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 +1040,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. @@ -919,85 +1050,63 @@

      -

      Throw an Exception

      -

      Algorithms steps that say to throw an exception, such as

      +

      Throw

      +

      In algorithm steps, the word “throw” is shorthand for returning the result of calling ThrowCompletion. For example,

      - 1. Throw a *TypeError* exception. + 1. If _result_.[[Error]] is not ~none~, throw _result_.[[Error]]. -

      mean the same things as:

      +

      is equivalent to

      - 1. Return ThrowCompletion(a newly created *TypeError* object). + 1. If _result_.[[Error]] is not ~none~, return ThrowCompletion(_result_.[[Error]]). -
      - - -

      ReturnIfAbrupt

      -

      Algorithms steps that say or are otherwise equivalent to:

      +

      Algorithm steps that say to throw an exception of a particular type construct an exception of that type to be thrown. For example,

      - 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_)). + 1. Throw a *TypeError* exception. -

      mean the same thing as:

      +

      is equivalent to

      - 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_). + 1. Return ThrowCompletion(a newly created *TypeError* object).
      - -

      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 +1114,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 +1134,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_. @@ -1055,14 +1164,15 @@

      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.

      +

      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 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*.

      +

      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_.

      +

      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_.

      The mathematical function floor(_x_) produces the largest integer (closest to +∞) that is not larger than _x_.

      floor(_x_) = _x_ - (_x_ modulo 1).

      @@ -1087,7 +1197,7 @@

      Value Notation

      Identity

      In this specification, both specification values and ECMAScript language values are compared for equality. When comparing for equality, values fall into one of two categories. Values without identity are equal to other values without identity if all of their innate characteristics are the same — characteristics such as the magnitude of an integer or the length of a sequence. Values without identity may be manifest without prior reference by fully describing their characteristics. In contrast, each value with identity is unique and therefore only equal to itself. Values with identity are like values without identity but with an additional unguessable, unchangeable, universally-unique characteristic called identity. References to existing values with identity cannot be manifest simply by describing them, as the identity itself is indescribable; instead, references to these values must be explicitly passed from one place to another. Some values with identity are mutable and therefore can have their characteristics (except their identity) changed in-place, causing all holders of the value to observe the new characteristics. A value without identity is never equal to a value with identity.

      -

      From the perspective of this specification, the word “is” is used to compare two values for equality, as in “If _bool_ is *true*, then ...”, and the word “contains” is used to search for a value inside lists using equality comparisons, as in "If _list_ contains a Record _r_ such that _r_.[[Foo]] is *true*, then ...". The specification identity of values determines the result of these comparisons and is axiomatic in this specification.

      +

      From the perspective of this specification, the word “is” is used to compare two values for equality, as in “If _bool_ is *true*, then ...”, and the word “contains” is used to search for a value inside lists using equality comparisons, as in “If _list_ contains a Record _r_ such that _r_.[[Foo]] is *true*, then ...”. The specification identity of values determines the result of these comparisons and is axiomatic in this specification.

      From the perspective of the ECMAScript language, language values are compared for equality using the SameValue abstract operation and the abstract operations it transitively calls. The algorithms of these comparison abstract operations determine language identity of ECMAScript language values.

      For specification values, examples of values without specification identity include, but are not limited to: mathematical values and extended mathematical values; ECMAScript source text, surrogate pairs, Directive Prologues, etc; UTF-16 code units; Unicode code points; enums; abstract operations, including syntax-directed operations, host hooks, etc; and ordered pairs. Examples of specification values with specification identity include, but are not limited to: any kind of Records, including Property Descriptors, PrivateElements, etc; Parse Nodes; Lists; Sets and Relations; Abstract Closures; Data Blocks; Private Names; execution contexts and execution context stacks; agent signifiers; and WaiterList Records.

      Specification identity agrees with language identity for all ECMAScript language values except Symbol values produced by Symbol.for. The ECMAScript language values without specification identity and without language identity are *undefined*, *null*, Booleans, Strings, Numbers, and BigInts. The ECMAScript language values with specification identity and language identity are Symbols not produced by Symbol.for and Objects. Symbol values produced by Symbol.for have specification identity, but not language identity.

      @@ -1095,10 +1205,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

      @@ -1138,10 +1247,10 @@

      The String Type

      The rationale behind this design was to keep the implementation of Strings as simple and high-performing as possible. If ECMAScript source text is in Normalized Form C, string literals are guaranteed to also be normalized, as long as they do not contain any Unicode escape sequences.

      -

      In this specification, the phrase "the string-concatenation of _A_, _B_, ..." (where each argument is a String value, a code unit, or a sequence of code units) denotes the String value whose sequence of code units is the concatenation of the code units (in order) of each of the arguments (in order).

      -

      The phrase "the substring of _S_ from _inclusiveStart_ to _exclusiveEnd_" (where _S_ is a String value or a sequence of code units and _inclusiveStart_ and _exclusiveEnd_ are integers) denotes the String value consisting of the consecutive code units of _S_ beginning at index _inclusiveStart_ and ending immediately before index _exclusiveEnd_ (which is the empty String when _inclusiveStart_ = _exclusiveEnd_). If the "to" suffix is omitted, the length of _S_ is used as the value of _exclusiveEnd_.

      +

      In this specification, the phrase “the string-concatenation of _A_, _B_, ...” (where each argument is a String value, a code unit, or a sequence of code units) denotes the String value whose sequence of code units is the concatenation of the code units (in order) of each of the arguments (in order).

      +

      The phrase “the substring of _string_ from _inclusiveStart_ to _exclusiveEnd_” (where _string_ is a String value or a sequence of code units and _inclusiveStart_ and _exclusiveEnd_ are integers) denotes the String value consisting of the consecutive code units of _string_ beginning at index _inclusiveStart_ and ending immediately before index _exclusiveEnd_ (which is the empty String when _inclusiveStart_ = _exclusiveEnd_). If the "to" suffix is omitted, the length of _string_ is used as the value of _exclusiveEnd_.

      - The phrase "the ASCII word characters" denotes the following String value, which consists solely of every letter and number in the Unicode Basic Latin block along with U+005F (LOW LINE):
      + The phrase “the ASCII word characters” denotes the following String value, which consists solely of every letter and number in the Unicode Basic Latin block along with U+005F (LOW LINE):
      *"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"*.
      For historical reasons, it has significance to various algorithms.

      @@ -1157,11 +1266,11 @@

      - 1. Let _len_ be the length of _string_. - 1. If _searchValue_ is the empty String and _fromIndex_ ≤ _len_, return _fromIndex_. - 1. Let _searchLen_ be the length of _searchValue_. - 1. For each integer _i_ such that _fromIndex_ ≤ _i_ ≤ _len_ - _searchLen_, in ascending order, do - 1. Let _candidate_ be the substring of _string_ from _i_ to _i_ + _searchLen_. + 1. Let _length_ be the length of _string_. + 1. If _searchValue_ is the empty String and _fromIndex_ ≤ _length_, return _fromIndex_. + 1. Let _searchLength_ be the length of _searchValue_. + 1. For each integer _i_ such that _fromIndex_ ≤ _i_ ≤ _length_ - _searchLength_, in ascending order, do + 1. Let _candidate_ be the substring of _string_ from _i_ to _i_ + _searchLength_. 1. If _candidate_ is _searchValue_, return _i_. 1. Return ~not-found~. @@ -1184,11 +1293,11 @@

      - 1. Let _len_ be the length of _string_. - 1. Let _searchLen_ be the length of _searchValue_. - 1. Assert: _fromIndex_ + _searchLen_ ≤ _len_. + 1. Let _length_ be the length of _string_. + 1. Let _searchLength_ be the length of _searchValue_. + 1. Assert: _fromIndex_ + _searchLength_ ≤ _length_. 1. For each integer _i_ such that 0 ≤ _i_ ≤ _fromIndex_, in descending order, do - 1. Let _candidate_ be the substring of _string_ from _i_ to _i_ + _searchLen_. + 1. Let _candidate_ be the substring of _string_ from _i_ to _i_ + _searchLength_. 1. If _candidate_ is _searchValue_, return _i_. 1. Return ~not-found~. @@ -1201,40 +1310,65 @@

      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 - + %Symbol.asyncDispose% + + *"Symbol.asyncDispose"* + + A method that asynchronously performs resource cleanup on an object. Called by AsyncDisposableStack objects and `await using` declarations when evaluation of their containing scope completes. +
      - @@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.dispose% + + *"Symbol.dispose"* + + A method that performs explicit resource cleanup on an object. Called by DisposableStack objects, AsyncDisposableStack objects, and `using` declarations when evaluation of their containing scope completes. +
      + %Symbol.hasInstance% *"Symbol.hasInstance"* @@ -1245,7 +1379,7 @@

      Well-Known Symbols

      - @@isConcatSpreadable + %Symbol.isConcatSpreadable% *"Symbol.isConcatSpreadable"* @@ -1256,18 +1390,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 +1412,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 +1434,7 @@

      Well-Known Symbols

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

      Well-Known Symbols

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

      Well-Known Symbols

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

      Well-Known Symbols

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

      Well-Known Symbols

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

      Well-Known Symbols

      - @@unscopables + %Symbol.unscopables% *"Symbol.unscopables"* @@ -1371,23 +1505,25 @@

      Well-Known Symbols

      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.

      +

      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 +1864,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 +1963,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.

      @@ -1855,28 +1990,28 @@

      The Number Type

      Number::unaryMinus ( - _x_: a Number, + _number_: a Number, ): a Number

      - 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. If _number_ is *NaN*, return *NaN*. + 1. Return the negation of _number_; that is, compute a Number with the same magnitude but opposite sign.

      Number::bitwiseNOT ( - _x_: a Number, + _number_: a Number, ): an integral Number

      - 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. Let _oldValue_ be ! ToInt32(_number_). + 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 +2031,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 +2089,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 +2118,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_)). @@ -1997,26 +2140,26 @@

      Number::remainder ( - _n_: a Number, - _d_: a Number, + _numerator_: a Number, + _denominator_: a Number, ): a Number

      description
      -
      It yields the remainder from an implied division of its operands where _n_ is the dividend and _d_ is the divisor.
      +
      It yields the remainder from an implied division of its operands where _numerator_ is the dividend and _denominator_ is the divisor.
      - 1. If _n_ is *NaN* or _d_ is *NaN*, return *NaN*. - 1. If _n_ is either *+∞*𝔽 or *-∞*𝔽, return *NaN*. - 1. If _d_ is either *+∞*𝔽 or *-∞*𝔽, return _n_. - 1. If _d_ is either *+0*𝔽 or *-0*𝔽, return *NaN*. - 1. If _n_ is either *+0*𝔽 or *-0*𝔽, return _n_. - 1. Assert: _n_ and _d_ are finite and non-zero. - 1. Let _quotient_ be ℝ(_n_) / ℝ(_d_). - 1. Let _q_ be truncate(_quotient_). - 1. Let _r_ be ℝ(_n_) - (ℝ(_d_) × _q_). - 1. If _r_ = 0 and _n_ < *-0*𝔽, return *-0*𝔽. - 1. Return 𝔽(_r_). + 1. If _numerator_ is *NaN* or _denominator_ is *NaN*, return *NaN*. + 1. If _numerator_ is either *+∞*𝔽 or *-∞*𝔽, return *NaN*. + 1. If _denominator_ is either *+∞*𝔽 or *-∞*𝔽, return _numerator_. + 1. If _denominator_ is either *+0*𝔽 or *-0*𝔽, return *NaN*. + 1. If _numerator_ is either *+0*𝔽 or *-0*𝔽, return _numerator_. + 1. Assert: _numerator_ and _denominator_ are finite and non-zero. + 1. Let _quotient_ be ℝ(_numerator_) / ℝ(_denominator_). + 1. Let _truncatedQuotient_ be truncate(_quotient_). + 1. Let _remainder_ be ℝ(_numerator_) - (ℝ(_denominator_) × _truncatedQuotient_). + 1. If _remainder_ = 0 and _numerator_ < *-0*𝔽, return *-0*𝔽. + 1. Return 𝔽(_remainder_).

      In C and C++, the remainder operator accepts only integral operands; in ECMAScript, it also accepts floating-point operands.

      @@ -2079,10 +2222,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 _leftNumber_ be ! ToInt32(_x_). + 1. Let _rightNumber_ be ! ToUint32(_y_). + 1. Let _shiftCount_ be ℝ(_rightNumber_) modulo 32. + 1. Return the result of left shifting _leftNumber_ by _shiftCount_ bits. The mathematical value of the result is exactly representable as a 32-bit two's complement bit string. @@ -2096,10 +2239,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 _leftNumber_ be ! ToInt32(_x_). + 1. Let _rightNumber_ be ! ToUint32(_y_). + 1. Let _shiftCount_ be ℝ(_rightNumber_) modulo 32. + 1. Return the result of performing a sign-extending right shift of _leftNumber_ 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 +2256,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 _leftNumber_ be ! ToUint32(_x_). + 1. Let _rightNumber_ be ! ToUint32(_y_). + 1. Let _shiftCount_ be ℝ(_rightNumber_) modulo 32. + 1. Return the result of performing a zero-filling right shift of _leftNumber_ 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 +2283,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 +2354,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 _leftNumber_ be ! ToInt32(_x_). + 1. Let _rightNumber_ be ! ToInt32(_y_). + 1. Let _leftBits_ be the 32-bit two's complement bit string representing ℝ(_leftNumber_). + 1. Let _rightBits_ be the 32-bit two's complement bit string representing ℝ(_rightNumber_). 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 _leftBits_ and _rightBits_. 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 _leftBits_ and _rightBits_. 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 _leftBits_ and _rightBits_. 1. Return the Number value for the integer represented by the 32-bit two's complement bit string _result_. @@ -2289,18 +2433,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 @@ -2335,14 +2478,14 @@

      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 _n_, _k_, and _s_ be integers such that _k_ ≥ 1, _radix__k_ - 1 ≤ _s_ < _radix__k_, 𝔽(_s_ × _radix__n_ - _k_) is _x_, and _k_ is as small as possible. If there are multiple possibilities for _s_, choose the value of _s_ for which _s_ × _radix__n_ - _k_ is closest in value to ℝ(_x_). If there are two such possible values of _s_, choose the one that is even. Note that _k_ is the number of digits in the representation of _s_ using radix _radix_ and that _s_ is not divisible by _radix_. + 1. Let _n_, _k_, and _s_ be integers such that _k_ ≥ 1, _radix__k_ - 1 ≤ _s_ < _radix__k_, 𝔽(_s_ × _radix__n_ - _k_) is _x_, and _k_ is as small as possible. If there are multiple possibilities for _s_, choose _s_ such that _s_ × _radix__n_ - _k_ is closest to ℝ(_x_). If there are two such possible values of _s_, choose the one that is even. Note that _k_ is the number of digits in the representation of _s_ using radix _radix_ and that _s_ is not divisible by _radix_.

      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.

      @@ -2357,29 +2500,29 @@

      The BigInt Type

      BigInt::unaryMinus ( - _x_: a BigInt, + _bigint_: a BigInt, ): a BigInt

      - 1. If _x_ = *0*, return *0*. - 1. Return -_x_. + 1. If _bigint_ = *0*, return *0*. + 1. Return -_bigint_.

      BigInt::bitwiseNOT ( - _x_: a BigInt, + _bigint_: a BigInt, ): a BigInt

      description
      -
      It returns the one's complement of _x_.
      +
      It returns the one's complement of _bigint_.
      - 1. Return -_x_ - *1*. + 1. Return -_bigint_ - *1*.
      @@ -2433,18 +2576,18 @@

      BigInt::remainder ( - _n_: a BigInt, - _d_: a BigInt, + _numerator_: a BigInt, + _denominator_: a BigInt, ): either a normal completion containing a BigInt or a throw completion

      - 1. If _d_ = *0*, throw a *RangeError* exception. - 1. If _n_ = *0*, return *0*. - 1. Let _quotient_ be ℝ(_n_) / ℝ(_d_). - 1. Let _q_ be ℤ(truncate(_quotient_)). - 1. Return _n_ - (_d_ × _q_). + 1. If _denominator_ = *0*, throw a *RangeError* exception. + 1. If _numerator_ = *0*, return *0*. + 1. Let _quotient_ be ℝ(_numerator_) / ℝ(_denominator_). + 1. Let _truncatedQuotient_ be ℤ(truncate(_quotient_)). + 1. Return _numerator_ - (_denominator_ × _truncatedQuotient_). The sign of the result is the sign of the dividend.
      @@ -2532,7 +2675,8 @@

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

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

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

      1. If _x_ = 1 or _y_ = 1, return 1. - 1. Else, return 0. + 1. Return 0. @@ -2591,8 +2736,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. @@ -2625,13 +2770,13 @@

      1. Set _x_ to (_x_ - _xDigit_) / 2. 1. Set _y_ to (_y_ - _yDigit_) / 2. 1. If _op_ is `&`, then - 1. Let _tmp_ be BinaryAnd(_x_ modulo 2, _y_ modulo 2). + 1. Let _signBit_ be BinaryAnd(_x_ modulo 2, _y_ modulo 2). 1. Else if _op_ is `|`, then - 1. Let _tmp_ be BinaryOr(_x_ modulo 2, _y_ modulo 2). + 1. Let _signBit_ be BinaryOr(_x_ modulo 2, _y_ modulo 2). 1. Else, 1. Assert: _op_ is `^`. - 1. Let _tmp_ be BinaryXor(_x_ modulo 2, _y_ modulo 2). - 1. If _tmp_ ≠ 0, then + 1. Let _signBit_ be BinaryXor(_x_ modulo 2, _y_ modulo 2). + 1. If _signBit_ ≠ 0, then 1. Set _result_ to _result_ - 2_shift_. 1. NOTE: This extends the sign. 1. Return the BigInt value for _result_. @@ -2710,7 +2855,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 +2869,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.

      - - - - - - - + + + + + + + + + @@ -2841,7 +2988,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 +3011,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.

      Attribute NameTypes of property for which it is presentValue DomainDefault ValueDescription
      Attribute NameTypes of property for which it is presentValue DomainDefault ValueDescription
      [[Value]] @@ -2767,36 +2914,36 @@

      Property Attributes

      - [[Get]] + [[Getter]] accessor property - an Object or *undefined* + a function object or *undefined* *undefined* - If the value is an Object it must be a function object. The function's [[Call]] internal method () is called with an empty arguments list to retrieve the property value each time a get access of the property is performed. + If the value is not *undefined*, its [[Call]] internal method () is called with an empty arguments list to retrieve the property value each time a get access of the property is performed.
      - [[Set]] + [[Setter]] accessor property - an Object or *undefined* + a function object or *undefined* *undefined* - If the value is an Object it must be a function object. The function's [[Call]] internal method () is called with an arguments list containing the assigned value as its sole argument each time a set access of the property is performed. The effect of a property's [[Set]] internal method may, but is not required to, have an effect on the value returned by subsequent calls to the property's [[Get]] internal method. + If the value is not *undefined*, its [[Call]] internal method () is called with an arguments list containing the assigned value as its sole argument each time a set access of the property is performed. The effect of a property's [[Setter]] internal method may, but is not required to, have an effect on the value returned by subsequent calls to the property's [[Getter]] internal method.
      - - - - - + + + + + + + @@ -2957,10 +3106,10 @@

      Object Internal Methods and Internal Slots

      [[Get]] @@ -2968,10 +3117,10 @@

      Object Internal Methods and Internal Slots

      [[Set]] @@ -3001,17 +3150,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 +
      [[GetPrototypeOf]] @@ -2935,10 +3084,10 @@

      Object Internal Methods and Internal Slots

      [[DefineOwnProperty]]
      - (_propertyKey_, _PropertyDescriptor_) Boolean + (_propertyKey_, _propertyDesc_) Boolean - Create or alter the own property, whose key is _propertyKey_, to have the state described by _PropertyDescriptor_. Return *true* if that property was successfully created/updated or *false* if the property could not be created or updated. + Create or alter the own property, whose key is _propertyKey_, to have the state described by _propertyDesc_. Return *true* if that property was successfully created/updated or *false* if the property could not be created or updated.
      - (_propertyKey_, _Receiver_) any + (_propertyKey_, _receiver_) any - Return the value of the property whose key is _propertyKey_ from this object. If any ECMAScript code must be executed to retrieve the property value, _Receiver_ is used as the *this* value when evaluating the code. + Return the value of the property whose key is _propertyKey_ from this object. If any ECMAScript code must be executed to retrieve the property value, _receiver_ is used as the *this* value when evaluating the code.
      - (_propertyKey_, _value_, _Receiver_) Boolean + (_propertyKey_, _value_, _receiver_) Boolean - Set the value of the property whose key is _propertyKey_ to _value_. If any ECMAScript code must be executed to set the property value, _Receiver_ is used as the *this* value when evaluating the code. Returns *true* if the property value was set or *false* if it could not be set. + Set the value of the property whose key is _propertyKey_ to _value_. If any ECMAScript code must be executed to set the property value, _receiver_ is used as the *this* value when evaluating the code. Returns *true* if the property value was set or *false* if it could not be set.
      - - - - - + + + + + + +
      - Internal Method - - Signature - - Description -
      + Internal Method + + Signature + + Description +
      [[Call]] @@ -3062,7 +3213,7 @@

      Definitions:

      Return value:

      The value returned by any internal method must be a Completion Record with either:

        -
      • [[Type]] = ~normal~, [[Target]] = ~empty~, and [[Value]] = a value of the "normal return type" shown below for that internal method, or
      • +
      • [[Type]] = ~normal~, [[Target]] = ~empty~, and [[Value]] = a value of the “normal return type” shown below for that internal method, or
      • [[Type]] = ~throw~, [[Target]] = ~empty~, and [[Value]] = any ECMAScript language value.
      @@ -3074,19 +3225,19 @@

      [[GetPrototypeOf]] ( )

      The normal return type is either Object or Null.
    11. - If target is non-extensible, and [[GetPrototypeOf]] returns a value _V_, then any future calls to [[GetPrototypeOf]] should return the SameValue as _V_. + If target is non-extensible, and [[GetPrototypeOf]] returns a value _proto_, then any future calls to [[GetPrototypeOf]] should return the SameValue as _proto_.
    12. An object's prototype chain should have finite length (that is, starting from any object, recursively applying the [[GetPrototypeOf]] internal method to its result should eventually lead to the value *null*). However, this requirement is not enforceable as an object level invariant if the prototype chain includes any exotic objects that do not use the ordinary object definition of [[GetPrototypeOf]]. Such a circular prototype chain may result in infinite loops when accessing object properties.

      -

      [[SetPrototypeOf]] ( _V_ )

      +

      [[SetPrototypeOf]] ( _proto_ )

      • The normal return type is Boolean.
      • - If target is non-extensible, [[SetPrototypeOf]] must return *false*, unless _V_ is the SameValue as the target's observed [[GetPrototypeOf]] value. + If target is non-extensible, [[SetPrototypeOf]] must return *false*, unless _proto_ is the SameValue as the target's observed [[GetPrototypeOf]] value.

      [[IsExtensible]] ( )

      @@ -3107,90 +3258,90 @@

      [[PreventExtensions]] ( )

      If [[PreventExtensions]] returns *true*, all future calls to [[IsExtensible]] on the target must return *false* and the target is now considered non-extensible. -

      [[GetOwnProperty]] ( _P_ )

      +

      [[GetOwnProperty]] ( _propertyKey_ )

      • 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. + If _propertyKey_ is described as a non-configurable, non-writable own data property, all future calls to [[GetOwnProperty]] ( _propertyKey_ ) must return Property Descriptor whose [[Value]] is SameValue as _propertyKey_'s [[Value]] attribute.
      • - If _P_'s attributes other than [[Writable]] and [[Value]] may change over time, or if the property might be deleted, then _P_'s [[Configurable]] attribute must be *true*. + If _propertyKey_'s attributes other than [[Writable]] and [[Value]] may change over time, or if the property might be deleted, then _propertyKey_'s [[Configurable]] attribute must be *true*.
      • If the [[Writable]] attribute may change from *false* to *true*, then the [[Configurable]] attribute must be *true*.
      • - If the target is non-extensible and _P_ is non-existent, then all future calls to [[GetOwnProperty]] (_P_) on the target must describe _P_ as non-existent (i.e. [[GetOwnProperty]] (_P_) must return *undefined*). + If the target is non-extensible and _propertyKey_ is non-existent, then all future calls to [[GetOwnProperty]] (_propertyKey_) on the target must describe _propertyKey_ as non-existent (i.e. [[GetOwnProperty]] (_propertyKey_) must return *undefined*).

      As a consequence of the third invariant, if a property is described as a data property and it may return different values over time, then either or both of the [[Writable]] and [[Configurable]] attributes must be *true* even if no mechanism to change the value is exposed via the other essential internal methods.

      -

      [[DefineOwnProperty]] ( _P_, _Desc_ )

      +

      [[DefineOwnProperty]] ( _propertyKey_, _propertyDesc_ )

      • The normal return type is Boolean.
      • - [[DefineOwnProperty]] must return *false* if _P_ has previously been observed as a non-configurable own property of the target, unless either: + [[DefineOwnProperty]] must return *false* if _propertyKey_ has previously been observed as a non-configurable own property of the target, unless either:
        1. - _P_ is a writable data property. A non-configurable writable data property can be changed into a non-configurable non-writable data property. + _propertyKey_ is a writable data property. A non-configurable writable data property can be changed into a non-configurable non-writable data property.
        2. - All attributes of _Desc_ are the SameValue as _P_'s attributes. + All attributes of _propertyDesc_ are the SameValue as _propertyKey_'s attributes.
      • - [[DefineOwnProperty]] (_P_, _Desc_) must return *false* if target is non-extensible and _P_ is a non-existent own property. That is, a non-extensible target object cannot be extended with new properties. + [[DefineOwnProperty]] (_propertyKey_, _propertyDesc_) must return *false* if target is non-extensible and _propertyKey_ is a non-existent own property. That is, a non-extensible target object cannot be extended with new properties.
      -

      [[HasProperty]] ( _P_ )

      +

      [[HasProperty]] ( _propertyKey_ )

      • The normal return type is Boolean.
      • - If _P_ was previously observed as a non-configurable own data or accessor property of the target, [[HasProperty]] must return *true*. + If _propertyKey_ was previously observed as a non-configurable own data or accessor property of the target, [[HasProperty]] must return *true*.
      -

      [[Get]] ( _P_, _Receiver_ )

      +

      [[Get]] ( _propertyKey_, _receiver_ )

      • The normal return type is any ECMAScript language type.
      • - If _P_ was previously observed as a non-configurable, non-writable own data property of the target with value _V_, then [[Get]] must return the SameValue as _V_. + If _propertyKey_ was previously observed as a non-configurable, non-writable own data property of the target with value _value_, then [[Get]] must return the SameValue as _value_.
      • - If _P_ was previously observed as a non-configurable own accessor property of the target whose [[Get]] attribute is *undefined*, the [[Get]] operation must return *undefined*. + If _propertyKey_ was previously observed as a non-configurable own accessor property of the target whose [[Getter]] attribute is *undefined*, the [[Get]] operation must return *undefined*.
      -

      [[Set]] ( _P_, _V_, _Receiver_ )

      +

      [[Set]] ( _propertyKey_, _value_, _receiver_ )

      • The normal return type is Boolean.
      • - If _P_ was previously observed as a non-configurable, non-writable own data property of the target, then [[Set]] must return *false* unless _V_ is the SameValue as _P_'s [[Value]] attribute. + If _propertyKey_ was previously observed as a non-configurable, non-writable own data property of the target, then [[Set]] must return *false* unless _value_ is the SameValue as _propertyKey_'s [[Value]] attribute.
      • - If _P_ was previously observed as a non-configurable own accessor property of the target whose [[Set]] attribute is *undefined*, the [[Set]] operation must return *false*. + If _propertyKey_ was previously observed as a non-configurable own accessor property of the target whose [[Setter]] attribute is *undefined*, the [[Set]] operation must return *false*.
      -

      [[Delete]] ( _P_ )

      +

      [[Delete]] ( _propertyKey_ )

      • The normal return type is Boolean.
      • - If _P_ was previously observed as a non-configurable own data or accessor property of the target, [[Delete]] must return *false*. + If _propertyKey_ was previously observed as a non-configurable own data or accessor property of the target, [[Delete]] must return *false*.

      [[OwnPropertyKeys]] ( )

      @@ -3202,7 +3353,7 @@

      [[OwnPropertyKeys]] ( )

      The returned List must not contain any duplicate entries.
    13. - 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.
    14. The returned List must contain at least the keys of all non-configurable own properties that have previously been observed. @@ -3234,26 +3385,28 @@

      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 .

      - - - - - + + + + + + + @@ -3261,10 +3414,10 @@

      Well-Known Intrinsic Objects

      %Array% @@ -3272,10 +3425,10 @@

      Well-Known Intrinsic Objects

      %ArrayBuffer% @@ -3285,7 +3438,18 @@

      Well-Known Intrinsic Objects

      + + + + + @@ -3295,7 +3459,7 @@

      Well-Known Intrinsic Objects

      @@ -3305,7 +3469,7 @@

      Well-Known Intrinsic Objects

      @@ -3315,7 +3479,7 @@

      Well-Known Intrinsic Objects

      @@ -3343,7 +3507,7 @@

      Well-Known Intrinsic Objects

      %Atomics% @@ -3365,10 +3529,10 @@

      Well-Known Intrinsic Objects

      %BigInt64Array% @@ -3376,10 +3540,10 @@

      Well-Known Intrinsic Objects

      %BigUint64Array% @@ -3387,10 +3551,10 @@

      Well-Known Intrinsic Objects

      %Boolean% @@ -3398,10 +3562,10 @@

      Well-Known Intrinsic Objects

      %DataView% @@ -3409,10 +3573,10 @@

      Well-Known Intrinsic Objects

      %Date% @@ -3420,7 +3584,7 @@

      Well-Known Intrinsic Objects

      %decodeURI% + + + + + @@ -3475,7 +3650,7 @@

      Well-Known Intrinsic Objects

      %eval% @@ -3497,10 +3672,21 @@

      Well-Known Intrinsic Objects

      %FinalizationRegistry% + + + + + @@ -3508,10 +3694,10 @@

      Well-Known Intrinsic Objects

      %Float32Array% @@ -3519,10 +3705,10 @@

      Well-Known Intrinsic Objects

      %Float64Array% @@ -3532,7 +3718,7 @@

      Well-Known Intrinsic Objects

      @@ -3540,10 +3726,10 @@

      Well-Known Intrinsic Objects

      %Function% @@ -3553,7 +3739,7 @@

      Well-Known Intrinsic Objects

      @@ -3571,10 +3757,10 @@

      Well-Known Intrinsic Objects

      %Int8Array% @@ -3582,10 +3768,10 @@

      Well-Known Intrinsic Objects

      %Int16Array% @@ -3593,10 +3779,10 @@

      Well-Known Intrinsic Objects

      %Int32Array% @@ -3604,7 +3790,7 @@

      Well-Known Intrinsic Objects

      %isFinite% + + + + + @@ -3636,7 +3833,7 @@

      Well-Known Intrinsic Objects

      %JSON% @@ -3660,7 +3857,7 @@

      Well-Known Intrinsic Objects

      @@ -3668,7 +3865,7 @@

      Well-Known Intrinsic Objects

      %Math% @@ -3690,10 +3887,10 @@

      Well-Known Intrinsic Objects

      %Object% @@ -3701,7 +3898,7 @@

      Well-Known Intrinsic Objects

      %parseFloat% @@ -3734,10 +3931,10 @@

      Well-Known Intrinsic Objects

      %Proxy% @@ -3745,10 +3942,10 @@

      Well-Known Intrinsic Objects

      %RangeError% @@ -3756,10 +3953,10 @@

      Well-Known Intrinsic Objects

      %ReferenceError% @@ -3767,7 +3964,7 @@

      Well-Known Intrinsic Objects

      %Reflect% @@ -3799,10 +3996,10 @@

      Well-Known Intrinsic Objects

      %Set% @@ -3812,7 +4009,7 @@

      Well-Known Intrinsic Objects

      @@ -3820,10 +4017,10 @@

      Well-Known Intrinsic Objects

      %SharedArrayBuffer% @@ -3831,10 +4028,10 @@

      Well-Known Intrinsic Objects

      %String% @@ -3844,7 +4041,18 @@

      Well-Known Intrinsic Objects

      + + + + + @@ -3852,10 +4060,10 @@

      Well-Known Intrinsic Objects

      %Symbol% @@ -3863,10 +4071,10 @@

      Well-Known Intrinsic Objects

      %SyntaxError% @@ -3886,7 +4094,7 @@

      Well-Known Intrinsic Objects

      @@ -3894,10 +4102,10 @@

      Well-Known Intrinsic Objects

      %TypeError% @@ -3905,10 +4113,10 @@

      Well-Known Intrinsic Objects

      %Uint8Array% @@ -3916,10 +4124,10 @@

      Well-Known Intrinsic Objects

      %Uint8ClampedArray% @@ -3927,10 +4135,10 @@

      Well-Known Intrinsic Objects

      %Uint16Array% @@ -3938,10 +4146,10 @@

      Well-Known Intrinsic Objects

      %Uint32Array% @@ -3949,10 +4157,10 @@

      Well-Known Intrinsic Objects

      %URIError% @@ -3960,10 +4168,10 @@

      Well-Known Intrinsic Objects

      %WeakMap% @@ -3971,10 +4179,10 @@

      Well-Known Intrinsic Objects

      %WeakRef% @@ -3982,10 +4190,20 @@

      Well-Known Intrinsic Objects

      %WeakSet% + + + + +
      - Intrinsic Name - - Global Name - - ECMAScript Language Association -
      + Intrinsic Name + + Global Name + + ECMAScript Language Association +
      %AggregateError% - `AggregateError` + *"AggregateError"* - The `AggregateError` constructor () + The `AggregateError` constructor ()
      - `Array` + *"Array"* - The Array constructor () + The `Array` constructor ()
      - `ArrayBuffer` + *"ArrayBuffer"* - The ArrayBuffer constructor () + The `ArrayBuffer` constructor ()
      - The prototype of Array iterator objects () + The prototype of Array Iterator objects () +
      + %AsyncDisposableStack% + + *"AsyncDisposableStack"* + + The `AsyncDisposableStack` constructor ()
      - The prototype of async-from-sync iterator objects () + The prototype of Async-from-Sync Iterator objects ()
      - The constructor of async function objects () + The constructor of async function objects ()
      - The constructor of async generator function objects () + The constructor of async generator function objects ()
      - `Atomics` + *"Atomics"* The `Atomics` object () @@ -3354,10 +3518,10 @@

      Well-Known Intrinsic Objects

      %BigInt%
      - `BigInt` + *"BigInt"* - The BigInt constructor () + The `BigInt` constructor ()
      - `BigInt64Array` + *"BigInt64Array"* - The BigInt64Array constructor () + The `BigInt64Array` constructor ()
      - `BigUint64Array` + *"BigUint64Array"* - The BigUint64Array constructor () + The `BigUint64Array` constructor ()
      - `Boolean` + *"Boolean"* - The Boolean constructor () + The `Boolean` constructor ()
      - `DataView` + *"DataView"* - The DataView constructor () + The `DataView` constructor ()
      - `Date` + *"Date"* - The Date constructor () + The `Date` constructor ()
      - `decodeURI` + *"decodeURI"* The `decodeURI` function () @@ -3431,18 +3595,29 @@

      Well-Known Intrinsic Objects

      %decodeURIComponent%
      - `decodeURIComponent` + *"decodeURIComponent"* The `decodeURIComponent` function ()
      + %DisposableStack% + + *"DisposableStack"* + + The `DisposableStack` constructor () +
      %encodeURI% - `encodeURI` + *"encodeURI"* The `encodeURI` function () @@ -3453,7 +3628,7 @@

      Well-Known Intrinsic Objects

      %encodeURIComponent%
      - `encodeURIComponent` + *"encodeURIComponent"* The `encodeURIComponent` function () @@ -3464,10 +3639,10 @@

      Well-Known Intrinsic Objects

      %Error%
      - `Error` + *"Error"* - The Error constructor () + The `Error` constructor ()
      - `eval` + *"eval"* The `eval` function () @@ -3486,10 +3661,10 @@

      Well-Known Intrinsic Objects

      %EvalError%
      - `EvalError` + *"EvalError"* - The EvalError constructor () + The `EvalError` constructor ()
      - `FinalizationRegistry` + *"FinalizationRegistry"* - The FinalizationRegistry constructor () + The `FinalizationRegistry` constructor () +
      + %Float16Array% + + *"Float16Array"* + + The `Float16Array` constructor ()
      - `Float32Array` + *"Float32Array"* - The Float32Array constructor () + The `Float32Array` constructor ()
      - `Float64Array` + *"Float64Array"* - The Float64Array constructor () + The `Float64Array` constructor ()
      - The prototype of For-In iterator objects () + The prototype of For-In Iterator objects ()
      - `Function` + *"Function"* - The Function constructor () + The `Function` constructor ()
      - The constructor of generator function objects () + The constructor of generator function objects ()
      - `Int8Array` + *"Int8Array"* - The Int8Array constructor () + The `Int8Array` constructor ()
      - `Int16Array` + *"Int16Array"* - The Int16Array constructor () + The `Int16Array` constructor ()
      - `Int32Array` + *"Int32Array"* - The Int32Array constructor () + The `Int32Array` constructor ()
      - `isFinite` + *"isFinite"* The `isFinite` function () @@ -3615,7 +3801,7 @@

      Well-Known Intrinsic Objects

      %isNaN%
      - `isNaN` + *"isNaN"* The `isNaN` function () @@ -3623,12 +3809,23 @@

      Well-Known Intrinsic 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 ()
      - `JSON` + *"JSON"* The `JSON` object () @@ -3647,10 +3844,10 @@

      Well-Known Intrinsic Objects

      %Map%
      - `Map` + *"Map"* - The Map constructor () + The `Map` constructor ()
      - The prototype of Map iterator objects () + The prototype of Map Iterator objects ()
      - `Math` + *"Math"* The `Math` object () @@ -3679,10 +3876,10 @@

      Well-Known Intrinsic Objects

      %Number%
      - `Number` + *"Number"* - The Number constructor () + The `Number` constructor ()
      - `Object` + *"Object"* - The Object constructor () + The `Object` constructor ()
      - `parseFloat` + *"parseFloat"* The `parseFloat` function () @@ -3712,7 +3909,7 @@

      Well-Known Intrinsic Objects

      %parseInt%
      - `parseInt` + *"parseInt"* The `parseInt` function () @@ -3723,10 +3920,10 @@

      Well-Known Intrinsic Objects

      %Promise%
      - `Promise` + *"Promise"* - The Promise constructor () + The `Promise` constructor ()
      - `Proxy` + *"Proxy"* - The Proxy constructor () + The `Proxy` constructor ()
      - `RangeError` + *"RangeError"* - The RangeError constructor () + The `RangeError` constructor ()
      - `ReferenceError` + *"ReferenceError"* - The ReferenceError constructor () + The `ReferenceError` constructor ()
      - `Reflect` + *"Reflect"* The `Reflect` object () @@ -3778,10 +3975,10 @@

      Well-Known Intrinsic Objects

      %RegExp%
      - `RegExp` + *"RegExp"* - The RegExp constructor () + The `RegExp` constructor ()
      - `Set` + *"Set"* - The Set constructor () + The `Set` constructor ()
      - The prototype of Set iterator objects () + The prototype of Set Iterator objects ()
      - `SharedArrayBuffer` + *"SharedArrayBuffer"* - The SharedArrayBuffer constructor () + The `SharedArrayBuffer` constructor ()
      - `String` + *"String"* - The String constructor () + The `String` constructor ()
      - The prototype of String iterator objects () + The prototype of String Iterator objects () +
      + %SuppressedError% + + *"SuppressedError"* + + The `SuppressedError` constructor ()
      - `Symbol` + *"Symbol"* - The Symbol constructor () + The `Symbol` constructor ()
      - `SyntaxError` + *"SyntaxError"* - The SyntaxError constructor () + The `SyntaxError` constructor ()
      - The super class of all typed Array constructors () + The super class of all typed Array constructors ()
      - `TypeError` + *"TypeError"* - The TypeError constructor () + The `TypeError` constructor ()
      - `Uint8Array` + *"Uint8Array"* - The Uint8Array constructor () + The `Uint8Array` constructor ()
      - `Uint8ClampedArray` + *"Uint8ClampedArray"* - The Uint8ClampedArray constructor () + The `Uint8ClampedArray` constructor ()
      - `Uint16Array` + *"Uint16Array"* - The Uint16Array constructor () + The `Uint16Array` constructor ()
      - `Uint32Array` + *"Uint32Array"* - The Uint32Array constructor () + The `Uint32Array` constructor ()
      - `URIError` + *"URIError"* - The URIError constructor () + The `URIError` constructor ()
      - `WeakMap` + *"WeakMap"* - The WeakMap constructor () + The `WeakMap` constructor ()
      - `WeakRef` + *"WeakRef"* - The WeakRef constructor () + The `WeakRef` constructor ()
      - `WeakSet` + *"WeakSet"* - The WeakSet constructor () + The `WeakSet` constructor () +
      + %WrapForValidIteratorPrototype% + + + The prototype of wrapped iterator objects returned by `Iterator.from` ()
      @@ -3999,30 +4217,30 @@

      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.

      The List and Record Specification Types

      -

      The List type is used to explain the evaluation of argument lists (see ) in `new` expressions, in function calls, and in other algorithms where a simple ordered list of values is needed. Values of the List type are simply ordered sequences of list elements containing the individual values. These sequences may be of any length. The elements of a list may be randomly accessed using 0-origin indices. For notational convenience an array-like syntax can be used to access List elements. For example, _arguments_[2] is shorthand for saying the 3rd element of the List _arguments_.

      +

      The List type is used to explain the evaluation of argument lists (see ) in `new` expressions, in function calls, and in other algorithms where a simple ordered list of values is needed. Values of the List type are simply ordered sequences of list elements containing the individual values. These sequences may be of any length. The elements of a list may be randomly accessed using 0-origin indices. For notational convenience an array-like syntax can be used to access List elements. For example, _args_[2] is shorthand for saying the 3rd element of the List _args_.

      When an algorithm iterates over the elements of a List without specifying an order, the order used is the order of the elements in the List.

      For notational convenience within this specification, a literal syntax can be used to express a new List value. For example, « 1, 2 » defines a List value that has two elements each of which is initialized to a specific value. A new empty List can be expressed as « ».

      -

      In this specification, the phrase "the list-concatenation of _A_, _B_, ..." (where each argument is a possibly empty List) denotes a new List value whose elements are the concatenation of the elements (in order) of each of the arguments (in order).

      -

      As applied to a List of Strings, the phrase "sorted according to lexicographic code unit order" means sorting by the numeric value of each code unit up to the length of the shorter string, and sorting the shorter string before the longer string if all are equal, as described in the abstract operation IsLessThan.

      +

      In this specification, the phrase “the list-concatenation of _A_, _B_, ...” (where each argument is a possibly empty List) denotes a new List value whose elements are the concatenation of the elements (in order) of each of the arguments (in order).

      +

      As applied to a List of Strings, the phrase “sorted according to lexicographic code unit order” means sorting by the numeric value of each code unit up to the length of the shorter string, and sorting the shorter string before the longer string if all are equal, as described in the abstract operation IsLessThan.

      The Record type is used to describe data aggregations within the algorithms of this specification. A Record type value consists of one or more named fields. The value of each field is an ECMAScript language value or specification value. Field names are always enclosed in double brackets, for example [[Value]].

      -

      For notational convenience within this specification, an object literal-like syntax can be used to express a Record value. For example, { [[Field1]]: 42, [[Field2]]: *false*, [[Field3]]: ~empty~ } defines a Record value that has three fields, each of which is initialized to a specific value. Field name order is not significant. Any fields that are not explicitly listed are considered to be absent.

      -

      In specification text and algorithms, dot notation may be used to refer to a specific field of a Record value. For example, if R is the record shown in the previous paragraph then R.[[Field2]] is shorthand for “the field of R named [[Field2]]”.

      -

      Schema for commonly used Record field combinations may be named, and that name may be used as a prefix to a literal Record value to identify the specific kind of aggregations that is being described. For example: PropertyDescriptor { [[Value]]: 42, [[Writable]]: *false*, [[Configurable]]: *true* }.

      +

      For notational convenience within this specification, an object literal-like syntax can be used to express a Record. For example, { [[Field1]]: 42, [[Field2]]: *false*, [[Field3]]: ~empty~ } defines a Record that has three fields, each of which is initialized to a specific value. Field name order is not significant. Any fields that are not explicitly listed are considered to be absent.

      +

      In specification text and algorithms, dot notation may be used to refer to a specific field of a Record. For example, if R is the record shown in the previous paragraph then R.[[Field2]] is shorthand for “the field of R named [[Field2]]”.

      +

      Schema for commonly used Record field combinations may be named, and that name may be used as a prefix to a literal Record to identify the specific kind of aggregations that is being described. For example: PropertyDescriptor { [[Value]]: 42, [[Writable]]: *false*, [[Configurable]]: *true* }.

      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 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 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 +4276,19 @@

        The Completion Record Specification Type

        Completion Records have the fields defined in .

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

        ): a normal completion

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

        + +

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

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

        UpdateEmpty ( @@ -4163,15 +4398,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 +4416,8 @@

        The Reference Record Specification Type

        - - + + @@ -4200,76 +4437,81 @@

        The Reference Record Specification Type

        IsPropertyReference ( - _V_: a Reference Record, + _refRecord_: a Reference Record, ): a Boolean

        - 1. If _V_.[[Base]] is ~unresolvable~, return *false*. - 1. If _V_.[[Base]] is an Environment Record, return *false*; otherwise return *true*. + 1. If _refRecord_.[[Base]] is ~unresolvable~, return *false*. + 1. If _refRecord_.[[Base]] is an Environment Record, return *false*. + 1. Return *true*.

        IsUnresolvableReference ( - _V_: a Reference Record, + _refRecord_: a Reference Record, ): a Boolean

        - 1. If _V_.[[Base]] is ~unresolvable~, return *true*; otherwise return *false*. + 1. If _refRecord_.[[Base]] is ~unresolvable~, return *true*. + 1. Return *false*.

        IsSuperReference ( - _V_: a Reference Record, + _refRecord_: a Reference Record, ): a Boolean

        - 1. If _V_.[[ThisValue]] is not ~empty~, return *true*; otherwise return *false*. + 1. If _refRecord_.[[ThisValue]] is ~empty~, return *false*. + 1. Return *true*.

        IsPrivateReference ( - _V_: a Reference Record, + _refRecord_: a Reference Record, ): a Boolean

        - 1. If _V_.[[ReferencedName]] is a Private Name, return *true*; otherwise return *false*. + 1. If _refRecord_.[[ReferencedName]] is a Private Name, return *true*. + 1. Return *false*.

        GetValue ( - _V_: a Reference Record or an ECMAScript language value, + _refRecord_: a Reference Record or an ECMAScript language value, ): either a normal completion containing an ECMAScript language value or an abrupt completion

        - 1. If _V_ is not a Reference Record, return _V_. - 1. If IsUnresolvableReference(_V_) is *true*, throw a *ReferenceError* exception. - 1. If IsPropertyReference(_V_) is *true*, then - 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 _refRecord_ is not a Reference Record, return _refRecord_. + 1. If IsUnresolvableReference(_refRecord_) is *true*, throw a *ReferenceError* exception. + 1. If IsPropertyReference(_refRecord_) is *true*, then + 1. [id="step-getvalue-toobject"] Let _baseObj_ be ? ToObject(_refRecord_.[[Base]]). + 1. If IsPrivateReference(_refRecord_) is *true*, then + 1. Return ? PrivateGet(_baseObj_, _refRecord_.[[ReferencedName]]). + 1. If _refRecord_.[[ReferencedName]] is not a property key, then + 1. Set _refRecord_.[[ReferencedName]] to ? ToPropertyKey(_refRecord_.[[ReferencedName]]). + 1. Return ? _baseObj_.[[Get]](_refRecord_.[[ReferencedName]], GetThisValue(_refRecord_)). + 1. Let _base_ be _refRecord_.[[Base]]. + 1. Assert: _base_ is an Environment Record. + 1. Return ? _base_.GetBindingValue(_refRecord_.[[ReferencedName]], _refRecord_.[[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.

        @@ -4279,30 +4521,31 @@

        PutValue ( - _V_: a Reference Record or an ECMAScript language value, - _W_: an ECMAScript language value, + _refRecord_: a Reference Record or an ECMAScript language value, + _value_: an ECMAScript language value, ): either a normal completion containing ~unused~ or an abrupt completion

        - 1. If _V_ is not a Reference Record, throw a *ReferenceError* exception. - 1. If IsUnresolvableReference(_V_) is *true*, then - 1. If _V_.[[Strict]] is *true*, throw a *ReferenceError* exception. + 1. If _refRecord_ is not a Reference Record, throw a *ReferenceError* exception. + 1. If IsUnresolvableReference(_refRecord_) is *true*, then + 1. If _refRecord_.[[Strict]] is *true*, throw a *ReferenceError* exception. 1. Let _globalObj_ be GetGlobalObject(). - 1. Perform ? Set(_globalObj_, _V_.[[ReferencedName]], _W_, *false*). + 1. Perform ? Set(_globalObj_, _refRecord_.[[ReferencedName]], _value_, *false*). 1. Return ~unused~. - 1. If IsPropertyReference(_V_) is *true*, then - 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 _succeeded_ is *false* and _V_.[[Strict]] is *true*, throw a *TypeError* exception. + 1. If IsPropertyReference(_refRecord_) is *true*, then + 1. [id="step-putvalue-toobject"] Let _baseObj_ be ? ToObject(_refRecord_.[[Base]]). + 1. If IsPrivateReference(_refRecord_) is *true*, then + 1. Return ? PrivateSet(_baseObj_, _refRecord_.[[ReferencedName]], _value_). + 1. If _refRecord_.[[ReferencedName]] is not a property key, then + 1. Set _refRecord_.[[ReferencedName]] to ? ToPropertyKey(_refRecord_.[[ReferencedName]]). + 1. Let _succeeded_ be ? _baseObj_.[[Set]](_refRecord_.[[ReferencedName]], _value_, GetThisValue(_refRecord_)). + 1. If _succeeded_ is *false* and _refRecord_.[[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 _refRecord_.[[Base]]. + 1. Assert: _base_ is an Environment Record. + 1. Return ? _base_.SetMutableBinding(_refRecord_.[[ReferencedName]], _value_, _refRecord_.[[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.

        @@ -4312,31 +4555,32 @@

        GetThisValue ( - _V_: a Reference Record, + _refRecord_: a Reference Record, ): an ECMAScript language value

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

        InitializeReferencedBinding ( - _V_: a Reference Record, - _W_: an ECMAScript language value, + _refRecord_: a Reference Record, + _value_: an ECMAScript language value, ): either a normal completion containing ~unused~ or an abrupt completion

        - 1. Assert: IsUnresolvableReference(_V_) is *false*. - 1. Let _base_ be _V_.[[Base]]. + 1. Assert: IsUnresolvableReference(_refRecord_) is *false*. + 1. Let _base_ be _refRecord_.[[Base]]. 1. Assert: _base_ is an Environment Record. - 1. Return ? _base_.InitializeBinding(_V_.[[ReferencedName]], _W_). + 1. Return ? _base_.InitializeBinding(_refRecord_.[[ReferencedName]], _value_).
        @@ -4350,9 +4594,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~ }. @@ -4361,21 +4605,20 @@

        The Property Descriptor Specification Type

        The Property Descriptor type is used to explain the manipulation and reification of Object property attributes. A Property Descriptor is a Record with zero or more fields, where each field's name is an attribute name and its value is a corresponding attribute value as specified in . The schema name used within this specification to tag literal descriptions of Property Descriptor records is “PropertyDescriptor”.

        -

        Property Descriptor values may be further classified as data Property Descriptors and accessor Property Descriptors based upon the existence or use of certain fields. A data Property Descriptor is one that includes any fields named either [[Value]] or [[Writable]]. An accessor Property Descriptor is one that includes any fields named either [[Get]] or [[Set]]. Any Property Descriptor may have fields named [[Enumerable]] and [[Configurable]]. A Property Descriptor value may not be both a data Property Descriptor and an accessor Property Descriptor; however, it may be neither (in which case it is a generic Property Descriptor). A fully populated Property Descriptor is one that is either an accessor Property Descriptor or a data Property Descriptor and that has all of the corresponding fields defined in .

        +

        Property Descriptor values may be further classified as data Property Descriptors and accessor Property Descriptors based upon the existence or use of certain fields. A data Property Descriptor is one that includes any fields named either [[Value]] or [[Writable]]. An accessor Property Descriptor is one that includes any fields named either [[Getter]] or [[Setter]]. Any Property Descriptor may have fields named [[Enumerable]] and [[Configurable]]. A Property Descriptor value may not be both a data Property Descriptor and an accessor Property Descriptor; however, it may be neither (in which case it is a generic Property Descriptor). A fully populated Property Descriptor is one that is either an accessor Property Descriptor or a data Property Descriptor and that has all of the corresponding fields defined in .

        The following abstract operations are used in this specification to operate upon Property Descriptor values:

        IsAccessorDescriptor ( - _Desc_: a Property Descriptor or *undefined*, + _propertyDesc_: 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. If _propertyDesc_ has a [[Getter]] field, return *true*. + 1. If _propertyDesc_ has a [[Setter]] field, return *true*. 1. Return *false*.
        @@ -4383,15 +4626,14 @@

        IsDataDescriptor ( - _Desc_: a Property Descriptor or *undefined*, + _propertyDesc_: 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. If _propertyDesc_ has a [[Value]] field, return *true*. + 1. If _propertyDesc_ has a [[Writable]] field, return *true*. 1. Return *false*.
        @@ -4399,15 +4641,14 @@

        IsGenericDescriptor ( - _Desc_: a Property Descriptor or *undefined*, + _propertyDesc_: 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. If IsAccessorDescriptor(_propertyDesc_) is *true*, return *false*. + 1. If IsDataDescriptor(_propertyDesc_) is *true*, return *false*. 1. Return *true*.
        @@ -4415,27 +4656,27 @@

        FromPropertyDescriptor ( - _Desc_: a Property Descriptor or *undefined*, + _propertyDesc_: a Property Descriptor or *undefined*, ): an Object or *undefined*

        - 1. If _Desc_ is *undefined*, return *undefined*. + 1. If _propertyDesc_ is *undefined*, return *undefined*. 1. Let _obj_ be OrdinaryObjectCreate(%Object.prototype%). 1. Assert: _obj_ is an extensible ordinary object with no own properties. - 1. If _Desc_ has a [[Value]] field, then - 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"value"*, _Desc_.[[Value]]). - 1. If _Desc_ has a [[Writable]] field, then - 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"writable"*, _Desc_.[[Writable]]). - 1. If _Desc_ has a [[Get]] field, then - 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"get"*, _Desc_.[[Get]]). - 1. If _Desc_ has a [[Set]] field, then - 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"set"*, _Desc_.[[Set]]). - 1. If _Desc_ has an [[Enumerable]] field, then - 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"enumerable"*, _Desc_.[[Enumerable]]). - 1. If _Desc_ has a [[Configurable]] field, then - 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"configurable"*, _Desc_.[[Configurable]]). + 1. If _propertyDesc_ has a [[Value]] field, then + 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"value"*, _propertyDesc_.[[Value]]). + 1. If _propertyDesc_ has a [[Writable]] field, then + 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"writable"*, _propertyDesc_.[[Writable]]). + 1. If _propertyDesc_ has a [[Getter]] field, then + 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"get"*, _propertyDesc_.[[Getter]]). + 1. If _propertyDesc_ has a [[Setter]] field, then + 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"set"*, _propertyDesc_.[[Setter]]). + 1. If _propertyDesc_ has an [[Enumerable]] field, then + 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"enumerable"*, _propertyDesc_.[[Enumerable]]). + 1. If _propertyDesc_ has a [[Configurable]] field, then + 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"configurable"*, _propertyDesc_.[[Configurable]]). 1. Return _obj_.
        @@ -4443,64 +4684,64 @@

        ToPropertyDescriptor ( - _Obj_: an ECMAScript language value, + _obj_: an ECMAScript language value, ): either a normal completion containing a Property Descriptor or a throw completion

        - 1. If _Obj_ is not an Object, throw a *TypeError* exception. - 1. Let _desc_ be a new Property Descriptor that initially has no fields. - 1. Let _hasEnumerable_ be ? HasProperty(_Obj_, *"enumerable"*). + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. Let _propertyDesc_ be a new Property Descriptor that initially has no fields. + 1. Let _hasEnumerable_ be ? HasProperty(_obj_, *"enumerable"*). 1. If _hasEnumerable_ is *true*, then - 1. Let _enumerable_ be ToBoolean(? Get(_Obj_, *"enumerable"*)). - 1. Set _desc_.[[Enumerable]] to _enumerable_. - 1. Let _hasConfigurable_ be ? HasProperty(_Obj_, *"configurable"*). + 1. Let _enumerable_ be ToBoolean(? Get(_obj_, *"enumerable"*)). + 1. Set _propertyDesc_.[[Enumerable]] to _enumerable_. + 1. Let _hasConfigurable_ be ? HasProperty(_obj_, *"configurable"*). 1. If _hasConfigurable_ is *true*, then - 1. Let _configurable_ be ToBoolean(? Get(_Obj_, *"configurable"*)). - 1. Set _desc_.[[Configurable]] to _configurable_. - 1. Let _hasValue_ be ? HasProperty(_Obj_, *"value"*). + 1. Let _configurable_ be ToBoolean(? Get(_obj_, *"configurable"*)). + 1. Set _propertyDesc_.[[Configurable]] to _configurable_. + 1. Let _hasValue_ be ? HasProperty(_obj_, *"value"*). 1. If _hasValue_ is *true*, then - 1. Let _value_ be ? Get(_Obj_, *"value"*). - 1. Set _desc_.[[Value]] to _value_. - 1. Let _hasWritable_ be ? HasProperty(_Obj_, *"writable"*). + 1. Let _value_ be ? Get(_obj_, *"value"*). + 1. Set _propertyDesc_.[[Value]] to _value_. + 1. Let _hasWritable_ be ? HasProperty(_obj_, *"writable"*). 1. If _hasWritable_ is *true*, then - 1. Let _writable_ be ToBoolean(? Get(_Obj_, *"writable"*)). - 1. Set _desc_.[[Writable]] to _writable_. - 1. Let _hasGet_ be ? HasProperty(_Obj_, *"get"*). + 1. Let _writable_ be ToBoolean(? Get(_obj_, *"writable"*)). + 1. Set _propertyDesc_.[[Writable]] to _writable_. + 1. Let _hasGet_ be ? HasProperty(_obj_, *"get"*). 1. If _hasGet_ is *true*, then - 1. Let _getter_ be ? Get(_Obj_, *"get"*). + 1. Let _getter_ be ? Get(_obj_, *"get"*). 1. If IsCallable(_getter_) is *false* and _getter_ is not *undefined*, throw a *TypeError* exception. - 1. Set _desc_.[[Get]] to _getter_. - 1. Let _hasSet_ be ? HasProperty(_Obj_, *"set"*). + 1. Set _propertyDesc_.[[Getter]] to _getter_. + 1. Let _hasSet_ be ? HasProperty(_obj_, *"set"*). 1. If _hasSet_ is *true*, then - 1. Let _setter_ be ? Get(_Obj_, *"set"*). + 1. Let _setter_ be ? Get(_obj_, *"set"*). 1. If IsCallable(_setter_) is *false* and _setter_ is not *undefined*, throw a *TypeError* exception. - 1. Set _desc_.[[Set]] to _setter_. - 1. If _desc_ has a [[Get]] field or _desc_ has a [[Set]] field, then - 1. If _desc_ has a [[Value]] field or _desc_ has a [[Writable]] field, throw a *TypeError* exception. - 1. Return _desc_. + 1. Set _propertyDesc_.[[Setter]] to _setter_. + 1. If _propertyDesc_ has a [[Getter]] field or _propertyDesc_ has a [[Setter]] field, then + 1. If _propertyDesc_ has a [[Value]] field or _propertyDesc_ has a [[Writable]] field, throw a *TypeError* exception. + 1. Return _propertyDesc_.

        CompletePropertyDescriptor ( - _Desc_: a Property Descriptor, + _propertyDesc_: a Property Descriptor, ): ~unused~

        - 1. Let _like_ be the Record { [[Value]]: *undefined*, [[Writable]]: *false*, [[Get]]: *undefined*, [[Set]]: *undefined*, [[Enumerable]]: *false*, [[Configurable]]: *false* }. - 1. If IsGenericDescriptor(_Desc_) is *true* or IsDataDescriptor(_Desc_) is *true*, then - 1. If _Desc_ does not have a [[Value]] field, set _Desc_.[[Value]] to _like_.[[Value]]. - 1. If _Desc_ does not have a [[Writable]] field, set _Desc_.[[Writable]] to _like_.[[Writable]]. + 1. Let _like_ be the Record { [[Value]]: *undefined*, [[Writable]]: *false*, [[Getter]]: *undefined*, [[Setter]]: *undefined*, [[Enumerable]]: *false*, [[Configurable]]: *false* }. + 1. If IsGenericDescriptor(_propertyDesc_) is *true* or IsDataDescriptor(_propertyDesc_) is *true*, then + 1. If _propertyDesc_ does not have a [[Value]] field, set _propertyDesc_.[[Value]] to _like_.[[Value]]. + 1. If _propertyDesc_ does not have a [[Writable]] field, set _propertyDesc_.[[Writable]] to _like_.[[Writable]]. 1. Else, - 1. If _Desc_ does not have a [[Get]] field, set _Desc_.[[Get]] to _like_.[[Get]]. - 1. If _Desc_ does not have a [[Set]] field, set _Desc_.[[Set]] to _like_.[[Set]]. - 1. If _Desc_ does not have an [[Enumerable]] field, set _Desc_.[[Enumerable]] to _like_.[[Enumerable]]. - 1. If _Desc_ does not have a [[Configurable]] field, set _Desc_.[[Configurable]] to _like_.[[Configurable]]. + 1. If _propertyDesc_ does not have a [[Getter]] field, set _propertyDesc_.[[Getter]] to _like_.[[Getter]]. + 1. If _propertyDesc_ does not have a [[Setter]] field, set _propertyDesc_.[[Setter]] to _like_.[[Setter]]. + 1. If _propertyDesc_ does not have an [[Enumerable]] field, set _propertyDesc_.[[Enumerable]] to _like_.[[Enumerable]]. + 1. If _propertyDesc_ does not have a [[Configurable]] field, set _propertyDesc_.[[Configurable]] to _like_.[[Configurable]]. 1. Return ~unused~.
        @@ -4514,25 +4755,25 @@

        The Environment Record Specification Type

        The Abstract Closure Specification Type

        The Abstract Closure specification type is used to refer to algorithm steps together with a collection of values. Abstract Closures are meta-values and are invoked using function application style such as _closure_(_arg1_, _arg2_). Like abstract operations, invocations perform the algorithm steps described by the Abstract Closure.

        -

        In algorithm steps that create an Abstract Closure, values are captured with the verb "capture" followed by a list of aliases. When an Abstract Closure is created, it captures the value that is associated with each alias at that time. In steps that specify the algorithm to be performed when an Abstract Closure is called, each captured value is referred to by the alias that was used to capture the value.

        +

        In algorithm steps that create an Abstract Closure, values are captured with the verb “capture” followed by a list of aliases. When an Abstract Closure is created, it captures the value that is associated with each alias at that time. In steps that specify the algorithm to be performed when an Abstract Closure is called, each captured value is referred to by the alias that was used to capture the value.

        If an Abstract Closure returns a Completion Record, that Completion Record must be either a normal completion or a throw completion.

        Abstract Closures are created inline as part of other algorithms, shown in the following example.

        1. Let _addend_ be 41. 1. Let _closure_ be a new Abstract Closure with parameters (_x_) that captures _addend_ and performs the following steps when called: 1. Return _x_ + _addend_. - 1. Let _val_ be _closure_(1). - 1. Assert: _val_ is 42. + 1. Let _value_ be _closure_(1). + 1. Assert: _value_ is 42.

        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 _dataBlock_ is a 5 byte Data Block value then _dataBlock_[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:

        @@ -4545,9 +4786,9 @@

        1. If _size_ > 253 - 1, throw a *RangeError* exception. - 1. Let _db_ be a new Data Block value consisting of _size_ bytes. If it is impossible to create such a Data Block, throw a *RangeError* exception. - 1. Set all of the bytes of _db_ to 0. - 1. Return _db_. + 1. Let _dataBlock_ be a new Data Block value consisting of _size_ bytes. If it is impossible to create such a Data Block, throw a *RangeError* exception. + 1. Set all of the bytes of _dataBlock_ to 0. + 1. Return _dataBlock_. @@ -4560,13 +4801,14 @@

        - 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 _dataBlock_ 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 _agentRecord_ be the Agent Record of the surrounding agent. + 1. Let _execution_ be _agentRecord_.[[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 - 1. Append WriteSharedMemory { [[Order]]: ~init~, [[NoTear]]: *true*, [[Block]]: _db_, [[ByteIndex]]: _i_, [[ElementSize]]: 1, [[Payload]]: _zero_ } to _eventsRecord_.[[EventList]]. - 1. Return _db_. + 1. For each index _index_ of _dataBlock_, do + 1. Append WriteSharedMemory { [[Order]]: ~init~, [[NoTear]]: *true*, [[Block]]: _dataBlock_, [[ByteIndex]]: _index_, [[ElementSize]]: 1, [[Payload]]: _zero_ } to _eventsRecord_.[[EventList]]. + 1. Return _dataBlock_. @@ -4590,7 +4832,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 _agentRecord_ be the Agent Record of the surrounding agent. + 1. Let _execution_ be _agentRecord_.[[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. @@ -4615,23 +4858,25 @@

        The PrivateElement Specification Type

        The PrivateElement type is a Record used in the specification of private class fields, methods, and accessors. Although Property Descriptors are not used for private elements, private fields behave similarly to non-configurable, non-enumerable, writable data properties, private methods behave similarly to non-configurable, non-enumerable, non-writable data properties, and private accessors behave similarly to non-configurable, non-enumerable accessor properties.

        -

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

        +

        Values of the PrivateElement type are Records 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]] @@ -4676,7 +4921,7 @@

        The PrivateElement Specification Type

        - [[Get]] + [[Getter]] ~accessor~ @@ -4690,7 +4935,7 @@

        The PrivateElement Specification Type

        - [[Set]] + [[Setter]] ~accessor~ @@ -4709,20 +4954,22 @@

        The PrivateElement Specification Type

        The ClassFieldDefinition Record Specification Type

        The ClassFieldDefinition type is a Record used in the specification of class fields.

        -

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

        +

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

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[Name]] @@ -4751,26 +4998,28 @@

        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.

        The ClassStaticBlockDefinition Record Specification Type

        -

        A ClassStaticBlockDefinition Record is a Record value used to encapsulate the executable code for a class static initialization block.

        +

        A ClassStaticBlockDefinition Record is a Record used to encapsulate the executable code for a class static initialization block.

        ClassStaticBlockDefinition Records have the fields listed in .

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[BodyFunction]] @@ -4810,8 +5059,8 @@

        1. If _input_ is an Object, then - 1. Let _exoticToPrim_ be ? GetMethod(_input_, @@toPrimitive). - 1. If _exoticToPrim_ is not *undefined*, then + 1. Let _exoticToPrimitive_ be ? GetMethod(_input_, %Symbol.toPrimitive%). + 1. If _exoticToPrimitive_ is not *undefined*, then 1. If _preferredType_ is not present, then 1. Let _hint_ be *"default"*. 1. Else if _preferredType_ is ~string~, then @@ -4819,21 +5068,21 @@

        1. Else, 1. Assert: _preferredType_ is ~number~. 1. Let _hint_ be *"number"*. - 1. Let _result_ be ? Call(_exoticToPrim_, _input_, « _hint_ »). + 1. Let _result_ be ? Call(_exoticToPrimitive_, _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~.

        OrdinaryToPrimitive ( - _O_: an Object, + _obj_: an Object, _hint_: ~string~ or ~number~, ): either a normal completion containing an ECMAScript language value or a throw completion

        @@ -4845,29 +5094,30 @@

        1. Else, 1. Let _methodNames_ be « *"valueOf"*, *"toString"* ». 1. For each element _name_ of _methodNames_, do - 1. Let _method_ be ? Get(_O_, _name_). + 1. Let _method_ be ? Get(_obj_, _name_). 1. If IsCallable(_method_) is *true*, then - 1. Let _result_ be ? Call(_method_, _O_). + 1. Let _result_ be ? Call(_method_, _obj_). 1. If _result_ is not an Object, return _result_. 1. Throw a *TypeError* exception. - +

        ToBoolean ( - _argument_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): a Boolean

        description
        -
        It converts _argument_ to a value of type Boolean.
        +
        It converts _arg_ to a value of type Boolean.
        - 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. If _arg_ is a Boolean, return _arg_. + 1. If _arg_ is one of *undefined*, *null*, *+0*𝔽, *-0*𝔽, *NaN*, *0*, or the empty String, return *false*. + 1. [id="step-to-boolean-web-compat-insertion-point", normative-optional] If the host is a web browser or otherwise supports , then + 1. If _arg_ is an Object and _arg_ has an [[IsHTMLDDA]] internal slot, return *false*. 1. Return *true*.
        @@ -4875,41 +5125,41 @@

        ToNumeric ( - _value_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing either a Number or a BigInt, or a throw completion

        description
        -
        It returns _value_ converted to a Number or a BigInt.
        +
        It returns _arg_ converted to a Number or a BigInt.
        - 1. Let _primValue_ be ? ToPrimitive(_value_, ~number~). - 1. If _primValue_ is a BigInt, return _primValue_. - 1. Return ? ToNumber(_primValue_). + 1. Let _primitiveValue_ be ? ToPrimitive(_arg_, ~number~). + 1. If _primitiveValue_ is a BigInt, return _primitiveValue_. + 1. Return ? ToNumber(_primitiveValue_).

        ToNumber ( - _argument_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing a Number or a throw completion

        description
        -
        It converts _argument_ to a value of type Number.
        +
        It converts _arg_ to a value of type Number.
        - 1. If _argument_ is a Number, return _argument_. - 1. If _argument_ is either a Symbol or a BigInt, throw a *TypeError* exception. - 1. If _argument_ is *undefined*, return *NaN*. - 1. If _argument_ is either *null* or *false*, return *+0*𝔽. - 1. If _argument_ is *true*, return *1*𝔽. - 1. If _argument_ is a String, return StringToNumber(_argument_). - 1. Assert: _argument_ is an Object. - 1. Let _primValue_ be ? ToPrimitive(_argument_, ~number~). - 1. Assert: _primValue_ is not an Object. - 1. Return ? ToNumber(_primValue_). + 1. If _arg_ is a Number, return _arg_. + 1. If _arg_ is either a Symbol or a BigInt, throw a *TypeError* exception. + 1. If _arg_ is *undefined*, return *NaN*. + 1. If _arg_ is either *null* or *false*, return *+0*𝔽. + 1. If _arg_ is *true*, return *1*𝔽. + 1. If _arg_ is a String, return StringToNumber(_arg_). + 1. Assert: _arg_ is an Object. + 1. Let _primitiveValue_ be ? ToPrimitive(_arg_, ~number~). + 1. Assert: _primitiveValue_ is not an Object. + 1. Return ? ToNumber(_primitiveValue_). @@ -4974,13 +5224,13 @@

        Syntax

        StringToNumber ( - _str_: a String, + _string_: a String, ): a Number

        - 1. Let _literal_ be ParseText(_str_, |StringNumericLiteral|). + 1. Let _literal_ be ParseText(_string_, |StringNumericLiteral|). 1. If _literal_ is a List of errors, return *NaN*. 1. Return the StringNumericValue of _literal_. @@ -5024,20 +5274,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_).
        @@ -5050,7 +5300,7 @@

        description
        -
        It converts _n_ to a Number in an implementation-defined manner. For the purposes of this abstract operation, a digit is significant if it is not zero or there is a non-zero digit to its left and there is a non-zero digit to its right. For the purposes of this abstract operation, "the mathematical value denoted by" a representation of a mathematical value is the inverse of "the decimal representation of" a mathematical value.
        +
        It converts _n_ to a Number in an implementation-defined manner. For the purposes of this abstract operation, a digit is significant if it is not zero or there is a non-zero digit to its left and there is a non-zero digit to its right. For the purposes of this abstract operation, “the mathematical value denoted by” a representation of a mathematical value is the inverse of “the decimal representation of” a mathematical value.
        1. If the decimal representation of _n_ has 20 or fewer significant digits, return 𝔽(_n_). @@ -5066,15 +5316,15 @@

        ToIntegerOrInfinity ( - _argument_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing either an integer, +∞, or -∞, or a throw completion

        description
        -
        It converts _argument_ to an integer representing its Number value with fractional part truncated, or to +∞ or -∞ when that Number value is infinite.
        +
        It converts _arg_ to an integer representing its Number value with fractional part truncated, or to +∞ or -∞ when that Number value is infinite.
        - 1. Let _number_ be ? ToNumber(_argument_). + 1. Let _number_ be ? ToNumber(_arg_). 1. If _number_ is one of *NaN*, *+0*𝔽, or *-0*𝔽, return 0. 1. If _number_ is *+∞*𝔽, return +∞. 1. If _number_ is *-∞*𝔽, return -∞. @@ -5085,181 +5335,146 @@

        + +

        + ToFixedSizeInteger ( + _int_: an integer, +∞, or -∞, + _signed_: ~unsigned~ or ~signed~, + _bitWidth_: a positive integer, + ): an integer +

        +
        +
        description
        +
        It maps _int_ to one of 2_bitWidth_ integers in the inclusive interval from 0 to 2_bitWidth_ - 1 (if _signed_ is ~unsigned~) or -2_bitWidth_ - 1 to 2_bitWidth_ - 1 - 1 (if _signed_ is ~signed~).
        +
        + + 1. If _int_ = +∞ or _int_ = -∞, return 0. + 1. Let _fixedInt_ be _int_ modulo 2_bitWidth_. + 1. NOTE: The following step does not change the two's complement representation of _fixedInt_. + 1. If _signed_ is ~signed~ and _fixedInt_ ≥ 2_bitWidth_ - 1, set _fixedInt_ to _fixedInt_ - 2_bitWidth_. + 1. Return _fixedInt_. + + +

        ToFixedSizeInteger is idempotent: for any ECMAScript language value _x_, ToFixedSizeInteger(ToFixedSizeInteger(_x_, _signed_, _bitWidth_), _signed_, _bitWidth_) is the same as ToFixedSizeInteger(_x_, _signed_, _bitWidth_). In fact, because +∞ and -∞ are mapped to 0, this invariant even survives inversion of _signed_ (e.g., ToFixedSizeInteger(ToFixedSizeInteger(_x_, ~signed~, 32), ~unsigned~, 32) is the same as ToFixedSizeInteger(_x_, ~unsigned~, 32)).

        +
        +
        +

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

        description
        -
        It converts _argument_ to one of 232 integral Number values in the inclusive interval from 𝔽(-231) to 𝔽(231 - 1).
        +
        It converts _arg_ to one of 232 integral Number values in the inclusive interval from 𝔽(-231) to 𝔽(231 - 1), excluding *-0*𝔽.
        - 1. Let _number_ be ? ToNumber(_argument_). - 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. Let _int_ be ? ToIntegerOrInfinity(_arg_). + 1. Return 𝔽(ToFixedSizeInteger(_int_, ~signed~, 32)). - -

        Given the above definition of ToInt32:

        -
          -
        • - The ToInt32 abstract operation is idempotent: if applied to a result that it produced, the second application leaves that value unchanged. -
        • -
        • - ToInt32(ToUint32(_x_)) is the same value as ToInt32(_x_) for all values of _x_. (It is to preserve this latter property that *+∞*𝔽 and *-∞*𝔽 are mapped to *+0*𝔽.) -
        • -
        • - ToInt32 maps *-0*𝔽 to *+0*𝔽. -
        • -
        -

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

        description
        -
        It converts _argument_ to one of 232 integral Number values in the inclusive interval from *+0*𝔽 to 𝔽(232 - 1).
        +
        It converts _arg_ to one of 232 integral Number values in the inclusive interval from *+0*𝔽 to 𝔽(232 - 1).
        - 1. Let _number_ be ? ToNumber(_argument_). - 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. [id="step-touint32-return"] Return 𝔽(_int32bit_). + 1. Let _int_ be ? ToIntegerOrInfinity(_arg_). + 1. Return 𝔽(ToFixedSizeInteger(_int_, ~unsigned~, 32)). - -

        Given the above definition of ToUint32:

        -
          -
        • - Step is the only difference between ToUint32 and ToInt32. -
        • -
        • - The ToUint32 abstract operation is idempotent: if applied to a result that it produced, the second application leaves that value unchanged. -
        • -
        • - ToUint32(ToInt32(_x_)) is the same value as ToUint32(_x_) for all values of _x_. (It is to preserve this latter property that *+∞*𝔽 and *-∞*𝔽 are mapped to *+0*𝔽.) -
        • -
        • - ToUint32 maps *-0*𝔽 to *+0*𝔽. -
        • -
        -

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

        description
        -
        It converts _argument_ to one of 216 integral Number values in the inclusive interval from 𝔽(-215) to 𝔽(215 - 1).
        +
        It converts _arg_ to one of 216 integral Number values in the inclusive interval from 𝔽(-215) to 𝔽(215 - 1), excluding *-0*𝔽.
        - 1. Let _number_ be ? ToNumber(_argument_). - 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. Let _int_ be ? ToIntegerOrInfinity(_arg_). + 1. Return 𝔽(ToFixedSizeInteger(_int_, ~signed~, 16)).

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

        description
        -
        It converts _argument_ to one of 216 integral Number values in the inclusive interval from *+0*𝔽 to 𝔽(216 - 1).
        +
        It converts _arg_ to one of 216 integral Number values in the inclusive interval from *+0*𝔽 to 𝔽(216 - 1).
        - 1. Let _number_ be ? ToNumber(_argument_). - 1. If _number_ is not finite or _number_ is either *+0*𝔽 or *-0*𝔽, return *+0*𝔽. - 1. Let _int_ be truncate(ℝ(_number_)). - 1. [id="step-touint16-mod"] Let _int16bit_ be _int_ modulo 216. - 1. Return 𝔽(_int16bit_). + 1. Let _int_ be ? ToIntegerOrInfinity(_arg_). + 1. Return 𝔽(ToFixedSizeInteger(_int_, ~unsigned~, 16)). - -

        Given the above definition of ToUint16:

        -
          -
        • - The substitution of 216 for 232 in step is the only difference between ToUint32 and ToUint16. -
        • -
        • - ToUint16 maps *-0*𝔽 to *+0*𝔽. -
        • -
        -

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

        description
        -
        It converts _argument_ to one of 28 integral Number values in the inclusive interval from *-128*𝔽 to *127*𝔽.
        +
        It converts _arg_ to one of 28 integral Number values in the inclusive interval from *-128*𝔽 to *127*𝔽, excluding *-0*𝔽.
        - 1. Let _number_ be ? ToNumber(_argument_). - 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. Let _int_ be ? ToIntegerOrInfinity(_arg_). + 1. Return 𝔽(ToFixedSizeInteger(_int_, ~signed~, 8)).

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

        description
        -
        It converts _argument_ to one of 28 integral Number values in the inclusive interval from *+0*𝔽 to *255*𝔽.
        +
        It converts _arg_ to one of 28 integral Number values in the inclusive interval from *+0*𝔽 to *255*𝔽.
        - 1. Let _number_ be ? ToNumber(_argument_). - 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. Return 𝔽(_int8bit_). + 1. Let _int_ be ? ToIntegerOrInfinity(_arg_). + 1. Return 𝔽(ToFixedSizeInteger(_int_, ~unsigned~, 8)).

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

        description
        -
        It clamps and rounds _argument_ to one of 28 integral Number values in the inclusive interval from *+0*𝔽 to *255*𝔽.
        +
        It clamps and rounds _arg_ to one of 28 integral Number values in the inclusive interval from *+0*𝔽 to *255*𝔽.
        - 1. Let _number_ be ? ToNumber(_argument_). + 1. Let _number_ be ? ToNumber(_arg_). 1. If _number_ is *NaN*, return *+0*𝔽. 1. Let _mv_ be the extended mathematical value of _number_. 1. Let _clamped_ be the result of clamping _mv_ between 0 and 255. 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`.

        @@ -5269,27 +5484,29 @@

        ToBigInt ( - _argument_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing a BigInt or a throw completion

        description
        -
        It converts _argument_ to a BigInt value, or throws if an implicit conversion from Number would be required.
        +
        It converts _arg_ to a BigInt value, or throws if an implicit conversion from Number would be required.
        - 1. Let _prim_ be ? ToPrimitive(_argument_, ~number~). - 1. Return the value that _prim_ corresponds to in . + 1. Let _primitive_ be ? ToPrimitive(_arg_, ~number~). + 1. Return the value that _primitive_ corresponds to in . - - - - + + + + + + @@ -5319,7 +5536,7 @@

        BigInt

        @@ -5336,7 +5553,7 @@

        - Argument Type - - Result -
        + Argument Type + + Result +
        Undefined @@ -5311,7 +5528,7 @@

        Boolean

        - Return `1n` if _prim_ is *true* and `0n` if _prim_ is *false*. + Return `1n` if _primitive_ is *true* and `0n` if _primitive_ is *false*.
        - Return _prim_. + Return _primitive_.
        - 1. Let _n_ be StringToBigInt(_prim_). + 1. Let _n_ be StringToBigInt(_primitive_). 1. If _n_ is *undefined*, throw a *SyntaxError* exception. 1. Return _n_. @@ -5357,13 +5574,13 @@

        StringToBigInt ( - _str_: a String, + _string_: a String, ): a BigInt or *undefined*

        - 1. Let _literal_ be ParseText(_str_, |StringIntegerLiteral|). + 1. Let _literal_ be ParseText(_string_, |StringIntegerLiteral|). 1. If _literal_ is a List of errors, return *undefined*. 1. Let _mv_ be the MV of _literal_. 1. Assert: _mv_ is an integer. @@ -5401,163 +5618,95 @@

        Runtime Semantics: MV

        ToBigInt64 ( - _argument_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing a BigInt or a throw completion

        description
        -
        It converts _argument_ to one of 264 BigInt values in the inclusive interval from ℤ(-263) to ℤ(263 - 1).
        +
        It converts _arg_ to one of 264 BigInt values in the inclusive interval from ℤ(-263) to ℤ(263 - 1).
        - 1. Let _n_ be ? ToBigInt(_argument_). - 1. Let _int64bit_ be ℝ(_n_) modulo 264. - 1. If _int64bit_ ≥ 263, return ℤ(_int64bit_ - 264); otherwise return ℤ(_int64bit_). + 1. Let _int_ be ℝ(? ToBigInt(_arg_)). + 1. Return ℤ(ToFixedSizeInteger(_int_, ~signed~, 64)).

        ToBigUint64 ( - _argument_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing a BigInt or a throw completion

        description
        -
        It converts _argument_ to one of 264 BigInt values in the inclusive interval from *0* to ℤ(264 - 1).
        +
        It converts _arg_ to one of 264 BigInt values in the inclusive interval from *0* to ℤ(264 - 1).
        - 1. Let _n_ be ? ToBigInt(_argument_). - 1. Let _int64bit_ be ℝ(_n_) modulo 264. - 1. Return ℤ(_int64bit_). + 1. Let _int_ be ℝ(? ToBigInt(_arg_)). + 1. Return ℤ(ToFixedSizeInteger(_int_, ~unsigned~, 64)).

        ToString ( - _argument_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing a String or a throw completion

        description
        -
        It converts _argument_ to a value of type String.
        +
        It converts _arg_ to a value of type String.
        - 1. If _argument_ is a String, return _argument_. - 1. If _argument_ is a Symbol, throw a *TypeError* exception. - 1. If _argument_ is *undefined*, return *"undefined"*. - 1. If _argument_ is *null*, return *"null"*. - 1. If _argument_ is *true*, return *"true"*. - 1. If _argument_ is *false*, return *"false"*. - 1. If _argument_ is a Number, return Number::toString(_argument_, 10). - 1. If _argument_ is a BigInt, return BigInt::toString(_argument_, 10). - 1. Assert: _argument_ is an Object. - 1. Let _primValue_ be ? ToPrimitive(_argument_, ~string~). - 1. Assert: _primValue_ is not an Object. - 1. Return ? ToString(_primValue_). + 1. If _arg_ is a String, return _arg_. + 1. If _arg_ is a Symbol, throw a *TypeError* exception. + 1. If _arg_ is *undefined*, return *"undefined"*. + 1. If _arg_ is *null*, return *"null"*. + 1. If _arg_ is *true*, return *"true"*. + 1. If _arg_ is *false*, return *"false"*. + 1. If _arg_ is a Number, return Number::toString(_arg_, 10). + 1. If _arg_ is a BigInt, return BigInt::toString(_arg_, 10). + 1. Assert: _arg_ is an Object. + 1. Let _primitiveValue_ be ? ToPrimitive(_arg_, ~string~). + 1. Assert: _primitiveValue_ is not an Object. + 1. Return ? ToString(_primitiveValue_).
        - +

        ToObject ( - _argument_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing an Object or a throw completion

        description
        -
        It converts _argument_ to a value of type Object according to :
        +
        It converts _arg_ 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 _arg_ is either *undefined* or *null*, throw a *TypeError* exception. + 1. If _arg_ is a Boolean, return a new Boolean object whose [[BooleanData]] internal slot is set to _arg_. See for a description of Boolean objects. + 1. If _arg_ is a Number, return a new Number object whose [[NumberData]] internal slot is set to _arg_. See for a description of Number objects. + 1. If _arg_ is a String, return a new String object whose [[StringData]] internal slot is set to _arg_. See for a description of String objects. + 1. If _arg_ is a Symbol, return a new Symbol object whose [[SymbolData]] internal slot is set to _arg_. See for a description of Symbol objects. + 1. If _arg_ is a BigInt, return a new BigInt object whose [[BigIntData]] internal slot is set to _arg_. See for a description of BigInt objects. + 1. Assert: _arg_ is an Object. + 1. Return _arg_. +

        ToPropertyKey ( - _argument_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing a property key or a throw completion

        description
        -
        It converts _argument_ to a value that can be used as a property key.
        +
        It converts _arg_ to a value that can be used as a property key.
        - 1. Let _key_ be ? ToPrimitive(_argument_, ~string~). + 1. Let _key_ be ? ToPrimitive(_arg_, ~string~). 1. If _key_ is a Symbol, then 1. Return _key_. 1. Return ! ToString(_key_). @@ -5567,53 +5716,53 @@

        ToLength ( - _argument_: an ECMAScript language value, - ): either a normal completion containing an integral Number or a throw completion + _arg_: an ECMAScript language value, + ): 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 _arg_ to a non-negative integral Number suitable for use as the length of an array-like object.
        - 1. Let _len_ be ? ToIntegerOrInfinity(_argument_). - 1. If _len_ ≤ 0, return *+0*𝔽. - 1. Return 𝔽(min(_len_, 253 - 1)). + 1. Let _length_ be ? ToIntegerOrInfinity(_arg_). + 1. If _length_ ≤ 0, return *+0*𝔽. + 1. Return 𝔽(min(_length_, 253 - 1)).

        CanonicalNumericIndexString ( - _argument_: a String, + _arg_: a String, ): a Number or *undefined*

        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 _arg_ 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*𝔽. - 1. Let _n_ be ! ToNumber(_argument_). - 1. If ! ToString(_n_) is _argument_, return _n_. + 1. If _arg_ is *"-0"*, return *-0*𝔽. + 1. Let _n_ be ! ToNumber(_arg_). + 1. If ! ToString(_n_) is _arg_, 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*.

        ToIndex ( - _value_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing a non-negative integer or a throw completion

        description
        -
        It converts _value_ to an integer and returns that integer if it is non-negative and corresponds with an integer index. Otherwise, it throws an exception.
        +
        It converts _arg_ to an integer and returns that integer if it is non-negative and corresponds with an integer index. Otherwise, it throws an exception.
        - 1. Let _integer_ be ? ToIntegerOrInfinity(_value_). - 1. If _integer_ is not in the inclusive interval from 0 to 253 - 1, throw a *RangeError* exception. - 1. Return _integer_. + 1. Let _int_ be ? ToIntegerOrInfinity(_arg_). + 1. If _int_ is not in the inclusive interval from 0 to 253 - 1, throw a *RangeError* exception. + 1. Return _int_.
        @@ -5621,108 +5770,36 @@

        Testing and Comparison Operations

        - +

        RequireObjectCoercible ( - _argument_: an ECMAScript language value, - ): either a normal completion containing an ECMAScript language value or a throw completion + _arg_: an ECMAScript language value, + ): 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 _arg_ 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 _arg_ is either *undefined* or *null*, throw a *TypeError* exception. + 1. Return ~unused~. +

        IsArray ( - _argument_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing a Boolean or a throw completion

        - 1. If _argument_ is not an Object, return *false*. - 1. If _argument_ is an Array exotic object, return *true*. - 1. If _argument_ is a Proxy exotic object, then - 1. Perform ? ValidateNonRevokedProxy(_argument_). - 1. Let _proxyTarget_ be _argument_.[[ProxyTarget]]. + 1. If _arg_ is not an Object, return *false*. + 1. If _arg_ is an Array exotic object, return *true*. + 1. If _arg_ is a Proxy exotic object, then + 1. Perform ? ValidateNonRevokedProxy(_arg_). + 1. Let _proxyTarget_ be _arg_.[[ProxyTarget]]. 1. Return ? IsArray(_proxyTarget_). 1. Return *false*. @@ -5731,16 +5808,16 @@

        IsCallable ( - _argument_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): a Boolean

        description
        -
        It determines if _argument_ is a callable function with a [[Call]] internal method.
        +
        It determines if _arg_ is a callable function with a [[Call]] internal method.
        - 1. If _argument_ is not an Object, return *false*. - 1. If _argument_ has a [[Call]] internal method, return *true*. + 1. If _arg_ is not an Object, return *false*. + 1. If _arg_ has a [[Call]] internal method, return *true*. 1. Return *false*.
        @@ -5748,16 +5825,16 @@

        IsConstructor ( - _argument_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): a Boolean

        description
        -
        It determines if _argument_ is a function object with a [[Construct]] internal method.
        +
        It determines if _arg_ is a function object with a [[Construct]] internal method.
        - 1. If _argument_ is not an Object, return *false*. - 1. If _argument_ has a [[Construct]] internal method, return *true*. + 1. If _arg_ is not an Object, return *false*. + 1. If _arg_ has a [[Construct]] internal method, return *true*. 1. Return *false*.
        @@ -5765,49 +5842,31 @@

        IsExtensible ( - _O_: an Object, + _obj_: an Object, ): either a normal completion containing a Boolean or a throw completion

        description
        -
        It is used to determine whether additional properties can be added to _O_.
        +
        It is used to determine whether additional properties can be added to _obj_.
        - 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 ? _obj_.[[IsExtensible]]().

        IsRegExp ( - _argument_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing a Boolean or a throw completion

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

        It interprets _string_ as a sequence of UTF-16 encoded code points, as described in , and determines whether it is a well formed UTF-16 sequence.
        - 1. Let _len_ be the length of _string_. + 1. Let _length_ be the length of _string_. 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. Let _cp_ be CodePointAt(_string_, _k_). - 1. If _cp_.[[IsUnpairedSurrogate]] is *true*, return *false*. - 1. Set _k_ to _k_ + _cp_.[[CodeUnitCount]]. + 1. Repeat, while _k_ < _length_, + 1. Let _codePoint_ be CodePointAt(_string_, _k_). + 1. If _codePoint_.[[IsUnpairedSurrogate]] is *true*, return *false*. + 1. Set _k_ to _k_ + _codePoint_.[[CodeUnitCount]]. 1. Return *true*. + +

        + 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 +5928,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 +5950,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,22 +5970,26 @@

        - 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_ is *true* and _y_ is *true*, return *true*. + 1. If _x_ is *false* and _y_ is *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. - The specifics of what "_x_ is _y_" means are detailed in . + The specifics of what “_x_ is _y_” means are detailed in . @@ -5911,15 +5998,15 @@

        IsLessThan ( _x_: an ECMAScript language value, _y_: an ECMAScript language value, - _LeftFirst_: a Boolean, + _leftFirst_: a Boolean, ): either a normal completion containing either a Boolean or *undefined*, or a throw completion

        description
        -
        It provides the semantics for the comparison _x_ < _y_, returning *true*, *false*, or *undefined* (which indicates that at least one operand is *NaN*). The _LeftFirst_ flag is used to control the order in which operations with potentially visible side-effects are performed upon _x_ and _y_. It is necessary because ECMAScript specifies left to right evaluation of expressions. If _LeftFirst_ is *true*, the _x_ parameter corresponds to an expression that occurs to the left of the _y_ parameter's corresponding expression. If _LeftFirst_ is *false*, the reverse is the case and operations must be performed upon _y_ before _x_.
        +
        It provides the semantics for the comparison _x_ < _y_, returning *true*, *false*, or *undefined* (which indicates that the operands could not be coerced to comparable values of the same numeric type). The _leftFirst_ flag is used to control the order in which operations with potentially visible side-effects are performed upon _x_ and _y_. It is necessary because ECMAScript specifies left to right evaluation of expressions. If _leftFirst_ is *true*, the _x_ parameter corresponds to an expression that occurs to the left of the _y_ parameter's corresponding expression. If _leftFirst_ is *false*, the reverse is the case and operations must be performed upon _y_ before _x_.
        - 1. If _LeftFirst_ is *true*, then + 1. If _leftFirst_ is *true*, then 1. Let _px_ be ? ToPrimitive(_x_, ~number~). 1. Let _py_ be ? ToPrimitive(_y_, ~number~). 1. Else, @@ -5934,30 +6021,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_ is *NaN* 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 +6053,7 @@

        - +

        IsLooselyEqual ( _x_: an ECMAScript language value, @@ -5979,11 +6065,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 +6085,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 +6103,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 +6129,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]]. @@ -6056,8 +6148,8 @@

        Get ( - _O_: an Object, - _P_: a property key, + _obj_: an Object, + _propertyKey_: a property key, ): either a normal completion containing an ECMAScript language value or a throw completion

        @@ -6065,15 +6157,15 @@

        It is used to retrieve the value of a specific property of an object.

        - 1. Return ? _O_.[[Get]](_P_, _O_). + 1. Return ? _obj_.[[Get]](_propertyKey_, _obj_).

        GetV ( - _V_: an ECMAScript language value, - _P_: a property key, + _value_: an ECMAScript language value, + _propertyKey_: a property key, ): either a normal completion containing an ECMAScript language value or a throw completion

        @@ -6081,27 +6173,27 @@

        It is used to retrieve the value of a specific property of an ECMAScript language value. If the value is not an object, the property lookup is performed using a wrapper object appropriate for the type of the value.

        - 1. Let _O_ be ? ToObject(_V_). - 1. Return ? _O_.[[Get]](_P_, _V_). + 1. Let _obj_ be ? ToObject(_value_). + 1. Return ? _obj_.[[Get]](_propertyKey_, _value_).

        Set ( - _O_: an Object, - _P_: a property key, - _V_: an ECMAScript language value, - _Throw_: a Boolean, + _obj_: an Object, + _propertyKey_: a property key, + _value_: an ECMAScript language value, + _throw_: a Boolean, ): either a normal completion containing ~unused~ or a throw completion

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

        CreateDataProperty ( - _O_: an Object, - _P_: a property key, - _V_: an ECMAScript language value, + _obj_: an Object, + _propertyKey_: a property key, + _value_: an ECMAScript language value, ): either a normal completion containing a Boolean or a throw completion

        @@ -6119,20 +6211,20 @@

        It is used to create a new own property of an object.

        - 1. Let _newDesc_ be the PropertyDescriptor { [[Value]]: _V_, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: *true* }. - 1. Return ? _O_.[[DefineOwnProperty]](_P_, _newDesc_). + 1. Let _newDesc_ be the PropertyDescriptor { [[Value]]: _value_, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: *true* }. + 1. Return ? _obj_.[[DefineOwnProperty]](_propertyKey_, _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*.

        +

        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 _obj_ is not extensible, [[DefineOwnProperty]] will return *false*.

        CreateDataPropertyOrThrow ( - _O_: an Object, - _P_: a property key, - _V_: an ECMAScript language value, + _obj_: an Object, + _propertyKey_: a property key, + _value_: an ECMAScript language value, ): either a normal completion containing ~unused~ or a throw completion

        @@ -6140,21 +6232,21 @@

        It is used to create a new own property of an object. It throws a *TypeError* exception if the requested property update cannot be performed.

        - 1. Let _success_ be ? CreateDataProperty(_O_, _P_, _V_). + 1. Let _success_ be ? CreateDataProperty(_obj_, _propertyKey_, _value_). 1. If _success_ is *false*, throw a *TypeError* exception. 1. Return ~unused~. -

        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* causing this operation to throw a *TypeError* exception.

        +

        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 _obj_ is not extensible, [[DefineOwnProperty]] will return *false* causing this operation to throw a *TypeError* exception.

        CreateNonEnumerableDataPropertyOrThrow ( - _O_: an Object, - _P_: a property key, - _V_: an ECMAScript language value, + _obj_: an Object, + _propertyKey_: a property key, + _value_: an ECMAScript language value, ): ~unused~

        @@ -6162,9 +6254,9 @@

        It is used to create a new non-enumerable own property of an ordinary object.

        - 1. Assert: _O_ is an ordinary, extensible object with no non-configurable properties. - 1. Let _newDesc_ be the PropertyDescriptor { [[Value]]: _V_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. - 1. Perform ! DefinePropertyOrThrow(_O_, _P_, _newDesc_). + 1. Assert: _obj_ is an ordinary, extensible object with no non-configurable properties. + 1. Let _newDesc_ be the PropertyDescriptor { [[Value]]: _value_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. + 1. Perform ! DefinePropertyOrThrow(_obj_, _propertyKey_, _newDesc_). 1. Return ~unused~. @@ -6175,9 +6267,9 @@

        DefinePropertyOrThrow ( - _O_: an Object, - _P_: a property key, - _desc_: a Property Descriptor, + _obj_: an Object, + _propertyKey_: a property key, + _propertyDesc_: a Property Descriptor, ): either a normal completion containing ~unused~ or a throw completion

        @@ -6185,7 +6277,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 ? _obj_.[[DefineOwnProperty]](_propertyKey_, _propertyDesc_). 1. If _success_ is *false*, throw a *TypeError* exception. 1. Return ~unused~. @@ -6194,8 +6286,8 @@

        DeletePropertyOrThrow ( - _O_: an Object, - _P_: a property key, + _obj_: an Object, + _propertyKey_: a property key, ): either a normal completion containing ~unused~ or a throw completion

        @@ -6203,7 +6295,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 ? _obj_.[[Delete]](_propertyKey_). 1. If _success_ is *false*, throw a *TypeError* exception. 1. Return ~unused~. @@ -6212,8 +6304,8 @@

        GetMethod ( - _V_: an ECMAScript language value, - _P_: a property key, + _value_: an ECMAScript language value, + _propertyKey_: a property key, ): either a normal completion containing either a function object or *undefined*, or a throw completion

        @@ -6221,7 +6313,7 @@

        It is used to get the value of a specific property of an ECMAScript language value when the value of the property is expected to be a function.

        - 1. Let _func_ be ? GetV(_V_, _P_). + 1. Let _func_ be ? GetV(_value_, _propertyKey_). 1. If _func_ is either *undefined* or *null*, return *undefined*. 1. If IsCallable(_func_) is *false*, throw a *TypeError* exception. 1. Return _func_. @@ -6231,8 +6323,8 @@

        HasProperty ( - _O_: an Object, - _P_: a property key, + _obj_: an Object, + _propertyKey_: a property key, ): either a normal completion containing a Boolean or a throw completion

        @@ -6240,15 +6332,15 @@

        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 ? _obj_.[[HasProperty]](_propertyKey_).

        HasOwnProperty ( - _O_: an Object, - _P_: a property key, + _obj_: an Object, + _propertyKey_: a property key, ): either a normal completion containing a Boolean or a throw completion

        @@ -6256,8 +6348,8 @@

        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. If _desc_ is *undefined*, return *false*. + 1. Let _propertyDesc_ be ? _obj_.[[GetOwnProperty]](_propertyKey_). + 1. If _propertyDesc_ is *undefined*, return *false*. 1. Return *true*.
        @@ -6265,38 +6357,38 @@

        Call ( - _F_: an ECMAScript language value, - _V_: an ECMAScript language value, - optional _argumentsList_: a List of ECMAScript language values, + _func_: an ECMAScript language value, + _thisValue_: an ECMAScript language value, + optional _argList_: a List of ECMAScript language values, ): either a normal completion containing an ECMAScript language value or a throw completion

        description
        -
        It is used to call the [[Call]] internal method of a function object. _F_ is the function object, _V_ is an ECMAScript language value that is the *this* value of the [[Call]], and _argumentsList_ is the value passed to the corresponding argument of the internal method. If _argumentsList_ is not present, a new empty List is used as its value.
        +
        It is used to call the [[Call]] internal method of a function object. _func_ is the function object, _thisValue_ is an ECMAScript language value that is the *this* value of the [[Call]], and _argList_ is the value passed to the corresponding argument of the internal method. If _argList_ is not present, a new empty List is used as its value.
        - 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. If _argList_ is not present, set _argList_ to a new empty List. + 1. If IsCallable(_func_) is *false*, throw a *TypeError* exception. + 1. Return ? _func_.[[Call]](_thisValue_, _argList_).

        Construct ( - _F_: a constructor, - optional _argumentsList_: a List of ECMAScript language values, + _ctor_: a constructor, + optional _argList_: a List of ECMAScript language values, optional _newTarget_: a constructor, ): either a normal completion containing an Object or a throw completion

        description
        -
        It is used to call the [[Construct]] internal method of a function object. _argumentsList_ and _newTarget_ are the values to be passed as the corresponding arguments of the internal method. If _argumentsList_ is not present, a new empty List is used as its value. If _newTarget_ is not present, _F_ is used as its value.
        +
        It is used to call the [[Construct]] internal method of a function object. _argList_ and _newTarget_ are the values to be passed as the corresponding arguments of the internal method. If _argList_ is not present, a new empty List is used as its value. If _newTarget_ is not present, _ctor_ is used as its value.
        - 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. If _newTarget_ is not present, set _newTarget_ to _ctor_. + 1. If _argList_ is not present, set _argList_ to a new empty List. + 1. Return ? _ctor_.[[Construct]](_argList_, _newTarget_).

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

        @@ -6306,7 +6398,7 @@

        SetIntegrityLevel ( - _O_: an Object, + _obj_: an Object, _level_: ~sealed~ or ~frozen~, ): either a normal completion containing a Boolean or a throw completion

        @@ -6315,22 +6407,22 @@

        It is used to fix the set of own properties of an object.
        - 1. Let _status_ be ? _O_.[[PreventExtensions]](). + 1. Let _status_ be ? _obj_.[[PreventExtensions]](). 1. If _status_ is *false*, return *false*. - 1. Let _keys_ be ? _O_.[[OwnPropertyKeys]](). + 1. Let _keys_ be ? _obj_.[[OwnPropertyKeys]](). 1. If _level_ is ~sealed~, then - 1. For each element _k_ of _keys_, do - 1. Perform ? DefinePropertyOrThrow(_O_, _k_, PropertyDescriptor { [[Configurable]]: *false* }). + 1. For each element _key_ of _keys_, do + 1. Perform ? DefinePropertyOrThrow(_obj_, _key_, PropertyDescriptor { [[Configurable]]: *false* }). 1. Else, 1. Assert: _level_ is ~frozen~. - 1. For each element _k_ of _keys_, do - 1. Let _currentDesc_ be ? _O_.[[GetOwnProperty]](_k_). + 1. For each element _key_ of _keys_, do + 1. Let _currentDesc_ be ? _obj_.[[GetOwnProperty]](_key_). 1. If _currentDesc_ is not *undefined*, then 1. If IsAccessorDescriptor(_currentDesc_) is *true*, then - 1. Let _desc_ be the PropertyDescriptor { [[Configurable]]: *false* }. + 1. Let _propertyDesc_ be the PropertyDescriptor { [[Configurable]]: *false* }. 1. Else, - 1. Let _desc_ be the PropertyDescriptor { [[Configurable]]: *false*, [[Writable]]: *false* }. - 1. Perform ? DefinePropertyOrThrow(_O_, _k_, _desc_). + 1. Let _propertyDesc_ be the PropertyDescriptor { [[Configurable]]: *false*, [[Writable]]: *false* }. + 1. Perform ? DefinePropertyOrThrow(_obj_, _key_, _propertyDesc_). 1. Return *true*. @@ -6338,7 +6430,7 @@

        TestIntegrityLevel ( - _O_: an Object, + _obj_: an Object, _level_: ~sealed~ or ~frozen~, ): either a normal completion containing a Boolean or a throw completion

        @@ -6347,12 +6439,12 @@

        It is used to determine if the set of own properties of an object are fixed.
        - 1. Let _extensible_ be ? IsExtensible(_O_). + 1. Let _extensible_ be ? IsExtensible(_obj_). 1. If _extensible_ is *true*, return *false*. 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 _keys_ be ? _obj_.[[OwnPropertyKeys]](). + 1. For each element _key_ of _keys_, do + 1. Let _currentDesc_ be ? _obj_.[[GetOwnProperty]](_key_). 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 @@ -6374,8 +6466,8 @@

        1. Let _array_ be ! ArrayCreate(0). 1. Let _n_ be 0. - 1. For each element _e_ of _elements_, do - 1. Perform ! CreateDataPropertyOrThrow(_array_, ! ToString(𝔽(_n_)), _e_). + 1. For each element _element_ of _elements_, do + 1. Perform ! CreateDataPropertyOrThrow(_array_, ! ToString(𝔽(_n_)), _element_). 1. Set _n_ to _n_ + 1. 1. Return _array_. @@ -6407,23 +6499,23 @@

        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 _length_ be ? LengthOfArrayLike(_obj_). 1. Let _list_ be a new empty List. 1. Let _index_ be 0. - 1. Repeat, while _index_ < _len_, + 1. Repeat, while _index_ < _length_, 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_. @@ -6433,67 +6525,67 @@

        Invoke ( - _V_: an ECMAScript language value, - _P_: a property key, - optional _argumentsList_: a List of ECMAScript language values, + _value_: an ECMAScript language value, + _propertyKey_: a property key, + optional _argList_: a List of ECMAScript language values, ): either a normal completion containing an ECMAScript language value or a throw completion

        description
        -
        It is used to call a method property of an ECMAScript language value. _V_ serves as both the lookup point for the property and the *this* value of the call. _argumentsList_ is the list of arguments values passed to the method. If _argumentsList_ is not present, a new empty List is used as its value.
        +
        It is used to call a method property of an ECMAScript language value. _value_ serves as both the lookup point for the property and the *this* value of the call. _argList_ is the list of arguments values passed to the method. If _argList_ is not present, a new empty List is used as its value.
        - 1. If _argumentsList_ is not present, set _argumentsList_ to a new empty List. - 1. Let _func_ be ? GetV(_V_, _P_). - 1. Return ? Call(_func_, _V_, _argumentsList_). + 1. If _argList_ is not present, set _argList_ to a new empty List. + 1. Let _func_ be ? GetV(_value_, _propertyKey_). + 1. Return ? Call(_func_, _value_, _argList_).

        OrdinaryHasInstance ( - _C_: an ECMAScript language value, - _O_: an ECMAScript language value, + _ctor_: an ECMAScript language value, + _instance_: an ECMAScript language value, ): either a normal completion containing a Boolean or a throw completion

        description
        -
        It implements the default algorithm for determining if _O_ inherits from the instance object inheritance path provided by _C_.
        +
        It implements the default algorithm for determining if _instance_ inherits from the instance object inheritance path provided by _ctor_.
        - 1. If IsCallable(_C_) is *false*, return *false*. - 1. If _C_ has a [[BoundTargetFunction]] internal slot, then - 1. Let _BC_ be _C_.[[BoundTargetFunction]]. - 1. Return ? InstanceofOperator(_O_, _BC_). - 1. If _O_ is not an Object, return *false*. - 1. Let _P_ be ? Get(_C_, *"prototype"*). - 1. If _P_ is not an Object, throw a *TypeError* exception. + 1. If IsCallable(_ctor_) is *false*, return *false*. + 1. If _ctor_ has a [[BoundTargetFunction]] internal slot, then + 1. Let _boundCtor_ be _ctor_.[[BoundTargetFunction]]. + 1. Return ? InstanceofOperator(_instance_, _boundCtor_). + 1. If _instance_ is not an Object, return *false*. + 1. Let _proto_ be ? Get(_ctor_, *"prototype"*). + 1. If _proto_ is not an Object, throw a *TypeError* exception. 1. Repeat, - 1. Set _O_ to ? _O_.[[GetPrototypeOf]](). - 1. If _O_ is *null*, return *false*. - 1. If SameValue(_P_, _O_) is *true*, return *true*. + 1. Set _instance_ to ? _instance_.[[GetPrototypeOf]](). + 1. If _instance_ is *null*, return *false*. + 1. If SameValue(_proto_, _instance_) is *true*, return *true*.

        SpeciesConstructor ( - _O_: an Object, - _defaultConstructor_: a constructor, + _obj_: an Object, + _defaultCtor_: a constructor, ): either a normal completion containing a constructor or a throw completion

        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 _obj_. _defaultCtor_ is the constructor to use if a constructor %Symbol.species% property cannot be found starting from _obj_.
        - 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. If _S_ is either *undefined* or *null*, return _defaultConstructor_. - 1. If IsConstructor(_S_) is *true*, return _S_. + 1. Let _ctor_ be ? Get(_obj_, *"constructor"*). + 1. If _ctor_ is *undefined*, return _defaultCtor_. + 1. If _ctor_ is not an Object, throw a *TypeError* exception. + 1. Let _species_ be ? Get(_ctor_, %Symbol.species%). + 1. If _species_ is either *undefined* or *null*, return _defaultCtor_. + 1. If IsConstructor(_species_) is *true*, return _species_. 1. Throw a *TypeError* exception.
        @@ -6501,23 +6593,23 @@

        EnumerableOwnProperties ( - _O_: an Object, + _obj_: an Object, _kind_: ~key~, ~value~, or ~key+value~, ): either a normal completion containing a List of ECMAScript language values or a throw completion

        - 1. Let _ownKeys_ be ? _O_.[[OwnPropertyKeys]](). + 1. Let _ownKeys_ be ? _obj_.[[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. If _desc_ is not *undefined* and _desc_.[[Enumerable]] is *true*, then + 1. Let _propertyDesc_ be ? _obj_.[[GetOwnProperty]](_key_). + 1. If _propertyDesc_ is not *undefined* and _propertyDesc_.[[Enumerable]] is *true*, then 1. If _kind_ is ~key~, then 1. Append _key_ to _results_. 1. Else, - 1. Let _value_ be ? Get(_O_, _key_). + 1. Let _value_ be ? Get(_obj_, _key_). 1. If _kind_ is ~value~, then 1. Append _value_ to _results_. 1. Else, @@ -6531,25 +6623,26 @@

        GetFunctionRealm ( - _obj_: a function object, + _func_: a function object, ): either a normal completion containing a Realm Record or a throw completion

        - 1. If _obj_ has a [[Realm]] internal slot, then - 1. Return _obj_.[[Realm]]. - 1. If _obj_ is a bound function exotic object, then - 1. Let _boundTargetFunction_ be _obj_.[[BoundTargetFunction]]. - 1. Return ? GetFunctionRealm(_boundTargetFunction_). - 1. If _obj_ is a Proxy exotic object, then - 1. Perform ? ValidateNonRevokedProxy(_obj_). - 1. Let _proxyTarget_ be _obj_.[[ProxyTarget]]. + 1. If _func_ has a [[Realm]] internal slot, then + 1. Return _func_.[[Realm]]. + 1. If _func_ is a bound function exotic object, then + 1. Let _boundTargetFunc_ be _func_.[[BoundTargetFunction]]. + 1. Return ? GetFunctionRealm(_boundTargetFunc_). + 1. If _func_ is a Proxy exotic object, then + 1. Perform ? ValidateNonRevokedProxy(_func_). + 1. Let _proxyTarget_ be _func_.[[ProxyTarget]]. + 1. Assert: _proxyTarget_ is a function object. 1. Return ? GetFunctionRealm(_proxyTarget_). 1. [id="step-getfunctionrealm-default-return"] Return the current Realm Record. -

        Step will only be reached if _obj_ is a non-standard function exotic object that does not have a [[Realm]] internal slot.

        +

        Step will only be reached if _func_ is a non-standard function exotic object that does not have a [[Realm]] internal slot.

        @@ -6566,17 +6659,17 @@

        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. For each element _element_ of _excludedItems_, do + 1. If SameValue(_element_, _nextKey_) is *true*, then 1. Set _excluded_ to *true*. 1. If _excluded_ is *false*, then - 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_). + 1. Let _propertyDesc_ be ? _from_.[[GetOwnProperty]](_nextKey_). + 1. If _propertyDesc_ is not *undefined* and _propertyDesc_.[[Enumerable]] is *true*, then + 1. Let _propertyValue_ be ? Get(_from_, _nextKey_). + 1. Perform ! CreateDataPropertyOrThrow(_target_, _nextKey_, _propertyValue_). 1. Return ~unused~. @@ -6587,15 +6680,15 @@

        PrivateElementFind ( - _O_: an Object, - _P_: a Private Name, + _obj_: an Object, + _privateName_: a Private Name, ): a PrivateElement or ~empty~

        - 1. If _O_.[[PrivateElements]] contains a PrivateElement _pe_ such that _pe_.[[Key]] is _P_, then - 1. Return _pe_. + 1. If _obj_.[[PrivateElements]] contains a PrivateElement _entry_ such that _entry_.[[Key]] is _privateName_, then + 1. Return _entry_. 1. Return ~empty~.
        @@ -6603,8 +6696,8 @@

        PrivateFieldAdd ( - _O_: an Object, - _P_: a Private Name, + _obj_: an Object, + _privateName_: a Private Name, _value_: an ECMAScript language value, ): either a normal completion containing ~unused~ or a throw completion

        @@ -6612,10 +6705,10 @@

        1. If the host is a web browser, then - 1. Perform ? HostEnsureCanAddPrivateElement(_O_). - 1. Let _entry_ be PrivateElementFind(_O_, _P_). + 1. Perform ? HostEnsureCanAddPrivateElement(_obj_). + 1. Let _entry_ be PrivateElementFind(_obj_, _privateName_). 1. If _entry_ is not ~empty~, throw a *TypeError* exception. - 1. Append PrivateElement { [[Key]]: _P_, [[Kind]]: ~field~, [[Value]]: _value_ } to _O_.[[PrivateElements]]. + 1. Append PrivateElement { [[Key]]: _privateName_, [[Kind]]: ~field~, [[Value]]: _value_ } to _obj_.[[PrivateElements]]. 1. Return ~unused~. @@ -6623,7 +6716,7 @@

        PrivateMethodOrAccessorAdd ( - _O_: an Object, + _obj_: an Object, _method_: a PrivateElement, ): either a normal completion containing ~unused~ or a throw completion

        @@ -6632,10 +6725,10 @@

        1. Assert: _method_.[[Kind]] is either ~method~ or ~accessor~. 1. If the host is a web browser, then - 1. Perform ? HostEnsureCanAddPrivateElement(_O_). - 1. Let _entry_ be PrivateElementFind(_O_, _method_.[[Key]]). + 1. Perform ? HostEnsureCanAddPrivateElement(_obj_). + 1. Let _entry_ be PrivateElementFind(_obj_, _method_.[[Key]]). 1. If _entry_ is not ~empty~, throw a *TypeError* exception. - 1. Append _method_ to _O_.[[PrivateElements]]. + 1. Append _method_ to _obj_.[[PrivateElements]]. 1. Return ~unused~. @@ -6646,7 +6739,7 @@

        HostEnsureCanAddPrivateElement ( - _O_: an Object, + _obj_: an Object, ): either a normal completion containing ~unused~ or a throw completion

        @@ -6655,7 +6748,7 @@

        An implementation of HostEnsureCanAddPrivateElement must conform to the following requirements:

          -
        • If _O_ is not a host-defined exotic object, this abstract operation must return NormalCompletion(~unused~) and perform no other steps.
        • +
        • If _obj_ is not a host-defined exotic object, this abstract operation must return NormalCompletion(~unused~) and perform no other steps.
        • Any two calls of this abstract operation with the same argument must return the same kind of Completion Record.

        The default implementation of HostEnsureCanAddPrivateElement is to return NormalCompletion(~unused~).

        @@ -6665,46 +6758,45 @@

        PrivateGet ( - _O_: an Object, - _P_: a Private Name, + _obj_: an Object, + _privateName_: a Private Name, ): either a normal completion containing an ECMAScript language value or a throw completion

        - 1. Let _entry_ be PrivateElementFind(_O_, _P_). + 1. Let _entry_ be PrivateElementFind(_obj_, _privateName_). 1. If _entry_ is ~empty~, throw a *TypeError* exception. 1. If _entry_.[[Kind]] is either ~field~ or ~method~, then 1. Return _entry_.[[Value]]. 1. Assert: _entry_.[[Kind]] is ~accessor~. - 1. If _entry_.[[Get]] is *undefined*, throw a *TypeError* exception. - 1. Let _getter_ be _entry_.[[Get]]. - 1. Return ? Call(_getter_, _O_). + 1. If _entry_.[[Getter]] is *undefined*, throw a *TypeError* exception. + 1. Let _getter_ be _entry_.[[Getter]]. + 1. Return ? Call(_getter_, _obj_).

        PrivateSet ( - _O_: an Object, - _P_: a Private Name, + _obj_: an Object, + _privateName_: a Private Name, _value_: an ECMAScript language value, ): either a normal completion containing ~unused~ or a throw completion

        - 1. Let _entry_ be PrivateElementFind(_O_, _P_). + 1. Let _entry_ be PrivateElementFind(_obj_, _privateName_). 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. - 1. Let _setter_ be _entry_.[[Set]]. - 1. Perform ? Call(_setter_, _O_, « _value_ »). + 1. If _entry_.[[Setter]] is *undefined*, throw a *TypeError* exception. + 1. Let _setter_ be _entry_.[[Setter]]. + 1. Perform ? Call(_setter_, _obj_, « _value_ »). 1. Return ~unused~.
        @@ -6737,19 +6829,19 @@

        InitializeInstanceElements ( - _O_: an Object, - _constructor_: an ECMAScript function object, + _obj_: an Object, + _ctor_: 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 _ctor_.[[PrivateMethods]]. 1. For each PrivateElement _method_ of _methods_, do - 1. Perform ? PrivateMethodOrAccessorAdd(_O_, _method_). - 1. Let _fields_ be the value of _constructor_.[[Fields]]. + 1. Perform ? PrivateMethodOrAccessorAdd(_obj_, _method_). + 1. Let _fields_ be _ctor_.[[Fields]]. 1. For each element _fieldRecord_ of _fields_, do - 1. Perform ? DefineField(_O_, _fieldRecord_). + 1. Perform ? DefineField(_obj_, _fieldRecord_). 1. Return ~unused~.
        @@ -6765,10 +6857,10 @@

        - 1. For each Record { [[Key]], [[Elements]] } _g_ of _groups_, do - 1. If SameValue(_g_.[[Key]], _key_) is *true*, then + 1. For each Record { [[Key]], [[Elements]] } _group_ of _groups_, do + 1. If SameValue(_group_.[[Key]], _key_) is *true*, then 1. Assert: Exactly one element of _groups_ meets this criterion. - 1. Append _value_ to _g_.[[Elements]]. + 1. Append _value_ to _group_.[[Elements]]. 1. Return ~unused~. 1. Let _group_ be the Record { [[Key]]: _key_, [[Elements]]: « _value_ » }. 1. Append _group_ to _groups_. @@ -6780,15 +6872,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 +6892,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, + _propertyKey_: a property key, + _value_: 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 _propertyDesc_ be ? _thisValue_.[[GetOwnProperty]](_propertyKey_). + 1. If _propertyDesc_ is *undefined*, then + 1. Perform ? CreateDataPropertyOrThrow(_thisValue_, _propertyKey_, _value_). + 1. Else, + 1. Perform ? Set(_thisValue_, _propertyKey_, _value_, *true*). + 1. Return ~unused~. + +
        @@ -6820,21 +6955,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 used to encapsulate an iterator or async iterator along with the `next` method.

        Iterator Records have the fields listed in .

        - - - - - + + + + + + + @@ -6872,6 +7009,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 +7036,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 +7051,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 +7116,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 +7210,24 @@

        + +

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

        +
        +
        skip global checks
        +
        true
        +
        + + 1. For each element _iterator_ of _iterators_, in reverse List order, do + 1. Set _completion_ to Completion(IteratorClose(_iterator_, _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 +7238,21 @@

        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_. + +
        + + +

        IfAbruptCloseIterators ( _value_, _iteratorRecords_ )

        +

        IfAbruptCloseIterators is a shorthand for a sequence of algorithm steps that use a list of Iterator Records. An algorithm step of the form:

        + + 1. IfAbruptCloseIterators(_value_, _iteratorRecords_). + +

        means the same thing as:

        + + 1. Assert: _value_ is a Completion Record. + 1. If _value_ is an abrupt completion, return ? IteratorCloseAll(_iteratorRecords_, _value_). + 1. Set _value_ to ! _value_.
        @@ -7077,16 +7283,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 +7324,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. For each element _value_ of _list_, do + 1. Perform ? GeneratorYield(CreateIteratorResultObject(_value_, *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.

        @@ -7137,6 +7357,186 @@

        + + +

        Operations on Disposable Objects

        +

        See Common Resource Management Interfaces ().

        + + +

        DisposableResource Records

        +

        A DisposableResource Record is a Record value used to encapsulate a disposable object along with the method used to dispose the object. DisposableResource Records are produced by the CreateDisposableResource abstract operation.

        +

        DisposableResource Records have the fields listed in :

        + +

        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[Iterator]] @@ -6843,7 +6980,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.
        + + + + + + + + + + + + + + + + + + + + +
        + Field Name + + Value + + Meaning +
        + [[ResourceValue]] + + an Object or *undefined* + + The value to be disposed. +
        + [[Kind]] + + ~sync-dispose~ or ~async-dispose~ + + Indicates whether the resource was added by a `using` declaration or DisposableStack object (~sync-dispose~) or by an `await using` declaration or AsyncDisposableStack object (~async-dispose~). +
        + [[DisposeMethod]] + + a function object or *undefined* + + A function object that will be called with [[ResourceValue]] as its *this* value when the resource is disposed. +
        +
        +
        + + +

        + AddDisposableResource ( + _disposableResourceStack_: a List of DisposableResource Records, + _value_: an ECMAScript language value, + _kind_: ~sync-dispose~ or ~async-dispose~, + optional _method_: a function object, + ): either a normal completion containing ~unused~ or a throw completion +

        +
        +
        + + 1. If _method_ is present, then + 1. Assert: _value_ is *undefined*. + 1. Let _resource_ be ? CreateDisposableResource(*undefined*, _kind_, _method_). + 1. Else, + 1. If _value_ is either *null* or *undefined* and _kind_ is ~sync-dispose~, return ~unused~. + 1. NOTE: When _value_ is either *null* or *undefined* and _kind_ is ~async-dispose~, we record that the resource was evaluated to ensure we will still perform an Await when resources are later disposed. + 1. Let _resource_ be ? CreateDisposableResource(_value_, _kind_). + 1. Append _resource_ to _disposableResourceStack_. + 1. Return ~unused~. + +
        + + +

        + CreateDisposableResource ( + _value_: an ECMAScript language value, + _kind_: ~sync-dispose~ or ~async-dispose~, + optional _method_: a function object, + ): either a normal completion containing a DisposableResource Record or a throw completion +

        +
        +
        + + 1. If _method_ is not present, then + 1. If _value_ is either *null* or *undefined*, then + 1. Set _value_ to *undefined*. + 1. Set _method_ to *undefined*. + 1. Else, + 1. Set _method_ to ? GetDisposeMethod(_value_, _kind_). + 1. If _method_ is *undefined*, throw a *TypeError* exception. + 1. Return the DisposableResource Record { [[ResourceValue]]: _value_, [[Kind]]: _kind_, [[DisposeMethod]]: _method_ }. + +
        + + +

        + GetDisposeMethod ( + _value_: an ECMAScript language value, + _kind_: ~sync-dispose~ or ~async-dispose~, + ): either a normal completion containing either a function object or *undefined*, or a throw completion +

        +
        +
        + + 1. If _value_ is not an Object, throw a *TypeError* exception. + 1. If _kind_ is ~sync-dispose~, return ? GetMethod(_value_, %Symbol.dispose%). + 1. Assert: _kind_ is ~async-dispose~. + 1. Let _asyncMethod_ be ? GetMethod(_value_, %Symbol.asyncDispose%). + 1. If _asyncMethod_ is not *undefined*, return _asyncMethod_. + 1. Let _syncMethod_ be ? GetMethod(_value_, %Symbol.dispose%). + 1. If _syncMethod_ is *undefined*, return *undefined*. + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _syncMethod_ and performs the following steps when called: + 1. Let _obj_ be the *this* value. + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _result_ be Completion(Call(_syncMethod_, _obj_)). + 1. IfAbruptRejectPromise(_result_, _promiseCapability_). + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « *undefined* »). + 1. Return _promiseCapability_.[[Promise]]. + 1. NOTE: This function is not observable to user code. It is used to ensure that a Promise returned from a synchronous `%Symbol.dispose%` method will not be awaited and that a synchronous exception will be translated to a rejected Promise. + 1. Return CreateBuiltinFunction(_closure_, 0, *""*, « »). + +
        + + +

        + DisposeResources ( + _disposableResourceStack_: a List of DisposableResource Records, + _completion_: either a normal completion containing either an ECMAScript language value or ~empty~, or an abrupt completion, + ): either a normal completion containing either an ECMAScript language value or ~empty~, or an abrupt completion +

        +
        +
        + + 1. Let _needsAwait_ be *false*. + 1. Let _hasAwaited_ be *false*. + 1. Let _outputCompletion_ be _completion_. + 1. For each element _resource_ of _disposableResourceStack_, in reverse List order, do + 1. Let _value_ be _resource_.[[ResourceValue]]. + 1. Let _kind_ be _resource_.[[Kind]]. + 1. Let _method_ be _resource_.[[DisposeMethod]]. + 1. If _kind_ is ~sync-dispose~, _needsAwait_ is *true*, and _hasAwaited_ is *false*, then + 1. Perform ! Await(*undefined*). + 1. Set _needsAwait_ to *false*. + 1. If _method_ is not *undefined*, then + 1. Let _result_ be Completion(Call(_method_, _value_)). + 1. If _result_ is a normal completion and _kind_ is ~async-dispose~, then + 1. Set _result_ to Completion(Await(_result_.[[Value]])). + 1. Set _hasAwaited_ to *true*. + 1. If _result_ is a throw completion, then + 1. If _outputCompletion_ is a throw completion, then + 1. Set _result_ to _result_.[[Value]]. + 1. Let _suppressed_ be _outputCompletion_.[[Value]]. + 1. Let _error_ be a newly created *SuppressedError* object. + 1. Perform CreateNonEnumerableDataPropertyOrThrow(_error_, *"error"*, _result_). + 1. Perform CreateNonEnumerableDataPropertyOrThrow(_error_, *"suppressed"*, _suppressed_). + 1. Set _outputCompletion_ to ThrowCompletion(_error_). + 1. Else, + 1. Set _outputCompletion_ to _result_. + 1. Else, + 1. Assert: _kind_ is ~async-dispose~. + 1. Set _needsAwait_ to *true*. + 1. NOTE: This can only indicate a case where either *null* or *undefined* was the initialized value of an `await using` declaration. + 1. If _needsAwait_ is *true* and _hasAwaited_ is *false*, then + 1. Perform ! Await(*undefined*). + 1. NOTE: At this point _disposableResourceStack_ will never be used again. The contents of _disposableResourceStack_ can be discarded in implementations, such as by garbage collection. + 1. Return ? _outputCompletion_. + +
        +
        @@ -7150,7 +7550,7 @@

        Runtime Semantics: Evaluation ( ): a Completion Record

        user-code
        - The definitions for this operation are distributed over the "ECMAScript Language" sections of this specification. Each definition appears after the defining occurrence of the relevant productions. + The definitions for this operation are distributed over the “ECMAScript Language” sections of this specification. Each definition appears after the defining occurrence of the relevant productions.
        @@ -7180,6 +7580,16 @@

        Static Semantics: BoundNames ( ): a List of Strings

        1. Return the BoundNames of |BindingList|. + + UsingDeclaration : + `using` BindingList `;` + + AwaitUsingDeclaration : + CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList `;` + + + 1. Return the BoundNames of |BindingList|. + BindingList : BindingList `,` LexicalBinding 1. Let _names1_ be the BoundNames of |BindingList|. @@ -7340,11 +7750,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 +7786,7 @@

        Static Semantics: BoundNames ( ): a List of Strings

        ExportDeclaration : - `export` ExportFromClause FromClause `;` + `export` ExportFromClause FromClause WithClause? `;` `export` NamedExports `;` @@ -7392,15 +7802,15 @@

        Static Semantics: BoundNames ( ): a List of Strings

        ExportDeclaration : `export` `default` HoistableDeclaration - 1. Let _declarationNames_ be the BoundNames of |HoistableDeclaration|. - 1. If _declarationNames_ does not include the element *"\*default\*"*, append *"\*default\*"* to _declarationNames_. - 1. Return _declarationNames_. + 1. Let _declNames_ be the BoundNames of |HoistableDeclaration|. + 1. If _declNames_ does not include the element *"\*default\*"*, append *"\*default\*"* to _declNames_. + 1. Return _declNames_. ExportDeclaration : `export` `default` ClassDeclaration - 1. Let _declarationNames_ be the BoundNames of |ClassDeclaration|. - 1. If _declarationNames_ does not include the element *"\*default\*"*, append *"\*default\*"* to _declarationNames_. - 1. Return _declarationNames_. + 1. Let _declNames_ be the BoundNames of |ClassDeclaration|. + 1. If _declNames_ does not include the element *"\*default\*"*, append *"\*default\*"* to _declNames_. + 1. Return _declNames_. ExportDeclaration : `export` `default` AssignmentExpression `;` @@ -7454,6 +7864,16 @@

        Static Semantics: IsConstantDeclaration ( ): a Boolean

        1. Return *true*. + + UsingDeclaration : + `using` BindingList `;` + + AwaitUsingDeclaration : + CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList `;` + + + 1. Return *true*. + FunctionDeclaration : `function` BindingIdentifier `(` FormalParameters `)` `{` FunctionBody `}` @@ -7496,6 +7916,124 @@

        Static Semantics: IsConstantDeclaration ( ): a Boolean

        + +

        Static Semantics: IsUsingDeclaration ( ): a Boolean

        +
        +
        + LexicalDeclaration : LetOrConst BindingList `;` + + 1. Return *false*. + + + UsingDeclaration : + `using` BindingList `;` + + AwaitUsingDeclaration : + CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList `;` + + + 1. Return *true*. + + ForDeclaration : LetOrConst ForBinding + + 1. Return *false*. + + + ForDeclaration : + `using` ForBinding + `await` `using` ForBinding + + + 1. Return *true*. + + + FunctionDeclaration : + `function` BindingIdentifier `(` FormalParameters `)` `{` FunctionBody `}` + `function` `(` FormalParameters `)` `{` FunctionBody `}` + + GeneratorDeclaration : + `function` `*` BindingIdentifier `(` FormalParameters `)` `{` GeneratorBody `}` + `function` `*` `(` FormalParameters `)` `{` GeneratorBody `}` + + AsyncGeneratorDeclaration : + `async` `function` `*` BindingIdentifier `(` FormalParameters `)` `{` AsyncGeneratorBody `}` + `async` `function` `*` `(` FormalParameters `)` `{` AsyncGeneratorBody `}` + + AsyncFunctionDeclaration : + `async` `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + `async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. Return *false*. + + + ClassDeclaration : + `class` BindingIdentifier ClassTail + `class` ClassTail + + + 1. Return *false*. + +
        + + +

        Static Semantics: IsAwaitUsingDeclaration ( ): a Boolean

        +
        +
        + LexicalDeclaration : LetOrConst BindingList `;` + + 1. Return *false*. + + UsingDeclaration : `using` BindingList `;` + + 1. Return *false*. + + AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList `;` + + 1. Return *true*. + + ForDeclaration : LetOrConst ForBinding + + 1. Return *false*. + + ForDeclaration : `using` ForBinding + + 1. Return *false*. + + ForDeclaration : `await` `using` ForBinding + + 1. Return *true*. + + + FunctionDeclaration : + `function` BindingIdentifier `(` FormalParameters `)` `{` FunctionBody `}` + `function` `(` FormalParameters `)` `{` FunctionBody `}` + + GeneratorDeclaration : + `function` `*` BindingIdentifier `(` FormalParameters `)` `{` GeneratorBody `}` + `function` `*` `(` FormalParameters `)` `{` GeneratorBody `}` + + AsyncGeneratorDeclaration : + `async` `function` `*` BindingIdentifier `(` FormalParameters `)` `{` AsyncGeneratorBody `}` + `async` `function` `*` `(` FormalParameters `)` `{` AsyncGeneratorBody `}` + + AsyncFunctionDeclaration : + `async` `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + `async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. Return *false*. + + + ClassDeclaration : + `class` BindingIdentifier ClassTail + `class` ClassTail + + + 1. Return *false*. + +
        +

        Static Semantics: LexicallyDeclaredNames ( ): a List of Strings

        @@ -7630,9 +8168,9 @@

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

        StatementList : StatementList StatementListItem - 1. Let _declarations1_ be the LexicallyScopedDeclarations of |StatementList|. - 1. Let _declarations2_ be the LexicallyScopedDeclarations of |StatementListItem|. - 1. Return the list-concatenation of _declarations1_ and _declarations2_. + 1. Let _decls1_ be the LexicallyScopedDeclarations of |StatementList|. + 1. Let _decls2_ be the LexicallyScopedDeclarations of |StatementListItem|. + 1. Return the list-concatenation of _decls1_ and _decls2_. StatementListItem : Statement @@ -7649,18 +8187,18 @@

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

        CaseBlock : `{` CaseClauses? DefaultClause CaseClauses? `}` - 1. If the first |CaseClauses| is present, let _declarations1_ be the LexicallyScopedDeclarations of the first |CaseClauses|. - 1. Else, let _declarations1_ be a new empty List. - 1. Let _declarations2_ be the LexicallyScopedDeclarations of |DefaultClause|. - 1. If the second |CaseClauses| is present, let _declarations3_ be the LexicallyScopedDeclarations of the second |CaseClauses|. - 1. Else, let _declarations3_ be a new empty List. - 1. Return the list-concatenation of _declarations1_, _declarations2_, and _declarations3_. + 1. If the first |CaseClauses| is present, let _decls1_ be the LexicallyScopedDeclarations of the first |CaseClauses|. + 1. Else, let _decls1_ be a new empty List. + 1. Let _decls2_ be the LexicallyScopedDeclarations of |DefaultClause|. + 1. If the second |CaseClauses| is present, let _decls3_ be the LexicallyScopedDeclarations of the second |CaseClauses|. + 1. Else, let _decls3_ be a new empty List. + 1. Return the list-concatenation of _decls1_, _decls2_, and _decls3_. CaseClauses : CaseClauses CaseClause - 1. Let _declarations1_ be the LexicallyScopedDeclarations of |CaseClauses|. - 1. Let _declarations2_ be the LexicallyScopedDeclarations of |CaseClause|. - 1. Return the list-concatenation of _declarations1_ and _declarations2_. + 1. Let _decls1_ be the LexicallyScopedDeclarations of |CaseClauses|. + 1. Let _decls2_ be the LexicallyScopedDeclarations of |CaseClause|. + 1. Return the list-concatenation of _decls1_ and _decls2_. CaseClause : `case` Expression `:` StatementList? @@ -7724,9 +8262,9 @@

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

        ModuleItemList : ModuleItemList ModuleItem - 1. Let _declarations1_ be the LexicallyScopedDeclarations of |ModuleItemList|. - 1. Let _declarations2_ be the LexicallyScopedDeclarations of |ModuleItem|. - 1. Return the list-concatenation of _declarations1_ and _declarations2_. + 1. Let _decls1_ be the LexicallyScopedDeclarations of |ModuleItemList|. + 1. Let _decls2_ be the LexicallyScopedDeclarations of |ModuleItem|. + 1. Return the list-concatenation of _decls1_ and _decls2_. ModuleItem : ImportDeclaration @@ -7734,7 +8272,7 @@

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

        ExportDeclaration : - `export` ExportFromClause FromClause `;` + `export` ExportFromClause FromClause WithClause? `;` `export` NamedExports `;` `export` VariableStatement @@ -7994,9 +8532,9 @@

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

        StatementList : StatementList StatementListItem - 1. Let _declarations1_ be the VarScopedDeclarations of |StatementList|. - 1. Let _declarations2_ be the VarScopedDeclarations of |StatementListItem|. - 1. Return the list-concatenation of _declarations1_ and _declarations2_. + 1. Let _decls1_ be the VarScopedDeclarations of |StatementList|. + 1. Let _decls2_ be the VarScopedDeclarations of |StatementListItem|. + 1. Return the list-concatenation of _decls1_ and _decls2_. StatementListItem : Declaration @@ -8008,14 +8546,14 @@

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

        VariableDeclarationList : VariableDeclarationList `,` VariableDeclaration - 1. Let _declarations1_ be the VarScopedDeclarations of |VariableDeclarationList|. - 1. Return the list-concatenation of _declarations1_ and « |VariableDeclaration| ». + 1. Let _decls1_ be the VarScopedDeclarations of |VariableDeclarationList|. + 1. Return the list-concatenation of _decls1_ and « |VariableDeclaration| ». IfStatement : `if` `(` Expression `)` Statement `else` Statement - 1. Let _declarations1_ be the VarScopedDeclarations of the first |Statement|. - 1. Let _declarations2_ be the VarScopedDeclarations of the second |Statement|. - 1. Return the list-concatenation of _declarations1_ and _declarations2_. + 1. Let _decls1_ be the VarScopedDeclarations of the first |Statement|. + 1. Let _decls2_ be the VarScopedDeclarations of the second |Statement|. + 1. Return the list-concatenation of _decls1_ and _decls2_. IfStatement : `if` `(` Expression `)` Statement @@ -8035,9 +8573,9 @@

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

        ForStatement : `for` `(` `var` VariableDeclarationList `;` Expression? `;` Expression? `)` Statement - 1. Let _declarations1_ be the VarScopedDeclarations of |VariableDeclarationList|. - 1. Let _declarations2_ be the VarScopedDeclarations of |Statement|. - 1. Return the list-concatenation of _declarations1_ and _declarations2_. + 1. Let _decls1_ be the VarScopedDeclarations of |VariableDeclarationList|. + 1. Let _decls2_ be the VarScopedDeclarations of |Statement|. + 1. Return the list-concatenation of _decls1_ and _decls2_. ForStatement : `for` `(` LexicalDeclaration Expression? `;` Expression? `)` Statement @@ -8062,9 +8600,9 @@

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

        `for` `await` `(` `var` ForBinding `of` AssignmentExpression `)` Statement - 1. Let _declarations1_ be « |ForBinding| ». - 1. Let _declarations2_ be the VarScopedDeclarations of |Statement|. - 1. Return the list-concatenation of _declarations1_ and _declarations2_. + 1. Let _decls1_ be « |ForBinding| ». + 1. Let _decls2_ be the VarScopedDeclarations of |Statement|. + 1. Return the list-concatenation of _decls1_ and _decls2_.

        This section is extended by Annex .

        @@ -8083,18 +8621,18 @@

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

        CaseBlock : `{` CaseClauses? DefaultClause CaseClauses? `}` - 1. If the first |CaseClauses| is present, let _declarations1_ be the VarScopedDeclarations of the first |CaseClauses|. - 1. Else, let _declarations1_ be a new empty List. - 1. Let _declarations2_ be the VarScopedDeclarations of |DefaultClause|. - 1. If the second |CaseClauses| is present, let _declarations3_ be the VarScopedDeclarations of the second |CaseClauses|. - 1. Else, let _declarations3_ be a new empty List. - 1. Return the list-concatenation of _declarations1_, _declarations2_, and _declarations3_. + 1. If the first |CaseClauses| is present, let _decls1_ be the VarScopedDeclarations of the first |CaseClauses|. + 1. Else, let _decls1_ be a new empty List. + 1. Let _decls2_ be the VarScopedDeclarations of |DefaultClause|. + 1. If the second |CaseClauses| is present, let _decls3_ be the VarScopedDeclarations of the second |CaseClauses|. + 1. Else, let _decls3_ be a new empty List. + 1. Return the list-concatenation of _decls1_, _decls2_, and _decls3_. CaseClauses : CaseClauses CaseClause - 1. Let _declarations1_ be the VarScopedDeclarations of |CaseClauses|. - 1. Let _declarations2_ be the VarScopedDeclarations of |CaseClause|. - 1. Return the list-concatenation of _declarations1_ and _declarations2_. + 1. Let _decls1_ be the VarScopedDeclarations of |CaseClauses|. + 1. Let _decls2_ be the VarScopedDeclarations of |CaseClause|. + 1. Return the list-concatenation of _decls1_ and _decls2_. CaseClause : `case` Expression `:` StatementList? @@ -8116,22 +8654,22 @@

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

        TryStatement : `try` Block Catch - 1. Let _declarations1_ be the VarScopedDeclarations of |Block|. - 1. Let _declarations2_ be the VarScopedDeclarations of |Catch|. - 1. Return the list-concatenation of _declarations1_ and _declarations2_. + 1. Let _decls1_ be the VarScopedDeclarations of |Block|. + 1. Let _decls2_ be the VarScopedDeclarations of |Catch|. + 1. Return the list-concatenation of _decls1_ and _decls2_. TryStatement : `try` Block Finally - 1. Let _declarations1_ be the VarScopedDeclarations of |Block|. - 1. Let _declarations2_ be the VarScopedDeclarations of |Finally|. - 1. Return the list-concatenation of _declarations1_ and _declarations2_. + 1. Let _decls1_ be the VarScopedDeclarations of |Block|. + 1. Let _decls2_ be the VarScopedDeclarations of |Finally|. + 1. Return the list-concatenation of _decls1_ and _decls2_. TryStatement : `try` Block Catch Finally - 1. Let _declarations1_ be the VarScopedDeclarations of |Block|. - 1. Let _declarations2_ be the VarScopedDeclarations of |Catch|. - 1. Let _declarations3_ be the VarScopedDeclarations of |Finally|. - 1. Return the list-concatenation of _declarations1_, _declarations2_, and _declarations3_. + 1. Let _decls1_ be the VarScopedDeclarations of |Block|. + 1. Let _decls2_ be the VarScopedDeclarations of |Catch|. + 1. Let _decls3_ be the VarScopedDeclarations of |Finally|. + 1. Return the list-concatenation of _decls1_, _decls2_, and _decls3_. Catch : `catch` `(` CatchParameter `)` Block @@ -8177,9 +8715,9 @@

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

        ModuleItemList : ModuleItemList ModuleItem - 1. Let _declarations1_ be the VarScopedDeclarations of |ModuleItemList|. - 1. Let _declarations2_ be the VarScopedDeclarations of |ModuleItem|. - 1. Return the list-concatenation of _declarations1_ and _declarations2_. + 1. Let _decls1_ be the VarScopedDeclarations of |ModuleItemList|. + 1. Let _decls2_ be the VarScopedDeclarations of |ModuleItem|. + 1. Return the list-concatenation of _decls1_ and _decls2_. ModuleItem : ImportDeclaration @@ -8223,9 +8761,9 @@

        Static Semantics: TopLevelLexicallyScopedDeclarations ( ): a List of Parse N

        StatementList : StatementList StatementListItem - 1. Let _declarations1_ be the TopLevelLexicallyScopedDeclarations of |StatementList|. - 1. Let _declarations2_ be the TopLevelLexicallyScopedDeclarations of |StatementListItem|. - 1. Return the list-concatenation of _declarations1_ and _declarations2_. + 1. Let _decls1_ be the TopLevelLexicallyScopedDeclarations of |StatementList|. + 1. Let _decls2_ be the TopLevelLexicallyScopedDeclarations of |StatementListItem|. + 1. Return the list-concatenation of _decls1_ and _decls2_. StatementListItem : Statement @@ -8284,9 +8822,9 @@

        Static Semantics: TopLevelVarScopedDeclarations ( ): a List of Parse Nodes StatementList : StatementList StatementListItem - 1. Let _declarations1_ be the TopLevelVarScopedDeclarations of |StatementList|. - 1. Let _declarations2_ be the TopLevelVarScopedDeclarations of |StatementListItem|. - 1. Return the list-concatenation of _declarations1_ and _declarations2_. + 1. Let _decls1_ be the TopLevelVarScopedDeclarations of |StatementList|. + 1. Let _decls2_ be the TopLevelVarScopedDeclarations of |StatementListItem|. + 1. Return the list-concatenation of _decls1_ and _decls2_. StatementListItem : Statement @@ -8296,8 +8834,8 @@

        Static Semantics: TopLevelVarScopedDeclarations ( ): a List of Parse NodesStatementListItem : Declaration 1. If |Declaration| is Declaration : HoistableDeclaration, then - 1. Let _declaration_ be the DeclarationPart of |HoistableDeclaration|. - 1. Return « _declaration_ ». + 1. Let _decl_ be the DeclarationPart of |HoistableDeclaration|. + 1. Return « _decl_ ». 1. Return a new empty List. LabelledStatement : LabelIdentifier `:` LabelledItem @@ -8575,8 +9113,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 +9302,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 @@ -8969,7 +9507,7 @@

        Static Semantics: IsFunctionDefinition ( ): a Boolean

        `-` UnaryExpression `~` UnaryExpression `!` UnaryExpression - AwaitExpression + CoverAwaitExpressionAndAwaitUsingDeclarationHead ExponentiationExpression : UpdateExpression `**` ExponentiationExpression @@ -9175,9 +9713,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 +9778,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_. @@ -9394,7 +9932,7 @@

        Miscellaneous

        Runtime Semantics: InstantiateFunctionObject ( - _env_: an Environment Record, + _envRecord_: an Environment Record, _privateEnv_: a PrivateEnvironment Record or *null*, ): an ECMAScript function object

        @@ -9406,7 +9944,7 @@

        `function` `(` FormalParameters `)` `{` FunctionBody `}` - 1. Return InstantiateOrdinaryFunctionObject of |FunctionDeclaration| with arguments _env_ and _privateEnv_. + 1. Return InstantiateOrdinaryFunctionObject of |FunctionDeclaration| with arguments _envRecord_ and _privateEnv_. GeneratorDeclaration : @@ -9414,7 +9952,7 @@

        `function` `*` `(` FormalParameters `)` `{` GeneratorBody `}` - 1. Return InstantiateGeneratorFunctionObject of |GeneratorDeclaration| with arguments _env_ and _privateEnv_. + 1. Return InstantiateGeneratorFunctionObject of |GeneratorDeclaration| with arguments _envRecord_ and _privateEnv_. AsyncGeneratorDeclaration : @@ -9422,7 +9960,7 @@

        `async` `function` `*` `(` FormalParameters `)` `{` AsyncGeneratorBody `}` - 1. Return InstantiateAsyncGeneratorFunctionObject of |AsyncGeneratorDeclaration| with arguments _env_ and _privateEnv_. + 1. Return InstantiateAsyncGeneratorFunctionObject of |AsyncGeneratorDeclaration| with arguments _envRecord_ and _privateEnv_. AsyncFunctionDeclaration : @@ -9430,7 +9968,7 @@

        `async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` - 1. Return InstantiateAsyncFunctionObject of |AsyncFunctionDeclaration| with arguments _env_ and _privateEnv_. + 1. Return InstantiateAsyncFunctionObject of |AsyncFunctionDeclaration| with arguments _envRecord_ and _privateEnv_. @@ -9438,36 +9976,36 @@

        Runtime Semantics: BindingInitialization ( _value_: an ECMAScript language value, - _environment_: an Environment Record or *undefined*, + _envRecord_: an Environment Record or *undefined*, ): either a normal completion containing ~unused~ or an abrupt completion

        -

        *undefined* is passed for _environment_ to indicate that a PutValue operation should be used to assign the initialization value. This is the case for `var` statements and formal parameter lists of some non-strict functions (See ). In those cases a lexical binding is hoisted and preinitialized prior to evaluation of its initializer.

        +

        *undefined* is passed for _envRecord_ to indicate that a PutValue operation should be used to assign the initialization value. This is the case for `var` statements and formal parameter lists of some non-strict functions (See ). In those cases a lexical binding is hoisted and preinitialized prior to evaluation of its initializer.

        BindingIdentifier : Identifier 1. Let _name_ be the StringValue of |Identifier|. - 1. Return ? InitializeBoundName(_name_, _value_, _environment_). + 1. Return ? InitializeBoundName(_name_, _value_, _envRecord_). BindingIdentifier : `yield` - 1. Return ? InitializeBoundName(*"yield"*, _value_, _environment_). + 1. Return ? InitializeBoundName(*"yield"*, _value_, _envRecord_). BindingIdentifier : `await` - 1. Return ? InitializeBoundName(*"await"*, _value_, _environment_). + 1. Return ? InitializeBoundName(*"await"*, _value_, _envRecord_). BindingPattern : ObjectBindingPattern 1. Perform ? RequireObjectCoercible(_value_). - 1. Return ? BindingInitialization of |ObjectBindingPattern| with arguments _value_ and _environment_. + 1. Return ? BindingInitialization of |ObjectBindingPattern| with arguments _value_ and _envRecord_. BindingPattern : ArrayBindingPattern 1. Let _iteratorRecord_ be ? GetIterator(_value_, ~sync~). - 1. Let _result_ be Completion(IteratorBindingInitialization of |ArrayBindingPattern| with arguments _iteratorRecord_ and _environment_). + 1. Let _result_ be Completion(IteratorBindingInitialization of |ArrayBindingPattern| with arguments _iteratorRecord_ and _envRecord_). 1. If _iteratorRecord_.[[Done]] is *false*, return ? IteratorClose(_iteratorRecord_, _result_). 1. Return ? _result_. @@ -9481,18 +10019,18 @@

        `{` BindingPropertyList `,` `}` - 1. Perform ? PropertyBindingInitialization of |BindingPropertyList| with arguments _value_ and _environment_. + 1. Perform ? PropertyBindingInitialization of |BindingPropertyList| with arguments _value_ and _envRecord_. 1. Return ~unused~. ObjectBindingPattern : `{` BindingRestProperty `}` 1. Let _excludedNames_ be a new empty List. - 1. Return ? RestBindingInitialization of |BindingRestProperty| with arguments _value_, _environment_, and _excludedNames_. + 1. Return ? RestBindingInitialization of |BindingRestProperty| with arguments _value_, _envRecord_, and _excludedNames_. ObjectBindingPattern : `{` BindingPropertyList `,` BindingRestProperty `}` - 1. Let _excludedNames_ be ? PropertyBindingInitialization of |BindingPropertyList| with arguments _value_ and _environment_. - 1. Return ? RestBindingInitialization of |BindingRestProperty| with arguments _value_, _environment_, and _excludedNames_. + 1. Let _excludedNames_ be ? PropertyBindingInitialization of |BindingPropertyList| with arguments _value_ and _envRecord_. + 1. Return ? RestBindingInitialization of |BindingRestProperty| with arguments _value_, _envRecord_, and _excludedNames_. @@ -9500,18 +10038,17 @@

        InitializeBoundName ( _name_: a String, _value_: an ECMAScript language value, - _environment_: an Environment Record or *undefined*, + _envRecord_: an Environment Record or *undefined*, ): either a normal completion containing ~unused~ or an abrupt completion

        - 1. If _environment_ is not *undefined*, then - 1. Perform ! _environment_.InitializeBinding(_name_, _value_). + 1. If _envRecord_ is not *undefined*, then + 1. Perform ! _envRecord_.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_).
        @@ -9520,13 +10057,13 @@

        Runtime Semantics: IteratorBindingInitialization ( _iteratorRecord_: an Iterator Record, - _environment_: an Environment Record or *undefined*, + _envRecord_: an Environment Record or *undefined*, ): either a normal completion containing ~unused~ or an abrupt completion

        -

        When *undefined* is passed for _environment_ it indicates that a PutValue operation should be used to assign the initialization value. This is the case for formal parameter lists of non-strict functions. In that case the formal parameter bindings are preinitialized in order to deal with the possibility of multiple parameters with the same name.

        +

        When *undefined* is passed for _envRecord_ it indicates that a PutValue operation should be used to assign the initialization value. This is the case for formal parameter lists of non-strict functions. In that case the formal parameter bindings are preinitialized in order to deal with the possibility of multiple parameters with the same name.

        ArrayBindingPattern : `[` `]` @@ -9540,34 +10077,34 @@

        1. If |Elision| is present, then 1. Perform ? IteratorDestructuringAssignmentEvaluation of |Elision| with argument _iteratorRecord_. - 1. Return ? IteratorBindingInitialization of |BindingRestElement| with arguments _iteratorRecord_ and _environment_. + 1. Return ? IteratorBindingInitialization of |BindingRestElement| with arguments _iteratorRecord_ and _envRecord_. ArrayBindingPattern : `[` BindingElementList `,` Elision `]` - 1. Perform ? IteratorBindingInitialization of |BindingElementList| with arguments _iteratorRecord_ and _environment_. + 1. Perform ? IteratorBindingInitialization of |BindingElementList| with arguments _iteratorRecord_ and _envRecord_. 1. Return ? IteratorDestructuringAssignmentEvaluation of |Elision| with argument _iteratorRecord_. ArrayBindingPattern : `[` BindingElementList `,` Elision? BindingRestElement `]` - 1. Perform ? IteratorBindingInitialization of |BindingElementList| with arguments _iteratorRecord_ and _environment_. + 1. Perform ? IteratorBindingInitialization of |BindingElementList| with arguments _iteratorRecord_ and _envRecord_. 1. If |Elision| is present, then 1. Perform ? IteratorDestructuringAssignmentEvaluation of |Elision| with argument _iteratorRecord_. - 1. Return ? IteratorBindingInitialization of |BindingRestElement| with arguments _iteratorRecord_ and _environment_. + 1. Return ? IteratorBindingInitialization of |BindingRestElement| with arguments _iteratorRecord_ and _envRecord_. BindingElementList : BindingElementList `,` BindingElisionElement - 1. Perform ? IteratorBindingInitialization of |BindingElementList| with arguments _iteratorRecord_ and _environment_. - 1. Return ? IteratorBindingInitialization of |BindingElisionElement| with arguments _iteratorRecord_ and _environment_. + 1. Perform ? IteratorBindingInitialization of |BindingElementList| with arguments _iteratorRecord_ and _envRecord_. + 1. Return ? IteratorBindingInitialization of |BindingElisionElement| with arguments _iteratorRecord_ and _envRecord_. BindingElisionElement : Elision BindingElement 1. Perform ? IteratorDestructuringAssignmentEvaluation of |Elision| with argument _iteratorRecord_. - 1. Return ? IteratorBindingInitialization of |BindingElement| with arguments _iteratorRecord_ and _environment_. + 1. Return ? IteratorBindingInitialization of |BindingElement| with arguments _iteratorRecord_ and _envRecord_. SingleNameBinding : BindingIdentifier Initializer? 1. Let _bindingId_ be the StringValue of |BindingIdentifier|. - 1. Let _lhs_ be ? ResolveBinding(_bindingId_, _environment_). + 1. Let _lhs_ be ? ResolveBinding(_bindingId_, _envRecord_). 1. Let _v_ be *undefined*. 1. If _iteratorRecord_.[[Done]] is *false*, then 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_). @@ -9579,7 +10116,7 @@

        1. Else, 1. Let _defaultValue_ be ? Evaluation of |Initializer|. 1. Set _v_ to ? GetValue(_defaultValue_). - 1. If _environment_ is *undefined*, return ? PutValue(_lhs_, _v_). + 1. If _envRecord_ is *undefined*, return ? PutValue(_lhs_, _v_). 1. Return ? InitializeReferencedBinding(_lhs_, _v_). BindingElement : BindingPattern Initializer? @@ -9592,34 +10129,34 @@

        1. If |Initializer| is present and _v_ is *undefined*, then 1. Let _defaultValue_ be ? Evaluation of |Initializer|. 1. Set _v_ to ? GetValue(_defaultValue_). - 1. Return ? BindingInitialization of |BindingPattern| with arguments _v_ and _environment_. + 1. Return ? BindingInitialization of |BindingPattern| with arguments _v_ and _envRecord_. BindingRestElement : `...` BindingIdentifier - 1. Let _lhs_ be ? ResolveBinding(StringValue of |BindingIdentifier|, _environment_). - 1. Let _A_ be ! ArrayCreate(0). + 1. Let _lhs_ be ? ResolveBinding(StringValue of |BindingIdentifier|, _envRecord_). + 1. Let _array_ be ! ArrayCreate(0). 1. Let _n_ be 0. 1. Repeat, 1. Let _next_ be ~done~. 1. If _iteratorRecord_.[[Done]] is *false*, then 1. Set _next_ to ? IteratorStepValue(_iteratorRecord_). 1. If _next_ is ~done~, then - 1. If _environment_ is *undefined*, return ? PutValue(_lhs_, _A_). - 1. Return ? InitializeReferencedBinding(_lhs_, _A_). - 1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_n_)), _next_). + 1. If _envRecord_ is *undefined*, return ? PutValue(_lhs_, _array_). + 1. Return ? InitializeReferencedBinding(_lhs_, _array_). + 1. Perform ! CreateDataPropertyOrThrow(_array_, ! ToString(𝔽(_n_)), _next_). 1. Set _n_ to _n_ + 1. BindingRestElement : `...` BindingPattern - 1. Let _A_ be ! ArrayCreate(0). + 1. Let _array_ be ! ArrayCreate(0). 1. Let _n_ be 0. 1. Repeat, 1. Let _next_ be ~done~. 1. If _iteratorRecord_.[[Done]] is *false*, then 1. Set _next_ to ? IteratorStepValue(_iteratorRecord_). 1. If _next_ is ~done~, then - 1. Return ? BindingInitialization of |BindingPattern| with arguments _A_ and _environment_. - 1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_n_)), _next_). + 1. Return ? BindingInitialization of |BindingPattern| with arguments _array_ and _envRecord_. + 1. Perform ! CreateDataPropertyOrThrow(_array_, ! ToString(𝔽(_n_)), _next_). 1. Set _n_ to _n_ + 1. FormalParameters : [empty] @@ -9628,13 +10165,13 @@

        FormalParameters : FormalParameterList `,` FunctionRestParameter - 1. Perform ? IteratorBindingInitialization of |FormalParameterList| with arguments _iteratorRecord_ and _environment_. - 1. Return ? IteratorBindingInitialization of |FunctionRestParameter| with arguments _iteratorRecord_ and _environment_. + 1. Perform ? IteratorBindingInitialization of |FormalParameterList| with arguments _iteratorRecord_ and _envRecord_. + 1. Return ? IteratorBindingInitialization of |FunctionRestParameter| with arguments _iteratorRecord_ and _envRecord_. FormalParameterList : FormalParameterList `,` FormalParameter - 1. Perform ? IteratorBindingInitialization of |FormalParameterList| with arguments _iteratorRecord_ and _environment_. - 1. Return ? IteratorBindingInitialization of |FormalParameter| with arguments _iteratorRecord_ and _environment_. + 1. Perform ? IteratorBindingInitialization of |FormalParameterList| with arguments _iteratorRecord_ and _envRecord_. + 1. Return ? IteratorBindingInitialization of |FormalParameter| with arguments _iteratorRecord_ and _envRecord_. ArrowParameters : BindingIdentifier @@ -9643,12 +10180,12 @@

        1. Let _next_ be ? IteratorStepValue(_iteratorRecord_). 1. If _next_ is not ~done~, then 1. Set _v_ to _next_. - 1. Return ? BindingInitialization of |BindingIdentifier| with arguments _v_ and _environment_. + 1. Return ? BindingInitialization of |BindingIdentifier| with arguments _v_ and _envRecord_. ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList 1. Let _formals_ be the |ArrowFormalParameters| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|. - 1. Return ? IteratorBindingInitialization of _formals_ with arguments _iteratorRecord_ and _environment_. + 1. Return ? IteratorBindingInitialization of _formals_ with arguments _iteratorRecord_ and _envRecord_. AsyncArrowBindingIdentifier : BindingIdentifier @@ -9659,12 +10196,12 @@

        1. Let _next_ be ? IteratorStepValue(_iteratorRecord_). 1. If _next_ is not ~done~, then 1. Set _v_ to _next_. - 1. Return ? BindingInitialization of |BindingIdentifier| with arguments _v_ and _environment_. + 1. Return ? BindingInitialization of |BindingIdentifier| with arguments _v_ and _envRecord_. -

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

        +

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

        IdentifierReference : Identifier @@ -9699,6 +10236,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 +10261,8 @@

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

        TemplateLiteral CallExpression : - CoverCallExpressionAndAsyncArrowHead SuperCall ImportCall - CallExpression Arguments CallExpression TemplateLiteral NewExpression : @@ -9750,7 +10295,7 @@

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

        `-` UnaryExpression `~` UnaryExpression `!` UnaryExpression - AwaitExpression + CoverAwaitExpressionAndAwaitUsingDeclarationHead ExponentiationExpression : UpdateExpression `**` ExponentiationExpression @@ -9837,18 +10382,26 @@

        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|. LiteralPropertyName : NumericLiteral - 1. Let _nbr_ be the NumericValue of |NumericLiteral|. - 1. Return ! ToString(_nbr_). + 1. Let _number_ be the NumericValue of |NumericLiteral|. + 1. Return ! ToString(_number_). ComputedPropertyName : `[` AssignmentExpression `]` @@ -9898,6 +10451,28 @@

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

        1. Return ~empty~.
        + + +

        Static Semantics: ContainsUsing ( ): a Boolean

        +
        +
        + StatementList : StatementList StatementListItem + + 1. If ContainsUsing of the derived |StatementList| is *true*, return *true*. + 1. If ContainsUsing of |StatementListItem| is *true*, return *true*. + 1. Return *false*. + + StatementListItem : Statement + + 1. Return *false*. + + StatementListItem : Declaration + + 1. If IsUsingDeclaration of |Declaration| is *true*, return *true*. + 1. If IsAwaitUsingDeclaration of |Declaration| is *true*, return *true*. + 1. Return *false*. + +
        @@ -9907,7 +10482,7 @@

        Executable Code and Execution Contexts

        Environment Records

        Environment Record is a specification type used to define the association of |Identifier|s to specific variables and functions, based upon the lexical nesting structure of ECMAScript code. Usually an Environment Record is associated with some specific syntactic structure of ECMAScript code such as a |FunctionDeclaration|, a |BlockStatement|, or a |Catch| clause of a |TryStatement|. Each time such code is evaluated, a new Environment Record is created to record the identifier bindings that are created by that code.

        -

        Every Environment Record has an [[OuterEnv]] field, which is either *null* or a reference to an outer Environment Record. This is used to model the logical nesting of Environment Record values. The outer reference of an (inner) Environment Record is a reference to the Environment Record that logically surrounds the inner Environment Record. An outer Environment Record may, of course, have its own outer Environment Record. An Environment Record may serve as the outer environment for multiple inner Environment Records. For example, if a |FunctionDeclaration| contains two nested |FunctionDeclaration|s then the Environment Records of each of the nested functions will have as their outer Environment Record the Environment Record of the current evaluation of the surrounding function.

        +

        Every Environment Record has an [[OuterEnv]] field, which is either *null* or a reference to an outer Environment Record. This is used to model the logical nesting of Environment Records. The outer reference of an (inner) Environment Record is a reference to the Environment Record that logically surrounds the inner Environment Record. An outer Environment Record may, of course, have its own outer Environment Record. An Environment Record may serve as the outer environment for multiple inner Environment Records. For example, if a |FunctionDeclaration| contains two nested |FunctionDeclaration|s then the Environment Records of each of the nested functions will have as their outer Environment Record the Environment Record of the current evaluation of the surrounding function.

        Environment Records are purely specification mechanisms and need not correspond to any specific artefact of an ECMAScript implementation. It is impossible for an ECMAScript program to directly access or manipulate such values.

        @@ -9939,94 +10514,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.

        - + - - - + + + + + + + + + + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + +
        - Method - - Purpose -
        + Method + + Purpose + + Definitions +
        + HasBinding ( + _name_: a String, + ): either a normal completion containing a Boolean or a throw completion + + It determines if an Environment Record has a binding for _name_. + + It has concrete definitions in the following types: + +
        + CreateMutableBinding ( + _name_: a String, + _deletable_: 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. _name_ is the text of the bound name. If _deletable_ 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: +
        - CreateMutableBinding(N, D) + CreateImmutableBinding ( + _name_: a String, + _strict_: a Boolean, + ): either a normal completion containing ~unused~ or a throw completion - 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 creates a new but uninitialized immutable binding in an Environment Record. _name_ is the text of the bound name. If _strict_ 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: +
        - CreateImmutableBinding(N, S) + InitializeBinding ( + _name_: a String, + _value_: an ECMAScript language value, + ): either a normal completion containing ~unused~ or a throw completion - 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 sets the value of an already existing but uninitialized binding in an Environment Record. _name_ is the text of the bound name. _value_ is the value for the binding. + + It has concrete definitions in the following types: +
        + SetMutableBinding ( + _name_: a String, + _value_: an ECMAScript language value, + _strict_: a Boolean, + ): either a normal completion containing ~unused~ or a throw completion + - InitializeBinding(N, V) + It sets the value of an already existing mutable binding in an Environment Record. _name_ is the text of the bound name. _value_ is the value for the binding. If _strict_ is *true* and the binding cannot be set, this will throw a *TypeError* exception. - 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 has concrete definitions in the following types: +
        + GetBindingValue ( + _name_: a String, + _strict_: a Boolean, + ): either a normal completion containing an ECMAScript language value or a throw completion + - SetMutableBinding(N, V, S) + It returns the value of an already existing binding from an Environment Record. _name_ is the text of the bound name. _strict_ is used to identify references originating in strict mode code or that otherwise require strict mode reference semantics. If _strict_ 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 _strict_. - 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 has concrete definitions in the following types: +
        - GetBindingValue(N, S) + DeleteBinding ( + _name_: a String, + ): either a normal completion containing a Boolean or a throw completion - 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 deletes a binding from an Environment Record. _name_ is the text of the bound name. If a binding for _name_ 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*. + + 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,23 +10679,23 @@

        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.

        +

        Every Declarative Environment Record also has a [[DisposableResourceStack]] field, which contains a List of DisposableResource Records. The elements of this list are tracked by the `using` declarations and `await using` declarations that must be disposed when the Evaluation step that constructed the Environment Record has completed.

        HasBinding ( - _N_: a String, + _name_: a String, ): a normal completion containing a Boolean

        for
        -
        a Declarative Environment Record _envRec_
        +
        a Declarative Environment Record _envRecord_
        description
        It determines if the argument identifier is one of the identifiers bound by the record.
        - 1. If _envRec_ has a binding for _N_, return *true*. + 1. If _envRecord_ has a binding for _name_, return *true*. 1. Return *false*.
        @@ -10059,20 +10703,20 @@

        CreateMutableBinding ( - _N_: a String, - _D_: a Boolean, + _name_: a String, + _deletable_: a Boolean, ): a normal completion containing ~unused~

        for
        -
        a Declarative Environment Record _envRec_
        +
        a Declarative Environment Record _envRecord_
        description
        -
        It creates a new mutable binding for the name _N_ that is uninitialized. A binding must not already exist in this Environment Record for _N_. If _D_ is *true*, the new binding is marked as being subject to deletion.
        +
        It creates a new mutable binding for the name _name_ that is uninitialized. A binding must not already exist in this Environment Record for _name_. If _deletable_ is *true*, the new binding is marked as being subject to deletion.
        - 1. Assert: _envRec_ does not already have a binding for _N_. - 1. Create a mutable binding in _envRec_ for _N_ and record that it is uninitialized. If _D_ is *true*, record that the newly created binding may be deleted by a subsequent DeleteBinding call. + 1. Assert: _envRecord_ does not already have a binding for _name_. + 1. Create a mutable binding in _envRecord_ for _name_ and record that it is uninitialized. If _deletable_ is *true*, record that the newly created binding may be deleted by a subsequent DeleteBinding call. 1. Return ~unused~.
        @@ -10080,20 +10724,20 @@

        CreateImmutableBinding ( - _N_: a String, - _S_: a Boolean, + _name_: a String, + _strict_: a Boolean, ): a normal completion containing ~unused~

        for
        -
        a Declarative Environment Record _envRec_
        +
        a Declarative Environment Record _envRecord_
        description
        -
        It creates a new immutable binding for the name _N_ that is uninitialized. A binding must not already exist in this Environment Record for _N_. If _S_ is *true*, the new binding is marked as a strict binding.
        +
        It creates a new immutable binding for the name _name_ that is uninitialized. A binding must not already exist in this Environment Record for _name_. If _strict_ is *true*, the new binding is marked as a strict binding.
        - 1. Assert: _envRec_ does not already have a binding for _N_. - 1. Create an immutable binding in _envRec_ for _N_ and record that it is uninitialized. If _S_ is *true*, record that the newly created binding is a strict binding. + 1. Assert: _envRecord_ does not already have a binding for _name_. + 1. Create an immutable binding in _envRecord_ for _name_ and record that it is uninitialized. If _strict_ is *true*, record that the newly created binding is a strict binding. 1. Return ~unused~.
        @@ -10101,21 +10745,21 @@

        InitializeBinding ( - _N_: a String, - _V_: an ECMAScript language value, + _name_: a String, + _value_: an ECMAScript language value, ): a normal completion containing ~unused~

        for
        -
        a Declarative Environment Record _envRec_
        +
        a Declarative Environment Record _envRecord_
        description
        -
        It is used to set the bound value of the current binding of the identifier whose name is _N_ to the value _V_. An uninitialized binding for _N_ must already exist.
        +
        It is used to set the bound value of the current binding of the identifier whose name is _name_ to the value _value_. An uninitialized binding for _name_ must already exist.
        - 1. Assert: _envRec_ must have an uninitialized binding for _N_. - 1. Set the bound value for _N_ in _envRec_ to _V_. - 1. Record that the binding for _N_ in _envRec_ has been initialized. + 1. Assert: _envRecord_ must have an uninitialized binding for _name_. + 1. Set the bound value for _name_ in _envRecord_ to _value_. + 1. Record that the binding for _name_ in _envRecord_ has been initialized. 1. Return ~unused~.
        @@ -10123,32 +10767,32 @@

        SetMutableBinding ( - _N_: a String, - _V_: an ECMAScript language value, - _S_: a Boolean, + _name_: a String, + _value_: an ECMAScript language value, + _strict_: a Boolean, ): either a normal completion containing ~unused~ or a throw completion

        for
        -
        a Declarative Environment Record _envRec_
        +
        a Declarative Environment Record _envRecord_
        description
        -
        It attempts to change the bound value of the current binding of the identifier whose name is _N_ to the value _V_. A binding for _N_ normally already exists, but in rare cases it may not. If the binding is an immutable binding, a *TypeError* is thrown if _S_ is *true*.
        +
        It attempts to change the bound value of the current binding of the identifier whose name is _name_ to the value _value_. A binding for _name_ normally already exists, but in rare cases it may not. If the binding is an immutable binding, a *TypeError* is thrown if _strict_ is *true*.
        - 1. [id="step-setmutablebinding-missing-binding"] If _envRec_ does not have a binding for _N_, then - 1. If _S_ is *true*, throw a *ReferenceError* exception. - 1. Perform ! _envRec_.CreateMutableBinding(_N_, *true*). - 1. Perform ! _envRec_.InitializeBinding(_N_, _V_). + 1. [id="step-setmutablebinding-missing-binding"] If _envRecord_ does not have a binding for _name_, then + 1. If _strict_ is *true*, throw a *ReferenceError* exception. + 1. Perform ! _envRecord_.CreateMutableBinding(_name_, *true*). + 1. Perform ! _envRecord_.InitializeBinding(_name_, _value_). 1. Return ~unused~. - 1. If the binding for _N_ in _envRec_ is a strict binding, set _S_ to *true*. - 1. If the binding for _N_ in _envRec_ has not yet been initialized, then + 1. If the binding for _name_ in _envRecord_ is a strict binding, set _strict_ to *true*. + 1. If the binding for _name_ in _envRecord_ has not yet been initialized, then 1. Throw a *ReferenceError* exception. - 1. Else if the binding for _N_ in _envRec_ is a mutable binding, then - 1. Change its bound value to _V_. + 1. Else if the binding for _name_ in _envRecord_ is a mutable binding, then + 1. Change its bound value to _value_. 1. Else, 1. Assert: This is an attempt to change the value of an immutable binding. - 1. If _S_ is *true*, throw a *TypeError* exception. + 1. If _strict_ is *true*, throw a *TypeError* exception. 1. Return ~unused~. @@ -10160,41 +10804,41 @@

        GetBindingValue ( - _N_: a String, - _S_: a Boolean, + _name_: a String, + _strict_: a Boolean, ): either a normal completion containing an ECMAScript language value or a throw completion

        for
        -
        a Declarative Environment Record _envRec_
        +
        a Declarative Environment Record _envRecord_
        description
        -
        It returns the value of its bound identifier whose name is _N_. If the binding exists but is uninitialized a *ReferenceError* is thrown, regardless of the value of _S_.
        +
        It returns the value of its bound identifier whose name is _name_. If the binding exists but is uninitialized a *ReferenceError* is thrown, regardless of the value of _strict_.
        - 1. Assert: _envRec_ has a binding for _N_. - 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_. + 1. Assert: _envRecord_ has a binding for _name_. + 1. If the binding for _name_ in _envRecord_ is an uninitialized binding, throw a *ReferenceError* exception. + 1. Return the value currently bound to _name_ in _envRecord_.

        DeleteBinding ( - _N_: a String, + _name_: a String, ): a normal completion containing a Boolean

        for
        -
        a Declarative Environment Record _envRec_
        +
        a Declarative Environment Record _envRecord_
        description
        It can only delete bindings that have been explicitly designated as being subject to deletion.
        - 1. Assert: _envRec_ has a binding for _N_. - 1. If the binding for _N_ in _envRec_ cannot be deleted, return *false*. - 1. Remove the binding for _N_ from _envRec_. + 1. Assert: _envRecord_ has a binding for _name_. + 1. If the binding for _name_ in _envRecord_ cannot be deleted, return *false*. + 1. Remove the binding for _name_ from _envRecord_. 1. Return *true*.
        @@ -10203,7 +10847,7 @@

        HasThisBinding ( ): *false*

        for
        -
        a Declarative Environment Record _envRec_
        +
        a Declarative Environment Record _envRecord_
        1. Return *false*. @@ -10213,11 +10857,16 @@

        HasThisBinding ( ): *false*

        + +

        GetThisBinding ( )

        +

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

        +
        +

        HasSuperBinding ( ): *false*

        for
        -
        a Declarative Environment Record _envRec_
        +
        a Declarative Environment Record _envRecord_
        1. Return *false*. @@ -10231,7 +10880,7 @@

        HasSuperBinding ( ): *false*

        WithBaseObject ( ): *undefined*

        for
        -
        a Declarative Environment Record _envRec_
        +
        a Declarative Environment Record _envRecord_
        1. Return *undefined*. @@ -10246,17 +10895,19 @@

        Object Environment Records

        Object Environment Records have the additional state fields listed in .

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[BindingObject]] @@ -10281,29 +10932,28 @@

        Object Environment Records

        -

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

        HasBinding ( - _N_: a String, + _name_: a String, ): either a normal completion containing a Boolean or a throw completion

        for
        -
        an Object Environment Record _envRec_
        +
        an Object Environment Record _envRecord_
        description
        -
        It determines if its associated binding object has a property whose name is _N_.
        +
        It determines if its associated binding object has a property whose name is _name_.
        - 1. Let _bindingObject_ be _envRec_.[[BindingObject]]. - 1. Let _foundBinding_ be ? HasProperty(_bindingObject_, _N_). + 1. Let _bindingObj_ be _envRecord_.[[BindingObject]]. + 1. Let _foundBinding_ be ? HasProperty(_bindingObj_, _name_). 1. If _foundBinding_ is *false*, return *false*. - 1. If _envRec_.[[IsWithEnvironment]] is *false*, return *true*. - 1. Let _unscopables_ be ? Get(_bindingObject_, @@unscopables). + 1. If _envRecord_.[[IsWithEnvironment]] is *false*, return *true*. + 1. Let _unscopables_ be ? Get(_bindingObj_, %Symbol.unscopables%). 1. If _unscopables_ is an Object, then - 1. Let _blocked_ be ToBoolean(? Get(_unscopables_, _N_)). + 1. Let _blocked_ be ToBoolean(? Get(_unscopables_, _name_)). 1. If _blocked_ is *true*, return *false*. 1. Return *true*. @@ -10312,48 +10962,48 @@

        CreateMutableBinding ( - _N_: a String, - _D_: a Boolean, + _name_: a String, + _deletable_: a Boolean, ): either a normal completion containing ~unused~ or a throw completion

        for
        -
        an Object Environment Record _envRec_
        +
        an Object Environment Record _envRecord_
        description
        -
        It creates in an Environment Record's associated binding object a property whose name is _N_ and initializes it to the value *undefined*. If _D_ is *true*, the new property's [[Configurable]] attribute is set to *true*; otherwise it is set to *false*.
        +
        It creates in an Environment Record's associated binding object a property whose name is _name_ and initializes it to the value *undefined*. If _deletable_ is *true*, the new property's [[Configurable]] attribute is set to *true*; otherwise it is set to *false*.
        - 1. Let _bindingObject_ be _envRec_.[[BindingObject]]. - 1. Perform ? DefinePropertyOrThrow(_bindingObject_, _N_, PropertyDescriptor { [[Value]]: *undefined*, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: _D_ }). + 1. Let _bindingObj_ be _envRecord_.[[BindingObject]]. + 1. Perform ? DefinePropertyOrThrow(_bindingObj_, _name_, PropertyDescriptor { [[Value]]: *undefined*, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: _deletable_ }). 1. Return ~unused~. -

        Normally _envRec_ will not have a binding for _N_ but if it does, the semantics of DefinePropertyOrThrow may result in an existing binding being replaced or shadowed or cause an abrupt completion to be returned.

        +

        Normally _envRecord_ will not have a binding for _name_ but if it does, the semantics of DefinePropertyOrThrow may result in an existing binding being replaced or shadowed or cause an abrupt completion to be returned.

        -

        CreateImmutableBinding ( _N_, _S_ )

        +

        CreateImmutableBinding ( _name_, _strict_ )

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

        InitializeBinding ( - _N_: a String, - _V_: an ECMAScript language value, + _name_: a String, + _value_: an ECMAScript language value, ): either a normal completion containing ~unused~ or a throw completion

        for
        -
        an Object Environment Record _envRec_
        +
        an Object Environment Record _envRecord_
        description
        -
        It is used to set the bound value of the current binding of the identifier whose name is _N_ to the value _V_.
        +
        It is used to set the bound value of the current binding of the identifier whose name is _name_ to the value _value_.
        - 1. Perform ? _envRec_.SetMutableBinding(_N_, _V_, *false*). + 1. Perform ? _envRecord_.SetMutableBinding(_name_, _value_, *false*). 1. Return ~unused~. @@ -10364,23 +11014,23 @@

        SetMutableBinding ( - _N_: a String, - _V_: an ECMAScript language value, - _S_: a Boolean, + _name_: a String, + _value_: an ECMAScript language value, + _strict_: a Boolean, ): either a normal completion containing ~unused~ or a throw completion

        for
        -
        an Object Environment Record _envRec_
        +
        an Object Environment Record _envRecord_
        description
        -
        It attempts to set the value of the Environment Record's associated binding object's property whose name is _N_ to the value _V_. A property named _N_ normally already exists but if it does not or is not currently writable, error handling is determined by _S_.
        +
        It attempts to set the value of the Environment Record's associated binding object's property whose name is _name_ to the value _value_. A property named _name_ normally already exists but if it does not or is not currently writable, error handling is determined by _strict_.
        - 1. Let _bindingObject_ be _envRec_.[[BindingObject]]. - 1. Let _stillExists_ be ? HasProperty(_bindingObject_, _N_). - 1. If _stillExists_ is *false* and _S_ is *true*, throw a *ReferenceError* exception. - 1. Perform ? Set(_bindingObject_, _N_, _V_, _S_). + 1. Let _bindingObj_ be _envRecord_.[[BindingObject]]. + 1. Let _stillExists_ be ? HasProperty(_bindingObj_, _name_). + 1. If _stillExists_ is *false* and _strict_ is *true*, throw a *ReferenceError* exception. + 1. Perform ? Set(_bindingObj_, _name_, _value_, _strict_). 1. Return ~unused~.
        @@ -10388,42 +11038,43 @@

        GetBindingValue ( - _N_: a String, - _S_: a Boolean, + _name_: a String, + _strict_: a Boolean, ): either a normal completion containing an ECMAScript language value or a throw completion

        for
        -
        an Object Environment Record _envRec_
        +
        an Object Environment Record _envRecord_
        description
        -
        It returns the value of its associated binding object's property whose name is _N_. The property should already exist but if it does not the result depends upon _S_.
        +
        It returns the value of its associated binding object's property whose name is _name_. The property should already exist but if it does not the result depends upon _strict_.
        - 1. Let _bindingObject_ be _envRec_.[[BindingObject]]. - 1. Let _value_ be ? HasProperty(_bindingObject_, _N_). + 1. Let _bindingObj_ be _envRecord_.[[BindingObject]]. + 1. Let _value_ be ? HasProperty(_bindingObj_, _name_). 1. If _value_ is *false*, then - 1. If _S_ is *false*, return *undefined*; otherwise throw a *ReferenceError* exception. - 1. Return ? Get(_bindingObject_, _N_). + 1. If _strict_ is *false*, return *undefined*. + 1. Throw a *ReferenceError* exception. + 1. Return ? Get(_bindingObj_, _name_).

        DeleteBinding ( - _N_: a String, + _name_: a String, ): either a normal completion containing a Boolean or a throw completion

        for
        -
        an Object Environment Record _envRec_
        +
        an Object Environment Record _envRecord_
        description
        It can only delete bindings that correspond to properties of the environment object whose [[Configurable]] attribute have the value *true*.
        - 1. Let _bindingObject_ be _envRec_.[[BindingObject]]. - 1. Return ? _bindingObject_.[[Delete]](_N_). + 1. Let _bindingObj_ be _envRecord_.[[BindingObject]]. + 1. Return ? _bindingObj_.[[Delete]](_name_).
        @@ -10431,7 +11082,7 @@

        HasThisBinding ( ): *false*

        for
        -
        an Object Environment Record _envRec_
        +
        an Object Environment Record _envRecord_
        1. Return *false*. @@ -10441,11 +11092,16 @@

        HasThisBinding ( ): *false*

        + +

        GetThisBinding ( )

        +

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

        +
        +

        HasSuperBinding ( ): *false*

        for
        -
        an Object Environment Record _envRec_
        +
        an Object Environment Record _envRecord_
        1. Return *false*. @@ -10459,32 +11115,34 @@

        HasSuperBinding ( ): *false*

        WithBaseObject ( ): an Object or *undefined*

        for
        -
        an Object Environment Record _envRec_
        +
        an Object Environment Record _envRecord_
        - 1. If _envRec_.[[IsWithEnvironment]] is *true*, return _envRec_.[[BindingObject]]. - 1. Otherwise, return *undefined*. + 1. If _envRecord_.[[IsWithEnvironment]] is *true*, return _envRecord_.[[BindingObject]]. + 1. Return *undefined*.

        Function Environment Records

        -

        A Function Environment Record is a Declarative Environment Record that is used to represent the top-level scope of a function and, if the function is not an |ArrowFunction|, provides a `this` binding. If a function is not an |ArrowFunction| function and references `super`, its Function Environment Record also contains the state that is used to perform `super` method invocations from within the function.

        +

        A Function Environment Record is a Declarative Environment Record that is used to represent the top-level scope of a function and, if the function is not an |ArrowFunction| function or |AsyncArrowFunction| function, provides a `this` binding. If a function is not an |ArrowFunction| function or |AsyncArrowFunction| function and references `super`, its Function Environment Record also contains the state that is used to perform `super` method invocations from within the function.

        Function Environment Records have the additional state fields listed in .

        - - - - - + + + + + + + @@ -10523,7 +11181,7 @@

        Function Environment Records

        [[NewTarget]]
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[ThisValue]] @@ -10504,7 +11162,7 @@

        Function Environment Records

        ~lexical~, ~initialized~, or ~uninitialized~
        - If the value is ~lexical~, this is an |ArrowFunction| and does not have a local *this* value. + If the value is ~lexical~, this is an |ArrowFunction| or |AsyncArrowFunction| and does not have a local *this* value.
        - 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 +11189,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 ( - _V_: an ECMAScript language value, - ): either a normal completion containing an ECMAScript language value or a throw completion + _envRecord_: a Function Environment Record, + _value_: an ECMAScript language value, + ): either a normal completion containing ~unused~ or a throw completion

        -
        for
        -
        a Function Environment Record _envRec_
        +
        description
        +
        It sets the _envRecord_.[[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. Assert: _envRecord_.[[ThisBindingStatus]] is not ~lexical~. + 1. If _envRecord_.[[ThisBindingStatus]] is ~initialized~, throw a *ReferenceError* exception. + 1. Set _envRecord_.[[ThisValue]] to _value_. + 1. Set _envRecord_.[[ThisBindingStatus]] to ~initialized~. + 1. Return ~unused~.
        @@ -10593,49 +11215,55 @@

        HasThisBinding ( ): a Boolean

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

        HasSuperBinding ( ): a Boolean

        + +

        GetThisBinding ( ): either a normal completion containing an ECMAScript language value or a throw completion

        for
        -
        a Function Environment Record _envRec_
        +
        a Function Environment Record _envRecord_
        - 1. If _envRec_.[[ThisBindingStatus]] is ~lexical~, return *false*. - 1. If _envRec_.[[FunctionObject]].[[HomeObject]] is *undefined*, return *false*; otherwise, return *true*. + 1. Assert: _envRecord_.[[ThisBindingStatus]] is not ~lexical~. + 1. If _envRecord_.[[ThisBindingStatus]] is ~uninitialized~, throw a *ReferenceError* exception. + 1. Return _envRecord_.[[ThisValue]].
        - -

        GetThisBinding ( ): either a normal completion containing an ECMAScript language value or a throw completion

        + +

        HasSuperBinding ( ): a Boolean

        for
        -
        a Function Environment Record _envRec_
        +
        a Function Environment Record _envRecord_
        - 1. Assert: _envRec_.[[ThisBindingStatus]] is not ~lexical~. - 1. If _envRec_.[[ThisBindingStatus]] is ~uninitialized~, throw a *ReferenceError* exception. - 1. Return _envRec_.[[ThisValue]]. + 1. If _envRecord_.[[ThisBindingStatus]] is ~lexical~, return *false*. + 1. If _envRecord_.[[FunctionObject]].[[HomeObject]] is *undefined*, return *false*. + 1. Return *true*.
        - -

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

        + +

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

        -
        for
        -
        a Function Environment Record _envRec_
        +
        description
        +
        It returns the object that is the base for `super` property accesses bound in _envRecord_. The value *undefined* indicates that such accesses will produce runtime errors.
        - 1. Let _home_ be _envRec_.[[FunctionObject]].[[HomeObject]]. + 1. Let _home_ be _envRecord_.[[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 +11272,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.

        +

        Global Environment Records have the additional fields listed in .

        - - - - - + + + + + + + - - - - -
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[ObjectRecord]] @@ -10692,256 +11322,165 @@

        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.

        HasBinding ( - _N_: a String, + _name_: a String, ): either a normal completion containing a Boolean or a throw completion

        for
        -
        a Global Environment Record _envRec_
        +
        a Global Environment Record _envRecord_
        description
        It determines if the argument identifier is one of the identifiers bound by the record.
        - 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. Let _declRecord_ be _envRecord_.[[DeclarativeRecord]]. + 1. If ! _declRecord_.HasBinding(_name_) is *true*, return *true*. + 1. Let _objRecord_ be _envRecord_.[[ObjectRecord]]. + 1. Return ? _objRecord_.HasBinding(_name_).

        CreateMutableBinding ( - _N_: a String, - _D_: a Boolean, + _name_: a String, + _deletable_: a Boolean, ): either a normal completion containing ~unused~ or a throw completion

        for
        -
        a Global Environment Record _envRec_
        +
        a Global Environment Record _envRecord_
        description
        -
        It creates a new mutable binding for the name _N_ that is uninitialized. The binding is created in the associated DeclarativeRecord. A binding for _N_ must not already exist in the DeclarativeRecord. If _D_ is *true*, the new binding is marked as being subject to deletion.
        +
        It creates a new mutable binding for the name _name_ that is uninitialized. The binding is created in the associated DeclarativeRecord. A binding for _name_ must not already exist in the DeclarativeRecord. If _deletable_ is *true*, the new binding is marked as being subject to deletion.
        - 1. Let _DclRec_ be _envRec_.[[DeclarativeRecord]]. - 1. If ! _DclRec_.HasBinding(_N_) is *true*, throw a *TypeError* exception. - 1. Return ! _DclRec_.CreateMutableBinding(_N_, _D_). + 1. Let _declRecord_ be _envRecord_.[[DeclarativeRecord]]. + 1. If ! _declRecord_.HasBinding(_name_) is *true*, throw a *TypeError* exception. + 1. Return ! _declRecord_.CreateMutableBinding(_name_, _deletable_).

        CreateImmutableBinding ( - _N_: a String, - _S_: a Boolean, + _name_: a String, + _strict_: a Boolean, ): either a normal completion containing ~unused~ or a throw completion

        for
        -
        a Global Environment Record _envRec_
        +
        a Global Environment Record _envRecord_
        description
        -
        It creates a new immutable binding for the name _N_ that is uninitialized. A binding must not already exist in this Environment Record for _N_. If _S_ is *true*, the new binding is marked as a strict binding.
        +
        It creates a new immutable binding for the name _name_ that is uninitialized. A binding must not already exist in this Environment Record for _name_. If _strict_ is *true*, the new binding is marked as a strict binding.
        - 1. Let _DclRec_ be _envRec_.[[DeclarativeRecord]]. - 1. If ! _DclRec_.HasBinding(_N_) is *true*, throw a *TypeError* exception. - 1. Return ! _DclRec_.CreateImmutableBinding(_N_, _S_). + 1. Let _declRecord_ be _envRecord_.[[DeclarativeRecord]]. + 1. If ! _declRecord_.HasBinding(_name_) is *true*, throw a *TypeError* exception. + 1. Return ! _declRecord_.CreateImmutableBinding(_name_, _strict_).

        InitializeBinding ( - _N_: a String, - _V_: an ECMAScript language value, + _name_: a String, + _value_: an ECMAScript language value, ): either a normal completion containing ~unused~ or a throw completion

        for
        -
        a Global Environment Record _envRec_
        +
        a Global Environment Record _envRecord_
        description
        -
        It is used to set the bound value of the current binding of the identifier whose name is _N_ to the value _V_. An uninitialized binding for _N_ must already exist.
        +
        It is used to set the bound value of the current binding of the identifier whose name is _name_ to the value _value_. An uninitialized binding for _name_ must already exist.
        - 1. Let _DclRec_ be _envRec_.[[DeclarativeRecord]]. - 1. If ! _DclRec_.HasBinding(_N_) is *true*, then - 1. Return ! _DclRec_.InitializeBinding(_N_, _V_). + 1. Let _declRecord_ be _envRecord_.[[DeclarativeRecord]]. + 1. If ! _declRecord_.HasBinding(_name_) is *true*, then + 1. Return ! _declRecord_.InitializeBinding(_name_, _value_). 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. Let _objRecord_ be _envRecord_.[[ObjectRecord]]. + 1. Return ? _objRecord_.InitializeBinding(_name_, _value_).

        SetMutableBinding ( - _N_: a String, - _V_: an ECMAScript language value, - _S_: a Boolean, + _name_: a String, + _value_: an ECMAScript language value, + _strict_: a Boolean, ): either a normal completion containing ~unused~ or a throw completion

        for
        -
        a Global Environment Record _envRec_
        +
        a Global Environment Record _envRecord_
        description
        -
        It attempts to change the bound value of the current binding of the identifier whose name is _N_ to the value _V_. If the binding is an immutable binding and _S_ is *true*, a *TypeError* is thrown. A property named _N_ normally already exists but if it does not or is not currently writable, error handling is determined by _S_.
        +
        It attempts to change the bound value of the current binding of the identifier whose name is _name_ to the value _value_. If the binding is an immutable binding and _strict_ is *true*, a *TypeError* is thrown. A binding named _name_ normally already exists but if it does not or is not currently writable, error handling is determined by _strict_.
        - 1. Let _DclRec_ be _envRec_.[[DeclarativeRecord]]. - 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. Let _declRecord_ be _envRecord_.[[DeclarativeRecord]]. + 1. If ! _declRecord_.HasBinding(_name_) is *true*, then + 1. Return ? _declRecord_.SetMutableBinding(_name_, _value_, _strict_). + 1. Let _objRecord_ be _envRecord_.[[ObjectRecord]]. + 1. Return ? _objRecord_.SetMutableBinding(_name_, _value_, _strict_).

        GetBindingValue ( - _N_: a String, - _S_: a Boolean, + _name_: a String, + _strict_: a Boolean, ): either a normal completion containing an ECMAScript language value or a throw completion

        for
        -
        a Global Environment Record _envRec_
        +
        a Global Environment Record _envRecord_
        description
        -
        It returns the value of its bound identifier whose name is _N_. If the binding is an uninitialized binding throw a *ReferenceError* exception. A property named _N_ normally already exists but if it does not or is not currently writable, error handling is determined by _S_.
        +
        It returns the value of its bound identifier whose name is _name_. If the binding is an uninitialized binding, it will throw a *ReferenceError* exception. A binding named _name_ normally already exists but if it does not or is not currently writable, error handling is determined by _strict_.
        - 1. Let _DclRec_ be _envRec_.[[DeclarativeRecord]]. - 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. Let _declRecord_ be _envRecord_.[[DeclarativeRecord]]. + 1. If ! _declRecord_.HasBinding(_name_) is *true*, then + 1. Return ? _declRecord_.GetBindingValue(_name_, _strict_). + 1. Let _objRecord_ be _envRecord_.[[ObjectRecord]]. + 1. Return ? _objRecord_.GetBindingValue(_name_, _strict_).

        DeleteBinding ( - _N_: a String, + _name_: a String, ): either a normal completion containing a Boolean or a throw completion

        for
        -
        a Global Environment Record _envRec_
        +
        a Global Environment Record _envRecord_
        description
        It can only delete bindings that have been explicitly designated as being subject to deletion.
        - 1. Let _DclRec_ be _envRec_.[[DeclarativeRecord]]. - 1. If ! _DclRec_.HasBinding(_N_) is *true*, then - 1. Return ! _DclRec_.DeleteBinding(_N_). - 1. Let _ObjRec_ be _envRec_.[[ObjectRecord]]. - 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. Let _declRecord_ be _envRecord_.[[DeclarativeRecord]]. + 1. If ! _declRecord_.HasBinding(_name_) is *true*, then + 1. Return ! _declRecord_.DeleteBinding(_name_). + 1. Let _objRecord_ be _envRecord_.[[ObjectRecord]]. + 1. Let _globalObj_ be _objRecord_.[[BindingObject]]. + 1. Let _existingProperty_ be ? HasOwnProperty(_globalObj_, _name_). + 1. If _existingProperty_ is *true*, then + 1. Return ? _objRecord_.DeleteBinding(_name_). 1. Return *true*.
        @@ -10950,7 +11489,7 @@

        HasThisBinding ( ): *true*

        for
        -
        a Global Environment Record _envRec_
        +
        a Global Environment Record _envRecord_
        1. Return *true*. @@ -10960,11 +11499,22 @@

        HasThisBinding ( ): *true*

        + +

        GetThisBinding ( ): a normal completion containing an Object

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

        HasSuperBinding ( ): *false*

        for
        -
        a Global Environment Record _envRec_
        +
        a Global Environment Record _envRecord_
        1. Return *false*. @@ -10978,82 +11528,47 @@

        HasSuperBinding ( ): *false*

        WithBaseObject ( ): *undefined*

        for
        -
        a Global Environment Record _envRec_
        +
        a Global Environment Record _envRecord_
        1. Return *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 ( - _N_: a String, + _envRecord_: a Global Environment Record, + _name_: 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 _envRecord_ that was created using a lexical declaration such as a |LexicalDeclaration| or a |ClassDeclaration|.
        - 1. Let _DclRec_ be _envRec_.[[DeclarativeRecord]]. - 1. Return ! _DclRec_.HasBinding(_N_). + 1. Let _declRecord_ be _envRecord_.[[DeclarativeRecord]]. + 1. Return ! _declRecord_.HasBinding(_name_).
        - +

        HasRestrictedGlobalProperty ( - _N_: a String, + _envRecord_: a Global Environment Record, + _name_: 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. If _existingProp_ is *undefined*, return *false*. - 1. If _existingProp_.[[Configurable]] is *true*, return *false*. + 1. Let _objRecord_ be _envRecord_.[[ObjectRecord]]. + 1. Let _globalObj_ be _objRecord_.[[BindingObject]]. + 1. Let _existingProperty_ be ? _globalObj_.[[GetOwnProperty]](_name_). + 1. If _existingProperty_ is *undefined*, return *false*. + 1. If _existingProperty_.[[Configurable]] is *true*, return *false*. 1. Return *true*. @@ -11061,111 +11576,99 @@

        - +

        CanDeclareGlobalVar ( - _N_: a String, + _envRecord_: a Global Environment Record, + _name_: 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.
        +
        It determines if a corresponding CreateGlobalVarBinding call would succeed if called for the same argument _name_. Redundant var declarations and var declarations for pre-existing global object properties are allowed.
        - 1. Let _ObjRec_ be _envRec_.[[ObjectRecord]]. - 1. Let _globalObject_ be _ObjRec_.[[BindingObject]]. - 1. Let _hasProperty_ be ? HasOwnProperty(_globalObject_, _N_). + 1. Let _objRecord_ be _envRecord_.[[ObjectRecord]]. + 1. Let _globalObj_ be _objRecord_.[[BindingObject]]. + 1. Let _hasProperty_ be ? HasOwnProperty(_globalObj_, _name_). 1. If _hasProperty_ is *true*, return *true*. - 1. Return ? IsExtensible(_globalObject_). + 1. Return ? IsExtensible(_globalObj_).
        - +

        CanDeclareGlobalFunction ( - _N_: a String, + _envRecord_: a Global Environment Record, + _name_: 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_.
        +
        It determines if a corresponding CreateGlobalFunctionBinding call would succeed if called for the same argument _name_.
        - 1. Let _ObjRec_ be _envRec_.[[ObjectRecord]]. - 1. Let _globalObject_ be _ObjRec_.[[BindingObject]]. - 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*. + 1. Let _objRecord_ be _envRecord_.[[ObjectRecord]]. + 1. Let _globalObj_ be _objRecord_.[[BindingObject]]. + 1. Let _existingProperty_ be ? _globalObj_.[[GetOwnProperty]](_name_). + 1. If _existingProperty_ is *undefined*, return ? IsExtensible(_globalObj_). + 1. If _existingProperty_.[[Configurable]] is *true*, return *true*. + 1. If IsDataDescriptor(_existingProperty_) is *true* and _existingProperty_ has attribute values { [[Writable]]: *true*, [[Enumerable]]: *true* }, return *true*. 1. Return *false*.
        - +

        CreateGlobalVarBinding ( - _N_: a String, - _D_: a Boolean, + _envRecord_: a Global Environment Record, + _name_: a String, + _deletable_: 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]]. - 1. Let _globalObject_ be _ObjRec_.[[BindingObject]]. - 1. Let _hasProperty_ be ? HasOwnProperty(_globalObject_, _N_). - 1. Let _extensible_ be ? IsExtensible(_globalObject_). + 1. Let _objRecord_ be _envRecord_.[[ObjectRecord]]. + 1. Let _globalObj_ be _objRecord_.[[BindingObject]]. + 1. Let _hasProperty_ be ? HasOwnProperty(_globalObj_, _name_). + 1. Let _extensible_ be ? IsExtensible(_globalObj_). 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 ? _objRecord_.CreateMutableBinding(_name_, _deletable_). + 1. Perform ? _objRecord_.InitializeBinding(_name_, *undefined*). 1. Return ~unused~.
        - +

        CreateGlobalFunctionBinding ( - _N_: a String, - _V_: an ECMAScript language value, - _D_: a Boolean, + _envRecord_: a Global Environment Record, + _name_: a String, + _value_: an ECMAScript function object, + _deletable_: 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. 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. Let _objRecord_ be _envRecord_.[[ObjectRecord]]. + 1. Let _globalObj_ be _objRecord_.[[BindingObject]]. + 1. Let _existingProperty_ be ? _globalObj_.[[GetOwnProperty]](_name_). + 1. If _existingProperty_ is *undefined* or _existingProperty_.[[Configurable]] is *true*, then + 1. Let _propertyDesc_ be the PropertyDescriptor { [[Value]]: _value_, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: _deletable_ }. 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. Let _propertyDesc_ be the PropertyDescriptor { [[Value]]: _value_ }. + 1. Perform ? DefinePropertyOrThrow(_globalObj_, _name_, _propertyDesc_). + 1. [id="step-createglobalfunctionbinding-set"] Perform ? Set(_globalObj_, _name_, _value_, *false*). 1. Return ~unused~. -

        Global function declarations are always represented as own properties of the global object. If possible, an existing own property is reconfigured to have a standard set of attribute values. Step is equivalent to what calling the InitializeBinding concrete method would do and if _globalObject_ is a Proxy will produce the same sequence of Proxy trap calls.

        +

        Global function declarations are always represented as own properties of the global object. If possible, an existing own property is reconfigured to have a standard set of attribute values. Step is equivalent to what calling the InitializeBinding concrete method would do and if _globalObj_ is a Proxy will produce the same sequence of Proxy trap calls.

        @@ -11173,69 +11676,40 @@

        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.

        GetBindingValue ( - _N_: a String, - _S_: a Boolean, + _name_: a String, + _strict_: a Boolean, ): either a normal completion containing an ECMAScript language value or a throw completion

        for
        -
        a Module Environment Record _envRec_
        +
        a Module Environment Record _envRecord_
        description
        -
        It returns the value of its bound identifier whose name is _N_. However, if the binding is an indirect binding the value of the target binding is returned. If the binding exists but is uninitialized a *ReferenceError* is thrown.
        +
        It returns the value of its bound identifier whose name is _name_. However, if the binding is an indirect binding the value of the target binding is returned. If the binding exists but is uninitialized a *ReferenceError* is thrown.
        - 1. Assert: _S_ is *true*. - 1. Assert: _envRec_ has a binding for _N_. - 1. If the binding for _N_ is an indirect binding, then - 1. Let _M_ and _N2_ be the indirection values provided when this binding for _N_ was created. - 1. Let _targetEnv_ be _M_.[[Environment]]. + 1. Assert: _strict_ is *true*. + 1. Assert: _envRecord_ has a binding for _name_. + 1. If the binding for _name_ is an indirect binding, then + 1. Let _module_ and _targetName_ be the indirection values provided when this binding for _name_ was created. + 1. Let _targetEnv_ be _module_.[[Environment]]. 1. If _targetEnv_ is ~empty~, throw a *ReferenceError* exception. - 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_. + 1. Return ? _targetEnv_.GetBindingValue(_targetName_, *true*). + 1. If the binding for _name_ in _envRecord_ is an uninitialized binding, throw a *ReferenceError* exception. + 1. Return the value currently bound to _name_ in _envRecord_. -

        _S_ will always be *true* because a |Module| is always strict mode code.

        +

        _strict_ will always be *true* because a |Module| is always strict mode code.

        -

        DeleteBinding ( _N_ )

        +

        DeleteBinding ( _name_ )

        The DeleteBinding concrete method of a Module Environment Record is never used within this specification.

        Module Environment Records are only used within strict code and an early error rule prevents the delete operator, in strict code, from being applied to a Reference Record that would resolve to a Module Environment Record binding. See .

        @@ -11246,7 +11720,7 @@

        DeleteBinding ( _N_ )

        HasThisBinding ( ): *true*

        for
        -
        a Module Environment Record _envRec_
        +
        a Module Environment Record _envRecord_
        1. Return *true*. @@ -11260,32 +11734,30 @@

        HasThisBinding ( ): *true*

        GetThisBinding ( ): a normal completion containing *undefined*

        for
        -
        a Module Environment Record _envRec_
        +
        a Module Environment Record _envRecord_
        1. Return *undefined*.
        - +

        CreateImportBinding ( - _N_: a String, - _M_: a Module Record, - _N2_: a String, + _envRecord_: a Module Environment Record, + _name_: a String, + _targetModule_: a Module Record, + _targetName_: 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 _name_. A binding must not already exist in _envRecord_ for _name_. _targetName_ is the name of a binding that exists in _targetModule_'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_. - 1. Assert: When _M_.[[Environment]] is instantiated, it will have a direct binding for _N2_. - 1. Create an immutable indirect binding in _envRec_ for _N_ that references _M_ and _N2_ as its target binding and record that the binding is initialized. + 1. Assert: _envRecord_ does not already have a binding for _name_. + 1. Assert: When _targetModule_.[[Environment]] is instantiated, it will have a direct binding for _targetName_. + 1. Create an immutable indirect binding in _envRecord_ for _name_ that references _targetModule_ and _targetName_ as its target binding and record that the binding is initialized. 1. Return ~unused~.
        @@ -11299,7 +11771,7 @@

        Environment Record Operations

        GetIdentifierReference ( - _env_: an Environment Record or *null*, + _envRecord_: an Environment Record or *null*, _name_: a String, _strict_: a Boolean, ): either a normal completion containing a Reference Record or a throw completion @@ -11307,105 +11779,106 @@

        - 1. If _env_ is *null*, then + 1. If _envRecord_ 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 ? _envRecord_.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. Return the Reference Record { [[Base]]: _envRecord_, [[ReferencedName]]: _name_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }. + 1. Let _outer_ be _envRecord_.[[OuterEnv]]. + 1. Return ? GetIdentifierReference(_outer_, _name_, _strict_).

        NewDeclarativeEnvironment ( - _E_: an Environment Record or *null*, + _outerEnv_: an Environment Record or *null*, ): a Declarative Environment Record

        - 1. Let _env_ be a new Declarative Environment Record containing no bindings. - 1. Set _env_.[[OuterEnv]] to _E_. - 1. Return _env_. + 1. Let _envRecord_ be a new Declarative Environment Record containing no bindings. + 1. Set _envRecord_.[[OuterEnv]] to _outerEnv_. + 1. Set _envRecord_.[[DisposableResourceStack]] to a new empty List. + 1. Return _envRecord_.

        NewObjectEnvironment ( - _O_: an Object, - _W_: a Boolean, - _E_: an Environment Record or *null*, + _obj_: an Object, + _isWithEnv_: a Boolean, + _outerEnv_: an Environment Record or *null*, ): an Object Environment Record

        - 1. Let _env_ be a new Object Environment Record. - 1. Set _env_.[[BindingObject]] to _O_. - 1. Set _env_.[[IsWithEnvironment]] to _W_. - 1. Set _env_.[[OuterEnv]] to _E_. - 1. Return _env_. + 1. Let _envRecord_ be a new Object Environment Record. + 1. Set _envRecord_.[[BindingObject]] to _obj_. + 1. Set _envRecord_.[[IsWithEnvironment]] to _isWithEnv_. + 1. Set _envRecord_.[[OuterEnv]] to _outerEnv_. + 1. Return _envRecord_.

        NewFunctionEnvironment ( - _F_: an ECMAScript function object, + _func_: an ECMAScript function object, _newTarget_: an Object or *undefined*, ): a Function Environment Record

        - 1. Let _env_ be a new Function Environment Record containing no bindings. - 1. Set _env_.[[FunctionObject]] to _F_. - 1. If _F_.[[ThisMode]] is ~lexical~, set _env_.[[ThisBindingStatus]] to ~lexical~. - 1. Else, set _env_.[[ThisBindingStatus]] to ~uninitialized~. - 1. Set _env_.[[NewTarget]] to _newTarget_. - 1. Set _env_.[[OuterEnv]] to _F_.[[Environment]]. - 1. Return _env_. + 1. Let _envRecord_ be a new Function Environment Record containing no bindings. + 1. Set _envRecord_.[[FunctionObject]] to _func_. + 1. If _func_.[[ThisMode]] is ~lexical~, set _envRecord_.[[ThisBindingStatus]] to ~lexical~. + 1. Else, set _envRecord_.[[ThisBindingStatus]] to ~uninitialized~. + 1. Set _envRecord_.[[NewTarget]] to _newTarget_. + 1. Set _envRecord_.[[OuterEnv]] to _func_.[[Environment]]. + 1. Set _envRecord_.[[DisposableResourceStack]] to a new empty List. + 1. Return _envRecord_.

        NewGlobalEnvironment ( - _G_: an Object, + _obj_: an Object, _thisValue_: an Object, ): a Global Environment Record

        - 1. Let _objRec_ be NewObjectEnvironment(_G_, *false*, *null*). - 1. Let _dclRec_ be NewDeclarativeEnvironment(*null*). - 1. Let _env_ be a new Global Environment Record. - 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_. + 1. Let _objRecord_ be NewObjectEnvironment(_obj_, *false*, *null*). + 1. Let _declRecord_ be NewDeclarativeEnvironment(*null*). + 1. Let _envRecord_ be a new Global Environment Record. + 1. Set _envRecord_.[[ObjectRecord]] to _objRecord_. + 1. Set _envRecord_.[[GlobalThisValue]] to _thisValue_. + 1. Set _envRecord_.[[DeclarativeRecord]] to _declRecord_. + 1. Set _envRecord_.[[OuterEnv]] to *null*. + 1. Return _envRecord_.

        NewModuleEnvironment ( - _E_: an Environment Record, + _outerEnv_: a Global Environment Record, ): a Module Environment Record

        - 1. Let _env_ be a new Module Environment Record containing no bindings. - 1. Set _env_.[[OuterEnv]] to _E_. - 1. Return _env_. + 1. Let _envRecord_ be a new Module Environment Record containing no bindings. + 1. Set _envRecord_.[[OuterEnv]] to _outerEnv_. + 1. Set _envRecord_.[[DisposableResourceStack]] to a new empty List. + 1. Return _envRecord_.
        @@ -11462,34 +11935,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. 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 _names_ be _privateEnv_.[[Names]]. + 1. For each Private Name _privateName_ of _names_, do + 1. If _privateName_.[[Description]] is _identifier_, then + 1. Return _privateName_. + 1. Let _outerPrivateEnv_ be _privateEnv_.[[OuterPrivateEnvironment]]. + 1. Assert: _outerPrivateEnv_ is not *null*. + 1. Return ResolvePrivateIdentifier(_outerPrivateEnv_, _identifier_).
        @@ -11501,17 +11974,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 +12014,7 @@

        Realms

        [[GlobalObject]]
        - an Object or *undefined* + an Object The global object for this realm @@ -11573,10 +12048,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 +12079,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%]]). @@ -11631,15 +12104,15 @@

        InitializeHostDefinedRealm ( ): either a normal completion containing ~unuse

        CreateIntrinsics ( - _realmRec_: a Realm Record, + _realmRecord_: a Realm Record, ): ~unused~

        - 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. Perform AddRestrictedFunctionProperties(_realmRec_.[[Intrinsics]].[[%Function.prototype%]], _realmRec_). + 1. Set _realmRecord_.[[Intrinsics]] to a new Record. + 1. [declared="steps,name,length,slots,proto,async"] Set fields of _realmRecord_.[[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_, _realmRecord_, _proto_, _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, _proto_ 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(_realmRecord_.[[Intrinsics]].[[%Function.prototype%]], _realmRecord_). 1. Return ~unused~.
        @@ -11647,17 +12120,17 @@

        SetDefaultGlobalBindings ( - _realmRec_: a Realm Record, + _realmRecord_: a Realm Record, ): either a normal completion containing ~unused~ or a throw completion

        - 1. Let _global_ be _realmRec_.[[GlobalObject]]. + 1. Let _global_ be _realmRecord_.[[GlobalObject]]. 1. For each property of the Global Object specified in clause , do 1. Let _name_ be the String value of the property name. - 1. Let _desc_ be the fully populated data Property Descriptor for the property, containing the specified attributes for the property. For properties listed in , , or the value of the [[Value]] attribute is the corresponding intrinsic object from _realmRec_. - 1. Perform ? DefinePropertyOrThrow(_global_, _name_, _desc_). + 1. Let _propertyDesc_ be the fully populated data Property Descriptor for the property, containing the specified attributes for the property. For properties listed in , , or the value of the [[Value]] attribute is the corresponding intrinsic object from _realmRecord_. + 1. Perform ? DefinePropertyOrThrow(_global_, _name_, _propertyDesc_). 1. Return ~unused~.
        @@ -11670,14 +12143,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 +12192,16 @@

        Execution Contexts

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

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

        Execution Contexts

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

        - - - - + + + + + +
        - Component - - Purpose -
        + Component + + Purpose +
        Generator @@ -11785,8 +12264,9 @@

        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. Let _executionContext_ 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*. + 1. Return _executionContext_'s ScriptOrModule. @@ -11794,19 +12274,19 @@

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

        ResolveBinding ( _name_: a String, - optional _env_: an Environment Record or *undefined*, + optional _envRecord_: an Environment Record or *undefined*, ): either a normal completion containing a Reference Record or a throw completion
        description
        -
        It is used to determine the binding of _name_. _env_ can be used to explicitly provide the Environment Record that is to be searched for the binding.
        +
        It is used to determine the binding of _name_. _envRecord_ can be used to explicitly provide the Environment Record that is to be searched for the binding.
        - 1. If _env_ is not present or _env_ is *undefined*, then - 1. Set _env_ to the running execution context's LexicalEnvironment. - 1. Assert: _env_ is an Environment Record. + 1. If _envRecord_ is not present or _envRecord_ is *undefined*, then + 1. Set _envRecord_ to the running execution context's LexicalEnvironment. + 1. Assert: _envRecord_ is an Environment Record. 1. Let _strict_ be IsStrict(the syntactic production that is being evaluated). - 1. Return ? GetIdentifierReference(_env_, _name_, _strict_). + 1. Return ? GetIdentifierReference(_envRecord_, _name_, _strict_).

        The result of ResolveBinding is always a Reference Record whose [[ReferencedName]] field is _name_.

        @@ -11820,13 +12300,13 @@

        GetThisEnvironment ( ): an Environment Record

        It finds the Environment Record that currently supplies the binding of the keyword `this`.
        - 1. Let _env_ be the running execution context's LexicalEnvironment. + 1. Let _envRecord_ be the running execution context's LexicalEnvironment. 1. [id="step-getthisenvironment-loop"] Repeat, - 1. Let _exists_ be _env_.HasThisBinding(). - 1. If _exists_ is *true*, return _env_. - 1. Let _outer_ be _env_.[[OuterEnv]]. + 1. Let _exists_ be _envRecord_.HasThisBinding(). + 1. If _exists_ is *true*, return _envRecord_. + 1. Let _outer_ be _envRecord_.[[OuterEnv]]. 1. Assert: _outer_ is not *null*. - 1. Set _env_ to _outer_. + 1. Set _envRecord_ to _outer_.

        The loop in step will always terminate because the list of environments always ends with the global environment which has a `this` binding.

        @@ -11840,8 +12320,8 @@

        ResolveThisBinding ( ): either a normal completion containing an ECMAScript
        It determines the binding of the keyword `this` using the LexicalEnvironment of the running execution context.
        - 1. Let _envRec_ be GetThisEnvironment(). - 1. Return ? _envRec_.GetThisBinding(). + 1. Let _envRecord_ be GetThisEnvironment(). + 1. Return ? _envRecord_.GetThisBinding(). @@ -11852,9 +12332,9 @@

        GetNewTarget ( ): an Object or *undefined*

        It determines the NewTarget value using the LexicalEnvironment of the running execution context.
        - 1. Let _envRec_ be GetThisEnvironment(). - 1. Assert: _envRec_ has a [[NewTarget]] field. - 1. Return _envRec_.[[NewTarget]]. + 1. Let _envRecord_ be GetThisEnvironment(). + 1. Assert: _envRecord_ has a [[NewTarget]] field. + 1. Return _envRecord_.[[NewTarget]]. @@ -11869,6 +12349,49 @@

        GetGlobalObject ( ): an Object

        1. Return _currentRealm_.[[GlobalObject]]. + + +

        + RunSuspendedContext ( + _context_: an execution context, + _completionRecord_: a Completion Record, + ): either a normal completion containing either an ECMAScript language value or ~unused~, or an abrupt completion +

        +
        +
        description
        +
        It resumes _context_ (sending it _completionRecord_ as the resumption value), and waits for the result.
        +
        + + 1. Let _callerContext_ be the running execution context. + 1. Suspend _callerContext_. + 1. Push _context_ onto the execution context stack; _context_ is now the running execution context. + 1. Resume the suspended evaluation of _context_ using _completionRecord_ as the result of the operation that suspended it. Let _result_ be the Completion Record returned by the resumed computation. + 1. Assert: When we reach this step, _context_ has already been removed from the execution context stack and _callerContext_ is the running execution context again. + 1. Return Completion(_result_). + +
        + + +

        + RunCallerContext ( + _value_: an ECMAScript language value or ~empty~, + ): a Completion Record +

        +
        +
        description
        +
        It resumes the caller context (sending it _value_ as the resumption value), and waits for the result, if any.
        +
        + + 1. Let _genContext_ be the running execution context. + 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(_value_). + 1. NOTE: The above step transfers control to _callerContext_ and pauses. The only way for it to un-pause and have control proceed to the subsequent steps in this algorithm is for _genContext_ to be resumed again, which might never happen. + 1. Assert: _genContext_ is the running execution context. + 1. Let _result_ be the Completion Record with which _genContext_ was just resumed. + 1. Return Completion(_result_). + +
        @@ -11880,7 +12403,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.
      • @@ -11896,7 +12419,7 @@

        Jobs and Host Operations to Enqueue Jobs

        At any particular time, _scriptOrModule_ (a Script Record, a Module Record, or *null*) is the active script or module if all of the following conditions are true:

        • GetActiveScriptOrModule() is _scriptOrModule_.
        • -
        • If _scriptOrModule_ is a Script Record or Module Record, let _ec_ be the topmost execution context on the execution context stack whose ScriptOrModule component is _scriptOrModule_. The Realm component of _ec_ is _scriptOrModule_.[[Realm]].
        • +
        • If _scriptOrModule_ is a Script Record or Module Record, let _executionContext_ be the topmost execution context on the execution context stack whose ScriptOrModule component is _scriptOrModule_. The Realm component of _executionContext_ is _scriptOrModule_.[[Realm]].

        At any particular time, an execution is prepared to evaluate ECMAScript code if all of the following conditions are true:

        @@ -11914,24 +12437,26 @@

        Jobs and Host Operations to Enqueue Jobs

        JobCallback Records

        -

        A JobCallback Record is a Record value used to store a function object and a host-defined value. Function objects that are invoked via a Job enqueued by the host may have additional host-defined context. To propagate the state, Job Abstract Closures should not capture and call function objects directly. Instead, use HostMakeJobCallback and HostCallJobCallback.

        +

        A JobCallback Record is a Record used to store a function object and a host-defined value. Function objects that are invoked via a Job enqueued by the host may have additional host-defined context. To propagate the state, Job Abstract Closures should not capture and call function objects directly. Instead, use HostMakeJobCallback and HostCallJobCallback.

        The WHATWG HTML specification (https://html.spec.whatwg.org/), for example, uses the host-defined value to propagate the incumbent settings object for Promise callbacks.

        JobCallback Records have the fields listed in .

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[Callback]] @@ -11984,15 +12509,15 @@

        HostCallJobCallback ( _jobCallback_: a JobCallback Record, - _V_: an ECMAScript language value, - _argumentsList_: a List of ECMAScript language values, + _thisValue_: an ECMAScript language value, + _argList_: a List of ECMAScript language values, ): either a normal completion containing an ECMAScript language value or a throw completion

        An implementation of HostCallJobCallback must conform to the following requirements:

          -
        • It must perform and return the result of Call(_jobCallback_.[[Callback]], _V_, _argumentsList_).
        • +
        • It must perform and return the result of Call(_jobCallback_.[[Callback]], _thisValue_, _argList_).

        This requirement means that hosts cannot change the [[Call]] behaviour of function objects defined in this specification.

        @@ -12000,7 +12525,7 @@

        The default implementation of HostCallJobCallback performs the following steps when called:

        1. Assert: IsCallable(_jobCallback_.[[Callback]]) is *true*. - 1. Return ? Call(_jobCallback_.[[Callback]], _V_, _argumentsList_). + 1. Return ? Call(_jobCallback_.[[Callback]], _thisValue_, _argList_).

        ECMAScript hosts that are not web browsers must use the default implementation of HostCallJobCallback.

        @@ -12071,15 +12596,17 @@

        Agents

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

        - - - - - + + + + + + + - + @@ -12116,13 +12643,25 @@

        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.
        [[GlobalSymbolRegistry]]a List of GlobalSymbolRegistry RecordsInitially a new empty List, representing the list of Symbol values produced by Symbol.for.
        -

        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 [[GlobalSymbolRegistry]] List is append-only and never reassigned.

        -

        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.

        @@ -12140,8 +12679,8 @@

        AgentSignifier ( ): an agent signifier

        - 1. Let _AR_ be the Agent Record of the surrounding agent. - 1. Return _AR_.[[Signifier]]. + 1. Let _agentRecord_ be the Agent Record of the surrounding agent. + 1. Return _agentRecord_.[[Signifier]]. @@ -12150,13 +12689,28 @@

        AgentCanSuspend ( ): a Boolean

        - 1. Let _AR_ be the Agent Record of the surrounding agent. - 1. Return _AR_.[[CanBlock]]. + 1. Let _agentRecord_ be the Agent Record of the surrounding agent. + 1. Return _agentRecord_.[[CanBlock]].

        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 ( ): a non-negative integer

        +
        +
        + + 1. Let _agentRecord_ be the Agent Record of the surrounding agent. + 1. Let _count_ be _agentRecord_.[[ModuleAsyncEvaluationCount]]. + 1. Set _agentRecord_.[[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 +12736,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.

        @@ -12241,7 +12795,7 @@

        Processing Model of WeakRef and FinalizationRegistry Targets

        Objectives

        -

        This specification does not make any guarantees that any object or symbol will be garbage collected. Objects or symbols which are not live may be released after long periods of time, or never at all. For this reason, this specification uses the term "may" when describing behaviour triggered by garbage collection.

        +

        This specification does not make any guarantees that any object or symbol will be garbage collected. Objects or symbols which are not live may be released after long periods of time, or never at all. For this reason, this specification uses the term “may” when describing behaviour triggered by garbage collection.

        The semantics of WeakRefs and FinalizationRegistrys is based on two operations which happen at particular points in time:

        @@ -12263,7 +12817,7 @@

        Objectives

        Liveness

        -

        For some set of objects and/or symbols _S_ a hypothetical WeakRef-oblivious execution with respect to _S_ is an execution whereby the abstract operation WeakRefDeref of a WeakRef whose referent is an element of _S_ always returns *undefined*.

        +

        For some set of objects and/or symbols _objSet_ a hypothetical WeakRef-oblivious execution with respect to _objSet_ is an execution whereby the abstract operation WeakRefDeref of a WeakRef whose referent is an element of _objSet_ always returns *undefined*.

        WeakRef-obliviousness, together with liveness, capture two notions. One, that a WeakRef itself does not keep its referent alive. Two, that cycles in liveness does not imply that a value is live. To be concrete, if determining _v_'s liveness depends on determining the liveness of a WeakRef referent, _r_, _r_'s liveness cannot assume _v_'s liveness, which would be circular reasoning. @@ -12275,14 +12829,14 @@

        Liveness

        Colloquially, we say that an individual object or symbol is live if every set containing it is live.
        -

        At any point during evaluation, a set of objects and/or symbols _S_ is considered live if either of the following conditions is met:

        +

        At any point during evaluation, a set of objects and/or symbols _objSet_ is considered live if either of the following conditions is met:

        • - Any element in _S_ is included in any agent's [[KeptAlive]] List. + Any element in _objSet_ is included in any agent's [[KeptAlive]] List.
        • - There exists a valid future hypothetical WeakRef-oblivious execution with respect to _S_ that observes the identity of any value in _S_. + There exists a valid future hypothetical WeakRef-oblivious execution with respect to _objSet_ that observes the identity of any value in _objSet_.
        @@ -12303,18 +12857,19 @@

        Liveness

        Execution

        -

        At any time, if a set of objects and/or symbols _S_ is not live, an ECMAScript implementation may perform the following steps atomically:

        +

        At any time, if a set of objects and/or symbols _objSet_ is not live, an ECMAScript implementation may perform the following steps atomically:

        - 1. For each element _value_ of _S_, do + 1. For each element _value_ of _objSet_, do 1. For each WeakRef _ref_ such that _ref_.[[WeakRefTarget]] is _value_, do 1. Set _ref_.[[WeakRefTarget]] to ~empty~. - 1. For each FinalizationRegistry _fg_ such that _fg_.[[Cells]] contains a Record _cell_ such that _cell_.[[WeakRefTarget]] is _value_, do + 1. For each FinalizationRegistry _finalizationRegistry_ such that _finalizationRegistry_.[[Cells]] contains a Record _cell_ such that _cell_.[[WeakRefTarget]] is _value_, do 1. Set _cell_.[[WeakRefTarget]] to ~empty~. - 1. Optionally, perform HostEnqueueFinalizationRegistryCleanupJob(_fg_). - 1. For each WeakMap _map_ such that _map_.[[WeakMapData]] contains a Record _r_ such that _r_.[[Key]] is _value_, do - 1. Set _r_.[[Key]] to ~empty~. - 1. Set _r_.[[Value]] to ~empty~. + 1. Let _enqueueCleanup_ be an implementation-defined choice of either *true* or *false*. + 1. If _enqueueCleanup_ is *true*, perform HostEnqueueFinalizationRegistryCleanupJob(_finalizationRegistry_). + 1. For each WeakMap _map_ such that _map_.[[WeakMapData]] contains a Record _entry_ such that _entry_.[[Key]] is _value_, do + 1. Set _entry_.[[Key]] to ~empty~. + 1. Set _entry_.[[Value]] to ~empty~. 1. For each WeakSet _set_ such that _set_.[[WeakSetData]] contains _value_, do 1. Replace the element of _set_.[[WeakSetData]] whose value is _value_ with an element whose value is ~empty~. @@ -12330,7 +12885,7 @@

        Execution

        Implementations are not obligated to empty WeakRefs for maximal sets of non-live objects or symbols.

        -

        If an implementation chooses a non-live set _S_ in which to empty WeakRefs, this definition requires that it empties WeakRefs for all values in _S_ simultaneously. In other words, it is not conformant for an implementation to empty a WeakRef pointing to a value _v_ without emptying out other WeakRefs that, if not emptied, could result in an execution that observes the value of _v_.

        +

        If an implementation chooses a non-live set _objSet_ in which to empty WeakRefs, this definition requires that it empties WeakRefs for all values in _objSet_ simultaneously. In other words, it is not conformant for an implementation to empty a WeakRef pointing to a value _v_ without emptying out other WeakRefs that, if not emptied, could result in an execution that observes the value of _v_.

        @@ -12409,16 +12964,16 @@

        CanBeHeldWeakly ( - _v_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): a Boolean

        description
        -
        It returns *true* if and only if _v_ is suitable for use as a weak reference. Only values that are suitable for use as a weak reference may be a key of a WeakMap, an element of a WeakSet, the target of a WeakRef, or one of the targets of a FinalizationRegistry.
        +
        It returns *true* if and only if _arg_ is suitable for use as a weak reference. Only values that are suitable for use as a weak reference may be a key of a WeakMap, an element of a WeakSet, the target of a WeakRef, or one of the targets of a FinalizationRegistry.
        - 1. If _v_ is an Object, return *true*. - 1. If _v_ is a Symbol and KeyForSymbol(_v_) is *undefined*, return *true*. + 1. If _arg_ is an Object, return *true*. + 1. If _arg_ is a Symbol and KeyForSymbol(_arg_) is *undefined*, return *true*. 1. Return *false*. @@ -12432,31 +12987,31 @@

        Ordinary and Exotic Objects Behaviours

        Ordinary Object Internal Methods and Internal Slots

        -

        All ordinary objects have an internal slot called [[Prototype]]. The value of this internal slot is either *null* or an object and is used for implementing inheritance. Assume a property named _P_ is missing from an ordinary object _O_ but exists on its [[Prototype]] object. If _P_ refers to a data property on the [[Prototype]] object, _O_ inherits it for get access, making it behave as if _P_ was a property of _O_. If _P_ refers to a writable data property on the [[Prototype]] object, set access of _P_ on _O_ creates a new data property named _P_ on _O_. If _P_ refers to a non-writable data property on the [[Prototype]] object, set access of _P_ on _O_ fails. If _P_ refers to an accessor property on the [[Prototype]] object, the accessor is inherited by _O_ for both get access and set access.

        +

        All ordinary objects have an internal slot called [[Prototype]]. The value of this internal slot is either *null* or an object and is used for implementing inheritance. Assume a property named _propertyKey_ is missing from an ordinary object _obj_ but exists on its [[Prototype]] object. If _propertyKey_ refers to a data property on the [[Prototype]] object, _obj_ inherits it for get access, making it behave as if _propertyKey_ was a property of _obj_. If _propertyKey_ refers to a writable data property on the [[Prototype]] object, set access of _propertyKey_ on _obj_ creates a new data property named _propertyKey_ on _obj_. If _propertyKey_ refers to a non-writable data property on the [[Prototype]] object, set access of _propertyKey_ on _obj_ fails. If _propertyKey_ refers to an accessor property on the [[Prototype]] object, the accessor is inherited by _obj_ for both get access and set access.

        Every ordinary object has a Boolean-valued [[Extensible]] internal slot which is used to fulfill the extensibility-related internal method invariants specified in . Namely, once the value of an object's [[Extensible]] internal slot has been set to *false*, it is no longer possible to add properties to the object, to modify the value of the object's [[Prototype]] internal slot, or to subsequently change the value of [[Extensible]] to *true*.

        -

        In the following algorithm descriptions, assume _O_ is an ordinary object, _P_ is a property key value, _V_ is any ECMAScript language value, and _Desc_ is a Property Descriptor record.

        -

        Each ordinary object internal method delegates to a similarly-named abstract operation. If such an abstract operation depends on another internal method, then the internal method is invoked on _O_ rather than calling the similarly-named abstract operation directly. These semantics ensure that exotic objects have their overridden internal methods invoked when ordinary object internal methods are applied to them.

        +

        In the following algorithm descriptions, assume _obj_ is an ordinary object, _propertyKey_ is a property key value, _value_ is any ECMAScript language value, and _propertyDesc_ is a Property Descriptor record.

        +

        Each ordinary object internal method delegates to a similarly-named abstract operation. If such an abstract operation depends on another internal method, then the internal method is invoked on _obj_ rather than calling the similarly-named abstract operation directly. These semantics ensure that exotic objects have their overridden internal methods invoked when ordinary object internal methods are applied to them.

        [[GetPrototypeOf]] ( ): a normal completion containing either an Object or *null*

        for
        -
        an ordinary object _O_
        +
        an ordinary object _obj_
        - 1. Return OrdinaryGetPrototypeOf(_O_). + 1. Return OrdinaryGetPrototypeOf(_obj_).

        OrdinaryGetPrototypeOf ( - _O_: an Object, + _obj_: an Object, ): an Object or *null*

        - 1. Return _O_.[[Prototype]]. + 1. Return _obj_.[[Prototype]].
        @@ -12464,46 +13019,46 @@

        [[SetPrototypeOf]] ( - _V_: an Object or *null*, + _proto_: an Object or *null*, ): a normal completion containing a Boolean

        for
        -
        an ordinary object _O_
        +
        an ordinary object _obj_
        - 1. Return OrdinarySetPrototypeOf(_O_, _V_). + 1. Return OrdinarySetPrototypeOf(_obj_, _proto_).

        OrdinarySetPrototypeOf ( - _O_: an Object, - _V_: an Object or *null*, + _obj_: an Object, + _proto_: an Object or *null*, ): a Boolean

        - 1. Let _current_ be _O_.[[Prototype]]. - 1. If SameValue(_V_, _current_) is *true*, return *true*. - 1. Let _extensible_ be _O_.[[Extensible]]. + 1. Let _current_ be _obj_.[[Prototype]]. + 1. If SameValue(_proto_, _current_) is *true*, return *true*. + 1. Let _extensible_ be _obj_.[[Extensible]]. 1. If _extensible_ is *false*, return *false*. - 1. Let _p_ be _V_. + 1. Let _cursor_ be _proto_. 1. Let _done_ be *false*. 1. [id="step-ordinarysetprototypeof-loop"] Repeat, while _done_ is *false*, - 1. If _p_ is *null*, then + 1. If _cursor_ is *null*, then 1. Set _done_ to *true*. - 1. Else if SameValue(_p_, _O_) is *true*, then + 1. Else if SameValue(_cursor_, _obj_) is *true*, then 1. Return *false*. 1. Else, - 1. If _p_.[[GetPrototypeOf]] is not the ordinary object internal method defined in , set _done_ to *true*. - 1. Else, set _p_ to _p_.[[Prototype]]. - 1. Set _O_.[[Prototype]] to _V_. + 1. If _cursor_.[[GetPrototypeOf]] is not the ordinary object internal method defined in , set _done_ to *true*. + 1. Else, set _cursor_ to _cursor_.[[Prototype]]. + 1. Set _obj_.[[Prototype]] to _proto_. 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]].

        @@ -12512,22 +13067,22 @@

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

        for
        -
        an ordinary object _O_
        +
        an ordinary object _obj_
        - 1. Return OrdinaryIsExtensible(_O_). + 1. Return OrdinaryIsExtensible(_obj_).

        OrdinaryIsExtensible ( - _O_: an Object, + _obj_: an Object, ): a Boolean

        - 1. Return _O_.[[Extensible]]. + 1. Return _obj_.[[Extensible]].
        @@ -12536,22 +13091,22 @@

        [[PreventExtensions]] ( ): a normal completion containing *true*

        for
        -
        an ordinary object _O_
        +
        an ordinary object _obj_
        - 1. Return OrdinaryPreventExtensions(_O_). + 1. Return OrdinaryPreventExtensions(_obj_).

        OrdinaryPreventExtensions ( - _O_: an Object, + _obj_: an Object, ): *true*

        - 1. Set _O_.[[Extensible]] to *false*. + 1. Set _obj_.[[Extensible]] to *false*. 1. Return *true*.
        @@ -12560,40 +13115,40 @@

        [[GetOwnProperty]] ( - _P_: a property key, + _propertyKey_: a property key, ): a normal completion containing either a Property Descriptor or *undefined*

        for
        -
        an ordinary object _O_
        +
        an ordinary object _obj_
        - 1. Return OrdinaryGetOwnProperty(_O_, _P_). + 1. Return OrdinaryGetOwnProperty(_obj_, _propertyKey_).

        OrdinaryGetOwnProperty ( - _O_: an Object, - _P_: a property key, + _obj_: an Object, + _propertyKey_: a property key, ): a Property Descriptor or *undefined*

        - 1. If _O_ does not have an own property with key _P_, return *undefined*. - 1. Let _D_ be a newly created Property Descriptor with no fields. - 1. Let _X_ be _O_'s own property whose key is _P_. - 1. If _X_ is a data property, then - 1. Set _D_.[[Value]] to the value of _X_'s [[Value]] attribute. - 1. Set _D_.[[Writable]] to the value of _X_'s [[Writable]] attribute. + 1. If _obj_ does not have an own property with key _propertyKey_, return *undefined*. + 1. Let _propertyDesc_ be a newly created Property Descriptor with no fields. + 1. Let _ownProperty_ be _obj_'s own property whose key is _propertyKey_. + 1. If _ownProperty_ is a data property, then + 1. Set _propertyDesc_.[[Value]] to the value of _ownProperty_'s [[Value]] attribute. + 1. Set _propertyDesc_.[[Writable]] to the value of _ownProperty_'s [[Writable]] attribute. 1. Else, - 1. Assert: _X_ is an accessor property. - 1. Set _D_.[[Get]] to the value of _X_'s [[Get]] attribute. - 1. Set _D_.[[Set]] to the value of _X_'s [[Set]] attribute. - 1. Set _D_.[[Enumerable]] to the value of _X_'s [[Enumerable]] attribute. - 1. Set _D_.[[Configurable]] to the value of _X_'s [[Configurable]] attribute. - 1. Return _D_. + 1. Assert: _ownProperty_ is an accessor property. + 1. Set _propertyDesc_.[[Getter]] to the value of _ownProperty_'s [[Getter]] attribute. + 1. Set _propertyDesc_.[[Setter]] to the value of _ownProperty_'s [[Setter]] attribute. + 1. Set _propertyDesc_.[[Enumerable]] to the value of _ownProperty_'s [[Enumerable]] attribute. + 1. Set _propertyDesc_.[[Configurable]] to the value of _ownProperty_'s [[Configurable]] attribute. + 1. Return _propertyDesc_.
        @@ -12601,97 +13156,98 @@

        [[DefineOwnProperty]] ( - _P_: a property key, - _Desc_: a Property Descriptor, + _propertyKey_: a property key, + _propertyDesc_: a Property Descriptor, ): either a normal completion containing a Boolean or a throw completion

        for
        -
        an ordinary object _O_
        +
        an ordinary object _obj_
        - 1. Return ? OrdinaryDefineOwnProperty(_O_, _P_, _Desc_). + 1. Return ? OrdinaryDefineOwnProperty(_obj_, _propertyKey_, _propertyDesc_).

        OrdinaryDefineOwnProperty ( - _O_: an Object, - _P_: a property key, - _Desc_: a Property Descriptor, + _obj_: an Object, + _propertyKey_: a property key, + _propertyDesc_: a Property Descriptor, ): either a normal completion containing a Boolean or a throw completion

        - 1. Let _current_ be ? _O_.[[GetOwnProperty]](_P_). - 1. Let _extensible_ be ? IsExtensible(_O_). - 1. Return ValidateAndApplyPropertyDescriptor(_O_, _P_, _extensible_, _Desc_, _current_). + 1. Let _current_ be ? _obj_.[[GetOwnProperty]](_propertyKey_). + 1. Let _extensible_ be ? IsExtensible(_obj_). + 1. Return ValidateAndApplyPropertyDescriptor(_obj_, _propertyKey_, _extensible_, _propertyDesc_, _current_).

        IsCompatiblePropertyDescriptor ( - _Extensible_: a Boolean, - _Desc_: a Property Descriptor, - _Current_: a Property Descriptor or *undefined*, + _extensible_: a Boolean, + _propertyDesc_: a Property Descriptor, + _current_: a Property Descriptor or *undefined*, ): a Boolean

        - 1. Return ValidateAndApplyPropertyDescriptor(*undefined*, *""*, _Extensible_, _Desc_, _Current_). + 1. Return ValidateAndApplyPropertyDescriptor(*undefined*, *""*, _extensible_, _propertyDesc_, _current_).

        ValidateAndApplyPropertyDescriptor ( - _O_: an Object or *undefined*, - _P_: a property key, + _obj_: an Object or *undefined*, + _propertyKey_: a property key, _extensible_: a Boolean, - _Desc_: a Property Descriptor, + _propertyDesc_: a Property Descriptor, _current_: a Property Descriptor or *undefined*, ): a Boolean

        description
        -
        It returns *true* if and only if _Desc_ can be applied as the property of an object with specified _extensibility_ and current property _current_ while upholding invariants. When such application is possible and _O_ is not *undefined*, it is performed for the property named _P_ (which is created if necessary).
        +
        It returns *true* if and only if _propertyDesc_ can be applied as the property of an object with specified _extensibility_ and current property _current_ while upholding invariants. When such application is possible and _obj_ is not *undefined*, it is performed for the property named _propertyKey_ (which is created if necessary).
        - 1. Assert: _P_ is a property key. + 1. Assert: _propertyKey_ is a property key. 1. If _current_ is *undefined*, then 1. If _extensible_ is *false*, return *false*. - 1. If _O_ is *undefined*, return *true*. - 1. If IsAccessorDescriptor(_Desc_) is *true*, then - 1. Create an own accessor property named _P_ of object _O_ whose [[Get]], [[Set]], [[Enumerable]], and [[Configurable]] 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. If _obj_ is *undefined*, return *true*. + 1. If IsAccessorDescriptor(_propertyDesc_) is *true*, then + 1. Create an own accessor property named _propertyKey_ of object _obj_ whose [[Getter]], [[Setter]], [[Enumerable]], and [[Configurable]] attributes are set to the value of the corresponding field in _propertyDesc_ if _propertyDesc_ has that field, or to the attribute's default value otherwise. 1. Else, - 1. Create an own data property named _P_ of object _O_ whose [[Value]], [[Writable]], [[Enumerable]], and [[Configurable]] 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. Create an own data property named _propertyKey_ of object _obj_ whose [[Value]], [[Writable]], [[Enumerable]], and [[Configurable]] attributes are set to the value of the corresponding field in _propertyDesc_ if _propertyDesc_ has that field, or to the attribute's default value otherwise. 1. Return *true*. 1. Assert: _current_ is a fully populated Property Descriptor. - 1. If _Desc_ does not have any fields, return *true*. + 1. If _propertyDesc_ does not have any fields, return *true*. 1. If _current_.[[Configurable]] is *false*, then - 1. If _Desc_ has a [[Configurable]] field and _Desc_.[[Configurable]] is *true*, return *false*. - 1. If _Desc_ has an [[Enumerable]] field and _Desc_.[[Enumerable]] is not _current_.[[Enumerable]], return *false*. - 1. If IsGenericDescriptor(_Desc_) is *false* and IsAccessorDescriptor(_Desc_) is not IsAccessorDescriptor(_current_), return *false*. + 1. If _propertyDesc_ has a [[Configurable]] field and _propertyDesc_.[[Configurable]] is *true*, return *false*. + 1. If _propertyDesc_ has an [[Enumerable]] field and _propertyDesc_.[[Enumerable]] is not _current_.[[Enumerable]], return *false*. + 1. If IsGenericDescriptor(_propertyDesc_) is *false* and IsAccessorDescriptor(_propertyDesc_) is not IsAccessorDescriptor(_current_), return *false*. 1. If IsAccessorDescriptor(_current_) is *true*, then - 1. If _Desc_ has a [[Get]] field and SameValue(_Desc_.[[Get]], _current_.[[Get]]) is *false*, return *false*. - 1. If _Desc_ has a [[Set]] field and SameValue(_Desc_.[[Set]], _current_.[[Set]]) is *false*, return *false*. + 1. If _propertyDesc_ has a [[Getter]] field and SameValue(_propertyDesc_.[[Getter]], _current_.[[Getter]]) is *false*, return *false*. + 1. If _propertyDesc_ has a [[Setter]] field and SameValue(_propertyDesc_.[[Setter]], _current_.[[Setter]]) 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. 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. 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. 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. If _propertyDesc_ has a [[Writable]] field and _propertyDesc_.[[Writable]] is *true*, 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 _obj_ remains unmodified. + 1. If _propertyDesc_ has a [[Value]] field, return SameValue(_propertyDesc_.[[Value]], _current_.[[Value]]). + 1. If _obj_ is not *undefined*, then + 1. If IsDataDescriptor(_current_) is *true* and IsAccessorDescriptor(_propertyDesc_) is *true*, then + 1. If _propertyDesc_ has a [[Configurable]] field, let _configurable_ be _propertyDesc_.[[Configurable]]; else let _configurable_ be _current_.[[Configurable]]. + 1. If _propertyDesc_ has an [[Enumerable]] field, let _enumerable_ be _propertyDesc_.[[Enumerable]]; else let _enumerable_ be _current_.[[Enumerable]]. + 1. Replace the property named _propertyKey_ of object _obj_ with an accessor property whose [[Configurable]] and [[Enumerable]] attributes are set to _configurable_ and _enumerable_, respectively, and whose [[Getter]] and [[Setter]] attributes are set to the value of the corresponding field in _propertyDesc_ if _propertyDesc_ has that field, or to the attribute's default value otherwise. + 1. Else if IsAccessorDescriptor(_current_) is *true* and IsDataDescriptor(_propertyDesc_) is *true*, then + 1. If _propertyDesc_ has a [[Configurable]] field, let _configurable_ be _propertyDesc_.[[Configurable]]; else let _configurable_ be _current_.[[Configurable]]. + 1. If _propertyDesc_ has an [[Enumerable]] field, let _enumerable_ be _propertyDesc_.[[Enumerable]]; else let _enumerable_ be _current_.[[Enumerable]]. + 1. Replace the property named _propertyKey_ of object _obj_ 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 _propertyDesc_ if _propertyDesc_ 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 _fieldName_ of _propertyDesc_, set the attribute named _fieldName_ of the property named _propertyKey_ of object _obj_ to the value of _propertyDesc_'s _fieldName_ field. 1. Return *true*.
        @@ -12700,32 +13256,32 @@

        [[HasProperty]] ( - _P_: a property key, + _propertyKey_: a property key, ): either a normal completion containing a Boolean or a throw completion

        for
        -
        an ordinary object _O_
        +
        an ordinary object _obj_
        - 1. Return ? OrdinaryHasProperty(_O_, _P_). + 1. Return ? OrdinaryHasProperty(_obj_, _propertyKey_).

        OrdinaryHasProperty ( - _O_: an Object, - _P_: a property key, + _obj_: an Object, + _propertyKey_: a property key, ): either a normal completion containing a Boolean or a throw completion

        - 1. Let _hasOwn_ be ? _O_.[[GetOwnProperty]](_P_). + 1. Let _hasOwn_ be ? _obj_.[[GetOwnProperty]](_propertyKey_). 1. If _hasOwn_ is not *undefined*, return *true*. - 1. Let _parent_ be ? _O_.[[GetPrototypeOf]](). + 1. Let _parent_ be ? _obj_.[[GetPrototypeOf]](). 1. If _parent_ is not *null*, then - 1. Return ? _parent_.[[HasProperty]](_P_). + 1. Return ? _parent_.[[HasProperty]](_propertyKey_). 1. Return *false*.
        @@ -12734,41 +13290,41 @@

        [[Get]] ( - _P_: a property key, - _Receiver_: an ECMAScript language value, + _propertyKey_: a property key, + _receiver_: an ECMAScript language value, ): either a normal completion containing an ECMAScript language value or a throw completion

        for
        -
        an ordinary object _O_
        +
        an ordinary object _obj_
        - 1. Return ? OrdinaryGet(_O_, _P_, _Receiver_). + 1. Return ? OrdinaryGet(_obj_, _propertyKey_, _receiver_).

        OrdinaryGet ( - _O_: an Object, - _P_: a property key, - _Receiver_: an ECMAScript language value, + _obj_: an Object, + _propertyKey_: a property key, + _receiver_: an ECMAScript language value, ): either a normal completion containing an ECMAScript language value or a throw completion

        - 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_P_). - 1. If _desc_ is *undefined*, then - 1. Let _parent_ be ? _O_.[[GetPrototypeOf]](). + 1. Let _propertyDesc_ be ? _obj_.[[GetOwnProperty]](_propertyKey_). + 1. If _propertyDesc_ is *undefined*, then + 1. Let _parent_ be ? _obj_.[[GetPrototypeOf]](). 1. If _parent_ is *null*, return *undefined*. - 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]]. + 1. Return ? _parent_.[[Get]](_propertyKey_, _receiver_). + 1. If IsDataDescriptor(_propertyDesc_) is *true*, return _propertyDesc_.[[Value]]. + 1. Assert: IsAccessorDescriptor(_propertyDesc_) is *true*. + 1. Let _getter_ be _propertyDesc_.[[Getter]]. 1. If _getter_ is *undefined*, return *undefined*. - 1. Return ? Call(_getter_, _Receiver_). + 1. Return ? Call(_getter_, _receiver_).
        @@ -12776,44 +13332,44 @@

        [[Set]] ( - _P_: a property key, - _V_: an ECMAScript language value, - _Receiver_: an ECMAScript language value, + _propertyKey_: a property key, + _value_: an ECMAScript language value, + _receiver_: an ECMAScript language value, ): either a normal completion containing a Boolean or a throw completion

        for
        -
        an ordinary object _O_
        +
        an ordinary object _obj_
        - 1. Return ? OrdinarySet(_O_, _P_, _V_, _Receiver_). + 1. Return ? OrdinarySet(_obj_, _propertyKey_, _value_, _receiver_).

        OrdinarySet ( - _O_: an Object, - _P_: a property key, - _V_: an ECMAScript language value, - _Receiver_: an ECMAScript language value, + _obj_: an Object, + _propertyKey_: a property key, + _value_: an ECMAScript language value, + _receiver_: an ECMAScript language value, ): either a normal completion containing a Boolean or a throw completion

        - 1. Let _ownDesc_ be ? _O_.[[GetOwnProperty]](_P_). - 1. Return ? OrdinarySetWithOwnDescriptor(_O_, _P_, _V_, _Receiver_, _ownDesc_). + 1. Let _ownDesc_ be ? _obj_.[[GetOwnProperty]](_propertyKey_). + 1. Return ? OrdinarySetWithOwnDescriptor(_obj_, _propertyKey_, _value_, _receiver_, _ownDesc_).

        OrdinarySetWithOwnDescriptor ( - _O_: an Object, - _P_: a property key, - _V_: an ECMAScript language value, - _Receiver_: an ECMAScript language value, + _obj_: an Object, + _propertyKey_: a property key, + _value_: an ECMAScript language value, + _receiver_: an ECMAScript language value, _ownDesc_: a Property Descriptor or *undefined*, ): either a normal completion containing a Boolean or a throw completion

        @@ -12822,27 +13378,24 @@

        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 ? _obj_.[[GetPrototypeOf]](). + 1. If _parent_ is not *null*, return ? _parent_.[[Set]](_propertyKey_, _value_, _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. Assert: _Receiver_ does not currently have a property _P_. - 1. Return ? CreateDataProperty(_Receiver_, _P_, _V_). + 1. If _receiver_ is not an Object, return *false*. + 1. Let _existingDesc_ be ? _receiver_.[[GetOwnProperty]](_propertyKey_). + 1. If _existingDesc_ is *undefined*, then + 1. Assert: _receiver_ does not currently have a property _propertyKey_. + 1. Return ? CreateDataProperty(_receiver_, _propertyKey_, _value_). + 1. If IsAccessorDescriptor(_existingDesc_) is *true*, return *false*. + 1. If _existingDesc_.[[Writable]] is *false*, return *false*. + 1. Let _valueDesc_ be the PropertyDescriptor { [[Value]]: _value_ }. + 1. Return ? _receiver_.[[DefineOwnProperty]](_propertyKey_, _valueDesc_). 1. Assert: IsAccessorDescriptor(_ownDesc_) is *true*. - 1. Let _setter_ be _ownDesc_.[[Set]]. + 1. Let _setter_ be _ownDesc_.[[Setter]]. 1. If _setter_ is *undefined*, return *false*. - 1. Perform ? Call(_setter_, _Receiver_, « _V_ »). + 1. Perform ? Call(_setter_, _receiver_, « _value_ »). 1. Return *true*. @@ -12851,31 +13404,31 @@

        [[Delete]] ( - _P_: a property key, + _propertyKey_: a property key, ): either a normal completion containing a Boolean or a throw completion

        for
        -
        an ordinary object _O_
        +
        an ordinary object _obj_
        - 1. Return ? OrdinaryDelete(_O_, _P_). + 1. Return ? OrdinaryDelete(_obj_, _propertyKey_).

        OrdinaryDelete ( - _O_: an Object, - _P_: a property key, + _obj_: an Object, + _propertyKey_: a property key, ): either a normal completion containing a Boolean or a throw completion

        - 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_. + 1. Let _propertyDesc_ be ? _obj_.[[GetOwnProperty]](_propertyKey_). + 1. If _propertyDesc_ is *undefined*, return *true*. + 1. If _propertyDesc_.[[Configurable]] is *true*, then + 1. Remove the own property with name _propertyKey_ from _obj_. 1. Return *true*. 1. Return *false*. @@ -12886,16 +13439,16 @@

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

        for
        -
        an ordinary object _O_
        +
        an ordinary object _obj_
        - 1. Return OrdinaryOwnPropertyKeys(_O_). + 1. Return OrdinaryOwnPropertyKeys(_obj_).

        OrdinaryOwnPropertyKeys ( - _O_: an Object, + _obj_: an Object, ): a List of property keys

        @@ -12903,12 +13456,12 @@

        1. Let _keys_ be a new empty List. - 1. For each own property key _P_ of _O_ such that _P_ is an array index, in ascending numeric index order, do - 1. Append _P_ to _keys_. - 1. For each own property key _P_ of _O_ such that _P_ is a String and _P_ is not an array index, in ascending chronological order of property creation, do - 1. Append _P_ to _keys_. - 1. For each own property key _P_ of _O_ such that _P_ is a Symbol, in ascending chronological order of property creation, do - 1. Append _P_ to _keys_. + 1. For each own property key _propertyKey_ of _obj_ such that _propertyKey_ is an array index, in ascending numeric index order, do + 1. Append _propertyKey_ to _keys_. + 1. For each own property key _propertyKey_ of _obj_ such that _propertyKey_ is a String and _propertyKey_ is not an array index, in ascending chronological order of property creation, do + 1. Append _propertyKey_ to _keys_. + 1. For each own property key _propertyKey_ of _obj_ such that _propertyKey_ is a Symbol, in ascending chronological order of property creation, do + 1. Append _propertyKey_ to _keys_. 1. Return _keys_. @@ -12928,9 +13481,9 @@

        1. Let _internalSlotsList_ be « [[Prototype]], [[Extensible]] ». 1. If _additionalInternalSlotsList_ is present, set _internalSlotsList_ to the list-concatenation of _internalSlotsList_ and _additionalInternalSlotsList_. - 1. Let _O_ be MakeBasicObject(_internalSlotsList_). - 1. Set _O_.[[Prototype]] to _proto_. - 1. Return _O_. + 1. Let _obj_ be MakeBasicObject(_internalSlotsList_). + 1. Set _obj_.[[Prototype]] to _proto_. + 1. Return _obj_. @@ -12941,7 +13494,7 @@

        OrdinaryCreateFromConstructor ( - _constructor_: a constructor, + _ctor_: 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 @@ -12952,17 +13505,17 @@

        1. Assert: _intrinsicDefaultProto_ is this specification's name of an intrinsic object. The corresponding object must be an intrinsic that is intended to be used as the [[Prototype]] value of an object. - 1. Let _proto_ be ? GetPrototypeFromConstructor(_constructor_, _intrinsicDefaultProto_). - 1. If _internalSlotsList_ is present, let _slotsList_ be _internalSlotsList_. - 1. Else, let _slotsList_ be a new empty List. - 1. Return OrdinaryObjectCreate(_proto_, _slotsList_). + 1. Let _proto_ be ? GetPrototypeFromConstructor(_ctor_, _intrinsicDefaultProto_). + 1. If _internalSlotsList_ is present, let _slots_ be _internalSlotsList_. + 1. Else, let _slots_ be a new empty List. + 1. Return OrdinaryObjectCreate(_proto_, _slots_).

        GetPrototypeFromConstructor ( - _constructor_: a function object, + _ctor_: a function object, _intrinsicDefaultProto_: a String, ): either a normal completion containing an Object or a throw completion

        @@ -12972,31 +13525,31 @@

        1. Assert: _intrinsicDefaultProto_ is this specification's name of an intrinsic object. The corresponding object must be an intrinsic that is intended to be used as the [[Prototype]] value of an object. - 1. Let _proto_ be ? Get(_constructor_, *"prototype"*). + 1. Let _proto_ be ? Get(_ctor_, *"prototype"*). 1. If _proto_ is not an Object, then - 1. Let _realm_ be ? GetFunctionRealm(_constructor_). + 1. Let _realm_ be ? GetFunctionRealm(_ctor_). 1. Set _proto_ to _realm_'s intrinsic object named _intrinsicDefaultProto_. 1. Return _proto_. -

        If _constructor_ does not supply a [[Prototype]] value, the default value that is used is obtained from the realm of the _constructor_ function rather than from the running execution context.

        +

        If _ctor_ does not supply a [[Prototype]] value, the default value that is used is obtained from the realm of the _ctor_ function rather than from the running execution context.

        RequireInternalSlot ( - _O_: an ECMAScript language value, + _obj_: an ECMAScript language value, _internalSlot_: an internal slot name, ): either a normal completion containing ~unused~ or a throw completion

        description
        -
        It throws an exception unless _O_ is an Object and has the given internal slot.
        +
        It throws an exception unless _obj_ is an Object and has the given internal slot.
        - 1. If _O_ is not an Object, throw a *TypeError* exception. - 1. If _O_ does not have an _internalSlot_ internal slot, throw a *TypeError* exception. + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. If _obj_ does not have an _internalSlot_ internal slot, throw a *TypeError* exception. 1. Return ~unused~.
        @@ -13008,17 +13561,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]] @@ -13123,7 +13678,7 @@

        ECMAScript Function Objects

        [[HomeObject]]
        - an Object + an Object or *undefined* If the function uses `super`, this is the object whose [[GetPrototypeOf]] provides the object where `super` property lookups begin. @@ -13191,29 +13746,29 @@

        ECMAScript Function Objects

        [[Call]] ( - _thisArgument_: an ECMAScript language value, - _argumentsList_: a List of ECMAScript language values, + _thisArg_: an ECMAScript language value, + _argList_: a List of ECMAScript language values, ): either a normal completion containing an ECMAScript language value or a throw completion

        for
        -
        an ECMAScript function object _F_
        +
        an ECMAScript function object _func_
        1. Let _callerContext_ be the running execution context. - 1. Let _calleeContext_ be PrepareForOrdinaryCall(_F_, *undefined*). + 1. Let _calleeContext_ be PrepareForOrdinaryCall(_func_, *undefined*). 1. Assert: _calleeContext_ is now the running execution context. - 1. If _F_.[[IsClassConstructor]] is *true*, then + 1. If _func_.[[IsClassConstructor]] is *true*, then 1. Let _error_ be a newly created *TypeError* object. - 1. NOTE: _error_ is created in _calleeContext_ with _F_'s associated Realm Record. + 1. NOTE: _error_ is created in _calleeContext_ with _func_'s associated Realm Record. 1. Remove _calleeContext_ from the execution context stack and restore _callerContext_ as the running execution context. - 1. Return ThrowCompletion(_error_). - 1. Perform OrdinaryCallBindThis(_F_, _calleeContext_, _thisArgument_). - 1. Let _result_ be Completion(OrdinaryCallEvaluateBody(_F_, _argumentsList_)). + 1. Throw _error_. + 1. Perform OrdinaryCallBindThis(_func_, _calleeContext_, _thisArg_). + 1. Let _result_ be Completion(OrdinaryCallEvaluateBody(_func_, _argList_)). 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.

        @@ -13222,7 +13777,7 @@

        PrepareForOrdinaryCall ( - _F_: an ECMAScript function object, + _func_: an ECMAScript function object, _newTarget_: an Object or *undefined*, ): an execution context

        @@ -13231,14 +13786,14 @@

        1. Let _callerContext_ be the running execution context. 1. Let _calleeContext_ be a new ECMAScript code execution context. - 1. Set the Function of _calleeContext_ to _F_. - 1. Let _calleeRealm_ be _F_.[[Realm]]. + 1. Set the Function of _calleeContext_ to _func_. + 1. Let _calleeRealm_ be _func_.[[Realm]]. 1. Set the Realm of _calleeContext_ to _calleeRealm_. - 1. Set the ScriptOrModule of _calleeContext_ to _F_.[[ScriptOrModule]]. - 1. Let _localEnv_ be NewFunctionEnvironment(_F_, _newTarget_). + 1. Set the ScriptOrModule of _calleeContext_ to _func_.[[ScriptOrModule]]. + 1. Let _localEnv_ be NewFunctionEnvironment(_func_, _newTarget_). 1. Set the LexicalEnvironment of _calleeContext_ to _localEnv_. 1. Set the VariableEnvironment of _calleeContext_ to _localEnv_. - 1. Set the PrivateEnvironment of _calleeContext_ to _F_.[[PrivateEnvironment]]. + 1. Set the PrivateEnvironment of _calleeContext_ to _func_.[[PrivateEnvironment]]. 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. NOTE: Any exception objects produced after this point are associated with _calleeRealm_. @@ -13249,31 +13804,31 @@

        OrdinaryCallBindThis ( - _F_: an ECMAScript function object, + _func_: an ECMAScript function object, _calleeContext_: an execution context, - _thisArgument_: an ECMAScript language value, + _thisArg_: an ECMAScript language value, ): ~unused~

        - 1. Let _thisMode_ be _F_.[[ThisMode]]. + 1. Let _thisMode_ be _func_.[[ThisMode]]. 1. If _thisMode_ is ~lexical~, return ~unused~. - 1. Let _calleeRealm_ be _F_.[[Realm]]. + 1. Let _calleeRealm_ be _func_.[[Realm]]. 1. Let _localEnv_ be the LexicalEnvironment of _calleeContext_. 1. If _thisMode_ is ~strict~, then - 1. Let _thisValue_ be _thisArgument_. + 1. Let _thisValue_ be _thisArg_. 1. Else, - 1. If _thisArgument_ is either *undefined* or *null*, then + 1. If _thisArg_ is either *undefined* or *null*, then 1. Let _globalEnv_ be _calleeRealm_.[[GlobalEnv]]. 1. Assert: _globalEnv_ is a Global Environment Record. 1. Let _thisValue_ be _globalEnv_.[[GlobalThisValue]]. 1. Else, - 1. Let _thisValue_ be ! ToObject(_thisArgument_). + 1. Let _thisValue_ be ! ToObject(_thisArg_). 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~.
        @@ -13281,55 +13836,55 @@

        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 + _func_: an ECMAScript function object, + _argList_: a List of ECMAScript language values, + ): a return completion or a throw completion

        FunctionBody : FunctionStatementList - 1. Return ? EvaluateFunctionBody of |FunctionBody| with arguments _functionObject_ and _argumentsList_. + 1. Return ? EvaluateFunctionBody of |FunctionBody| with arguments _func_ and _argList_. ConciseBody : ExpressionBody - 1. Return ? EvaluateConciseBody of |ConciseBody| with arguments _functionObject_ and _argumentsList_. + 1. Return ? EvaluateConciseBody of |ConciseBody| with arguments _func_ and _argList_. GeneratorBody : FunctionBody - 1. Return ? EvaluateGeneratorBody of |GeneratorBody| with arguments _functionObject_ and _argumentsList_. + 1. Return ? EvaluateGeneratorBody of |GeneratorBody| with arguments _func_ and _argList_. AsyncGeneratorBody : FunctionBody - 1. Return ? EvaluateAsyncGeneratorBody of |AsyncGeneratorBody| with arguments _functionObject_ and _argumentsList_. + 1. Return ? EvaluateAsyncGeneratorBody of |AsyncGeneratorBody| with arguments _func_ and _argList_. AsyncFunctionBody : FunctionBody - 1. Return ? EvaluateAsyncFunctionBody of |AsyncFunctionBody| with arguments _functionObject_ and _argumentsList_. + 1. Return ? EvaluateAsyncFunctionBody of |AsyncFunctionBody| with arguments _func_ and _argList_. AsyncConciseBody : ExpressionBody - 1. Return ? EvaluateAsyncConciseBody of |AsyncConciseBody| with arguments _functionObject_ and _argumentsList_. + 1. Return ? EvaluateAsyncConciseBody of |AsyncConciseBody| with arguments _func_ and _argList_. Initializer : `=` AssignmentExpression - 1. Assert: _argumentsList_ is empty. - 1. Assert: _functionObject_.[[ClassFieldInitializerName]] is not ~empty~. + 1. Assert: _argList_ is empty. + 1. Assert: _func_.[[ClassFieldInitializerName]] is not ~empty~. 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true*, then - 1. Let _value_ be ? NamedEvaluation of |Initializer| with argument _functionObject_.[[ClassFieldInitializerName]]. + 1. Let _value_ be ? NamedEvaluation of |Initializer| with argument _func_.[[ClassFieldInitializerName]]. 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.

        @@ -13338,22 +13893,22 @@

        ClassStaticBlockBody : ClassStaticBlockStatementList - 1. Assert: _argumentsList_ is empty. - 1. Return ? EvaluateClassStaticBlockBody of |ClassStaticBlockBody| with argument _functionObject_. + 1. Assert: _argList_ is empty. + 1. Return ? EvaluateClassStaticBlockBody of |ClassStaticBlockBody| with argument _func_.

        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 + _func_: an ECMAScript function object, + _argList_: a List of ECMAScript language values, + ): a return completion or a throw completion

        - 1. Return ? EvaluateBody of _F_.[[ECMAScriptCode]] with arguments _F_ and _argumentsList_. + 1. Return ? EvaluateBody of _func_.[[ECMAScriptCode]] with arguments _func_ and _argList_.
        @@ -13361,37 +13916,37 @@

        [[Construct]] ( - _argumentsList_: a List of ECMAScript language values, + _argList_: a List of ECMAScript language values, _newTarget_: a constructor, ): either a normal completion containing an Object or a throw completion

        for
        -
        an ECMAScript function object _F_
        +
        an ECMAScript function object _func_
        1. Let _callerContext_ be the running execution context. - 1. Let _kind_ be _F_.[[ConstructorKind]]. + 1. Let _kind_ be _func_.[[ConstructorKind]]. 1. If _kind_ is ~base~, then - 1. Let _thisArgument_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%Object.prototype%"*). - 1. Let _calleeContext_ be PrepareForOrdinaryCall(_F_, _newTarget_). + 1. Let _thisArg_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%Object.prototype%"*). + 1. Let _calleeContext_ be PrepareForOrdinaryCall(_func_, _newTarget_). 1. Assert: _calleeContext_ is now the running execution context. 1. If _kind_ is ~base~, then - 1. Perform OrdinaryCallBindThis(_F_, _calleeContext_, _thisArgument_). - 1. Let _initializeResult_ be Completion(InitializeInstanceElements(_thisArgument_, _F_)). + 1. Perform OrdinaryCallBindThis(_func_, _calleeContext_, _thisArg_). + 1. Let _initializeResult_ be Completion(InitializeInstanceElements(_thisArg_, _func_)). 1. If _initializeResult_ is an abrupt completion, then 1. Remove _calleeContext_ from the execution context stack and restore _callerContext_ as the running execution context. 1. Return ? _initializeResult_. - 1. Let _constructorEnv_ be the LexicalEnvironment of _calleeContext_. - 1. Let _result_ be Completion(OrdinaryCallEvaluateBody(_F_, _argumentsList_)). + 1. Let _ctorEnv_ be the LexicalEnvironment of _calleeContext_. + 1. Let _result_ be Completion(OrdinaryCallEvaluateBody(_func_, _argList_)). 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. Let _thisBinding_ be ? _constructorEnv_.GetThisBinding(). + 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 _thisArg_. + 1. If _result_.[[Value]] is not *undefined*, throw a *TypeError* exception. + 1. Let _thisBinding_ be ? _ctorEnv_.GetThisBinding(). 1. Assert: _thisBinding_ is an Object. 1. Return _thisBinding_. @@ -13400,12 +13955,12 @@

        OrdinaryFunctionCreate ( - _functionPrototype_: an Object, + _proto_: an Object, _sourceText_: a sequence of Unicode code points, - _ParameterList_: a Parse Node, - _Body_: a Parse Node, + _paramList_: a Parse Node, + _body_: a Parse Node, _thisMode_: ~lexical-this~ or ~non-lexical-this~, - _env_: an Environment Record, + _envRecord_: an Environment Record, _privateEnv_: a PrivateEnvironment Record or *null*, ): an ECMAScript function object

        @@ -13415,35 +13970,35 @@

        1. Let _internalSlotsList_ be the internal slots listed in . - 1. Let _F_ be OrdinaryObjectCreate(_functionPrototype_, _internalSlotsList_). - 1. Set _F_.[[Call]] to the definition specified in . - 1. Set _F_.[[SourceText]] to _sourceText_. - 1. Set _F_.[[FormalParameters]] to _ParameterList_. - 1. Set _F_.[[ECMAScriptCode]] to _Body_. - 1. Let _Strict_ be IsStrict(_Body_). - 1. Set _F_.[[Strict]] to _Strict_. - 1. If _thisMode_ is ~lexical-this~, set _F_.[[ThisMode]] to ~lexical~. - 1. Else if _Strict_ is *true*, set _F_.[[ThisMode]] to ~strict~. - 1. Else, set _F_.[[ThisMode]] to ~global~. - 1. Set _F_.[[IsClassConstructor]] to *false*. - 1. Set _F_.[[Environment]] to _env_. - 1. Set _F_.[[PrivateEnvironment]] to _privateEnv_. - 1. Set _F_.[[ScriptOrModule]] to GetActiveScriptOrModule(). - 1. Set _F_.[[Realm]] to the current Realm Record. - 1. Set _F_.[[HomeObject]] to *undefined*. - 1. Set _F_.[[Fields]] to a new empty List. - 1. Set _F_.[[PrivateMethods]] to a new empty List. - 1. Set _F_.[[ClassFieldInitializerName]] to ~empty~. - 1. Let _len_ be the ExpectedArgumentCount of _ParameterList_. - 1. Perform SetFunctionLength(_F_, _len_). - 1. Return _F_. + 1. Let _func_ be OrdinaryObjectCreate(_proto_, _internalSlotsList_). + 1. Set _func_.[[Call]] to the definition specified in . + 1. Set _func_.[[SourceText]] to _sourceText_. + 1. Set _func_.[[FormalParameters]] to _paramList_. + 1. Set _func_.[[ECMAScriptCode]] to _body_. + 1. Let _strict_ be IsStrict(_body_). + 1. Set _func_.[[Strict]] to _strict_. + 1. If _thisMode_ is ~lexical-this~, set _func_.[[ThisMode]] to ~lexical~. + 1. Else if _strict_ is *true*, set _func_.[[ThisMode]] to ~strict~. + 1. Else, set _func_.[[ThisMode]] to ~global~. + 1. Set _func_.[[IsClassConstructor]] to *false*. + 1. Set _func_.[[Environment]] to _envRecord_. + 1. Set _func_.[[PrivateEnvironment]] to _privateEnv_. + 1. Set _func_.[[ScriptOrModule]] to GetActiveScriptOrModule(). + 1. Set _func_.[[Realm]] to the current Realm Record. + 1. Set _func_.[[HomeObject]] to *undefined*. + 1. Set _func_.[[Fields]] to a new empty List. + 1. Set _func_.[[PrivateMethods]] to a new empty List. + 1. Set _func_.[[ClassFieldInitializerName]] to ~empty~. + 1. Let _length_ be the ExpectedArgumentCount of _paramList_. + 1. Perform SetFunctionLength(_func_, _length_). + 1. Return _func_.

        AddRestrictedFunctionProperties ( - _F_: a function object, + _func_: a function object, _realm_: a Realm Record, ): ~unused~

        @@ -13452,12 +14007,12 @@

        1. Assert: _realm_.[[Intrinsics]].[[%ThrowTypeError%]] exists and has been initialized. 1. Let _thrower_ be _realm_.[[Intrinsics]].[[%ThrowTypeError%]]. - 1. Perform ! DefinePropertyOrThrow(_F_, *"caller"*, PropertyDescriptor { [[Get]]: _thrower_, [[Set]]: _thrower_, [[Enumerable]]: *false*, [[Configurable]]: *true* }). - 1. Perform ! DefinePropertyOrThrow(_F_, *"arguments"*, PropertyDescriptor { [[Get]]: _thrower_, [[Set]]: _thrower_, [[Enumerable]]: *false*, [[Configurable]]: *true* }). + 1. Perform ! DefinePropertyOrThrow(_func_, *"caller"*, PropertyDescriptor { [[Getter]]: _thrower_, [[Setter]]: _thrower_, [[Enumerable]]: *false*, [[Configurable]]: *true* }). + 1. Perform ! DefinePropertyOrThrow(_func_, *"arguments"*, PropertyDescriptor { [[Getter]]: _thrower_, [[Setter]]: _thrower_, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 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.

        @@ -13474,28 +14029,28 @@

        %ThrowTypeError% ( )

        MakeConstructor ( - _F_: an ECMAScript function object or a built-in function object, - optional _writablePrototype_: a Boolean, - optional _prototype_: an Object, + _func_: an ECMAScript function object or a built-in function object, + optional _writableProto_: a Boolean, + optional _proto_: an Object, ): ~unused~

        description
        -
        It converts _F_ into a constructor.
        +
        It converts _func_ into a constructor.
        - 1. If _F_ is an ECMAScript function object, then - 1. Assert: IsConstructor(_F_) is *false*. - 1. Assert: _F_ is an extensible object that does not have a *"prototype"* own property. - 1. Set _F_.[[Construct]] to the definition specified in . + 1. If _func_ is an ECMAScript function object, then + 1. Assert: IsConstructor(_func_) is *false*. + 1. Assert: _func_ is an extensible object that does not have a *"prototype"* own property. + 1. Set _func_.[[Construct]] to the definition specified in . 1. Else, - 1. Set _F_.[[Construct]] to the definition specified in . - 1. Set _F_.[[ConstructorKind]] to ~base~. - 1. If _writablePrototype_ is not present, set _writablePrototype_ to *true*. - 1. If _prototype_ is not present, then - 1. Set _prototype_ to OrdinaryObjectCreate(%Object.prototype%). - 1. Perform ! DefinePropertyOrThrow(_prototype_, *"constructor"*, PropertyDescriptor { [[Value]]: _F_, [[Writable]]: _writablePrototype_, [[Enumerable]]: *false*, [[Configurable]]: *true* }). - 1. Perform ! DefinePropertyOrThrow(_F_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: _writablePrototype_, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Set _func_.[[Construct]] to the definition specified in . + 1. Set _func_.[[ConstructorKind]] to ~base~. + 1. If _writableProto_ is not present, set _writableProto_ to *true*. + 1. If _proto_ is not present, then + 1. Set _proto_ to OrdinaryObjectCreate(%Object.prototype%). + 1. Perform ! DefinePropertyOrThrow(_proto_, *"constructor"*, PropertyDescriptor { [[Value]]: _func_, [[Writable]]: _writableProto_, [[Enumerable]]: *false*, [[Configurable]]: *true* }). + 1. Perform ! DefinePropertyOrThrow(_func_, *"prototype"*, PropertyDescriptor { [[Value]]: _proto_, [[Writable]]: _writableProto_, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Return ~unused~.
        @@ -13503,14 +14058,14 @@

        MakeClassConstructor ( - _F_: an ECMAScript function object, + _func_: an ECMAScript function object, ): ~unused~

        - 1. Assert: _F_.[[IsClassConstructor]] is *false*. - 1. Set _F_.[[IsClassConstructor]] to *true*. + 1. Assert: _func_.[[IsClassConstructor]] is *false*. + 1. Set _func_.[[IsClassConstructor]] to *true*. 1. Return ~unused~.
        @@ -13518,16 +14073,17 @@

        MakeMethod ( - _F_: an ECMAScript function object, - _homeObject_: an Object, + _func_: an ECMAScript function object, + _homeObj_: an Object, ): ~unused~

        description
        -
        It configures _F_ as a method.
        +
        It configures _func_ as a method.
        - 1. Set _F_.[[HomeObject]] to _homeObject_. + 1. Assert: _homeObj_ is an ordinary object. + 1. Set _func_.[[HomeObject]] to _homeObj_. 1. Return ~unused~.
        @@ -13535,8 +14091,8 @@

        DefineMethodProperty ( - _homeObject_: an Object, - _key_: a property key or Private Name, + _homeObj_: an Object, + _name_: a property key or Private Name, _closure_: a function object, _enumerable_: a Boolean, ): either a normal completion containing either a PrivateElement or ~unused~, or an abrupt completion @@ -13544,44 +14100,44 @@

        - 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. Assert: _homeObj_ is an ordinary, extensible object. + 1. If _name_ is a Private Name, return PrivateElement { [[Key]]: _name_, [[Kind]]: ~method~, [[Value]]: _closure_ }. + 1. Let _propertyDesc_ be the PropertyDescriptor { [[Value]]: _closure_, [[Writable]]: *true*, [[Enumerable]]: _enumerable_, [[Configurable]]: *true* }. + 1. Perform ? DefinePropertyOrThrow(_homeObj_, _name_, _propertyDesc_). + 1. NOTE: DefinePropertyOrThrow only returns an abrupt completion when attempting to define a class static method whose _name_ is *"prototype"*. + 1. Return ~unused~.

        SetFunctionName ( - _F_: a function object, + _func_: a function object, _name_: a property key or Private Name, optional _prefix_: a String, ): ~unused~

        description
        -
        It adds a *"name"* property to _F_.
        +
        It adds a *"name"* property to _func_.
        - 1. Assert: _F_ is an extensible object that does not have a *"name"* own property. + 1. Assert: _func_ 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 1. Set _name_ to _name_.[[Description]]. - 1. If _F_ has an [[InitialName]] internal slot, then - 1. Set _F_.[[InitialName]] to _name_. + 1. If _func_ has an [[InitialName]] internal slot, then + 1. Set _func_.[[InitialName]] to _name_. 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. Optionally, set _F_.[[InitialName]] to _name_. - 1. Perform ! DefinePropertyOrThrow(_F_, *"name"*, PropertyDescriptor { [[Value]]: _name_, [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). + 1. Let _prefixedName_ be the string-concatenation of _prefix_, the code unit 0x0020 (SPACE), and _name_. + 1. If _func_ 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. Set _func_.[[InitialName]] to an implementation-defined choice of either _name_ or _prefixedName_. + 1. Set _name_ to _prefixedName_. + 1. Perform ! DefinePropertyOrThrow(_func_, *"name"*, PropertyDescriptor { [[Value]]: _name_, [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 1. Return ~unused~.
        @@ -13589,27 +14145,27 @@

        SetFunctionLength ( - _F_: a function object, + _func_: a function object, _length_: a non-negative integer or +∞, ): ~unused~

        description
        -
        It adds a *"length"* property to _F_.
        +
        It adds a *"length"* property to _func_.
        - 1. Assert: _F_ is an extensible object that does not have a *"length"* own property. - 1. Perform ! DefinePropertyOrThrow(_F_, *"length"*, PropertyDescriptor { [[Value]]: 𝔽(_length_), [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). + 1. Assert: _func_ is an extensible object that does not have a *"length"* own property. + 1. Perform ! DefinePropertyOrThrow(_func_, *"length"*, PropertyDescriptor { [[Value]]: 𝔽(_length_), [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 1. Return ~unused~.
        - +

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

        description
        @@ -13619,127 +14175,135 @@

        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. Let _simpleParameterList_ be IsSimpleParameterList of _formals_. - 1. Let _hasParameterExpressions_ be ContainsExpression of _formals_. - 1. Let _varNames_ be the VarDeclaredNames of _code_. - 1. Let _varDeclarations_ be the VarScopedDeclarations of _code_. + 1. Let _paramNames_ be the BoundNames of _formals_. + 1. If _paramNames_ has any duplicate entries, let _hasDuplicates_ be *true*; else let _hasDuplicates_ be *false*. + 1. Let _simpleParamList_ be IsSimpleParameterList of _formals_. + 1. Let _hasParamExprs_ be ContainsExpression of _formals_. + 1. Let _variableNames_ be the VarDeclaredNames of _code_. + 1. Let _variableDecls_ be the VarScopedDeclarations of _code_. 1. Let _lexicalNames_ be the LexicallyDeclaredNames of _code_. - 1. Let _functionNames_ be a new empty List. - 1. Let _functionsToInitialize_ be a new empty List. - 1. For each element _d_ of _varDeclarations_, in reverse List order, do - 1. If _d_ is neither a |VariableDeclaration| nor a |ForBinding| nor a |BindingIdentifier|, then - 1. Assert: _d_ is either a |FunctionDeclaration|, a |GeneratorDeclaration|, an |AsyncFunctionDeclaration|, or an |AsyncGeneratorDeclaration|. - 1. Let _fn_ be the sole element of the BoundNames of _d_. - 1. If _functionNames_ does not contain _fn_, then - 1. Insert _fn_ as the first element of _functionNames_. + 1. Let _funcNames_ be a new empty List. + 1. Let _funcsToInitialize_ be a new empty List. + 1. For each element _variableDecl_ of _variableDecls_, in reverse List order, do + 1. If _variableDecl_ is neither a |VariableDeclaration| nor a |ForBinding| nor a |BindingIdentifier|, then + 1. Assert: _variableDecl_ is either a |FunctionDeclaration|, a |GeneratorDeclaration|, an |AsyncFunctionDeclaration|, or an |AsyncGeneratorDeclaration|. + 1. Let _funcName_ be the sole element of the BoundNames of _variableDecl_. + 1. If _funcNames_ does not contain _funcName_, then + 1. Insert _funcName_ as the first element of _funcNames_. 1. NOTE: If there are multiple function declarations for the same name, the last declaration is used. - 1. Insert _d_ as the first element of _functionsToInitialize_. - 1. Let _argumentsObjectNeeded_ be *true*. + 1. Insert _variableDecl_ as the first element of _funcsToInitialize_. + 1. Let _argumentsObjNeeded_ be *true*. 1. If _func_.[[ThisMode]] is ~lexical~, then 1. NOTE: Arrow functions never have an arguments object. - 1. Set _argumentsObjectNeeded_ to *false*. - 1. Else if _parameterNames_ contains *"arguments"*, then - 1. Set _argumentsObjectNeeded_ to *false*. - 1. Else if _hasParameterExpressions_ is *false*, then - 1. If _functionNames_ contains *"arguments"* or _lexicalNames_ contains *"arguments"*, then - 1. Set _argumentsObjectNeeded_ to *false*. - 1. If _strict_ is *true* or _hasParameterExpressions_ is *false*, then + 1. Set _argumentsObjNeeded_ to *false*. + 1. Else if _paramNames_ contains *"arguments"*, then + 1. Set _argumentsObjNeeded_ to *false*. + 1. Else if _hasParamExprs_ is *false*, then + 1. If _funcNames_ contains *"arguments"* or _lexicalNames_ contains *"arguments"*, then + 1. Set _argumentsObjNeeded_ to *false*. + 1. If _strict_ is *true* or _hasParamExprs_ is *false*, then 1. NOTE: Only a single Environment Record is needed for the parameters, since calls to `eval` in strict mode code cannot create new bindings which are visible outside of the `eval`. - 1. Let _env_ be the LexicalEnvironment of _calleeContext_. + 1. Let _envRecord_ be the LexicalEnvironment of _calleeContext_. 1. Else, 1. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared. 1. Let _calleeEnv_ be the LexicalEnvironment of _calleeContext_. - 1. Let _env_ be NewDeclarativeEnvironment(_calleeEnv_). + 1. Let _envRecord_ be NewDeclarativeEnvironment(_calleeEnv_). 1. Assert: The VariableEnvironment of _calleeContext_ and _calleeEnv_ are the same Environment Record. - 1. Set the LexicalEnvironment of _calleeContext_ to _env_. - 1. For each String _paramName_ of _parameterNames_, do - 1. Let _alreadyDeclared_ be ! _env_.HasBinding(_paramName_). + 1. Set the LexicalEnvironment of _calleeContext_ to _envRecord_. + 1. For each String _paramName_ of _paramNames_, do + 1. Let _alreadyDeclared_ be ! _envRecord_.HasBinding(_paramName_). 1. NOTE: Early errors ensure that duplicate parameter names can only occur in non-strict functions that do not have parameter default values or rest parameters. 1. If _alreadyDeclared_ is *false*, then - 1. Perform ! _env_.CreateMutableBinding(_paramName_, *false*). + 1. Perform ! _envRecord_.CreateMutableBinding(_paramName_, *false*). 1. If _hasDuplicates_ is *true*, then - 1. Perform ! _env_.InitializeBinding(_paramName_, *undefined*). - 1. If _argumentsObjectNeeded_ is *true*, then - 1. If _strict_ is *true* or _simpleParameterList_ is *false*, then - 1. Let _ao_ be CreateUnmappedArgumentsObject(_argumentsList_). + 1. Perform ! _envRecord_.InitializeBinding(_paramName_, *undefined*). + 1. If _argumentsObjNeeded_ is *true*, then + 1. If _strict_ is *true* or _simpleParamList_ is *false*, then + 1. Let _argumentsObj_ be CreateUnmappedArgumentsObject(_argList_). 1. Else, 1. NOTE: A mapped argument object is only provided for non-strict functions that don't have a rest parameter, any parameter default value initializers, or any destructured parameters. - 1. Let _ao_ be CreateMappedArgumentsObject(_func_, _formals_, _argumentsList_, _env_). + 1. Let _argumentsObj_ be CreateMappedArgumentsObject(_func_, _formals_, _argList_, _envRecord_). 1. If _strict_ is *true*, then - 1. Perform ! _env_.CreateImmutableBinding(*"arguments"*, *false*). + 1. Perform ! _envRecord_.CreateImmutableBinding(*"arguments"*, *false*). 1. NOTE: In strict mode code early errors prevent attempting to assign to this binding, so its mutability is not observable. 1. Else, - 1. Perform ! _env_.CreateMutableBinding(*"arguments"*, *false*). - 1. Perform ! _env_.InitializeBinding(*"arguments"*, _ao_). - 1. Let _parameterBindings_ be the list-concatenation of _parameterNames_ and « *"arguments"* ». + 1. Perform ! _envRecord_.CreateMutableBinding(*"arguments"*, *false*). + 1. Perform ! _envRecord_.InitializeBinding(*"arguments"*, _argumentsObj_). + 1. Let _paramBindings_ be the list-concatenation of _paramNames_ and « *"arguments"* ». 1. Else, - 1. Let _parameterBindings_ be _parameterNames_. - 1. Let _iteratorRecord_ be CreateListIteratorRecord(_argumentsList_). + 1. Let _paramBindings_ be _paramNames_. + 1. Let _iteratorRecord_ be CreateListIteratorRecord(_argList_). 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. If _hasParameterExpressions_ is *false*, then + 1. Let _usedEnv_ be _envRecord_. + 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 _hasParamExprs_ 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_. - 1. For each element _n_ of _varNames_, do - 1. If _instantiatedVarNames_ does not contain _n_, then - 1. Append _n_ to _instantiatedVarNames_. - 1. Perform ! _env_.CreateMutableBinding(_n_, *false*). - 1. Perform ! _env_.InitializeBinding(_n_, *undefined*). - 1. Let _varEnv_ be _env_. + 1. Let _instantiatedVariableNames_ be a copy of the List _paramBindings_. + 1. For each element _name_ of _variableNames_, do + 1. If _instantiatedVariableNames_ does not contain _name_, then + 1. Append _name_ to _instantiatedVariableNames_. + 1. Perform ! _envRecord_.CreateMutableBinding(_name_, *false*). + 1. Perform ! _envRecord_.InitializeBinding(_name_, *undefined*). + 1. Let _variableEnv_ be _envRecord_. 1. Else, 1. NOTE: A separate Environment Record is needed to ensure that closures created by expressions in the formal parameter list do not have visibility of declarations in the function body. - 1. Let _varEnv_ be NewDeclarativeEnvironment(_env_). - 1. Set the VariableEnvironment of _calleeContext_ to _varEnv_. - 1. Let _instantiatedVarNames_ be a new empty List. - 1. For each element _n_ of _varNames_, do - 1. If _instantiatedVarNames_ does not contain _n_, then - 1. Append _n_ to _instantiatedVarNames_. - 1. Perform ! _varEnv_.CreateMutableBinding(_n_, *false*). - 1. If _parameterBindings_ does not contain _n_, or if _functionNames_ contains _n_, then + 1. Let _variableEnv_ be NewDeclarativeEnvironment(_envRecord_). + 1. Set the VariableEnvironment of _calleeContext_ to _variableEnv_. + 1. Let _instantiatedVariableNames_ be a new empty List. + 1. For each element _name_ of _variableNames_, do + 1. If _instantiatedVariableNames_ does not contain _name_, then + 1. Append _name_ to _instantiatedVariableNames_. + 1. Perform ! _variableEnv_.CreateMutableBinding(_name_, *false*). + 1. If _paramBindings_ does not contain _name_ or _funcNames_ contains _name_, then 1. Let _initialValue_ be *undefined*. 1. Else, - 1. Let _initialValue_ be ! _env_.GetBindingValue(_n_, *false*). - 1. Perform ! _varEnv_.InitializeBinding(_n_, _initialValue_). + 1. Let _initialValue_ be ! _envRecord_.GetBindingValue(_name_, *false*). + 1. Perform ! _variableEnv_.InitializeBinding(_name_, _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. 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. If _strict_ is *true*, then + 1. Let _lexicalEnv_ be _variableEnv_. 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 + 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| _funcDecl_ that is directly contained in the |StatementList| of any |Block|, |CaseClause|, or |DefaultClause| _x_ such that _code_ Contains _x_ is *true*, do + 1. Let _funcName_ be the StringValue of the |BindingIdentifier| of _funcDecl_. + 1. If replacing the |FunctionDeclaration| _funcDecl_ with a |VariableStatement| that has _funcName_ as a |BindingIdentifier| would not produce any Early Errors for _func_ and _paramNames_ does not contain _funcName_, then + 1. NOTE: A var binding for _funcName_ is only instantiated here if it is neither a VarDeclaredName, the name of a formal parameter, or another |FunctionDeclaration|. + 1. If _instantiatedVariableNames_ does not contain _funcName_ and _funcName_ is not *"arguments"*, then + 1. Perform ! _variableEnv_.CreateMutableBinding(_funcName_, *false*). + 1. Perform ! _variableEnv_.InitializeBinding(_funcName_, *undefined*). + 1. Append _funcName_ to _instantiatedVariableNames_. + 1. [id="step-functiondeclarationinstantiation-alt-funcdecl-eval"] When the |FunctionDeclaration| _funcDecl_ is evaluated, perform the following steps in place of the |FunctionDeclaration| Evaluation algorithm provided in : + 1. Let _funcEnv_ be the running execution context's VariableEnvironment. + 1. Let _blockEnv_ be the running execution context's LexicalEnvironment. + 1. Let _funcObj_ be ! _blockEnv_.GetBindingValue(_funcName_, *false*). + 1. Perform ! _funcEnv_.SetMutableBinding(_funcName_, _funcObj_, *false*). + 1. Return ~unused~. + 1. Let _lexicalEnv_ be NewDeclarativeEnvironment(_variableEnv_). + 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. Set the LexicalEnvironment of _calleeContext_ to _lexicalEnv_. + 1. Let _lexicalDecls_ be the LexicallyScopedDeclarations of _code_. + 1. For each element _lexicalDecl_ of _lexicalDecls_, do 1. NOTE: A lexically declared name cannot be the same as a function/generator declaration, formal parameter, or a var name. 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 ! _lexEnv_.CreateImmutableBinding(_dn_, *true*). + 1. For each element _name_ of the BoundNames of _lexicalDecl_, do + 1. If IsConstantDeclaration of _lexicalDecl_ is *true*, then + 1. Perform ! _lexicalEnv_.CreateImmutableBinding(_name_, *true*). 1. Else, - 1. Perform ! _lexEnv_.CreateMutableBinding(_dn_, *false*). + 1. Perform ! _lexicalEnv_.CreateMutableBinding(_name_, *false*). 1. Let _privateEnv_ be the PrivateEnvironment of _calleeContext_. - 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 _lexEnv_ and _privateEnv_. - 1. Perform ! _varEnv_.SetMutableBinding(_fn_, _fo_, *false*). + 1. For each Parse Node _funcDecl_ of _funcsToInitialize_, do + 1. Let _funcName_ be the sole element of the BoundNames of _funcDecl_. + 1. Let _funcObj_ be InstantiateFunctionObject of _funcDecl_ with arguments _lexicalEnv_ and _privateEnv_. + 1. Perform ! _variableEnv_.SetMutableBinding(_funcName_, _funcObj_, *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 +14314,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 .

        @@ -13759,41 +14324,43 @@

        Built-in Function Objects

        [[Call]] ( - _thisArgument_: an ECMAScript language value, - _argumentsList_: a List of ECMAScript language values, + _thisArg_: an ECMAScript language value, + _argList_: a List of ECMAScript language values, ): either a normal completion containing an ECMAScript language value or a throw completion

        for
        -
        a built-in function object _F_
        +
        a built-in function object _func_
        - 1. Return ? BuiltinCallOrConstruct(_F_, _thisArgument_, _argumentsList_, *undefined*). + 1. Return ? BuiltinCallOrConstruct(_func_, _thisArg_, _argList_, *undefined*).

        [[Construct]] ( - _argumentsList_: a List of ECMAScript language values, + _argList_: a List of ECMAScript language values, _newTarget_: a constructor, ): either a normal completion containing an Object or a throw completion

        for
        -
        a built-in function object _F_ (when the method is present)
        +
        a built-in function object _func_ (when the method is present)
        - 1. Return ? BuiltinCallOrConstruct(_F_, ~uninitialized~, _argumentsList_, _newTarget_). + 1. Let _result_ be ? BuiltinCallOrConstruct(_func_, ~uninitialized~, _argList_, _newTarget_). + 1. Assert: _result_ is an Object. + 1. Return _result_.

        BuiltinCallOrConstruct ( - _F_: a built-in function object, - _thisArgument_: an ECMAScript language value or ~uninitialized~, - _argumentsList_: a List of ECMAScript language values, + _func_: a built-in function object, + _thisArg_: an ECMAScript language value or ~uninitialized~, + _argList_: a List of ECMAScript language values, _newTarget_: a constructor or *undefined*, ): either a normal completion containing an ECMAScript language value or a throw completion

        @@ -13803,14 +14370,23 @@

        1. Let _callerContext_ be the running execution context. 1. If _callerContext_ is not already suspended, suspend _callerContext_. 1. Let _calleeContext_ be a new execution context. - 1. Set the Function of _calleeContext_ to _F_. - 1. Let _calleeRealm_ be _F_.[[Realm]]. + 1. Set the Function of _calleeContext_ to _func_. + 1. Let _calleeRealm_ be _func_.[[Realm]]. 1. Set the Realm of _calleeContext_ to _calleeRealm_. 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. 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. If _func_.[[Async]] is *true*, then + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _resultsClosure_ be a new Abstract Closure with no parameters that captures _func_, _thisArg_, _argList_, and _newTarget_ and performs the following steps when called: + 1. Let _result_ be the Completion Record that is the result of evaluating _func_ in a manner that conforms to the specification of _func_. If _thisArg_ is ~uninitialized~, the *this* value is uninitialized; else _thisArg_ provides the *this* value. _argList_ provides the named parameters. _newTarget_ provides the NewTarget value. + 1. NOTE: If _func_ is defined in this document, “the specification of _func_” 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 _func_ in a manner that conforms to the specification of _func_. If _thisArg_ is ~uninitialized~, the *this* value is uninitialized; else _thisArg_ provides the *this* value. _argList_ provides the named parameters. _newTarget_ provides the NewTarget value. + 1. NOTE: If _func_ is defined in this document, “the specification of _func_” 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_. @@ -13827,9 +14403,10 @@

        _name_: a property key or a Private Name, _additionalInternalSlotsList_: a List of names of internal slots, optional _realm_: a Realm Record, - optional _prototype_: an Object or *null*, + optional _proto_: an Object or *null*, optional _prefix_: a String, - ): a function object + optional _async_: a Boolean, + ): a built-in function object

        description
        @@ -13837,11 +14414,13 @@

        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 _proto_ is not present, set _proto_ 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. Append the elements of _additionalInternalSlotsList_ to _internalSlotsList_. 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_.[[Prototype]] to _prototype_. + 1. Set _func_.[[Async]] to _async_. + 1. Set _func_.[[Prototype]] to _proto_. 1. Set _func_.[[Extensible]] to *true*. 1. Set _func_.[[Realm]] to _realm_. 1. Set _func_.[[InitialName]] to *null*. @@ -13869,17 +14448,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]] @@ -13919,19 +14500,19 @@

        Bound Function Exotic Objects

        [[Call]] ( - _thisArgument_: an ECMAScript language value, - _argumentsList_: a List of ECMAScript language values, + _thisArg_: an ECMAScript language value, + _argList_: a List of ECMAScript language values, ): either a normal completion containing an ECMAScript language value or a throw completion

        for
        -
        a bound function exotic object _F_
        +
        a bound function exotic object _func_
        - 1. Let _target_ be _F_.[[BoundTargetFunction]]. - 1. Let _boundThis_ be _F_.[[BoundThis]]. - 1. Let _boundArgs_ be _F_.[[BoundArguments]]. - 1. Let _args_ be the list-concatenation of _boundArgs_ and _argumentsList_. + 1. Let _target_ be _func_.[[BoundTargetFunction]]. + 1. Let _boundThis_ be _func_.[[BoundThis]]. + 1. Let _boundArgs_ be _func_.[[BoundArguments]]. + 1. Let _args_ be the list-concatenation of _boundArgs_ and _argList_. 1. Return ? Call(_target_, _boundThis_, _args_).
        @@ -13939,20 +14520,20 @@

        [[Construct]] ( - _argumentsList_: a List of ECMAScript language values, + _argList_: a List of ECMAScript language values, _newTarget_: a constructor, ): either a normal completion containing an Object or a throw completion

        for
        -
        a bound function exotic object _F_
        +
        a bound function exotic object _func_
        - 1. Let _target_ be _F_.[[BoundTargetFunction]]. + 1. Let _target_ be _func_.[[BoundTargetFunction]]. 1. Assert: IsConstructor(_target_) is *true*. - 1. Let _boundArgs_ be _F_.[[BoundArguments]]. - 1. Let _args_ be the list-concatenation of _boundArgs_ and _argumentsList_. - 1. If SameValue(_F_, _newTarget_) is *true*, set _newTarget_ to _target_. + 1. Let _boundArgs_ be _func_.[[BoundArguments]]. + 1. Let _args_ be the list-concatenation of _boundArgs_ and _argList_. + 1. If SameValue(_func_, _newTarget_) is *true*, set _newTarget_ to _target_. 1. Return ? Construct(_target_, _args_, _newTarget_).
        @@ -13960,7 +14541,7 @@

        BoundFunctionCreate ( - _targetFunction_: a function object, + _targetFunc_: a function object, _boundThis_: an ECMAScript language value, _boundArgs_: a List of ECMAScript language values, ): either a normal completion containing a function object or a throw completion @@ -13970,14 +14551,14 @@

        It is used to specify the creation of new bound function exotic objects.
        - 1. Let _proto_ be ? _targetFunction_.[[GetPrototypeOf]](). + 1. Let _proto_ be ? _targetFunc_.[[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. If IsConstructor(_targetFunction_) is *true*, then - 1. Set _obj_.[[Construct]] as described in . - 1. Set _obj_.[[BoundTargetFunction]] to _targetFunction_. + 1. Set _obj_.[[Call]] as specified in . + 1. If IsConstructor(_targetFunc_) is *true*, then + 1. Set _obj_.[[Construct]] as specified in . + 1. Set _obj_.[[BoundTargetFunction]] to _targetFunc_. 1. Set _obj_.[[BoundThis]] to _boundThis_. 1. Set _obj_.[[BoundArguments]] to _boundArgs_. 1. Return _obj_. @@ -13994,33 +14575,33 @@

        Array Exotic Objects

        [[DefineOwnProperty]] ( - _P_: a property key, - _Desc_: a Property Descriptor, + _propertyKey_: a property key, + _propertyDesc_: a Property Descriptor, ): either a normal completion containing a Boolean or a throw completion

        for
        -
        an Array exotic object _A_
        +
        an Array exotic object _array_
        - 1. If _P_ is *"length"*, then - 1. Return ? ArraySetLength(_A_, _Desc_). - 1. Else if _P_ is an array index, then - 1. Let _lengthDesc_ be OrdinaryGetOwnProperty(_A_, *"length"*). + 1. If _propertyKey_ is *"length"*, return ? ArraySetLength(_array_, _propertyDesc_). + 1. If _propertyKey_ is an array index, then + 1. Let _lengthDesc_ be OrdinaryGetOwnProperty(_array_, *"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]]. 1. Assert: _length_ is a non-negative integral Number. - 1. Let _index_ be ! ToUint32(_P_). + 1. Let _index_ be ! ToUint32(_propertyKey_). 1. If _index_ ≥ _length_ and _lengthDesc_.[[Writable]] is *false*, return *false*. - 1. Let _succeeded_ be ! OrdinaryDefineOwnProperty(_A_, _P_, _Desc_). + 1. Let _succeeded_ be ! OrdinaryDefineOwnProperty(_array_, _propertyKey_, _propertyDesc_). 1. If _succeeded_ is *false*, return *false*. 1. If _index_ ≥ _length_, then 1. Set _lengthDesc_.[[Value]] to _index_ + *1*𝔽. - 1. Set _succeeded_ to ! OrdinaryDefineOwnProperty(_A_, *"length"*, _lengthDesc_). + 1. Set _succeeded_ to ! OrdinaryDefineOwnProperty(_array_, *"length"*, _lengthDesc_). 1. Assert: _succeeded_ is *true*. 1. Return *true*. - 1. Return ? OrdinaryDefineOwnProperty(_A_, _P_, _Desc_). + 1. Return ? OrdinaryDefineOwnProperty(_array_, _propertyKey_, _propertyDesc_).
        @@ -14038,11 +14619,11 @@

        1. If _length_ > 232 - 1, throw a *RangeError* exception. 1. If _proto_ is not present, set _proto_ to %Array.prototype%. - 1. Let _A_ be MakeBasicObject(« [[Prototype]], [[Extensible]] »). - 1. Set _A_.[[Prototype]] to _proto_. - 1. Set _A_.[[DefineOwnProperty]] as specified in . - 1. Perform ! OrdinaryDefineOwnProperty(_A_, *"length"*, PropertyDescriptor { [[Value]]: 𝔽(_length_), [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). - 1. Return _A_. + 1. Let _array_ be MakeBasicObject(« [[Prototype]], [[Extensible]] »). + 1. Set _array_.[[Prototype]] to _proto_. + 1. Set _array_.[[DefineOwnProperty]] as specified in . + 1. Perform ! OrdinaryDefineOwnProperty(_array_, *"length"*, PropertyDescriptor { [[Value]]: 𝔽(_length_), [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Return _array_. @@ -14060,18 +14641,18 @@

        1. Let _isArray_ be ? IsArray(_originalArray_). 1. If _isArray_ is *false*, return ? ArrayCreate(_length_). - 1. Let _C_ be ? Get(_originalArray_, *"constructor"*). - 1. If IsConstructor(_C_) is *true*, then + 1. Let _ctor_ be ? Get(_originalArray_, *"constructor"*). + 1. If IsConstructor(_ctor_) is *true*, then 1. Let _thisRealm_ be the current Realm Record. - 1. Let _realmC_ be ? GetFunctionRealm(_C_). - 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. 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. - 1. Return ? Construct(_C_, « 𝔽(_length_) »). + 1. Let _ctorRealm_ be ? GetFunctionRealm(_ctor_). + 1. If _thisRealm_ and _ctorRealm_ are not the same Realm Record, then + 1. If SameValue(_ctor_, _ctorRealm_.[[Intrinsics]].[[%Array%]]) is *true*, set _ctor_ to *undefined*. + 1. If _ctor_ is an Object, then + 1. Set _ctor_ to ? Get(_ctor_, %Symbol.species%). + 1. If _ctor_ is *null*, set _ctor_ to *undefined*. + 1. If _ctor_ is *undefined*, return ? ArrayCreate(_length_). + 1. If IsConstructor(_ctor_) is *false*, throw a *TypeError* exception. + 1. Return ? Construct(_ctor_, « 𝔽(_length_) »).

        If _originalArray_ was created using the standard built-in Array constructor for a realm that is not the realm of the running execution context, then a new Array is created using the realm of the running execution context. This maintains compatibility with Web browsers that have historically had that behaviour for the `Array.prototype` methods that now are defined using ArraySpeciesCreate.

        @@ -14081,49 +14662,50 @@

        ArraySetLength ( - _A_: an Array, - _Desc_: a Property Descriptor, + _array_: an Array, + _propertyDesc_: a Property Descriptor, ): either a normal completion containing a Boolean or a throw completion

        - 1. If _Desc_ does not have a [[Value]] field, then - 1. Return ! OrdinaryDefineOwnProperty(_A_, *"length"*, _Desc_). - 1. Let _newLenDesc_ be a copy of _Desc_. - 1. [id="step-arraysetlength-newlen"] Let _newLen_ be ? ToUint32(_Desc_.[[Value]]). - 1. [id="step-arraysetlength-numberlen"] Let _numberLen_ be ? ToNumber(_Desc_.[[Value]]). - 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: IsDataDescriptor(_oldLenDesc_) is *true*. - 1. Assert: _oldLenDesc_.[[Configurable]] is *false*. - 1. Let _oldLen_ be _oldLenDesc_.[[Value]]. - 1. If _newLen_ ≥ _oldLen_, then - 1. Return ! OrdinaryDefineOwnProperty(_A_, *"length"*, _newLenDesc_). - 1. If _oldLenDesc_.[[Writable]] is *false*, return *false*. - 1. If _newLenDesc_ does not have a [[Writable]] field or _newLenDesc_.[[Writable]] is *true*, then + 1. If _propertyDesc_ does not have a [[Value]] field, then + 1. Return ! OrdinaryDefineOwnProperty(_array_, *"length"*, _propertyDesc_). + 1. Let _newLengthDesc_ be a copy of _propertyDesc_. + 1. [id="step-arraysetlength-newlen"] Let _newLength_ be ? ToUint32(_propertyDesc_.[[Value]]). + 1. [id="step-arraysetlength-numberlen"] Let _numberLength_ be ? ToNumber(_propertyDesc_.[[Value]]). + 1. If SameValueZero(_newLength_, _numberLength_) is *false*, throw a *RangeError* exception. + 1. Set _newLengthDesc_.[[Value]] to _newLength_. + 1. Let _oldLengthDesc_ be OrdinaryGetOwnProperty(_array_, *"length"*). + 1. Assert: _oldLengthDesc_ is not *undefined*. + 1. Assert: IsDataDescriptor(_oldLengthDesc_) is *true*. + 1. Assert: _oldLengthDesc_.[[Configurable]] is *false*. + 1. Let _oldLength_ be _oldLengthDesc_.[[Value]]. + 1. If _newLength_ ≥ _oldLength_, then + 1. Return ! OrdinaryDefineOwnProperty(_array_, *"length"*, _newLengthDesc_). + 1. If _oldLengthDesc_.[[Writable]] is *false*, return *false*. + 1. If _newLengthDesc_ does not have a [[Writable]] field or _newLengthDesc_.[[Writable]] is *true*, then 1. Let _newWritable_ be *true*. 1. Else, 1. NOTE: Setting the [[Writable]] attribute to *false* is deferred in case any elements cannot be deleted. 1. Let _newWritable_ be *false*. - 1. Set _newLenDesc_.[[Writable]] to *true*. - 1. Let _succeeded_ be ! OrdinaryDefineOwnProperty(_A_, *"length"*, _newLenDesc_). + 1. Set _newLengthDesc_.[[Writable]] to *true*. + 1. Let _succeeded_ be ! OrdinaryDefineOwnProperty(_array_, *"length"*, _newLengthDesc_). 1. If _succeeded_ is *false*, return *false*. - 1. For each own property key _P_ of _A_ such that _P_ is an array index and ! ToUint32(_P_) ≥ _newLen_, in descending numeric index order, do - 1. Let _deleteSucceeded_ be ! _A_.[[Delete]](_P_). + 1. For each own property key _propertyKey_ of _array_ such that _propertyKey_ is an array index and ! ToUint32(_propertyKey_) ≥ _newLength_, in descending numeric index order, do + 1. Let _deleteSucceeded_ be ! _array_.[[Delete]](_propertyKey_). 1. If _deleteSucceeded_ is *false*, then - 1. Set _newLenDesc_.[[Value]] to ! ToUint32(_P_) + *1*𝔽. - 1. If _newWritable_ is *false*, set _newLenDesc_.[[Writable]] to *false*. - 1. Perform ! OrdinaryDefineOwnProperty(_A_, *"length"*, _newLenDesc_). + 1. Set _newLengthDesc_.[[Value]] to ! ToUint32(_propertyKey_) + *1*𝔽. + 1. If _newWritable_ is *false*, set _newLengthDesc_.[[Writable]] to *false*. + 1. Perform ! OrdinaryDefineOwnProperty(_array_, *"length"*, _newLengthDesc_). 1. Return *false*. 1. If _newWritable_ is *false*, then - 1. Set _succeeded_ to ! OrdinaryDefineOwnProperty(_A_, *"length"*, PropertyDescriptor { [[Writable]]: *false* }). + 1. Set _succeeded_ to ! OrdinaryDefineOwnProperty(_array_, *"length"*, PropertyDescriptor { [[Writable]]: *false* }). 1. Assert: _succeeded_ is *true*. 1. Return *true*. -

        In steps and , if _Desc_.[[Value]] is an object then its `valueOf` method is called twice. This is legacy behaviour that was specified with this effect starting with the 2nd Edition of this specification.

        +

        In steps and , if _propertyDesc_.[[Value]] is an object then its `valueOf` method is called twice. This is legacy behaviour that was specified with this effect starting with the 2nd Edition of this specification.

        @@ -14139,37 +14721,37 @@

        String Exotic Objects

        [[GetOwnProperty]] ( - _P_: a property key, + _propertyKey_: a property key, ): a normal completion containing either a Property Descriptor or *undefined*

        for
        -
        a String exotic object _S_
        +
        a String exotic object _string_
        - 1. Let _desc_ be OrdinaryGetOwnProperty(_S_, _P_). - 1. If _desc_ is not *undefined*, return _desc_. - 1. Return StringGetOwnProperty(_S_, _P_). + 1. Let _propertyDesc_ be OrdinaryGetOwnProperty(_string_, _propertyKey_). + 1. If _propertyDesc_ is not *undefined*, return _propertyDesc_. + 1. Return StringGetOwnProperty(_string_, _propertyKey_).

        [[DefineOwnProperty]] ( - _P_: a property key, - _Desc_: a Property Descriptor, + _propertyKey_: a property key, + _propertyDesc_: a Property Descriptor, ): a normal completion containing a Boolean

        for
        -
        a String exotic object _S_
        +
        a String exotic object _string_
        - 1. Let _stringDesc_ be StringGetOwnProperty(_S_, _P_). + 1. Let _stringDesc_ be StringGetOwnProperty(_string_, _propertyKey_). 1. If _stringDesc_ is not *undefined*, then - 1. Let _extensible_ be _S_.[[Extensible]]. - 1. Return IsCompatiblePropertyDescriptor(_extensible_, _Desc_, _stringDesc_). - 1. Return ! OrdinaryDefineOwnProperty(_S_, _P_, _Desc_). + 1. Let _extensible_ be _string_.[[Extensible]]. + 1. Return IsCompatiblePropertyDescriptor(_extensible_, _propertyDesc_, _stringDesc_). + 1. Return ! OrdinaryDefineOwnProperty(_string_, _propertyKey_, _propertyDesc_).
        @@ -14177,21 +14759,21 @@

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

        for
        -
        a String exotic object _O_
        +
        a String exotic object _obj_
        1. Let _keys_ be a new empty List. - 1. Let _str_ be _O_.[[StringData]]. - 1. Assert: _str_ is a String. - 1. Let _len_ be the length of _str_. - 1. For each integer _i_ such that 0 ≤ _i_ < _len_, in ascending order, do + 1. Let _string_ be _obj_.[[StringData]]. + 1. Assert: _string_ is a String. + 1. Let _length_ be the length of _string_. + 1. For each integer _i_ such that 0 ≤ _i_ < _length_, in ascending order, do 1. Append ! ToString(𝔽(_i_)) to _keys_. - 1. For each own property key _P_ of _O_ such that _P_ is an array index and ! ToIntegerOrInfinity(_P_) ≥ _len_, in ascending numeric index order, do - 1. Append _P_ to _keys_. - 1. For each own property key _P_ of _O_ such that _P_ is a String and _P_ is not an array index, in ascending chronological order of property creation, do - 1. Append _P_ to _keys_. - 1. For each own property key _P_ of _O_ such that _P_ is a Symbol, in ascending chronological order of property creation, do - 1. Append _P_ to _keys_. + 1. For each own property key _propertyKey_ of _obj_ such that _propertyKey_ is an array index and ! ToIntegerOrInfinity(_propertyKey_) ≥ _length_, in ascending numeric index order, do + 1. Append _propertyKey_ to _keys_. + 1. For each own property key _propertyKey_ of _obj_ such that _propertyKey_ is a String and _propertyKey_ is not an array index, in ascending chronological order of property creation, do + 1. Append _propertyKey_ to _keys_. + 1. For each own property key _propertyKey_ of _obj_ such that _propertyKey_ is a Symbol, in ascending chronological order of property creation, do + 1. Append _propertyKey_ to _keys_. 1. Return _keys_. @@ -14200,7 +14782,7 @@

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

        StringCreate ( _value_: a String, - _prototype_: an Object, + _proto_: an Object, ): a String exotic object

        @@ -14208,39 +14790,38 @@

        It is used to specify the creation of new String exotic objects.

        - 1. Let _S_ be MakeBasicObject(« [[Prototype]], [[Extensible]], [[StringData]] »). - 1. Set _S_.[[Prototype]] to _prototype_. - 1. Set _S_.[[StringData]] to _value_. - 1. Set _S_.[[GetOwnProperty]] as specified in . - 1. Set _S_.[[DefineOwnProperty]] as specified in . - 1. Set _S_.[[OwnPropertyKeys]] as specified in . + 1. Let _string_ be MakeBasicObject(« [[Prototype]], [[Extensible]], [[StringData]] »). + 1. Set _string_.[[Prototype]] to _proto_. + 1. Set _string_.[[StringData]] to _value_. + 1. Set _string_.[[GetOwnProperty]] as specified in . + 1. Set _string_.[[DefineOwnProperty]] as specified in . + 1. Set _string_.[[OwnPropertyKeys]] as specified in . 1. Let _length_ be the length of _value_. - 1. Perform ! DefinePropertyOrThrow(_S_, *"length"*, PropertyDescriptor { [[Value]]: 𝔽(_length_), [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). - 1. Return _S_. + 1. Perform ! DefinePropertyOrThrow(_string_, *"length"*, PropertyDescriptor { [[Value]]: 𝔽(_length_), [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Return _string_.

        StringGetOwnProperty ( - _S_: an Object that has a [[StringData]] internal slot, - _P_: a property key, + _string_: an Object that has a [[StringData]] internal slot, + _propertyKey_: a property key, ): a Property Descriptor or *undefined*

        - 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. 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. Let _resultStr_ be the substring of _str_ from ℝ(_index_) to ℝ(_index_) + 1. - 1. Return the PropertyDescriptor { [[Value]]: _resultStr_, [[Writable]]: *false*, [[Enumerable]]: *true*, [[Configurable]]: *false* }. + 1. If _propertyKey_ is not a String, return *undefined*. + 1. Let _numericIndex_ be CanonicalNumericIndexString(_propertyKey_). + 1. If _numericIndex_ is not an integral Number, return *undefined*. + 1. If _numericIndex_ is *-0*𝔽 or _numericIndex_ < *-0*𝔽, return *undefined*. + 1. Let _stringData_ be _string_.[[StringData]]. + 1. Assert: _stringData_ is a String. + 1. Let _length_ be the length of _stringData_. + 1. If ℝ(_numericIndex_) ≥ _length_, return *undefined*. + 1. Let _resultString_ be the substring of _stringData_ from ℝ(_numericIndex_) to ℝ(_numericIndex_) + 1. + 1. Return the PropertyDescriptor { [[Value]]: _resultString_, [[Writable]]: *false*, [[Enumerable]]: *true*, [[Configurable]]: *false* }.
        @@ -14256,7 +14837,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.

        @@ -14274,7 +14855,7 @@

        Arguments Exotic Objects

        [[GetOwnProperty]] ( - _P_: a property key, + _propertyKey_: a property key, ): a normal completion containing either a Property Descriptor or *undefined*

        @@ -14282,21 +14863,21 @@

        an arguments exotic object _args_

        - 1. Let _desc_ be OrdinaryGetOwnProperty(_args_, _P_). - 1. If _desc_ is *undefined*, return *undefined*. + 1. Let _propertyDesc_ be OrdinaryGetOwnProperty(_args_, _propertyKey_). + 1. If _propertyDesc_ is *undefined*, return *undefined*. 1. Let _map_ be _args_.[[ParameterMap]]. - 1. Let _isMapped_ be ! HasOwnProperty(_map_, _P_). + 1. Let _isMapped_ be ! HasOwnProperty(_map_, _propertyKey_). 1. If _isMapped_ is *true*, then - 1. Set _desc_.[[Value]] to ! Get(_map_, _P_). - 1. Return _desc_. + 1. Set _propertyDesc_.[[Value]] to ! Get(_map_, _propertyKey_). + 1. Return _propertyDesc_.

        [[DefineOwnProperty]] ( - _P_: a property key, - _Desc_: a Property Descriptor, + _propertyKey_: a property key, + _propertyDesc_: a Property Descriptor, ): a normal completion containing a Boolean

        @@ -14305,23 +14886,23 @@

        1. Let _map_ be _args_.[[ParameterMap]]. - 1. Let _isMapped_ be ! HasOwnProperty(_map_, _P_). - 1. Let _newArgDesc_ be _Desc_. - 1. If _isMapped_ is *true* and IsDataDescriptor(_Desc_) is *true*, then - 1. If _Desc_ does not have a [[Value]] field, _Desc_ has a [[Writable]] field, and _Desc_.[[Writable]] is *false*, then - 1. Set _newArgDesc_ to a copy of _Desc_. - 1. Set _newArgDesc_.[[Value]] to ! Get(_map_, _P_). - 1. Let _allowed_ be ! OrdinaryDefineOwnProperty(_args_, _P_, _newArgDesc_). + 1. Let _isMapped_ be ! HasOwnProperty(_map_, _propertyKey_). + 1. Let _newArgDesc_ be _propertyDesc_. + 1. If _isMapped_ is *true* and IsDataDescriptor(_propertyDesc_) is *true*, then + 1. If _propertyDesc_ does not have a [[Value]] field, _propertyDesc_ has a [[Writable]] field, and _propertyDesc_.[[Writable]] is *false*, then + 1. Set _newArgDesc_ to a copy of _propertyDesc_. + 1. Set _newArgDesc_.[[Value]] to ! Get(_map_, _propertyKey_). + 1. Let _allowed_ be ! OrdinaryDefineOwnProperty(_args_, _propertyKey_, _newArgDesc_). 1. If _allowed_ is *false*, return *false*. 1. If _isMapped_ is *true*, then - 1. If IsAccessorDescriptor(_Desc_) is *true*, then - 1. Perform ! _map_.[[Delete]](_P_). + 1. If IsAccessorDescriptor(_propertyDesc_) is *true*, then + 1. Perform ! _map_.[[Delete]](_propertyKey_). 1. Else, - 1. If _Desc_ has a [[Value]] field, then + 1. If _propertyDesc_ has a [[Value]] field, then 1. Assert: The following Set will succeed, since formal parameters mapped by arguments objects are always writable. - 1. Perform ! Set(_map_, _P_, _Desc_.[[Value]], *false*). - 1. If _Desc_ has a [[Writable]] field and _Desc_.[[Writable]] is *false*, then - 1. Perform ! _map_.[[Delete]](_P_). + 1. Perform ! Set(_map_, _propertyKey_, _propertyDesc_.[[Value]], *false*). + 1. If _propertyDesc_ has a [[Writable]] field and _propertyDesc_.[[Writable]] is *false*, then + 1. Perform ! _map_.[[Delete]](_propertyKey_). 1. Return *true*.
        @@ -14329,8 +14910,8 @@

        [[Get]] ( - _P_: a property key, - _Receiver_: an ECMAScript language value, + _propertyKey_: a property key, + _receiver_: an ECMAScript language value, ): either a normal completion containing an ECMAScript language value or a throw completion

        @@ -14339,21 +14920,19 @@

        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. Let _isMapped_ be ! HasOwnProperty(_map_, _propertyKey_). + 1. If _isMapped_ is *false*, return ? OrdinaryGet(_args_, _propertyKey_, _receiver_). + 1. Assert: _map_ contains a formal parameter mapping for _propertyKey_. + 1. Return ! Get(_map_, _propertyKey_).

        [[Set]] ( - _P_: a property key, - _V_: an ECMAScript language value, - _Receiver_: an ECMAScript language value, + _propertyKey_: a property key, + _value_: an ECMAScript language value, + _receiver_: an ECMAScript language value, ): either a normal completion containing a Boolean or a throw completion

        @@ -14361,22 +14940,22 @@

        an arguments exotic object _args_

        - 1. If SameValue(_args_, _Receiver_) is *false*, then + 1. If SameValue(_args_, _receiver_) is *false*, then 1. Let _isMapped_ be *false*. 1. Else, 1. Let _map_ be _args_.[[ParameterMap]]. - 1. Let _isMapped_ be ! HasOwnProperty(_map_, _P_). + 1. Let _isMapped_ be ! HasOwnProperty(_map_, _propertyKey_). 1. If _isMapped_ is *true*, then 1. Assert: The following Set will succeed, since formal parameters mapped by arguments objects are always writable. - 1. Perform ! Set(_map_, _P_, _V_, *false*). - 1. Return ? OrdinarySet(_args_, _P_, _V_, _Receiver_). + 1. Perform ! Set(_map_, _propertyKey_, _value_, *false*). + 1. Return ? OrdinarySet(_args_, _propertyKey_, _value_, _receiver_).

        [[Delete]] ( - _P_: a property key, + _propertyKey_: a property key, ): either a normal completion containing a Boolean or a throw completion

        @@ -14385,10 +14964,10 @@

        1. Let _map_ be _args_.[[ParameterMap]]. - 1. Let _isMapped_ be ! HasOwnProperty(_map_, _P_). - 1. Let _result_ be ? OrdinaryDelete(_args_, _P_). + 1. Let _isMapped_ be ! HasOwnProperty(_map_, _propertyKey_). + 1. Let _result_ be ? OrdinaryDelete(_args_, _propertyKey_). 1. If _result_ is *true* and _isMapped_ is *true*, then - 1. Perform ! _map_.[[Delete]](_P_). + 1. Perform ! _map_.[[Delete]](_propertyKey_). 1. Return _result_.
        @@ -14396,23 +14975,23 @@

        CreateUnmappedArgumentsObject ( - _argumentsList_: a List of ECMAScript language values, + _argList_: a List of ECMAScript language values, ): an ordinary object

        - 1. Let _len_ be the number of elements in _argumentsList_. + 1. Let _length_ be the number of elements in _argList_. 1. Let _obj_ be OrdinaryObjectCreate(%Object.prototype%, « [[ParameterMap]] »). 1. Set _obj_.[[ParameterMap]] to *undefined*. - 1. Perform ! DefinePropertyOrThrow(_obj_, *"length"*, PropertyDescriptor { [[Value]]: 𝔽(_len_), [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). + 1. Perform ! DefinePropertyOrThrow(_obj_, *"length"*, PropertyDescriptor { [[Value]]: 𝔽(_length_), [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 1. Let _index_ be 0. - 1. Repeat, while _index_ < _len_, - 1. Let _val_ be _argumentsList_[_index_]. - 1. Perform ! CreateDataPropertyOrThrow(_obj_, ! ToString(𝔽(_index_)), _val_). + 1. Repeat, while _index_ < _length_, + 1. Let _value_ be _argList_[_index_]. + 1. Perform ! CreateDataPropertyOrThrow(_obj_, ! ToString(𝔽(_index_)), _value_). 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_, *"callee"*, PropertyDescriptor { [[Get]]: %ThrowTypeError%, [[Set]]: %ThrowTypeError%, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Perform ! DefinePropertyOrThrow(_obj_, %Symbol.iterator%, PropertyDescriptor { [[Value]]: %Array.prototype.values%, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). + 1. Perform ! DefinePropertyOrThrow(_obj_, *"callee"*, PropertyDescriptor { [[Getter]]: %ThrowTypeError%, [[Setter]]: %ThrowTypeError%, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Return _obj_.
        @@ -14420,17 +14999,17 @@

        CreateMappedArgumentsObject ( - _func_: an Object, + _func_: an ECMAScript function object, _formals_: a Parse Node, - _argumentsList_: a List of ECMAScript language values, - _env_: an Environment Record, + _argList_: a List of ECMAScript language values, + _envRecord_: an Environment Record, ): an arguments exotic object

        1. Assert: _formals_ does not contain a rest parameter, any binding patterns, or any initializers. It may contain duplicate identifiers. - 1. Let _len_ be the number of elements in _argumentsList_. + 1. Let _length_ be the number of elements in _argList_. 1. Let _obj_ be MakeBasicObject(« [[Prototype]], [[Extensible]], [[ParameterMap]] »). 1. Set _obj_.[[GetOwnProperty]] as specified in . 1. Set _obj_.[[DefineOwnProperty]] as specified in . @@ -14440,26 +15019,26 @@

        1. Set _obj_.[[Prototype]] to %Object.prototype%. 1. Let _map_ be OrdinaryObjectCreate(*null*). 1. Set _obj_.[[ParameterMap]] to _map_. - 1. Let _parameterNames_ be the BoundNames of _formals_. - 1. Let _numberOfParameters_ be the number of elements in _parameterNames_. + 1. Let _paramNames_ be the BoundNames of _formals_. + 1. Let _paramCount_ be the number of elements in _paramNames_. 1. Let _index_ be 0. - 1. Repeat, while _index_ < _len_, - 1. Let _val_ be _argumentsList_[_index_]. - 1. Perform ! CreateDataPropertyOrThrow(_obj_, ! ToString(𝔽(_index_)), _val_). + 1. Repeat, while _index_ < _length_, + 1. Let _value_ be _argList_[_index_]. + 1. Perform ! CreateDataPropertyOrThrow(_obj_, ! ToString(𝔽(_index_)), _value_). 1. Set _index_ to _index_ + 1. - 1. Perform ! DefinePropertyOrThrow(_obj_, *"length"*, PropertyDescriptor { [[Value]]: 𝔽(_len_), [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). + 1. Perform ! DefinePropertyOrThrow(_obj_, *"length"*, PropertyDescriptor { [[Value]]: 𝔽(_length_), [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 1. Let _mappedNames_ be a new empty List. - 1. Set _index_ to _numberOfParameters_ - 1. + 1. Set _index_ to _paramCount_ - 1. 1. Repeat, while _index_ ≥ 0, - 1. Let _name_ be _parameterNames_[_index_]. + 1. Let _name_ be _paramNames_[_index_]. 1. If _mappedNames_ does not contain _name_, then 1. Append _name_ to _mappedNames_. - 1. If _index_ < _len_, then - 1. Let _g_ be MakeArgGetter(_name_, _env_). - 1. Let _p_ be MakeArgSetter(_name_, _env_). - 1. Perform ! _map_.[[DefineOwnProperty]](! ToString(𝔽(_index_)), PropertyDescriptor { [[Set]]: _p_, [[Get]]: _g_, [[Enumerable]]: *false*, [[Configurable]]: *true* }). + 1. If _index_ < _length_, then + 1. Let _getter_ be MakeArgGetter(_name_, _envRecord_). + 1. Let _setter_ be MakeArgSetter(_name_, _envRecord_). + 1. Perform ! _map_.[[DefineOwnProperty]](! ToString(𝔽(_index_)), PropertyDescriptor { [[Setter]]: _setter_, [[Getter]]: _getter_, [[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_. @@ -14468,16 +15047,16 @@

        MakeArgGetter ( _name_: a String, - _env_: an Environment Record, + _envRecord_: an Environment Record, ): a function object

        description
        -
        It creates a built-in function object that when executed returns the value bound for _name_ in _env_.
        +
        It creates a built-in function object that when executed returns the value bound for _name_ in _envRecord_.
        - 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. Let _getterClosure_ be a new Abstract Closure with no parameters that captures _name_ and _envRecord_ and performs the following steps when called: + 1. Return NormalCompletion(! _envRecord_.GetBindingValue(_name_, *false*)). 1. Let _getter_ be CreateBuiltinFunction(_getterClosure_, 0, *""*, « »). 1. NOTE: _getter_ is never directly accessible to ECMAScript code. 1. Return _getter_. @@ -14488,16 +15067,16 @@

        MakeArgSetter ( _name_: a String, - _env_: an Environment Record, + _envRecord_: an Environment Record, ): a function object

        description
        -
        It creates a built-in function object that when executed sets the value bound for _name_ in _env_.
        +
        It creates a built-in function object that when executed sets the value bound for _name_ in _envRecord_.
        - 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. Let _setterClosure_ be a new Abstract Closure with parameters (_value_) that captures _name_ and _envRecord_ and performs the following steps when called: + 1. Return NormalCompletion(! _envRecord_.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,135 +15087,152 @@

        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 _obj_
        +
        + + 1. NOTE: The extensibility-related invariants specified in do not allow this method to return *true* when _obj_ 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(_obj_) is *false*, return *false*. + 1. Return OrdinaryPreventExtensions(_obj_). + +

        [[GetOwnProperty]] ( - _P_: a property key, + _propertyKey_: a property key, ): a normal completion containing either a Property Descriptor or *undefined*

        for
        -
        a TypedArray _O_
        +
        a TypedArray _obj_
        - 1. If _P_ is a String, then - 1. Let _numericIndex_ be CanonicalNumericIndexString(_P_). + 1. If _propertyKey_ is a String, then + 1. Let _numericIndex_ be CanonicalNumericIndexString(_propertyKey_). 1. If _numericIndex_ is not *undefined*, then - 1. Let _value_ be TypedArrayGetElement(_O_, _numericIndex_). + 1. Let _value_ be TypedArrayGetElement(_obj_, _numericIndex_). 1. If _value_ is *undefined*, return *undefined*. 1. Return the PropertyDescriptor { [[Value]]: _value_, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: *true* }. - 1. Return OrdinaryGetOwnProperty(_O_, _P_). + 1. Return OrdinaryGetOwnProperty(_obj_, _propertyKey_).

        [[HasProperty]] ( - _P_: a property key, + _propertyKey_: a property key, ): either a normal completion containing a Boolean or a throw completion

        for
        -
        a TypedArray _O_
        +
        a TypedArray _obj_
        - 1. If _P_ is a String, then - 1. Let _numericIndex_ be CanonicalNumericIndexString(_P_). - 1. If _numericIndex_ is not *undefined*, return IsValidIntegerIndex(_O_, _numericIndex_). - 1. Return ? OrdinaryHasProperty(_O_, _P_). + 1. If _propertyKey_ is a String, then + 1. Let _numericIndex_ be CanonicalNumericIndexString(_propertyKey_). + 1. If _numericIndex_ is not *undefined*, return IsValidIntegerIndex(_obj_, _numericIndex_). + 1. Return ? OrdinaryHasProperty(_obj_, _propertyKey_).

        [[DefineOwnProperty]] ( - _P_: a property key, - _Desc_: a Property Descriptor, + _propertyKey_: a property key, + _propertyDesc_: a Property Descriptor, ): either a normal completion containing a Boolean or a throw completion

        for
        -
        a TypedArray _O_
        +
        a TypedArray _obj_
        - 1. If _P_ is a String, then - 1. Let _numericIndex_ be CanonicalNumericIndexString(_P_). + 1. If _propertyKey_ is a String, then + 1. Let _numericIndex_ be CanonicalNumericIndexString(_propertyKey_). 1. If _numericIndex_ is not *undefined*, then - 1. If IsValidIntegerIndex(_O_, _numericIndex_) is *false*, return *false*. - 1. If _Desc_ has a [[Configurable]] field and _Desc_.[[Configurable]] is *false*, return *false*. - 1. If _Desc_ has an [[Enumerable]] field and _Desc_.[[Enumerable]] is *false*, return *false*. - 1. If IsAccessorDescriptor(_Desc_) is *true*, return *false*. - 1. If _Desc_ has a [[Writable]] field and _Desc_.[[Writable]] is *false*, return *false*. - 1. If _Desc_ has a [[Value]] field, perform ? TypedArraySetElement(_O_, _numericIndex_, _Desc_.[[Value]]). + 1. If IsValidIntegerIndex(_obj_, _numericIndex_) is *false*, return *false*. + 1. If _propertyDesc_ has a [[Configurable]] field and _propertyDesc_.[[Configurable]] is *false*, return *false*. + 1. If _propertyDesc_ has an [[Enumerable]] field and _propertyDesc_.[[Enumerable]] is *false*, return *false*. + 1. If IsAccessorDescriptor(_propertyDesc_) is *true*, return *false*. + 1. If _propertyDesc_ has a [[Writable]] field and _propertyDesc_.[[Writable]] is *false*, return *false*. + 1. If _propertyDesc_ has a [[Value]] field, perform ? TypedArraySetElement(_obj_, _numericIndex_, _propertyDesc_.[[Value]]). 1. Return *true*. - 1. Return ! OrdinaryDefineOwnProperty(_O_, _P_, _Desc_). + 1. Return ! OrdinaryDefineOwnProperty(_obj_, _propertyKey_, _propertyDesc_).

        [[Get]] ( - _P_: a property key, - _Receiver_: an ECMAScript language value, + _propertyKey_: a property key, + _receiver_: an ECMAScript language value, ): either a normal completion containing an ECMAScript language value or a throw completion

        for
        -
        a TypedArray _O_
        +
        a TypedArray _obj_
        - 1. If _P_ is a String, then - 1. Let _numericIndex_ be CanonicalNumericIndexString(_P_). + 1. If _propertyKey_ is a String, then + 1. Let _numericIndex_ be CanonicalNumericIndexString(_propertyKey_). 1. If _numericIndex_ is not *undefined*, then - 1. Return TypedArrayGetElement(_O_, _numericIndex_). - 1. Return ? OrdinaryGet(_O_, _P_, _Receiver_). + 1. Return TypedArrayGetElement(_obj_, _numericIndex_). + 1. Return ? OrdinaryGet(_obj_, _propertyKey_, _receiver_).

        [[Set]] ( - _P_: a property key, - _V_: an ECMAScript language value, - _Receiver_: an ECMAScript language value, + _propertyKey_: a property key, + _value_: an ECMAScript language value, + _receiver_: an ECMAScript language value, ): either a normal completion containing a Boolean or a throw completion

        for
        -
        a TypedArray _O_
        +
        a TypedArray _obj_
        - 1. If _P_ is a String, then - 1. Let _numericIndex_ be CanonicalNumericIndexString(_P_). + 1. If _propertyKey_ is a String, then + 1. Let _numericIndex_ be CanonicalNumericIndexString(_propertyKey_). 1. If _numericIndex_ is not *undefined*, then - 1. If SameValue(_O_, _Receiver_) is *true*, then - 1. Perform ? TypedArraySetElement(_O_, _numericIndex_, _V_). + 1. If SameValue(_obj_, _receiver_) is *true*, then + 1. Perform ? TypedArraySetElement(_obj_, _numericIndex_, _value_). 1. Return *true*. - 1. If IsValidIntegerIndex(_O_, _numericIndex_) is *false*, return *true*. - 1. Return ? OrdinarySet(_O_, _P_, _V_, _Receiver_). + 1. If IsValidIntegerIndex(_obj_, _numericIndex_) is *false*, return *true*. + 1. Return ? OrdinarySet(_obj_, _propertyKey_, _value_, _receiver_).

        [[Delete]] ( - _P_: a property key, + _propertyKey_: a property key, ): a normal completion containing a Boolean

        for
        -
        a TypedArray _O_
        +
        a TypedArray _obj_
        - 1. If _P_ is a String, then - 1. Let _numericIndex_ be CanonicalNumericIndexString(_P_). + 1. If _propertyKey_ is a String, then + 1. Let _numericIndex_ be CanonicalNumericIndexString(_propertyKey_). 1. If _numericIndex_ is not *undefined*, then - 1. If IsValidIntegerIndex(_O_, _numericIndex_) is *false*, return *true*; else return *false*. - 1. Return ! OrdinaryDelete(_O_, _P_). + 1. If IsValidIntegerIndex(_obj_, _numericIndex_) is *false*, return *true*. + 1. Return *false*. + 1. Return ! OrdinaryDelete(_obj_, _propertyKey_).
        @@ -14644,40 +15240,42 @@

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

        for
        -
        a TypedArray _O_
        +
        a TypedArray _obj_
        - 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~). + 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_obj_, ~seq-cst~). 1. Let _keys_ be a new empty List. 1. If IsTypedArrayOutOfBounds(_taRecord_) is *false*, then 1. Let _length_ be TypedArrayLength(_taRecord_). 1. For each integer _i_ such that 0 ≤ _i_ < _length_, in ascending order, do 1. Append ! ToString(𝔽(_i_)) to _keys_. - 1. For each own property key _P_ of _O_ such that _P_ is a String and _P_ is not an integer index, in ascending chronological order of property creation, do - 1. Append _P_ to _keys_. - 1. For each own property key _P_ of _O_ such that _P_ is a Symbol, in ascending chronological order of property creation, do - 1. Append _P_ to _keys_. + 1. For each own property key _propertyKey_ of _obj_ such that _propertyKey_ is a String and _propertyKey_ is not an integer index, in ascending chronological order of property creation, do + 1. Append _propertyKey_ to _keys_. + 1. For each own property key _propertyKey_ of _obj_ such that _propertyKey_ is a Symbol, in ascending chronological order of property creation, do + 1. Append _propertyKey_ to _keys_. 1. Return _keys_.

        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 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]] @@ -14726,7 +15324,7 @@

        TypedArrayCreate ( - _prototype_: an Object, + _proto_: an Object, ): a TypedArray

        @@ -14735,16 +15333,17 @@

        1. Let _internalSlotsList_ be « [[Prototype]], [[Extensible]], [[ViewedArrayBuffer]], [[TypedArrayName]], [[ContentType]], [[ByteLength]], [[ByteOffset]], [[ArrayLength]] ». - 1. Let _A_ be MakeBasicObject(_internalSlotsList_). - 1. Set _A_.[[GetOwnProperty]] as specified in . - 1. Set _A_.[[HasProperty]] as specified in . - 1. Set _A_.[[DefineOwnProperty]] as specified in . - 1. Set _A_.[[Get]] as specified in . - 1. Set _A_.[[Set]] as specified in . - 1. Set _A_.[[Delete]] as specified in . - 1. Set _A_.[[OwnPropertyKeys]] as specified in . - 1. Set _A_.[[Prototype]] to _prototype_. - 1. Return _A_. + 1. Let _ta_ be MakeBasicObject(_internalSlotsList_). + 1. Set _ta_.[[PreventExtensions]] as specified in . + 1. Set _ta_.[[GetOwnProperty]] as specified in . + 1. Set _ta_.[[HasProperty]] as specified in . + 1. Set _ta_.[[DefineOwnProperty]] as specified in . + 1. Set _ta_.[[Get]] as specified in . + 1. Set _ta_.[[Set]] as specified in . + 1. Set _ta_.[[Delete]] as specified in . + 1. Set _ta_.[[OwnPropertyKeys]] as specified in . + 1. Set _ta_.[[Prototype]] to _proto_. + 1. Return _ta_.
        @@ -14757,12 +15356,12 @@

        - 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, return 0. + 1. Assert: IsTypedArrayOutOfBounds(_taRecord_) is *false*. + 1. Let _obj_ be _taRecord_.[[Object]]. + 1. If _obj_.[[ByteLength]] is not ~auto~, return _obj_.[[ByteLength]]. 1. Let _length_ be TypedArrayLength(_taRecord_). - 1. If _length_ = 0, return 0. - 1. Let _O_ be _taRecord_.[[Object]]. - 1. If _O_.[[ByteLength]] is not ~auto~, return _O_.[[ByteLength]]. - 1. Let _elementSize_ be TypedArrayElementSize(_O_). + 1. Let _elementSize_ be TypedArrayElementSize(_obj_). + 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_. @@ -14777,11 +15376,11 @@

        1. Assert: IsTypedArrayOutOfBounds(_taRecord_) is *false*. - 1. Let _O_ be _taRecord_.[[Object]]. - 1. If _O_.[[ArrayLength]] is not ~auto~, return _O_.[[ArrayLength]]. - 1. Assert: IsFixedLengthArrayBuffer(_O_.[[ViewedArrayBuffer]]) is *false*. - 1. Let _byteOffset_ be _O_.[[ByteOffset]]. - 1. Let _elementSize_ be TypedArrayElementSize(_O_). + 1. Let _obj_ be _taRecord_.[[Object]]. + 1. If _obj_.[[ArrayLength]] is not ~auto~, return _obj_.[[ArrayLength]]. + 1. Assert: IsFixedLengthArrayBuffer(_obj_.[[ViewedArrayBuffer]]) is *false*. + 1. Let _byteOffset_ be _obj_.[[ByteOffset]]. + 1. Let _elementSize_ be TypedArrayElementSize(_obj_). 1. Let _byteLength_ be _taRecord_.[[CachedBufferByteLength]]. 1. Assert: _byteLength_ is not ~detached~. 1. Return floor((_byteLength_ - _byteOffset_) / _elementSize_). @@ -14799,40 +15398,59 @@

        It checks if any of the object's numeric properties reference a value at an index not contained within the underlying buffer's bounds.
        - 1. Let _O_ be _taRecord_.[[Object]]. + 1. Let _obj_ 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. Let _byteOffsetStart_ be _O_.[[ByteOffset]]. - 1. If _O_.[[ArrayLength]] is ~auto~, then + 1. If IsDetachedBuffer(_obj_.[[ViewedArrayBuffer]]) is *true*, then + 1. Assert: _bufferByteLength_ is ~detached~. + 1. Return *true*. + 1. Assert: _bufferByteLength_ is a non-negative integer. + 1. Let _byteOffsetStart_ be _obj_.[[ByteOffset]]. + 1. If _obj_.[[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 _elementSize_ be TypedArrayElementSize(_obj_). + 1. Let _arrayByteLength_ be _obj_.[[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 ( + _obj_: a TypedArray, + ): a Boolean +

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

        IsValidIntegerIndex ( - _O_: a TypedArray, + _obj_: a TypedArray, _index_: a Number, ): a Boolean

        - 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. 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 IsDetachedBuffer(_obj_.[[ViewedArrayBuffer]]) is *true*, 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(_obj_, ~unordered~). + 1. NOTE: Bounds checking is not a synchronizing operation when _obj_'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*.
        @@ -14840,26 +15458,26 @@

        TypedArrayGetElement ( - _O_: a TypedArray, + _obj_: a TypedArray, _index_: a Number, ): a Number, a BigInt, or *undefined*

        - 1. If IsValidIntegerIndex(_O_, _index_) is *false*, return *undefined*. - 1. Let _offset_ be _O_.[[ByteOffset]]. - 1. Let _elementSize_ be TypedArrayElementSize(_O_). + 1. If IsValidIntegerIndex(_obj_, _index_) is *false*, return *undefined*. + 1. Let _offset_ be _obj_.[[ByteOffset]]. + 1. Let _elementSize_ be TypedArrayElementSize(_obj_). 1. Let _byteIndexInBuffer_ be (ℝ(_index_) × _elementSize_) + _offset_. - 1. Let _elementType_ be TypedArrayElementType(_O_). - 1. Return GetValueFromBuffer(_O_.[[ViewedArrayBuffer]], _byteIndexInBuffer_, _elementType_, *true*, ~unordered~). + 1. Let _elementType_ be TypedArrayElementType(_obj_). + 1. Return GetValueFromBuffer(_obj_.[[ViewedArrayBuffer]], _byteIndexInBuffer_, _elementType_, *true*, ~unordered~).

        TypedArraySetElement ( - _O_: a TypedArray, + _obj_: a TypedArray, _index_: a Number, _value_: an ECMAScript language value, ): either a normal completion containing ~unused~ or a throw completion @@ -14867,14 +15485,14 @@

        - 1. If _O_.[[ContentType]] is ~bigint~, let _numValue_ be ? ToBigInt(_value_). - 1. Otherwise, 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_). + 1. If _obj_.[[ContentType]] is ~bigint~, let _number_ be ? ToBigInt(_value_). + 1. Else, let _number_ be ? ToNumber(_value_). + 1. If IsValidIntegerIndex(_obj_, _index_) is *true*, then + 1. Let _offset_ be _obj_.[[ByteOffset]]. + 1. Let _elementSize_ be TypedArrayElementSize(_obj_). 1. Let _byteIndexInBuffer_ be (ℝ(_index_) × _elementSize_) + _offset_. - 1. Let _elementType_ be TypedArrayElementType(_O_). - 1. Perform SetValueInBuffer(_O_.[[ViewedArrayBuffer]], _byteIndexInBuffer_, _elementType_, _numValue_, *true*, ~unordered~). + 1. Let _elementType_ be TypedArrayElementType(_obj_). + 1. Perform SetValueInBuffer(_obj_.[[ViewedArrayBuffer]], _byteIndexInBuffer_, _elementType_, _number_, *true*, ~unordered~). 1. Return ~unused~. @@ -14885,7 +15503,7 @@

        IsArrayBufferViewOutOfBounds ( - _O_: a TypedArray or a DataView, + _obj_: a TypedArray or a DataView, ): a Boolean

        @@ -14893,10 +15511,10 @@

        It checks if either any of a TypedArray's numeric properties or a DataView object's methods can reference a value at an index not contained within the underlying data block's bounds. This abstract operation exists as a convenience for upstream specifications.

        - 1. If _O_ has a [[DataView]] internal slot, then - 1. Let _viewRecord_ be MakeDataViewWithBufferWitnessRecord(_O_, ~seq-cst~). + 1. If _obj_ has a [[DataView]] internal slot, then + 1. Let _viewRecord_ be MakeDataViewWithBufferWitnessRecord(_obj_, ~seq-cst~). 1. Return IsViewOutOfBounds(_viewRecord_). - 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~). + 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_obj_, ~seq-cst~). 1. Return IsTypedArrayOutOfBounds(_taRecord_).
        @@ -14909,17 +15527,19 @@

        Module Namespace Exotic Objects

        Module namespace exotic objects have the internal slots defined in .

        - - - - - + + + + + + +
        - Internal Slot - - Type - - Description -
        + Internal Slot + + Type + + Description +
        [[Module]] @@ -14959,15 +15579,15 @@

        [[GetPrototypeOf]] ( ): a normal completion containing *null*

        [[SetPrototypeOf]] ( - _V_: an Object or *null*, + _proto_: an Object or *null*, ): a normal completion containing a Boolean

        for
        -
        a module namespace exotic object _O_
        +
        a module namespace exotic object _obj_
        - 1. Return ! SetImmutablePrototype(_O_, _V_). + 1. Return ! SetImmutablePrototype(_obj_, _proto_).
        @@ -14996,18 +15616,18 @@

        [[PreventExtensions]] ( ): a normal completion containing *true*

        [[GetOwnProperty]] ( - _P_: a property key, + _propertyKey_: a property key, ): either a normal completion containing either a Property Descriptor or *undefined*, or a throw completion

        for
        -
        a module namespace exotic object _O_
        +
        a module namespace exotic object _obj_
        - 1. If _P_ is a Symbol, return OrdinaryGetOwnProperty(_O_, _P_). - 1. Let _exports_ be _O_.[[Exports]]. - 1. If _exports_ does not contain _P_, return *undefined*. - 1. Let _value_ be ? _O_.[[Get]](_P_, _O_). + 1. If _propertyKey_ is a Symbol, return OrdinaryGetOwnProperty(_obj_, _propertyKey_). + 1. Let _exports_ be _obj_.[[Exports]]. + 1. If _exports_ does not contain _propertyKey_, return *undefined*. + 1. Let _value_ be ? _obj_.[[Get]](_propertyKey_, _obj_). 1. Return PropertyDescriptor { [[Value]]: _value_, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: *false* }.
        @@ -15015,23 +15635,23 @@

        [[DefineOwnProperty]] ( - _P_: a property key, - _Desc_: a Property Descriptor, + _propertyKey_: a property key, + _propertyDesc_: a Property Descriptor, ): either a normal completion containing a Boolean or a throw completion

        for
        -
        a module namespace exotic object _O_
        +
        a module namespace exotic object _obj_
        - 1. If _P_ is a Symbol, return ! OrdinaryDefineOwnProperty(_O_, _P_, _Desc_). - 1. Let _current_ be ? _O_.[[GetOwnProperty]](_P_). + 1. If _propertyKey_ is a Symbol, return ! OrdinaryDefineOwnProperty(_obj_, _propertyKey_, _propertyDesc_). + 1. Let _current_ be ? _obj_.[[GetOwnProperty]](_propertyKey_). 1. If _current_ is *undefined*, return *false*. - 1. If _Desc_ has a [[Configurable]] field and _Desc_.[[Configurable]] is *true*, return *false*. - 1. If _Desc_ has an [[Enumerable]] field and _Desc_.[[Enumerable]] is *false*, return *false*. - 1. If IsAccessorDescriptor(_Desc_) is *true*, return *false*. - 1. If _Desc_ has a [[Writable]] field and _Desc_.[[Writable]] is *false*, return *false*. - 1. If _Desc_ has a [[Value]] field, return SameValue(_Desc_.[[Value]], _current_.[[Value]]). + 1. If _propertyDesc_ has a [[Configurable]] field and _propertyDesc_.[[Configurable]] is *true*, return *false*. + 1. If _propertyDesc_ has an [[Enumerable]] field and _propertyDesc_.[[Enumerable]] is *false*, return *false*. + 1. If IsAccessorDescriptor(_propertyDesc_) is *true*, return *false*. + 1. If _propertyDesc_ has a [[Writable]] field and _propertyDesc_.[[Writable]] is *false*, return *false*. + 1. If _propertyDesc_ has a [[Value]] field, return SameValue(_propertyDesc_.[[Value]], _current_.[[Value]]). 1. Return *true*.
        @@ -15039,17 +15659,17 @@

        [[HasProperty]] ( - _P_: a property key, + _propertyKey_: a property key, ): a normal completion containing a Boolean

        for
        -
        a module namespace exotic object _O_
        +
        a module namespace exotic object _obj_
        - 1. If _P_ is a Symbol, return ! OrdinaryHasProperty(_O_, _P_). - 1. Let _exports_ be _O_.[[Exports]]. - 1. If _exports_ contains _P_, return *true*. + 1. If _propertyKey_ is a Symbol, return ! OrdinaryHasProperty(_obj_, _propertyKey_). + 1. Let _exports_ be _obj_.[[Exports]]. + 1. If _exports_ contains _propertyKey_, return *true*. 1. Return *false*.
        @@ -15057,21 +15677,21 @@

        [[Get]] ( - _P_: a property key, - _Receiver_: an ECMAScript language value, + _propertyKey_: a property key, + _receiver_: an ECMAScript language value, ): either a normal completion containing an ECMAScript language value or a throw completion

        for
        -
        a module namespace exotic object _O_
        +
        a module namespace exotic object _obj_
        - 1. If _P_ is a Symbol, then - 1. Return ! OrdinaryGet(_O_, _P_, _Receiver_). - 1. Let _exports_ be _O_.[[Exports]]. - 1. If _exports_ does not contain _P_, return *undefined*. - 1. Let _m_ be _O_.[[Module]]. - 1. Let _binding_ be _m_.ResolveExport(_P_). + 1. If _propertyKey_ is a Symbol, then + 1. Return ! OrdinaryGet(_obj_, _propertyKey_, _receiver_). + 1. Let _exports_ be _obj_.[[Exports]]. + 1. If _exports_ does not contain _propertyKey_, return *undefined*. + 1. Let _module_ be _obj_.[[Module]]. + 1. Let _binding_ be _module_.ResolveExport(_propertyKey_). 1. Assert: _binding_ is a ResolvedBinding Record. 1. Let _targetModule_ be _binding_.[[Module]]. 1. Assert: _targetModule_ is not *undefined*. @@ -15089,9 +15709,9 @@

        [[Set]] ( - _P_: a property key, - _V_: an ECMAScript language value, - _Receiver_: an ECMAScript language value, + _propertyKey_: a property key, + _value_: an ECMAScript language value, + _receiver_: an ECMAScript language value, ): a normal completion containing *false*

        @@ -15106,18 +15726,18 @@

        [[Delete]] ( - _P_: a property key, + _propertyKey_: a property key, ): a normal completion containing a Boolean

        for
        -
        a module namespace exotic object _O_
        +
        a module namespace exotic object _obj_
        - 1. If _P_ is a Symbol, then - 1. Return ! OrdinaryDelete(_O_, _P_). - 1. Let _exports_ be _O_.[[Exports]]. - 1. If _exports_ contains _P_, return *false*. + 1. If _propertyKey_ is a Symbol, then + 1. Return ! OrdinaryDelete(_obj_, _propertyKey_). + 1. Let _exports_ be _obj_.[[Exports]]. + 1. If _exports_ contains _propertyKey_, return *false*. 1. Return *true*.
        @@ -15126,11 +15746,11 @@

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

        for
        -
        a module namespace exotic object _O_
        +
        a module namespace exotic object _obj_
        - 1. Let _exports_ be _O_.[[Exports]]. - 1. Let _symbolKeys_ be OrdinaryOwnPropertyKeys(_O_). + 1. Let _exports_ be _obj_.[[Exports]]. + 1. Let _symbolKeys_ be OrdinaryOwnPropertyKeys(_obj_). 1. Return the list-concatenation of _exports_ and _symbolKeys_. @@ -15149,14 +15769,14 @@

        1. Assert: _module_.[[Namespace]] is ~empty~. 1. Let _internalSlotsList_ be the internal slots listed in . - 1. Let _M_ be MakeBasicObject(_internalSlotsList_). - 1. Set _M_'s essential internal methods to the definitions specified in . - 1. Set _M_.[[Module]] to _module_. + 1. Let _namespace_ be MakeBasicObject(_internalSlotsList_). + 1. Set _namespace_'s essential internal methods to the definitions specified in . + 1. Set _namespace_.[[Module]] to _module_. 1. Let _sortedExports_ be a List whose elements are the elements of _exports_, sorted according to lexicographic code unit order. - 1. Set _M_.[[Exports]] to _sortedExports_. - 1. Create own properties of _M_ corresponding to the definitions in . - 1. Set _module_.[[Namespace]] to _M_. - 1. Return _M_. + 1. Set _namespace_.[[Exports]] to _sortedExports_. + 1. Create own properties of _namespace_ corresponding to the definitions in . + 1. Set _module_.[[Namespace]] to _namespace_. + 1. Return _namespace_. @@ -15174,30 +15794,30 @@

        Immutable Prototype Exotic Objects

        [[SetPrototypeOf]] ( - _V_: an Object or *null*, + _proto_: an Object or *null*, ): either a normal completion containing a Boolean or a throw completion

        for
        -
        an immutable prototype exotic object _O_
        +
        an immutable prototype exotic object _obj_
        - 1. Return ? SetImmutablePrototype(_O_, _V_). + 1. Return ? SetImmutablePrototype(_obj_, _proto_).

        SetImmutablePrototype ( - _O_: an Object, - _V_: an Object or *null*, + _obj_: an Object, + _proto_: an Object or *null*, ): either a normal completion containing a Boolean or a throw completion

        - 1. Let _current_ be ? _O_.[[GetPrototypeOf]](). - 1. If SameValue(_V_, _current_) is *true*, return *true*. + 1. Let _current_ be ? _obj_.[[GetPrototypeOf]](). + 1. If SameValue(_proto_, _current_) is *true*, return *true*. 1. Return *false*.
        @@ -15206,20 +15826,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]] @@ -15329,27 +15951,27 @@

        Proxy Object Internal Methods and Internal Slots

        When a handler method is called to provide the implementation of a Proxy object internal method, the handler method is passed the proxy's target object as a parameter. A proxy's handler object does not necessarily have a method corresponding to every essential internal method. Invoking an internal method on the proxy results in the invocation of the corresponding internal method on the proxy's target object if the handler object does not have a method corresponding to the internal trap.

        The [[ProxyHandler]] and [[ProxyTarget]] internal slots of a Proxy object are always initialized when the object is created and typically may not be modified. Some Proxy objects are created in a manner that permits them to be subsequently revoked. When a proxy is revoked, its [[ProxyHandler]] and [[ProxyTarget]] internal slots are set to *null* causing subsequent invocations of internal methods on that Proxy object to throw a *TypeError* exception.

        Because Proxy objects permit the implementation of internal methods to be provided by arbitrary ECMAScript code, it is possible to define a Proxy object whose handler methods violates the invariants defined in . Some of the internal method invariants defined in are essential integrity invariants. These invariants are explicitly enforced by the Proxy object internal methods specified in this section. An ECMAScript implementation must be robust in the presence of all possible invariant violations.

        -

        In the following algorithm descriptions, assume _O_ is an ECMAScript Proxy object, _P_ is a property key value, _V_ is any ECMAScript language value and _Desc_ is a Property Descriptor record.

        +

        In the following algorithm descriptions, assume _obj_ is an ECMAScript Proxy object, _propertyKey_ is a property key value, _value_ is any ECMAScript language value and _propertyDesc_ is a Property Descriptor record.

        [[GetPrototypeOf]] ( ): either a normal completion containing either an Object or *null*, or a throw completion

        for
        -
        a Proxy exotic object _O_
        +
        a Proxy exotic object _obj_
        - 1. Perform ? ValidateNonRevokedProxy(_O_). - 1. Let _target_ be _O_.[[ProxyTarget]]. - 1. Let _handler_ be _O_.[[ProxyHandler]]. + 1. Perform ? ValidateNonRevokedProxy(_obj_). + 1. Let _target_ be _obj_.[[ProxyTarget]]. + 1. Let _handler_ be _obj_.[[ProxyHandler]]. 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_. @@ -15369,27 +15991,27 @@

        [[GetPrototypeOf]] ( ): either a normal completion containing either an Obje

        [[SetPrototypeOf]] ( - _V_: an Object or *null*, + _proto_: an Object or *null*, ): either a normal completion containing a Boolean or a throw completion

        for
        -
        a Proxy exotic object _O_
        +
        a Proxy exotic object _obj_
        - 1. Perform ? ValidateNonRevokedProxy(_O_). - 1. Let _target_ be _O_.[[ProxyTarget]]. - 1. Let _handler_ be _O_.[[ProxyHandler]]. + 1. Perform ? ValidateNonRevokedProxy(_obj_). + 1. Let _target_ be _obj_.[[ProxyTarget]]. + 1. Let _handler_ be _obj_.[[ProxyHandler]]. 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. Let _booleanTrapResult_ be ToBoolean(? Call(_trap_, _handler_, « _target_, _V_ »)). - 1. If _booleanTrapResult_ is *false*, return *false*. + 1. Return ? _target_.[[SetPrototypeOf]](_proto_). + 1. Let _boolTrapResult_ be ToBoolean(? Call(_trap_, _handler_, « _target_, _proto_ »)). + 1. If _boolTrapResult_ is *false*, return *false*. 1. Let _extensibleTarget_ be ? IsExtensible(_target_). 1. If _extensibleTarget_ is *true*, return *true*. - 1. Let _targetProto_ be ? _target_.[[GetPrototypeOf]](). - 1. If SameValue(_V_, _targetProto_) is *false*, throw a *TypeError* exception. + 1. Let _targetProto_ be ? _target_.[[GetPrototypeOf]](). + 1. If SameValue(_proto_, _targetProto_) is *false*, throw a *TypeError* exception. 1. Return *true*. @@ -15409,20 +16031,20 @@

        [[IsExtensible]] ( ): either a normal completion containing a Boolean or a throw completion

        for
        -
        a Proxy exotic object _O_
        +
        a Proxy exotic object _obj_
        - 1. Perform ? ValidateNonRevokedProxy(_O_). - 1. Let _target_ be _O_.[[ProxyTarget]]. - 1. Let _handler_ be _O_.[[ProxyHandler]]. + 1. Perform ? ValidateNonRevokedProxy(_obj_). + 1. Let _target_ be _obj_.[[ProxyTarget]]. + 1. Let _handler_ be _obj_.[[ProxyHandler]]. 1. Assert: _handler_ is an Object. 1. Let _trap_ be ? GetMethod(_handler_, *"isExtensible"*). 1. If _trap_ is *undefined*, then 1. Return ? IsExtensible(_target_). - 1. Let _booleanTrapResult_ be ToBoolean(? Call(_trap_, _handler_, « _target_ »)). + 1. Let _boolTrapResult_ be ToBoolean(? Call(_trap_, _handler_, « _target_ »)). 1. Let _targetResult_ be ? IsExtensible(_target_). - 1. If _booleanTrapResult_ is not _targetResult_, throw a *TypeError* exception. - 1. Return _booleanTrapResult_. + 1. If _boolTrapResult_ is not _targetResult_, throw a *TypeError* exception. + 1. Return _boolTrapResult_.

        [[IsExtensible]] for Proxy objects enforces the following invariants:

        @@ -15441,21 +16063,21 @@

        [[IsExtensible]] ( ): either a normal completion containing a Boolean or a t

        [[PreventExtensions]] ( ): either a normal completion containing a Boolean or a throw completion

        for
        -
        a Proxy exotic object _O_
        +
        a Proxy exotic object _obj_
        - 1. Perform ? ValidateNonRevokedProxy(_O_). - 1. Let _target_ be _O_.[[ProxyTarget]]. - 1. Let _handler_ be _O_.[[ProxyHandler]]. + 1. Perform ? ValidateNonRevokedProxy(_obj_). + 1. Let _target_ be _obj_.[[ProxyTarget]]. + 1. Let _handler_ be _obj_.[[ProxyHandler]]. 1. Assert: _handler_ is an Object. 1. Let _trap_ be ? GetMethod(_handler_, *"preventExtensions"*). 1. If _trap_ is *undefined*, then 1. Return ? _target_.[[PreventExtensions]](). - 1. Let _booleanTrapResult_ be ToBoolean(? Call(_trap_, _handler_, « _target_ »)). - 1. If _booleanTrapResult_ is *true*, then + 1. Let _boolTrapResult_ be ToBoolean(? Call(_trap_, _handler_, « _target_ »)). + 1. If _boolTrapResult_ is *true*, then 1. Let _extensibleTarget_ be ? IsExtensible(_target_). 1. If _extensibleTarget_ is *true*, throw a *TypeError* exception. - 1. Return _booleanTrapResult_. + 1. Return _boolTrapResult_.

        [[PreventExtensions]] for Proxy objects enforces the following invariants:

        @@ -15473,24 +16095,24 @@

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

        [[GetOwnProperty]] ( - _P_: a property key, + _propertyKey_: a property key, ): either a normal completion containing either a Property Descriptor or *undefined*, or a throw completion

        for
        -
        a Proxy exotic object _O_
        +
        a Proxy exotic object _obj_
        - 1. Perform ? ValidateNonRevokedProxy(_O_). - 1. Let _target_ be _O_.[[ProxyTarget]]. - 1. Let _handler_ be _O_.[[ProxyHandler]]. + 1. Perform ? ValidateNonRevokedProxy(_obj_). + 1. Let _target_ be _obj_.[[ProxyTarget]]. + 1. Let _handler_ be _obj_.[[ProxyHandler]]. 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. Let _trapResultObj_ be ? Call(_trap_, _handler_, « _target_, _P_ »). + 1. Return ? _target_.[[GetOwnProperty]](_propertyKey_). + 1. Let _trapResultObj_ be ? Call(_trap_, _handler_, « _target_, _propertyKey_ »). 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]](_propertyKey_). 1. If _trapResultObj_ is *undefined*, then 1. If _targetDesc_ is *undefined*, return *undefined*. 1. If _targetDesc_.[[Configurable]] is *false*, throw a *TypeError* exception. @@ -15514,7 +16136,7 @@

        [[GetOwnProperty]] for Proxy objects enforces the following invariants:

        • - The result of [[GetOwnProperty]] must be either an Object or *undefined*. + The result of [[GetOwnProperty]] must be either a Property Descriptor or *undefined*.
        • A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. @@ -15538,28 +16160,28 @@

          [[DefineOwnProperty]] ( - _P_: a property key, - _Desc_: a Property Descriptor, + _propertyKey_: a property key, + _propertyDesc_: a Property Descriptor, ): either a normal completion containing a Boolean or a throw completion

          for
          -
          a Proxy exotic object _O_
          +
          a Proxy exotic object _obj_
          - 1. Perform ? ValidateNonRevokedProxy(_O_). - 1. Let _target_ be _O_.[[ProxyTarget]]. - 1. Let _handler_ be _O_.[[ProxyHandler]]. + 1. Perform ? ValidateNonRevokedProxy(_obj_). + 1. Let _target_ be _obj_.[[ProxyTarget]]. + 1. Let _handler_ be _obj_.[[ProxyHandler]]. 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. 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. Return ? _target_.[[DefineOwnProperty]](_propertyKey_, _propertyDesc_). + 1. Let _propertyDescObj_ be FromPropertyDescriptor(_propertyDesc_). + 1. Let _boolTrapResult_ be ToBoolean(? Call(_trap_, _handler_, « _target_, _propertyKey_, _propertyDescObj_ »)). + 1. If _boolTrapResult_ is *false*, return *false*. + 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_propertyKey_). 1. Let _extensibleTarget_ be ? IsExtensible(_target_). - 1. If _Desc_ has a [[Configurable]] field and _Desc_.[[Configurable]] is *false*, then + 1. If _propertyDesc_ has a [[Configurable]] field and _propertyDesc_.[[Configurable]] is *false*, then 1. Let _settingConfigFalse_ be *true*. 1. Else, 1. Let _settingConfigFalse_ be *false*. @@ -15567,10 +16189,10 @@

          1. If _extensibleTarget_ is *false*, throw a *TypeError* exception. 1. If _settingConfigFalse_ is *true*, throw a *TypeError* exception. 1. Else, - 1. If IsCompatiblePropertyDescriptor(_extensibleTarget_, _Desc_, _targetDesc_) is *false*, throw a *TypeError* exception. + 1. If IsCompatiblePropertyDescriptor(_extensibleTarget_, _propertyDesc_, _targetDesc_) is *false*, throw a *TypeError* exception. 1. If _settingConfigFalse_ is *true* and _targetDesc_.[[Configurable]] is *true*, throw a *TypeError* exception. 1. If IsDataDescriptor(_targetDesc_) is *true*, _targetDesc_.[[Configurable]] is *false*, and _targetDesc_.[[Writable]] is *true*, then - 1. If _Desc_ has a [[Writable]] field and _Desc_.[[Writable]] is *false*, throw a *TypeError* exception. + 1. If _propertyDesc_ has a [[Writable]] field and _propertyDesc_.[[Writable]] is *false*, throw a *TypeError* exception. 1. Return *true*. @@ -15598,29 +16220,29 @@

          [[HasProperty]] ( - _P_: a property key, + _propertyKey_: a property key, ): either a normal completion containing a Boolean or a throw completion

          for
          -
          a Proxy exotic object _O_
          +
          a Proxy exotic object _obj_
          - 1. Perform ? ValidateNonRevokedProxy(_O_). - 1. Let _target_ be _O_.[[ProxyTarget]]. - 1. Let _handler_ be _O_.[[ProxyHandler]]. + 1. Perform ? ValidateNonRevokedProxy(_obj_). + 1. Let _target_ be _obj_.[[ProxyTarget]]. + 1. Let _handler_ be _obj_.[[ProxyHandler]]. 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. Let _booleanTrapResult_ be ToBoolean(? Call(_trap_, _handler_, « _target_, _P_ »)). - 1. If _booleanTrapResult_ is *false*, then - 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_P_). + 1. Return ? _target_.[[HasProperty]](_propertyKey_). + 1. Let _boolTrapResult_ be ToBoolean(? Call(_trap_, _handler_, « _target_, _propertyKey_ »)). + 1. If _boolTrapResult_ is *false*, then + 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_propertyKey_). 1. If _targetDesc_ is not *undefined*, then 1. If _targetDesc_.[[Configurable]] is *false*, throw a *TypeError* exception. 1. Let _extensibleTarget_ be ? IsExtensible(_target_). 1. If _extensibleTarget_ is *false*, throw a *TypeError* exception. - 1. Return _booleanTrapResult_. + 1. Return _boolTrapResult_.

          [[HasProperty]] for Proxy objects enforces the following invariants:

          @@ -15641,28 +16263,28 @@

          [[Get]] ( - _P_: a property key, - _Receiver_: an ECMAScript language value, + _propertyKey_: a property key, + _receiver_: an ECMAScript language value, ): either a normal completion containing an ECMAScript language value or a throw completion

          for
          -
          a Proxy exotic object _O_
          +
          a Proxy exotic object _obj_
          - 1. Perform ? ValidateNonRevokedProxy(_O_). - 1. Let _target_ be _O_.[[ProxyTarget]]. - 1. Let _handler_ be _O_.[[ProxyHandler]]. + 1. Perform ? ValidateNonRevokedProxy(_obj_). + 1. Let _target_ be _obj_.[[ProxyTarget]]. + 1. Let _handler_ be _obj_.[[ProxyHandler]]. 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. Let _trapResult_ be ? Call(_trap_, _handler_, « _target_, _P_, _Receiver_ »). - 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_P_). + 1. Return ? _target_.[[Get]](_propertyKey_, _receiver_). + 1. Let _trapResult_ be ? Call(_trap_, _handler_, « _target_, _propertyKey_, _receiver_ »). + 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_propertyKey_). 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. - 1. If IsAccessorDescriptor(_targetDesc_) is *true* and _targetDesc_.[[Get]] is *undefined*, then + 1. If IsAccessorDescriptor(_targetDesc_) is *true* and _targetDesc_.[[Getter]] is *undefined*, then 1. If _trapResult_ is not *undefined*, throw a *TypeError* exception. 1. Return _trapResult_. @@ -15673,7 +16295,7 @@

          The value reported for a property must be the same as the value of the corresponding target object property if the target object property is a non-writable, non-configurable own data property.

        • - The value reported for a property must be *undefined* if the corresponding target object property is a non-configurable own accessor property that has *undefined* as its [[Get]] attribute. + The value reported for a property must be *undefined* if the corresponding target object property is a non-configurable own accessor property that has *undefined* as its [[Getter]] attribute.
        @@ -15682,31 +16304,31 @@

        [[Set]] ( - _P_: a property key, - _V_: an ECMAScript language value, - _Receiver_: an ECMAScript language value, + _propertyKey_: a property key, + _value_: an ECMAScript language value, + _receiver_: an ECMAScript language value, ): either a normal completion containing a Boolean or a throw completion

        for
        -
        a Proxy exotic object _O_
        +
        a Proxy exotic object _obj_
        - 1. Perform ? ValidateNonRevokedProxy(_O_). - 1. Let _target_ be _O_.[[ProxyTarget]]. - 1. Let _handler_ be _O_.[[ProxyHandler]]. + 1. Perform ? ValidateNonRevokedProxy(_obj_). + 1. Let _target_ be _obj_.[[ProxyTarget]]. + 1. Let _handler_ be _obj_.[[ProxyHandler]]. 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. 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. Return ? _target_.[[Set]](_propertyKey_, _value_, _receiver_). + 1. Let _boolTrapResult_ be ToBoolean(? Call(_trap_, _handler_, « _target_, _propertyKey_, _value_, _receiver_ »)). + 1. If _boolTrapResult_ is *false*, return *false*. + 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_propertyKey_). 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. + 1. If SameValue(_value_, _targetDesc_.[[Value]]) is *false*, throw a *TypeError* exception. 1. If IsAccessorDescriptor(_targetDesc_) is *true*, then - 1. If _targetDesc_.[[Set]] is *undefined*, throw a *TypeError* exception. + 1. If _targetDesc_.[[Setter]] is *undefined*, throw a *TypeError* exception. 1. Return *true*. @@ -15719,7 +16341,7 @@

        Cannot change the value of a property to be different from the value of the corresponding target object property if the corresponding target object property is a non-writable, non-configurable own data property.
      • - Cannot set the value of a property if the corresponding target object property is a non-configurable own accessor property that has *undefined* as its [[Set]] attribute. + Cannot set the value of a property if the corresponding target object property is a non-configurable own accessor property that has *undefined* as its [[Setter]] attribute.
      • @@ -15728,24 +16350,24 @@

        [[Delete]] ( - _P_: a property key, + _propertyKey_: a property key, ): either a normal completion containing a Boolean or a throw completion

        for
        -
        a Proxy exotic object _O_
        +
        a Proxy exotic object _obj_
        - 1. Perform ? ValidateNonRevokedProxy(_O_). - 1. Let _target_ be _O_.[[ProxyTarget]]. - 1. Let _handler_ be _O_.[[ProxyHandler]]. + 1. Perform ? ValidateNonRevokedProxy(_obj_). + 1. Let _target_ be _obj_.[[ProxyTarget]]. + 1. Let _handler_ be _obj_.[[ProxyHandler]]. 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. Let _booleanTrapResult_ be ToBoolean(? Call(_trap_, _handler_, « _target_, _P_ »)). - 1. If _booleanTrapResult_ is *false*, return *false*. - 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_P_). + 1. Return ? _target_.[[Delete]](_propertyKey_). + 1. Let _boolTrapResult_ be ToBoolean(? Call(_trap_, _handler_, « _target_, _propertyKey_ »)). + 1. If _boolTrapResult_ is *false*, return *false*. + 1. Let _targetDesc_ be ? _target_.[[GetOwnProperty]](_propertyKey_). 1. If _targetDesc_ is *undefined*, return *true*. 1. If _targetDesc_.[[Configurable]] is *false*, throw a *TypeError* exception. 1. Let _extensibleTarget_ be ? IsExtensible(_target_). @@ -15772,18 +16394,18 @@

        [[OwnPropertyKeys]] ( ): either a normal completion containing a List of property keys or a throw completion

        for
        -
        a Proxy exotic object _O_
        +
        a Proxy exotic object _obj_
        - 1. Perform ? ValidateNonRevokedProxy(_O_). - 1. Let _target_ be _O_.[[ProxyTarget]]. - 1. Let _handler_ be _O_.[[ProxyHandler]]. + 1. Perform ? ValidateNonRevokedProxy(_obj_). + 1. Let _target_ be _obj_.[[ProxyTarget]]. + 1. Let _handler_ be _obj_.[[ProxyHandler]]. 1. Assert: _handler_ is an Object. 1. Let _trap_ be ? GetMethod(_handler_, *"ownKeys"*). 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,8 +16414,8 @@

        [[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. If _desc_ is not *undefined* and _desc_.[[Configurable]] is *false*, then + 1. Let _propertyDesc_ be ? _target_.[[GetOwnProperty]](_key_). + 1. If _propertyDesc_ is not *undefined* and _propertyDesc_.[[Configurable]] is *false*, then 1. Append _key_ to _targetNonconfigurableKeys_. 1. Else, 1. Append _key_ to _targetConfigurableKeys_. @@ -15820,7 +16442,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. @@ -15835,24 +16457,24 @@

        [[OwnPropertyKeys]] ( ): either a normal completion containing a List of pro

        [[Call]] ( - _thisArgument_: an ECMAScript language value, - _argumentsList_: a List of ECMAScript language values, + _thisArg_: an ECMAScript language value, + _argList_: a List of ECMAScript language values, ): either a normal completion containing an ECMAScript language value or a throw completion

        for
        -
        a Proxy exotic object _O_
        +
        a Proxy exotic object _obj_
        - 1. Perform ? ValidateNonRevokedProxy(_O_). - 1. Let _target_ be _O_.[[ProxyTarget]]. - 1. Let _handler_ be _O_.[[ProxyHandler]]. + 1. Perform ? ValidateNonRevokedProxy(_obj_). + 1. Let _target_ be _obj_.[[ProxyTarget]]. + 1. Let _handler_ be _obj_.[[ProxyHandler]]. 1. Assert: _handler_ is an Object. 1. Let _trap_ be ? GetMethod(_handler_, *"apply"*). 1. If _trap_ is *undefined*, then - 1. Return ? Call(_target_, _thisArgument_, _argumentsList_). - 1. Let _argArray_ be CreateArrayFromList(_argumentsList_). - 1. Return ? Call(_trap_, _handler_, « _target_, _thisArgument_, _argArray_ »). + 1. Return ? Call(_target_, _thisArg_, _argList_). + 1. Let _argArray_ be CreateArrayFromList(_argList_). + 1. Return ? Call(_trap_, _handler_, « _target_, _thisArg_, _argArray_ »).

        A Proxy exotic object only has a [[Call]] internal method if the initial value of its [[ProxyTarget]] internal slot is an object that has a [[Call]] internal method.

        @@ -15862,24 +16484,24 @@

        [[Construct]] ( - _argumentsList_: a List of ECMAScript language values, + _argList_: a List of ECMAScript language values, _newTarget_: a constructor, ): either a normal completion containing an Object or a throw completion

        for
        -
        a Proxy exotic object _O_
        +
        a Proxy exotic object _obj_
        - 1. Perform ? ValidateNonRevokedProxy(_O_). - 1. Let _target_ be _O_.[[ProxyTarget]]. + 1. Perform ? ValidateNonRevokedProxy(_obj_). + 1. Let _target_ be _obj_.[[ProxyTarget]]. 1. Assert: IsConstructor(_target_) is *true*. - 1. Let _handler_ be _O_.[[ProxyHandler]]. + 1. Let _handler_ be _obj_.[[ProxyHandler]]. 1. Assert: _handler_ is an Object. 1. Let _trap_ be ? GetMethod(_handler_, *"construct"*). 1. If _trap_ is *undefined*, then - 1. Return ? Construct(_target_, _argumentsList_, _newTarget_). - 1. Let _argArray_ be CreateArrayFromList(_argumentsList_). + 1. Return ? Construct(_target_, _argList_, _newTarget_). + 1. Let _argArray_ be CreateArrayFromList(_argList_). 1. Let _newObj_ be ? Call(_trap_, _handler_, « _target_, _argArray_, _newTarget_ »). 1. If _newObj_ is not an Object, throw a *TypeError* exception. 1. Return _newObj_. @@ -15928,15 +16550,15 @@

        1. If _target_ is not an Object, throw a *TypeError* exception. 1. If _handler_ is not an Object, throw a *TypeError* exception. - 1. Let _P_ be MakeBasicObject(« [[ProxyHandler]], [[ProxyTarget]] »). - 1. Set _P_'s essential internal methods, except for [[Call]] and [[Construct]], to the definitions specified in . + 1. Let _proxy_ be MakeBasicObject(« [[ProxyHandler]], [[ProxyTarget]] »). + 1. Set _proxy_'s essential internal methods, except for [[Call]] and [[Construct]], to the definitions specified in . 1. If IsCallable(_target_) is *true*, then - 1. Set _P_.[[Call]] as specified in . + 1. Set _proxy_.[[Call]] as specified in . 1. If IsConstructor(_target_) is *true*, then - 1. Set _P_.[[Construct]] as specified in . - 1. Set _P_.[[ProxyTarget]] to _target_. - 1. Set _P_.[[ProxyHandler]] to _handler_. - 1. Return _P_. + 1. Set _proxy_.[[Construct]] as specified in . + 1. Set _proxy_.[[ProxyTarget]] to _target_. + 1. Set _proxy_.[[ProxyHandler]] to _handler_. + 1. Return _proxy_. @@ -15956,22 +16578,22 @@

        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.

        Static Semantics: UTF16EncodeCodePoint ( - _cp_: a Unicode code point, + _codePoint_: a Unicode code point, ): a String

        - 1. Assert: 0 ≤ _cp_ ≤ 0x10FFFF. - 1. If _cp_ ≤ 0xFFFF, return the String value consisting of the code unit whose numeric value is _cp_. - 1. Let _cu1_ be the code unit whose numeric value is floor((_cp_ - 0x10000) / 0x400) + 0xD800. - 1. Let _cu2_ be the code unit whose numeric value is ((_cp_ - 0x10000) modulo 0x400) + 0xDC00. + 1. Assert: 0 ≤ _codePoint_ ≤ 0x10FFFF. + 1. If _codePoint_ ≤ 0xFFFF, return the String value consisting of the code unit whose numeric value is _codePoint_. + 1. Let _cu1_ be the code unit whose numeric value is floor((_codePoint_ - 0x10000) / 0x400) + 0xD800. + 1. Let _cu2_ be the code unit whose numeric value is ((_codePoint_ - 0x10000) modulo 0x400) + 0xDC00. 1. Return the string-concatenation of _cu1_ and _cu2_.
        @@ -15988,8 +16610,8 @@

        1. Let _result_ be the empty String. - 1. For each code point _cp_ of _text_, do - 1. Set _result_ to the string-concatenation of _result_ and UTF16EncodeCodePoint(_cp_). + 1. For each code point _codePoint_ of _text_, do + 1. Set _result_ to the string-concatenation of _result_ and UTF16EncodeCodePoint(_codePoint_). 1. Return _result_. @@ -16007,8 +16629,8 @@

        1. Assert: _lead_ is a leading surrogate and _trail_ is a trailing surrogate. - 1. Let _cp_ be (_lead_ - 0xD800) × 0x400 + (_trail_ - 0xDC00) + 0x10000. - 1. Return the code point _cp_. + 1. Let _codePoint_ be (_lead_ - 0xD800) × 0x400 + (_trail_ - 0xDC00) + 0x10000. + 1. Return the code point _codePoint_. @@ -16027,16 +16649,16 @@

        1. Let _size_ be the length of _string_. 1. Assert: _position_ ≥ 0 and _position_ < _size_. 1. Let _first_ be the code unit at index _position_ within _string_. - 1. Let _cp_ be the code point whose numeric value is the numeric value of _first_. + 1. Let _codePoint_ be the code point whose numeric value is the numeric value of _first_. 1. If _first_ is neither a leading surrogate nor a trailing surrogate, then - 1. Return the Record { [[CodePoint]]: _cp_, [[CodeUnitCount]]: 1, [[IsUnpairedSurrogate]]: *false* }. + 1. Return the Record { [[CodePoint]]: _codePoint_, [[CodeUnitCount]]: 1, [[IsUnpairedSurrogate]]: *false* }. 1. If _first_ is a trailing surrogate or _position_ + 1 = _size_, then - 1. Return the Record { [[CodePoint]]: _cp_, [[CodeUnitCount]]: 1, [[IsUnpairedSurrogate]]: *true* }. + 1. Return the Record { [[CodePoint]]: _codePoint_, [[CodeUnitCount]]: 1, [[IsUnpairedSurrogate]]: *true* }. 1. Let _second_ be the code unit at index _position_ + 1 within _string_. 1. If _second_ is not a trailing surrogate, then - 1. Return the Record { [[CodePoint]]: _cp_, [[CodeUnitCount]]: 1, [[IsUnpairedSurrogate]]: *true* }. - 1. Set _cp_ to UTF16SurrogatePairToCodePoint(_first_, _second_). - 1. Return the Record { [[CodePoint]]: _cp_, [[CodeUnitCount]]: 2, [[IsUnpairedSurrogate]]: *false* }. + 1. Return the Record { [[CodePoint]]: _codePoint_, [[CodeUnitCount]]: 1, [[IsUnpairedSurrogate]]: *true* }. + 1. Set _codePoint_ to UTF16SurrogatePairToCodePoint(_first_, _second_). + 1. Return the Record { [[CodePoint]]: _codePoint_, [[CodeUnitCount]]: 2, [[IsUnpairedSurrogate]]: *false* }. @@ -16055,9 +16677,9 @@

        1. Let _size_ be the length of _string_. 1. Let _position_ be 0. 1. Repeat, while _position_ < _size_, - 1. Let _cp_ be CodePointAt(_string_, _position_). - 1. Append _cp_.[[CodePoint]] to _codePoints_. - 1. Set _position_ to _position_ + _cp_.[[CodeUnitCount]]. + 1. Let _codePoint_ be CodePointAt(_string_, _position_). + 1. Append _codePoint_.[[CodePoint]] to _codePoints_. + 1. Set _position_ to _position_ + _codePoint_.[[CodeUnitCount]]. 1. Return _codePoints_. @@ -16075,7 +16697,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,10 +16734,10 @@

        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.

        +

        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 , even if the surrounding code is not strict mode code.

        @@ -16156,13 +16778,14 @@

        Strict Mode Code

        Static Semantics: IsStrict ( - _node_: a Parse Node, + _parseNode_: a Parse Node, ): a Boolean

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

        White Space

        The ECMAScript white space code points are listed in .

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

        Line Terminators

        The ECMAScript line terminator code points are listed in .

        - - - - - + + + + + + +
        - Code Point - - Unicode Name - - Abbreviation -
        + Code Point + + Unicode Name + + Abbreviation +
        `U+000A` @@ -16559,14 +17186,14 @@

        Static Semantics: IdentifierCodePoints ( ): a List of code points

        IdentifierName :: IdentifierStart - 1. Let _cp_ be the IdentifierCodePoint of |IdentifierStart|. - 1. Return « _cp_ ». + 1. Let _codePoint_ be the IdentifierCodePoint of |IdentifierStart|. + 1. Return « _codePoint_ ». IdentifierName :: IdentifierName IdentifierPart - 1. Let _cps_ be the IdentifierCodePoints of the derived |IdentifierName|. - 1. Let _cp_ be the IdentifierCodePoint of |IdentifierPart|. - 1. Return the list-concatenation of _cps_ and « _cp_ ». + 1. Let _codePoints_ be the IdentifierCodePoints of the derived |IdentifierName|. + 1. Let _codePoint_ be the IdentifierCodePoint of |IdentifierPart|. + 1. Return the list-concatenation of _codePoints_ and « _codePoint_ ». @@ -16637,7 +17264,7 @@

        Syntax

        Per , keywords in the grammar match literal sequences of specific |SourceCharacter| elements. A code point in a keyword cannot be expressed by a `\\` |UnicodeEscapeSequence|.

        -

        An |IdentifierName| can contain `\\` |UnicodeEscapeSequence|s, but it is not possible to declare a variable named "else" by spelling it `els\u{65}`. The early error rules in rule out identifiers with the same StringValue as a reserved word.

        +

        An |IdentifierName| can contain `\\` |UnicodeEscapeSequence|s, but it is not possible to declare a variable named “else” by spelling it `els\u{65}`. The early error rules in rule out identifiers with the same StringValue as a reserved word.

        `enum` is not currently used as a keyword in this specification. It is a future reserved word, set aside for use as a keyword in future language extensions.

        @@ -17166,20 +17793,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` @@ -17722,6 +18351,9 @@

        Rules of Automatic Semicolon Insertion

        LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `++` LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `--` + UsingDeclaration[In, Yield, Await] : + `using` [no LineTerminator here] BindingList[?In, ?Yield, ?Await, ~Pattern] `;` + ContinueStatement[Yield, Await] : `continue` `;` `continue` [no LineTerminator here] LabelIdentifier[?Yield, ?Await] `;` @@ -17777,6 +18409,9 @@

        Rules of Automatic Semicolon Insertion

      • When a `++` or `--` token is encountered where the parser would treat it as a postfix operator, and at least one |LineTerminator| occurred between the preceding token and the `++` or `--` token, then a semicolon is automatically inserted before the `++` or `--` token.
      • +
      • + When a `using` token is encountered and a |LineTerminator| is encountered before an |IdentifierName| token, a semicolon is automatically inserted after the `using` token. +
      • When a `continue`, `break`, `return`, `throw`, or `yield` token is encountered and a |LineTerminator| is encountered before the next token, a semicolon is automatically inserted after the `continue`, `break`, `return`, `throw`, or `yield` token.
      • @@ -17795,6 +18430,9 @@

        Rules of Automatic Semicolon Insertion

      • A postfix `++` or `--` operator should be on the same line as its operand.
      • +
      • + A |BindingList| in a `using` declaration should start on the same line as the `using` token. +
      • An |Expression| in a `return` or `throw` statement or an |AssignmentExpression| in a `yield` expression should start on the same line as the `return`, `throw`, or `yield` token.
      • @@ -18235,10 +18873,10 @@

        Elision : `,` - 1. Let _len_ be _nextIndex_ + 1. - 1. Perform ? Set(_array_, *"length"*, 𝔽(_len_), *true*). - 1. NOTE: The above step throws if _len_ exceeds 232 - 1. - 1. Return _len_. + 1. Let _length_ be _nextIndex_ + 1. + 1. Perform ? Set(_array_, *"length"*, 𝔽(_length_), *true*). + 1. NOTE: The above step throws if _length_ exceeds 232 - 1. + 1. Return _length_. Elision : Elision `,` @@ -18261,7 +18899,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 +18909,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_. @@ -18363,11 +19001,24 @@

        Syntax

        |MethodDefinition| is defined in .

        -

        In certain contexts, |ObjectLiteral| is used as a cover grammar for a more restricted secondary grammar. The |CoverInitializedName| production is necessary to fully cover these secondary grammars. However, use of this production results in an early Syntax Error in normal contexts where an actual |ObjectLiteral| is expected.

        +

        See the next section for the significance of |CoverInitializedName|.

        Static Semantics: Early Errors

        + + ObjectLiteral : + `{` PropertyDefinitionList `}` + `{` PropertyDefinitionList `,` `}` + +
          +
        • + 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). +
        • +
        + +

        The List returned by PropertyNameList does not include property names defined using a |ComputedPropertyName|.

        +
        PropertyDefinition : MethodDefinition
        • @@ -18377,7 +19028,6 @@

          Static Semantics: Early Errors

          It is a Syntax Error if the PrivateBoundIdentifiers of |MethodDefinition| is not empty.
        -

        In addition to describing an actual object initializer the |ObjectLiteral| productions are also used as a cover grammar for |ObjectAssignmentPattern| and may be recognized as part of a |CoverParenthesizedExpressionAndArrowParameterList|. When |ObjectLiteral| appears in a context where |ObjectAssignmentPattern| is required the following Early Error rules are not applied. In addition, they are not applied when initially parsing a |CoverParenthesizedExpressionAndArrowParameterList| or |CoverCallExpressionAndAsyncArrowHead|.

        PropertyDefinition : CoverInitializedName
        • @@ -18385,20 +19035,18 @@

          Static Semantics: Early Errors

        -

        This production exists so that |ObjectLiteral| can serve as a cover grammar for |ObjectAssignmentPattern|. It cannot occur in an actual object initializer.

        -
        - - ObjectLiteral : - `{` PropertyDefinitionList `}` - `{` PropertyDefinitionList `,` `}` - -
          -
        • - 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). -
        • -
        - -

        The List returned by PropertyNameList does not include property names defined using a |ComputedPropertyName|.

        +

        Elsewhere in this specification, there are early error rules that, under certain circumstances, require that a |LeftHandSideExpression| must cover an |AssignmentPattern|. Consequently, |ObjectLiteral| serves as a cover grammar for |ObjectAssignmentPattern|. The |CoverInitializedName| production is necessary to fully cover |AssignmentProperty|, but is not valid within an actual object initializer.

        +

        Specifically, in a context where an actual |ObjectLiteral| is expected, the above early error rule prevents the use of |CoverInitializedName|. But in cases where |ObjectLiteral| is used as a cover grammar, the semantics of "must cover" state that the Parse Nodes within the |ObjectLiteral| are not subject to early error rules, and so |CoverInitializedName| is allowed.

        +

        For example, consider:

        +
        
        +            let o = {f = 1};
        +          
        +

        `{f = 1}` is parsed as an |ObjectLiteral| with a |CoverInitializedName|, which results in a Syntax Error via this early error rule.

        +

        In contrast, consider:

        +
        
        +            ({f = 1} = {f: 2});
        +          
        +

        Here, `{f = 1}` is again initially parsed as an |ObjectLiteral| with a |CoverInitializedName|, but since it's the |LeftHandSideExpression| of an |AssignmentExpression|, it must cover an |AssignmentPattern|, so the |ObjectLiteral| and |CoverInitializedName| are not subject to early error rules. Instead, `{f = 1}` is reparsed as an |ObjectAssignmentPattern| with an |AssignmentProperty|, and there is no Syntax Error.

        @@ -18416,22 +19064,44 @@

        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

        PropertyDefinitionList : PropertyDefinition - 1. Let _propName_ be the PropName of |PropertyDefinition|. - 1. If _propName_ is ~empty~, return a new empty List. - 1. Return « _propName_ ». + 1. Let _propertyName_ be the PropName of |PropertyDefinition|. + 1. If _propertyName_ is ~empty~, return a new empty List. + 1. Return « _propertyName_ ». PropertyDefinitionList : PropertyDefinitionList `,` PropertyDefinition 1. Let _list_ be the PropertyNameList of |PropertyDefinitionList|. - 1. Let _propName_ be the PropName of |PropertyDefinition|. - 1. If _propName_ is ~empty~, return _list_. - 1. Return the list-concatenation of _list_ and « _propName_ ». + 1. Let _propertyName_ be the PropName of |PropertyDefinition|. + 1. If _propertyName_ is ~empty~, return _list_. + 1. Return the list-concatenation of _list_ and « _propertyName_ ».
        @@ -18461,29 +19131,29 @@

        Runtime Semantics: Evaluation

        LiteralPropertyName : NumericLiteral - 1. Let _nbr_ be the NumericValue of |NumericLiteral|. - 1. Return ! ToString(_nbr_). + 1. Let _number_ be the NumericValue of |NumericLiteral|. + 1. Return ! ToString(_number_). ComputedPropertyName : `[` AssignmentExpression `]` 1. Let _exprValue_ be ? Evaluation of |AssignmentExpression|. - 1. Let _propName_ be ? GetValue(_exprValue_). - 1. Return ? ToPropertyKey(_propName_). + 1. Let _propertyName_ be ? GetValue(_exprValue_). + 1. Return ? ToPropertyKey(_propertyName_).

        Runtime Semantics: PropertyDefinitionEvaluation ( - _object_: an Object, + _obj_: an Object, ): either a normal completion containing ~unused~ or an abrupt completion

        PropertyDefinitionList : PropertyDefinitionList `,` PropertyDefinition - 1. Perform ? PropertyDefinitionEvaluation of |PropertyDefinitionList| with argument _object_. - 1. Perform ? PropertyDefinitionEvaluation of |PropertyDefinition| with argument _object_. + 1. Perform ? PropertyDefinitionEvaluation of |PropertyDefinitionList| with argument _obj_. + 1. Perform ? PropertyDefinitionEvaluation of |PropertyDefinition| with argument _obj_. 1. Return ~unused~. PropertyDefinition : `...` AssignmentExpression @@ -18491,43 +19161,43 @@

        1. Let _exprValue_ be ? Evaluation of |AssignmentExpression|. 1. Let _fromValue_ be ? GetValue(_exprValue_). 1. Let _excludedNames_ be a new empty List. - 1. Perform ? CopyDataProperties(_object_, _fromValue_, _excludedNames_). + 1. Perform ? CopyDataProperties(_obj_, _fromValue_, _excludedNames_). 1. Return ~unused~. PropertyDefinition : IdentifierReference - 1. Let _propName_ be the StringValue of |IdentifierReference|. + 1. Let _propertyName_ be the StringValue of |IdentifierReference|. 1. Let _exprValue_ be ? Evaluation of |IdentifierReference|. - 1. Let _propValue_ be ? GetValue(_exprValue_). - 1. Assert: _object_ is an ordinary, extensible object with no non-configurable properties. - 1. Perform ! CreateDataPropertyOrThrow(_object_, _propName_, _propValue_). + 1. Let _propertyValue_ be ? GetValue(_exprValue_). + 1. Assert: _obj_ is an ordinary, extensible object with no non-configurable properties. + 1. Perform ! CreateDataPropertyOrThrow(_obj_, _propertyName_, _propertyValue_). 1. Return ~unused~. 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. Let _propertyKey_ be ? Evaluation of |PropertyName|. + 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. Else if _propertyKey_ is *"__proto__"* and IsComputedPropertyKey of |PropertyName| is *false*, then 1. Let _isProtoSetter_ be *true*. 1. Else, 1. Let _isProtoSetter_ be *false*. 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true* and _isProtoSetter_ is *false*, then - 1. Let _propValue_ be ? NamedEvaluation of |AssignmentExpression| with argument _propKey_. + 1. Let _propertyValue_ be ? NamedEvaluation of |AssignmentExpression| with argument _propertyKey_. 1. Else, 1. Let _exprValueRef_ be ? Evaluation of |AssignmentExpression|. - 1. Let _propValue_ be ? GetValue(_exprValueRef_). + 1. Let _propertyValue_ 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. If _propertyValue_ is an Object or _propertyValue_ is *null*, then + 1. Perform ! _obj_.[[SetPrototypeOf]](_propertyValue_). 1. Return ~unused~. - 1. Assert: _object_ is an ordinary, extensible object with no non-configurable properties. - 1. Perform ! CreateDataPropertyOrThrow(_object_, _propKey_, _propValue_). + 1. Assert: _obj_ is an ordinary, extensible object with no non-configurable properties. + 1. Perform ! CreateDataPropertyOrThrow(_obj_, _propertyKey_, _propertyValue_). 1. Return ~unused~. PropertyDefinition : MethodDefinition - 1. Perform ? MethodDefinitionEvaluation of |MethodDefinition| with arguments _object_ and *true*. + 1. Perform ? MethodDefinitionEvaluation of |MethodDefinition| with arguments _obj_ and *true*. 1. Return ~unused~. @@ -18569,7 +19239,8 @@

        1. Let _flags_ be the FlagText of _literal_. - 1. If _flags_ contains any code points other than `d`, `g`, `i`, `m`, `s`, `u`, `v`, or `y`, or if _flags_ contains any code point more than once, return *false*. + 1. If _flags_ contains any code points other than `d`, `g`, `i`, `m`, `s`, `u`, `v`, or `y`, return *false*. + 1. If _flags_ contains any code point more than once, return *false*. 1. If _flags_ contains `u`, let _u_ be *true*; else let _u_ be *false*. 1. If _flags_ contains `v`, let _v_ be *true*; else let _v_ be *false*. 1. Let _patternText_ be the BodyText of _literal_. @@ -18577,7 +19248,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*. @@ -18734,9 +19406,9 @@

        1. Let _realm_ be the current Realm Record. 1. Let _templateRegistry_ be _realm_.[[TemplateMap]]. - 1. For each element _e_ of _templateRegistry_, do - 1. If _e_.[[Site]] is the same Parse Node as _templateLiteral_, then - 1. Return _e_.[[Array]]. + 1. For each element _element_ of _templateRegistry_, do + 1. If _element_.[[Site]] is the same Parse Node as _templateLiteral_, then + 1. Return _element_.[[Array]]. 1. Let _rawStrings_ be the TemplateStrings of _templateLiteral_ with argument *true*. 1. Assert: _rawStrings_ is a List of Strings. 1. Let _cookedStrings_ be the TemplateStrings of _templateLiteral_ with argument *false*. @@ -18746,11 +19418,11 @@

        1. Let _rawObj_ be ! ArrayCreate(_count_). 1. Let _index_ be 0. 1. Repeat, while _index_ < _count_, - 1. Let _prop_ be ! ToString(𝔽(_index_)). + 1. Let _propertyKey_ be ! ToString(𝔽(_index_)). 1. Let _cookedValue_ be _cookedStrings_[_index_]. - 1. Perform ! DefinePropertyOrThrow(_template_, _prop_, PropertyDescriptor { [[Value]]: _cookedValue_, [[Writable]]: *false*, [[Enumerable]]: *true*, [[Configurable]]: *false* }). + 1. Perform ! DefinePropertyOrThrow(_template_, _propertyKey_, PropertyDescriptor { [[Value]]: _cookedValue_, [[Writable]]: *false*, [[Enumerable]]: *true*, [[Configurable]]: *false* }). 1. Let _rawValue_ be the String value _rawStrings_[_index_]. - 1. Perform ! DefinePropertyOrThrow(_rawObj_, _prop_, PropertyDescriptor { [[Value]]: _rawValue_, [[Writable]]: *false*, [[Enumerable]]: *true*, [[Configurable]]: *false* }). + 1. Perform ! DefinePropertyOrThrow(_rawObj_, _propertyKey_, PropertyDescriptor { [[Value]]: _rawValue_, [[Writable]]: *false*, [[Enumerable]]: *true*, [[Configurable]]: *false* }). 1. Set _index_ to _index_ + 1. 1. Perform ! SetIntegrityLevel(_rawObj_, ~frozen~). 1. Perform ! DefinePropertyOrThrow(_template_, *"raw"*, PropertyDescriptor { [[Value]]: _rawObj_, [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). @@ -18927,7 +19599,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] : `(` `)` @@ -19050,43 +19723,43 @@

        Property Accessors

        Runtime Semantics: Evaluation

        MemberExpression : MemberExpression `[` Expression `]` - 1. Let _baseReference_ be ? Evaluation of |MemberExpression|. - 1. Let _baseValue_ be ? GetValue(_baseReference_). + 1. Let _baseRef_ be ? Evaluation of |MemberExpression|. + 1. Let _baseValue_ be ? GetValue(_baseRef_). 1. Let _strict_ be IsStrict(this |MemberExpression|). 1. Return ? EvaluatePropertyAccessWithExpressionKey(_baseValue_, |Expression|, _strict_). MemberExpression : MemberExpression `.` IdentifierName - 1. Let _baseReference_ be ? Evaluation of |MemberExpression|. - 1. Let _baseValue_ be ? GetValue(_baseReference_). + 1. Let _baseRef_ be ? Evaluation of |MemberExpression|. + 1. Let _baseValue_ be ? GetValue(_baseRef_). 1. Let _strict_ be IsStrict(this |MemberExpression|). 1. Return EvaluatePropertyAccessWithIdentifierKey(_baseValue_, |IdentifierName|, _strict_). MemberExpression : MemberExpression `.` PrivateIdentifier - 1. Let _baseReference_ be ? Evaluation of |MemberExpression|. - 1. Let _baseValue_ be ? GetValue(_baseReference_). + 1. Let _baseRef_ be ? Evaluation of |MemberExpression|. + 1. Let _baseValue_ be ? GetValue(_baseRef_). 1. Let _fieldNameString_ be the StringValue of |PrivateIdentifier|. 1. Return MakePrivateReference(_baseValue_, _fieldNameString_). CallExpression : CallExpression `[` Expression `]` - 1. Let _baseReference_ be ? Evaluation of |CallExpression|. - 1. Let _baseValue_ be ? GetValue(_baseReference_). + 1. Let _baseRef_ be ? Evaluation of |CallExpression|. + 1. Let _baseValue_ be ? GetValue(_baseRef_). 1. Let _strict_ be IsStrict(this |CallExpression|). 1. Return ? EvaluatePropertyAccessWithExpressionKey(_baseValue_, |Expression|, _strict_). CallExpression : CallExpression `.` IdentifierName - 1. Let _baseReference_ be ? Evaluation of |CallExpression|. - 1. Let _baseValue_ be ? GetValue(_baseReference_). + 1. Let _baseRef_ be ? Evaluation of |CallExpression|. + 1. Let _baseValue_ be ? GetValue(_baseRef_). 1. Let _strict_ be IsStrict(this |CallExpression|). 1. Return EvaluatePropertyAccessWithIdentifierKey(_baseValue_, |IdentifierName|, _strict_). CallExpression : CallExpression `.` PrivateIdentifier - 1. Let _baseReference_ be ? Evaluation of |CallExpression|. - 1. Let _baseValue_ be ? GetValue(_baseReference_). + 1. Let _baseRef_ be ? Evaluation of |CallExpression|. + 1. Let _baseValue_ be ? GetValue(_baseRef_). 1. Let _fieldNameString_ be the StringValue of |PrivateIdentifier|. 1. Return MakePrivateReference(_baseValue_, _fieldNameString_). @@ -19097,17 +19770,17 @@

        Runtime Semantics: Evaluation

        EvaluatePropertyAccessWithExpressionKey ( _baseValue_: an ECMAScript language value, - _expression_: an |Expression| Parse Node, + _expr_: an |Expression| Parse Node, _strict_: a Boolean, ): either a normal completion containing a Reference Record or an abrupt completion

        - 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. Let _propertyNameRef_ be ? Evaluation of _expr_. + 1. Let _propertyNameValue_ be ? GetValue(_propertyNameRef_). + 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~ }. @@ -19145,20 +19818,20 @@

        Runtime Semantics: Evaluation

        EvaluateNew ( _constructExpr_: a |NewExpression| Parse Node or a |MemberExpression| Parse Node, - _arguments_: ~empty~ or an |Arguments| Parse Node, - ): either a normal completion containing an ECMAScript language value or an abrupt completion + _argumentsNode_: ~empty~ or an |Arguments| Parse Node, + ): either a normal completion containing an Object or an abrupt completion

        1. Let _ref_ be ? Evaluation of _constructExpr_. - 1. Let _constructor_ be ? GetValue(_ref_). - 1. If _arguments_ is ~empty~, then + 1. Let _ctor_ be ? GetValue(_ref_). + 1. If _argumentsNode_ is ~empty~, then 1. Let _argList_ be a new empty List. 1. Else, - 1. Let _argList_ be ? ArgumentListEvaluation of _arguments_. - 1. If IsConstructor(_constructor_) is *false*, throw a *TypeError* exception. - 1. Return ? Construct(_constructor_, _argList_). + 1. Let _argList_ be ? ArgumentListEvaluation of _argumentsNode_. + 1. If IsConstructor(_ctor_) is *false*, throw a *TypeError* exception. + 1. Return ? Construct(_ctor_, _argList_). @@ -19173,19 +19846,19 @@

        Runtime Semantics: Evaluation

        1. Let _expr_ be the |CallMemberExpression| that is covered by |CoverCallExpressionAndAsyncArrowHead|. 1. Let _memberExpr_ be the |MemberExpression| of _expr_. - 1. Let _arguments_ be the |Arguments| of _expr_. + 1. Let _args_ be the |Arguments| of _expr_. 1. Let _ref_ be ? Evaluation of _memberExpr_. 1. Let _func_ be ? GetValue(_ref_). 1. If _ref_ is a Reference Record, IsPropertyReference(_ref_) is *false*, and _ref_.[[ReferencedName]] is *"eval"*, then 1. If SameValue(_func_, %eval%) is *true*, then - 1. Let _argList_ be ? ArgumentListEvaluation of _arguments_. + 1. Let _argList_ be ? ArgumentListEvaluation of _args_. 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_). - 1. Return ? EvaluateCall(_func_, _ref_, _arguments_, _tailCall_). + 1. Return ? EvaluateCall(_func_, _ref_, _args_, _tailCall_).

        A |CallExpression| evaluation that executes step is a direct eval.

        CallExpression : CallExpression Arguments @@ -19202,24 +19875,24 @@

        Runtime Semantics: Evaluation

        EvaluateCall ( _func_: an ECMAScript language value, - _ref_: an ECMAScript language value or a Reference Record, - _arguments_: a Parse Node, + _thisValueRef_: an ECMAScript language value or a Reference Record, + _argumentListNode_: a Parse Node, _tailPosition_: a Boolean, ): either a normal completion containing an ECMAScript language value or an abrupt completion

        - 1. If _ref_ is a Reference Record, then - 1. If IsPropertyReference(_ref_) is *true*, then - 1. Let _thisValue_ be GetThisValue(_ref_). + 1. If _thisValueRef_ is a Reference Record, then + 1. If IsPropertyReference(_thisValueRef_) is *true*, then + 1. Let _thisValue_ be GetThisValue(_thisValueRef_). 1. Else, - 1. Let _refEnv_ be _ref_.[[Base]]. + 1. Let _refEnv_ be _thisValueRef_.[[Base]]. 1. Assert: _refEnv_ is an Environment Record. 1. Let _thisValue_ be _refEnv_.WithBaseObject(). 1. Else, 1. Let _thisValue_ be *undefined*. - 1. Let _argList_ be ? ArgumentListEvaluation of _arguments_. + 1. Let _argList_ be ? ArgumentListEvaluation of _argumentListNode_. 1. If _func_ is not an Object, throw a *TypeError* exception. 1. If IsCallable(_func_) is *false*, throw a *TypeError* exception. 1. If _tailPosition_ is *true*, perform PrepareForTailCall(). @@ -19235,50 +19908,51 @@

        The `super` Keyword

        Runtime Semantics: Evaluation

        SuperProperty : `super` `[` Expression `]` - 1. Let _env_ be GetThisEnvironment(). - 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 _envRecord_ be GetThisEnvironment(). + 1. Let _actualThis_ be ? _envRecord_.GetThisBinding(). + 1. Let _propertyNameRef_ be ? Evaluation of |Expression|. + 1. Let _propertyNameValue_ be ? GetValue(_propertyNameRef_). 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 - 1. Let _env_ be GetThisEnvironment(). - 1. Let _actualThis_ be ? _env_.GetThisBinding(). + 1. Let _envRecord_ be GetThisEnvironment(). + 1. Let _actualThis_ be ? _envRecord_.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. Let _func_ be GetSuperConstructor(). + 1. Assert: _newTarget_ is a constructor. + 1. Let _superCtor_ 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. If IsConstructor(_superCtor_) is *false*, throw a *TypeError* exception. + 1. Let _result_ be ? Construct(_superCtor_, _argList_, _newTarget_). 1. Let _thisER_ be GetThisEnvironment(). - 1. Perform ? _thisER_.BindThisValue(_result_). - 1. Let _F_ be _thisER_.[[FunctionObject]]. - 1. Assert: _F_ is an ECMAScript function object. - 1. Perform ? InitializeInstanceElements(_result_, _F_). + 1. Assert: _thisER_ is a Function Environment Record. + 1. Perform ? BindThisValue(_thisER_, _result_). + 1. Let _funcObj_ be _thisER_.[[FunctionObject]]. + 1. Assert: _funcObj_ is an ECMAScript function object. + 1. Perform ? InitializeInstanceElements(_result_, _funcObj_). 1. Return _result_. -

        GetSuperConstructor ( ): an ECMAScript language value

        +

        GetSuperConstructor ( ): an Object or *null*

        - 1. Let _envRec_ be GetThisEnvironment(). - 1. Assert: _envRec_ is a Function Environment Record. - 1. Let _activeFunction_ be _envRec_.[[FunctionObject]]. - 1. Assert: _activeFunction_ is an ECMAScript function object. - 1. Let _superConstructor_ be ! _activeFunction_.[[GetPrototypeOf]](). - 1. Return _superConstructor_. + 1. Let _envRecord_ be GetThisEnvironment(). + 1. Assert: _envRecord_ is a Function Environment Record. + 1. Let _activeFunc_ be _envRecord_.[[FunctionObject]]. + 1. Assert: _activeFunc_ is an ECMAScript function object. + 1. Let _superCtor_ be ! _activeFunc_.[[GetPrototypeOf]](). + 1. Return _superCtor_.
        @@ -19286,16 +19960,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. Let _envRecord_ be GetThisEnvironment(). + 1. Assert: _envRecord_.HasSuperBinding() is *true*. + 1. Assert: _envRecord_ is a Function Environment Record. + 1. Let _baseValue_ be GetSuperBase(_envRecord_). 1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyKey_, [[Strict]]: _strict_, [[ThisValue]]: _actualThis_ }. @@ -19384,33 +20059,33 @@

        Runtime Semantics: Evaluation

        MemberExpression OptionalChain - 1. Let _baseReference_ be ? Evaluation of |MemberExpression|. - 1. Let _baseValue_ be ? GetValue(_baseReference_). + 1. Let _baseRef_ be ? Evaluation of |MemberExpression|. + 1. Let _baseValue_ be ? GetValue(_baseRef_). 1. If _baseValue_ is either *undefined* or *null*, then 1. Return *undefined*. - 1. Return ? ChainEvaluation of |OptionalChain| with arguments _baseValue_ and _baseReference_. + 1. Return ? ChainEvaluation of |OptionalChain| with arguments _baseValue_ and _baseRef_. OptionalExpression : CallExpression OptionalChain - 1. Let _baseReference_ be ? Evaluation of |CallExpression|. - 1. Let _baseValue_ be ? GetValue(_baseReference_). + 1. Let _baseRef_ be ? Evaluation of |CallExpression|. + 1. Let _baseValue_ be ? GetValue(_baseRef_). 1. If _baseValue_ is either *undefined* or *null*, then 1. Return *undefined*. - 1. Return ? ChainEvaluation of |OptionalChain| with arguments _baseValue_ and _baseReference_. + 1. Return ? ChainEvaluation of |OptionalChain| with arguments _baseValue_ and _baseRef_. OptionalExpression : OptionalExpression OptionalChain - 1. Let _baseReference_ be ? Evaluation of |OptionalExpression|. - 1. Let _baseValue_ be ? GetValue(_baseReference_). + 1. Let _baseRef_ be ? Evaluation of |OptionalExpression|. + 1. Let _baseValue_ be ? GetValue(_baseRef_). 1. If _baseValue_ is either *undefined* or *null*, then 1. Return *undefined*. - 1. Return ? ChainEvaluation of |OptionalChain| with arguments _baseValue_ and _baseReference_. + 1. Return ? ChainEvaluation of |OptionalChain| with arguments _baseValue_ and _baseRef_. @@ -19418,7 +20093,7 @@

        Runtime Semantics: Evaluation

        Runtime Semantics: ChainEvaluation ( _baseValue_: an ECMAScript language value, - _baseReference_: an ECMAScript language value or a Reference Record, + _baseRef_: an ECMAScript language value or a Reference Record, ): either a normal completion containing either an ECMAScript language value or a Reference Record, or an abrupt completion

        @@ -19427,7 +20102,7 @@

        1. Let _thisChain_ be this |OptionalChain|. 1. Let _tailCall_ be IsInTailPosition(_thisChain_). - 1. Return ? EvaluateCall(_baseValue_, _baseReference_, |Arguments|, _tailCall_). + 1. Return ? EvaluateCall(_baseValue_, _baseRef_, |Arguments|, _tailCall_). OptionalChain : `?.` `[` Expression `]` @@ -19447,33 +20122,33 @@

        OptionalChain : OptionalChain Arguments 1. Let _optionalChain_ be |OptionalChain|. - 1. Let _newReference_ be ? ChainEvaluation of _optionalChain_ with arguments _baseValue_ and _baseReference_. - 1. Let _newValue_ be ? GetValue(_newReference_). + 1. Let _newRef_ be ? ChainEvaluation of _optionalChain_ with arguments _baseValue_ and _baseRef_. + 1. Let _newValue_ be ? GetValue(_newRef_). 1. Let _thisChain_ be this |OptionalChain|. 1. Let _tailCall_ be IsInTailPosition(_thisChain_). - 1. Return ? EvaluateCall(_newValue_, _newReference_, |Arguments|, _tailCall_). + 1. Return ? EvaluateCall(_newValue_, _newRef_, |Arguments|, _tailCall_). OptionalChain : OptionalChain `[` Expression `]` 1. Let _optionalChain_ be |OptionalChain|. - 1. Let _newReference_ be ? ChainEvaluation of _optionalChain_ with arguments _baseValue_ and _baseReference_. - 1. Let _newValue_ be ? GetValue(_newReference_). + 1. Let _newRef_ be ? ChainEvaluation of _optionalChain_ with arguments _baseValue_ and _baseRef_. + 1. Let _newValue_ be ? GetValue(_newRef_). 1. Let _strict_ be IsStrict(this |OptionalChain|). 1. Return ? EvaluatePropertyAccessWithExpressionKey(_newValue_, |Expression|, _strict_). OptionalChain : OptionalChain `.` IdentifierName 1. Let _optionalChain_ be |OptionalChain|. - 1. Let _newReference_ be ? ChainEvaluation of _optionalChain_ with arguments _baseValue_ and _baseReference_. - 1. Let _newValue_ be ? GetValue(_newReference_). + 1. Let _newRef_ be ? ChainEvaluation of _optionalChain_ with arguments _baseValue_ and _baseRef_. + 1. Let _newValue_ be ? GetValue(_newRef_). 1. Let _strict_ be IsStrict(this |OptionalChain|). 1. Return EvaluatePropertyAccessWithIdentifierKey(_newValue_, |IdentifierName|, _strict_). OptionalChain : OptionalChain `.` PrivateIdentifier 1. Let _optionalChain_ be |OptionalChain|. - 1. Let _newReference_ be ? ChainEvaluation of _optionalChain_ with arguments _baseValue_ and _baseReference_. - 1. Let _newValue_ be ? GetValue(_newReference_). + 1. Let _newRef_ be ? ChainEvaluation of _optionalChain_ with arguments _baseValue_ and _baseRef_. + 1. Let _newValue_ be ? GetValue(_newRef_). 1. Let _fieldNameString_ be the StringValue of |PrivateIdentifier|. 1. Return MakePrivateReference(_newValue_, _fieldNameString_). @@ -19486,58 +20161,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 ( + _specifierExpr_: a Parse Node, + optional _optionsExpr_: 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 _specifierExpr_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. If _optionsExpr_ is present, then + 1. Let _optionsRef_ be ? Evaluation of _optionsExpr_. + 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 _attrs_ 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 _attrsObj_ be Completion(Get(_options_, *"with"*)). + 1. IfAbruptRejectPromise(_attrsObj_, _promiseCapability_). + 1. If _attrsObj_ is not *undefined*, then + 1. If _attrsObj_ 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(_attrsObj_, ~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 _attrs_. + 1. If AllImportAttributesSupported(_attrs_) is *false*, then + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « a newly created *TypeError* object »). + 1. Return _promiseCapability_.[[Promise]]. + 1. Sort _attrs_ 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]]: _attrs_ }. + 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~. +
        @@ -19586,14 +20311,13 @@

        Runtime Semantics: Evaluation

        1. If _importMeta_ is ~empty~, then 1. Set _importMeta_ to OrdinaryObjectCreate(*null*). 1. Let _importMetaValues_ be HostGetImportMetaProperties(_module_). - 1. For each Record { [[Key]], [[Value]] } _p_ of _importMetaValues_, do - 1. Perform ! CreateDataPropertyOrThrow(_importMeta_, _p_.[[Key]], _p_.[[Value]]). + 1. For each Record { [[Key]], [[Value]] } _entry_ of _importMetaValues_, do + 1. Perform ! CreateDataPropertyOrThrow(_importMeta_, _entry_.[[Key]], _entry_.[[Value]]). 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_.
        @@ -19622,7 +20346,7 @@

        It allows hosts to perform any extraordinary operations to prepare the object returned from `import.meta`.

        -

        Most hosts will be able to simply define HostGetImportMetaProperties, and leave HostFinalizeImportMeta with its default behaviour. However, HostFinalizeImportMeta provides an "escape hatch" for hosts which need to directly manipulate the object before it is exposed to ECMAScript code.

        +

        Most hosts will be able to simply define HostGetImportMetaProperties, and leave HostFinalizeImportMeta with its default behaviour. However, HostFinalizeImportMeta provides an “escape hatch” for hosts which need to directly manipulate the object before it is exposed to ECMAScript code.

        The default implementation of HostFinalizeImportMeta is to return ~unused~.

        @@ -19651,7 +20375,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 +20386,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 +20399,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 +20420,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 +20441,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 +20462,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*𝔽). @@ -19761,7 +20489,21 @@

        Syntax

        `-` UnaryExpression[?Yield, ?Await] `~` UnaryExpression[?Yield, ?Await] `!` UnaryExpression[?Yield, ?Await] - [+Await] AwaitExpression[?Yield] + [+Await] CoverAwaitExpressionAndAwaitUsingDeclarationHead[?Yield] #awaitusingcover + + CoverAwaitExpressionAndAwaitUsingDeclarationHead[Yield] : + `await` UnaryExpression[?Yield, +Await] + + +

        Supplemental Syntax

        +

        + When processing an instance of the production
        + UnaryExpression : CoverAwaitExpressionAndAwaitUsingDeclarationHead
        + the interpretation of |CoverAwaitExpressionAndAwaitUsingDeclarationHead| is refined using the following grammar: +

        + + AwaitExpression[Yield] : + `await` UnaryExpression[?Yield, +Await] @@ -19800,13 +20542,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,24 +20580,25 @@

        Runtime Semantics: Evaluation

        The `typeof` Operator

        - +

        Runtime Semantics: Evaluation

        UnaryExpression : `typeof` UnaryExpression - 1. Let _val_ be ? Evaluation of |UnaryExpression|. - 1. If _val_ is a Reference Record, then - 1. If IsUnresolvableReference(_val_) is *true*, return *"undefined"*. - 1. Set _val_ to ? GetValue(_val_). - 1. If _val_ is *undefined*, return *"undefined"*. - 1. If _val_ is *null*, return *"object"*. - 1. If _val_ is a String, return *"string"*. - 1. If _val_ is a Symbol, return *"symbol"*. - 1. If _val_ is a Boolean, return *"boolean"*. - 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. Let _value_ be ? Evaluation of |UnaryExpression|. + 1. If _value_ is a Reference Record, then + 1. If IsUnresolvableReference(_value_) is *true*, return *"undefined"*. + 1. Set _value_ to ? GetValue(_value_). + 1. If _value_ is *undefined*, return *"undefined"*. + 1. If _value_ is *null*, return *"object"*. + 1. If _value_ is a String, return *"string"*. + 1. If _value_ is a Symbol, return *"symbol"*. + 1. If _value_ is a Boolean, return *"boolean"*. + 1. If _value_ is a Number, return *"number"*. + 1. If _value_ is a BigInt, return *"bigint"*. + 1. Assert: _value_ is an Object. + 1. [id="step-typeof-web-compat-insertion-point", normative-optional] If the host is a web browser or otherwise supports , then + 1. If _value_ has an [[IsHTMLDDA]] internal slot, return *"undefined"*. + 1. If _value_ has a [[Call]] internal method, return *"function"*. 1. Return *"object"*.
        @@ -19888,11 +20632,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 +20648,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,91 +20844,96 @@

        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 _leftRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _leftValue_ be ? GetValue(_leftRef_). + 1. Let _rightRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rightValue_ be ? GetValue(_rightRef_). + 1. Let _result_ be ? IsLessThan(_leftValue_, _rightValue_, *true*). + 1. If _result_ is *undefined*, return *false*. + 1. Return _result_. 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 _leftRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _leftValue_ be ? GetValue(_leftRef_). + 1. Let _rightRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rightValue_ be ? GetValue(_rightRef_). + 1. Let _result_ be ? IsLessThan(_rightValue_, _leftValue_, *false*). + 1. If _result_ is *undefined*, return *false*. + 1. Return _result_. 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 _leftRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _leftValue_ be ? GetValue(_leftRef_). + 1. Let _rightRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rightValue_ be ? GetValue(_rightRef_). + 1. Let _result_ be ? IsLessThan(_rightValue_, _leftValue_, *false*). + 1. If _result_ 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 _leftRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _leftValue_ be ? GetValue(_leftRef_). + 1. Let _rightRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rightValue_ be ? GetValue(_rightRef_). + 1. Let _result_ be ? IsLessThan(_leftValue_, _rightValue_, *true*). + 1. If _result_ 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 _leftRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _leftValue_ be ? GetValue(_leftRef_). + 1. Let _rightRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rightValue_ be ? GetValue(_rightRef_). + 1. Return ? InstanceofOperator(_leftValue_, _rightValue_). 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 _leftRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _leftValue_ be ? GetValue(_leftRef_). + 1. Let _rightRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rightValue_ be ? GetValue(_rightRef_). + 1. If _rightValue_ is not an Object, throw a *TypeError* exception. + 1. Return ? HasProperty(_rightValue_, ? ToPropertyKey(_leftValue_)). 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 _rightRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rightValue_ be ? GetValue(_rightRef_). + 1. If _rightValue_ 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(_rightValue_, _privateName_) is ~empty~, return *false*. + 1. Return *true*.

        InstanceofOperator ( - _V_: an ECMAScript language value, + _value_: an ECMAScript language value, _target_: an ECMAScript language value, ): either a normal completion containing a Boolean or a throw completion

        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 _value_ 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 _value_'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. Return ToBoolean(? Call(_instOfHandler_, _target_, « _value_ »)). 1. [id="step-instanceof-check-function"] If IsCallable(_target_) is *false*, throw a *TypeError* exception. - 1. [id="step-instanceof-fallback"] Return ? OrdinaryHasInstance(_target_, _V_). + 1. [id="step-instanceof-fallback"] Return ? OrdinaryHasInstance(_target_, _value_). -

        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 +20957,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 _leftRef_ be ? Evaluation of |EqualityExpression|. + 1. Let _leftValue_ be ? GetValue(_leftRef_). + 1. Let _rightRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _rightValue_ be ? GetValue(_rightRef_). + 1. Return ? IsLooselyEqual(_rightValue_, _leftValue_). 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 _leftRef_ be ? Evaluation of |EqualityExpression|. + 1. Let _leftValue_ be ? GetValue(_leftRef_). + 1. Let _rightRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _rightValue_ be ? GetValue(_rightRef_). + 1. Let _result_ be ? IsLooselyEqual(_rightValue_, _leftValue_). + 1. If _result_ 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 _leftRef_ be ? Evaluation of |EqualityExpression|. + 1. Let _leftValue_ be ? GetValue(_leftRef_). + 1. Let _rightRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _rightValue_ be ? GetValue(_rightRef_). + 1. Return IsStrictlyEqual(_rightValue_, _leftValue_). 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 _leftRef_ be ? Evaluation of |EqualityExpression|. + 1. Let _leftValue_ be ? GetValue(_leftRef_). + 1. Let _rightRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _rightValue_ be ? GetValue(_rightRef_). + 1. Let _result_ be IsStrictlyEqual(_rightValue_, _leftValue_). + 1. If _result_ 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 +21084,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 _leftRef_ be ? Evaluation of |LogicalANDExpression|. + 1. Let _leftValue_ be ? GetValue(_leftRef_). + 1. If ToBoolean(_leftValue_) is *false*, return _leftValue_. + 1. Let _rightRef_ be ? Evaluation of |BitwiseORExpression|. + 1. Return ? GetValue(_rightRef_). 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 _leftRef_ be ? Evaluation of |LogicalORExpression|. + 1. Let _leftValue_ be ? GetValue(_leftRef_). + 1. If ToBoolean(_leftValue_) is *true*, return _leftValue_. + 1. Let _rightRef_ be ? Evaluation of |LogicalANDExpression|. + 1. Return ? GetValue(_rightRef_). 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 _leftRef_ be ? Evaluation of |CoalesceExpressionHead|. + 1. Let _leftValue_ be ? GetValue(_leftRef_). + 1. If _leftValue_ is neither *undefined* nor *null*, return _leftValue_. + 1. Let _rightRef_ be ? Evaluation of |BitwiseORExpression|. + 1. Return ? GetValue(_rightRef_). @@ -20396,14 +21125,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 _leftRef_ be ? Evaluation of |ShortCircuitExpression|. + 1. Let _leftValue_ be ToBoolean(? GetValue(_leftRef_)). + 1. If _leftValue_ 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 +21164,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 +21194,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 _leftRef_ 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 _rightValue_ 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 _rightRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rightValue_ be ? GetValue(_rightRef_). + 1. [id="step-assignmentexpression-evaluation-simple-putvalue"] Perform ? PutValue(_leftRef_, _rightValue_). + 1. Return _rightValue_. 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 _rightRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rightValue_ be ? GetValue(_rightRef_). + 1. Perform ? DestructuringAssignmentEvaluation of _assignmentPattern_ with argument _rightValue_. + 1. Return _rightValue_. 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 _leftRef_ 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 _leftValue_ be ? GetValue(_leftRef_). + 1. Let _rightRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rightValue_ be ? GetValue(_rightRef_). 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 +21239,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. Return _r_. + 1. Let _result_ be ? ApplyStringOrNumericBinaryOperator(_leftValue_, _opText_, _rightValue_). + 1. [id="step-assignmentexpression-evaluation-compound-putvalue"] Perform ? PutValue(_leftRef_, _result_). + 1. Return _result_.
        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 _leftRef_ be ? Evaluation of |LeftHandSideExpression|. + 1. [id="step-assignmentexpression-evaluation-lgcl-and-getvalue"] Let _leftValue_ be ? GetValue(_leftRef_). + 1. If ToBoolean(_leftValue_) is *false*, return _leftValue_. 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 _rightValue_ 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 _rightRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rightValue_ be ? GetValue(_rightRef_). + 1. [id="step-assignmentexpression-evaluation-lgcl-and-putvalue"] Perform ? PutValue(_leftRef_, _rightValue_). + 1. Return _rightValue_. 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 _leftRef_ be ? Evaluation of |LeftHandSideExpression|. + 1. [id="step-assignmentexpression-evaluation-lgcl-or-getvalue"] Let _leftValue_ be ? GetValue(_leftRef_). + 1. If ToBoolean(_leftValue_) is *true*, return _leftValue_. 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 _rightValue_ 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 _rightRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rightValue_ be ? GetValue(_rightRef_). + 1. [id="step-assignmentexpression-evaluation-lgcl-or-putvalue"] Perform ? PutValue(_leftRef_, _rightValue_). + 1. Return _rightValue_. 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 _leftRef_ be ? Evaluation of |LeftHandSideExpression|. + 1. [id="step-assignmentexpression-evaluation-lgcl-nullish-getvalue"] Let _leftValue_ be ? GetValue(_leftRef_). + 1. If _leftValue_ is neither *undefined* nor *null*, return _leftValue_. 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 _rightValue_ 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 _rightRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rightValue_ be ? GetValue(_rightRef_). + 1. [id="step-assignmentexpression-evaluation-lgcl-nullish-putvalue"] Perform ? PutValue(_leftRef_, _rightValue_). + 1. Return _rightValue_. -

        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 _leftRef_ in step , , , , is an unresolvable reference. If it is, a *ReferenceError* exception is thrown. Additionally, it is a runtime error if the _leftRef_ in step , , , is a reference to a data property with the attribute value { [[Writable]]: *false* }, to an accessor property with the attribute value { [[Setter]]: *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, + _leftValue_: an ECMAScript language value, _opText_: `**`, `*`, `/`, `%`, `+`, `-`, `<<`, `>>`, `>>>`, `&`, `^`, or `|`, - _rval_: an ECMAScript language value, + _rightValue_: 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 _leftPrimitive_ be ? ToPrimitive(_leftValue_). + 1. [id="step-binary-op-toprimitive-rval"] Let _rightPrimitive_ be ? ToPrimitive(_rightValue_). + 1. [id="step-binary-op-string-check"] If _leftPrimitive_ is a String or _rightPrimitive_ is a String, then + 1. Let _leftString_ be ? ToString(_leftPrimitive_). + 1. Let _rightString_ be ? ToString(_rightPrimitive_). + 1. Return the string-concatenation of _leftString_ and _rightString_. + 1. Set _leftValue_ to _leftPrimitive_. + 1. Set _rightValue_ to _rightPrimitive_. 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 _leftNumber_ be ? ToNumeric(_leftValue_). + 1. Let _rightNumber_ be ? ToNumeric(_rightValue_). + 1. If SameType(_leftNumber_, _rightNumber_) is *false*, throw a *TypeError* exception. + 1. If _leftNumber_ is a BigInt, then + 1. If _opText_ is `**`, return ? BigInt::exponentiate(_leftNumber_, _rightNumber_). + 1. If _opText_ is `/`, return ? BigInt::divide(_leftNumber_, _rightNumber_). + 1. If _opText_ is `%`, return ? BigInt::remainder(_leftNumber_, _rightNumber_). + 1. If _opText_ is `>>>`, return ? BigInt::unsignedRightShift(_leftNumber_, _rightNumber_). + 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: _leftNumber_ 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_(_leftNumber_, _rightNumber_).

        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.

        @@ -20618,18 +21377,18 @@

        EvaluateStringOrNumericBinaryExpression ( _leftOperand_: a Parse Node, - _opText_: a sequence of Unicode code points, + _opText_: `**`, `*`, `/`, `%`, `+`, `-`, `<<`, `>>`, `>>>`, `&`, `^`, or `|`, _rightOperand_: a Parse Node, ): either a normal completion containing either a String, a BigInt, or a Number, or an abrupt completion

        - 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 _leftRef_ be ? Evaluation of _leftOperand_. + 1. Let _leftValue_ be ? GetValue(_leftRef_). + 1. Let _rightRef_ be ? Evaluation of _rightOperand_. + 1. Let _rightValue_ be ? GetValue(_rightRef_). + 1. Return ? ApplyStringOrNumericBinaryOperator(_leftValue_, _opText_, _rightValue_).
        @@ -20814,17 +21573,17 @@

        AssignmentProperty : IdentifierReference Initializer? - 1. Let _P_ be the StringValue of |IdentifierReference|. - 1. Let _lref_ be ? ResolveBinding(_P_). - 1. Let _v_ be ? GetV(_value_, _P_). - 1. If |Initializer| is present and _v_ is *undefined*, then + 1. Let _propertyName_ be the StringValue of |IdentifierReference|. + 1. Let _leftRef_ be ? ResolveBinding(_propertyName_). + 1. Set _value_ to ? GetV(_value_, _propertyName_). + 1. If |Initializer| is present and _value_ is *undefined*, then 1. If IsAnonymousFunctionDefinition(|Initializer|) is *true*, then - 1. Set _v_ to ? NamedEvaluation of |Initializer| with argument _P_. + 1. Set _value_ to ? NamedEvaluation of |Initializer| with argument _propertyName_. 1. Else, 1. Let _defaultValue_ be ? Evaluation of |Initializer|. - 1. Set _v_ to ? GetValue(_defaultValue_). - 1. Perform ? PutValue(_lref_, _v_). - 1. Return « _P_ ». + 1. Set _value_ to ? GetValue(_defaultValue_). + 1. Perform ? PutValue(_leftRef_, _value_). + 1. Return « _propertyName_ ». AssignmentProperty : PropertyName `:` AssignmentElement @@ -20846,10 +21605,10 @@

        AssignmentRestProperty : `...` DestructuringAssignmentTarget - 1. Let _lref_ be ? Evaluation of |DestructuringAssignmentTarget|. + 1. Let _leftRef_ 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(_leftRef_, _restObj_). @@ -20895,7 +21654,7 @@

        AssignmentElement : DestructuringAssignmentTarget Initializer? 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then - 1. Let _lref_ be ? Evaluation of |DestructuringAssignmentTarget|. + 1. Let _leftRef_ be ? Evaluation of |DestructuringAssignmentTarget|. 1. Let _value_ be *undefined*. 1. If _iteratorRecord_.[[Done]] is *false*, then 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_). @@ -20903,7 +21662,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 +21672,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(_leftRef_, _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,18 +21680,18 @@

        AssignmentRestElement : `...` DestructuringAssignmentTarget 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then - 1. Let _lref_ be ? Evaluation of |DestructuringAssignmentTarget|. - 1. Let _A_ be ! ArrayCreate(0). + 1. Let _leftRef_ be ? Evaluation of |DestructuringAssignmentTarget|. + 1. Let _array_ be ! ArrayCreate(0). 1. Let _n_ be 0. 1. Repeat, while _iteratorRecord_.[[Done]] is *false*, 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_). 1. If _next_ is not ~done~, then - 1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_n_)), _next_). + 1. Perform ! CreateDataPropertyOrThrow(_array_, ! 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(_leftRef_, _array_). 1. Let _nestedAssignmentPattern_ be the |AssignmentPattern| that is covered by |DestructuringAssignmentTarget|. - 1. Return ? DestructuringAssignmentEvaluation of _nestedAssignmentPattern_ with argument _A_. + 1. Return ? DestructuringAssignmentEvaluation of _nestedAssignmentPattern_ with argument _array_. @@ -20947,20 +21707,21 @@

        AssignmentElement : DestructuringAssignmentTarget Initializer? 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then - 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. Let _leftRef_ be ? Evaluation of |DestructuringAssignmentTarget|. + 1. Set _value_ to ? GetV(_value_, _propertyName_). + 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 _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_). 1. Else, - 1. Let _rhsValue_ be _v_. + 1. Let _rhsValue_ be _value_. 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(_leftRef_, _rhsValue_). @@ -20979,10 +21740,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 _leftRef_ be ? Evaluation of |Expression|. + 1. Perform ? GetValue(_leftRef_). + 1. Let _rightRef_ be ? Evaluation of |AssignmentExpression|. + 1. Return ? GetValue(_rightRef_).

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

        @@ -21078,12 +21839,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|. @@ -21104,6 +21869,7 @@

          Runtime Semantics: Evaluation

          1. Perform BlockDeclarationInstantiation(|StatementList|, _blockEnv_). 1. Set the running execution context's LexicalEnvironment to _blockEnv_. 1. Let _blockValue_ be Completion(Evaluation of |StatementList|). + 1. Set _blockValue_ to Completion(DisposeResources(_blockEnv_.[[DisposableResourceStack]], _blockValue_)). 1. Set the running execution context's LexicalEnvironment to _oldEnv_. 1. Return ? _blockValue_. @@ -21126,39 +21892,45 @@

          Runtime Semantics: Evaluation

          - +

          BlockDeclarationInstantiation ( _code_: a Parse Node, - _env_: a Declarative Environment Record, + _envRecord_: a Declarative Environment Record, ): ~unused~

          description
          -
          _code_ is the Parse Node corresponding to the body of the block. _env_ is the Environment Record in which bindings are to be created.
          +
          _code_ is the Parse Node corresponding to the body of the block. _envRecord_ is the Environment Record in which bindings are to be created.

          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 _decls_ be the LexicallyScopedDeclarations of _code_. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. - 1. For each element _d_ of _declarations_, 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. For each element _decl_ of _decls_, do + 1. For each element _name_ of the BoundNames of _decl_, do + 1. If IsConstantDeclaration of _decl_ is *true*, then + 1. Perform ! _envRecord_.CreateImmutableBinding(_name_, *true*). 1. Else, - 1. [id="step-blockdeclarationinstantiation-createmutablebinding"] Perform ! _env_.CreateMutableBinding(_dn_, *false*). NOTE: This step is replaced in section . - 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-createmutablebinding", normative-optional] If the host is a web browser or otherwise supports , then + 1. If ! _envRecord_.HasBinding(_name_) is *false*, then + 1. Perform ! _envRecord_.CreateMutableBinding(_name_, *false*). + 1. Else, + 1. Perform ! _envRecord_.CreateMutableBinding(_name_, *false*). + 1. If _decl_ is either a |FunctionDeclaration|, a |GeneratorDeclaration|, an |AsyncFunctionDeclaration|, or an |AsyncGeneratorDeclaration|, then + 1. Let _funcName_ be the sole element of the BoundNames of _decl_. + 1. Let _funcObj_ be InstantiateFunctionObject of _decl_ with arguments _envRecord_ and _privateEnv_. + 1. [id="step-blockdeclarationinstantiation-initializebinding", normative-optional] If the host is a web browser or otherwise supports , then + 1. If the binding for _funcName_ in _envRecord_ is an uninitialized binding, then + 1. Perform ! _envRecord_.InitializeBinding(_funcName_, _funcObj_). + 1. Else, + 1. Assert: _decl_ is a |FunctionDeclaration|. + 1. Perform ! _envRecord_.SetMutableBinding(_funcName_, _funcObj_, *false*). + 1. Else, + 1. Perform ! _envRecord_.InitializeBinding(_funcName_, _funcObj_). 1. Return ~unused~.
          @@ -21168,26 +21940,45 @@

          Declarations and the Variable Statement

          -

          Let and Const Declarations

          +

          Let, Const, Using, and Await Using Declarations

          -

          `let` and `const` declarations define variables that are scoped to the running execution context's LexicalEnvironment. The variables are created when their containing Environment Record is instantiated but may not be accessed in any way until the variable's |LexicalBinding| is evaluated. A variable defined by a |LexicalBinding| with an |Initializer| is assigned the value of its |Initializer|'s |AssignmentExpression| when the |LexicalBinding| is evaluated, not when the variable is created. If a |LexicalBinding| in a `let` declaration does not have an |Initializer| the variable is assigned the value *undefined* when the |LexicalBinding| is evaluated.

          +

          `let`, `const`, `using`, and `await using` declarations define variables that are scoped to the running execution context's LexicalEnvironment. The variables are created when their containing Environment Record is instantiated but may not be accessed in any way until the variable's |LexicalBinding| is evaluated. A variable defined by a |LexicalBinding| with an |Initializer| is assigned the value of its |Initializer|'s |AssignmentExpression| when the |LexicalBinding| is evaluated, not when the variable is created. If a |LexicalBinding| in a `let` declaration does not have an |Initializer| the variable is assigned the value *undefined* when the |LexicalBinding| is evaluated.

          Syntax

          LexicalDeclaration[In, Yield, Await] : - LetOrConst BindingList[?In, ?Yield, ?Await] `;` + LetOrConst BindingList[?In, ?Yield, ?Await, +Pattern] `;` + UsingDeclaration[?In, ?Yield, ?Await] + [+Await] AwaitUsingDeclaration[?In, ?Yield] LetOrConst : `let` `const` - BindingList[In, Yield, Await] : - LexicalBinding[?In, ?Yield, ?Await] - BindingList[?In, ?Yield, ?Await] `,` LexicalBinding[?In, ?Yield, ?Await] + UsingDeclaration[In, Yield, Await] : + `using` [no LineTerminator here] BindingList[?In, ?Yield, ?Await, ~Pattern] `;` + + AwaitUsingDeclaration[In, Yield] : + CoverAwaitExpressionAndAwaitUsingDeclarationHead[?Yield] [no LineTerminator here] BindingList[?In, ?Yield, +Await, ~Pattern] `;` + + BindingList[In, Yield, Await, Pattern] : + LexicalBinding[?In, ?Yield, ?Await, ?Pattern] + BindingList[?In, ?Yield, ?Await, ?Pattern] `,` LexicalBinding[?In, ?Yield, ?Await, ?Pattern] - LexicalBinding[In, Yield, Await] : + LexicalBinding[In, Yield, Await, Pattern] : BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]? - BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + [+Pattern] BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + + +

          Supplemental Syntax

          +

          + When processing an instance of the production
          + AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList `;`
          + the interpretation of |CoverAwaitExpressionAndAwaitUsingDeclarationHead| is refined using the following grammar: +

          + + AwaitUsingDeclarationHead : + `await` [no LineTerminator here] `using` @@ -21201,6 +21992,31 @@

          Static Semantics: Early Errors

          It is a Syntax Error if the BoundNames of |BindingList| contains any duplicate entries.
        + + UsingDeclaration : + `using` BindingList `;` + +
          +
        • + It is a Syntax Error if the BoundNames of |BindingList| contains *"let"*. +
        • +
        • + It is a Syntax Error if the BoundNames of |BindingList| contains any duplicate entries. +
        • +
        + + AwaitUsingDeclaration : + CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList `;` + +
          +
        • |CoverAwaitExpressionAndAwaitUsingDeclarationHead| must cover an |AwaitUsingDeclarationHead|.
        • +
        • + It is a Syntax Error if the BoundNames of |BindingList| contains *"let"*. +
        • +
        • + It is a Syntax Error if the BoundNames of |BindingList| contains any duplicate entries. +
        • +
        LexicalBinding : BindingIdentifier Initializer?
        • @@ -21213,22 +22029,43 @@

          Static Semantics: Early Errors

          Runtime Semantics: Evaluation

          LexicalDeclaration : LetOrConst BindingList `;` - 1. Perform ? Evaluation of |BindingList|. + 1. Perform ? BindingEvaluation of |BindingList| with argument ~normal~. 1. Return ~empty~. + UsingDeclaration : `using` BindingList `;` + + 1. Perform ? BindingEvaluation of |BindingList| with argument ~sync-dispose~. + 1. Return ~empty~. + + AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList `;` + + 1. Perform ? BindingEvaluation of |BindingList| with argument ~async-dispose~. + 1. Return ~empty~. + + + + +

          + Runtime Semantics: BindingEvaluation ( + _kind_: ~normal~, ~sync-dispose~, or ~async-dispose~, + ): either a normal completion containing ~unused~ or an abrupt completion +

          +
          +
          BindingList : BindingList `,` LexicalBinding - 1. Perform ? Evaluation of |BindingList|. - 1. Return ? Evaluation of |LexicalBinding|. + 1. Perform ? BindingEvaluation of the derived |BindingList| with argument _kind_. + 1. Return ? BindingEvaluation of |LexicalBinding| with argument _kind_. LexicalBinding : BindingIdentifier + 1. Assert: _kind_ is ~normal~. 1. Let _lhs_ be ! ResolveBinding(StringValue of |BindingIdentifier|). 1. Perform ! InitializeReferencedBinding(_lhs_, *undefined*). - 1. Return ~empty~. + 1. Return ~unused~. -

          A static semantics rule ensures that this form of |LexicalBinding| never occurs in a `const` declaration.

          +

          A static semantics rule ensures that this form of |LexicalBinding| never occurs in a `const`, `using`, or `await using` declaration.

          LexicalBinding : BindingIdentifier Initializer @@ -21239,15 +22076,21 @@

          Runtime Semantics: Evaluation

          1. Else, 1. Let _rhs_ be ? Evaluation of |Initializer|. 1. Let _value_ be ? GetValue(_rhs_). - 1. Perform ! InitializeReferencedBinding(_lhs_, _value_). - 1. Return ~empty~. + 1. If _kind_ is not ~normal~, then + 1. Assert: IsUnresolvableReference(_lhs_) is *false*. + 1. Let _base_ be _lhs_.[[Base]]. + 1. Assert: _base_ is a Declarative Environment Record. + 1. Perform ? AddDisposableResource(_base_.[[DisposableResourceStack]], _value_, _kind_). + 1. Perform ? InitializeReferencedBinding(_lhs_, _value_). + 1. Return ~unused~.
          LexicalBinding : BindingPattern Initializer + 1. Assert: _kind_ is ~normal~. 1. Let _rhs_ be ? Evaluation of |Initializer|. 1. Let _value_ be ? GetValue(_rhs_). - 1. Let _env_ be the running execution context's LexicalEnvironment. - 1. Return ? BindingInitialization of |BindingPattern| with arguments _value_ and _env_. + 1. Let _envRecord_ be the running execution context's LexicalEnvironment. + 1. Return ? BindingInitialization of |BindingPattern| with arguments _value_ and _envRecord_.
          @@ -21305,8 +22148,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 _rightValue_ be ? GetValue(_rhs_). + 1. Return ? BindingInitialization of |BindingPattern| with arguments _rightValue_ and *undefined*. @@ -21364,7 +22207,7 @@

          Syntax

          Runtime Semantics: PropertyBindingInitialization ( _value_: an ECMAScript language value, - _environment_: an Environment Record or *undefined*, + _envRecord_: an Environment Record or *undefined*, ): either a normal completion containing a List of property keys or an abrupt completion

          @@ -21373,23 +22216,23 @@

          BindingPropertyList : BindingPropertyList `,` BindingProperty - 1. Let _boundNames_ be ? PropertyBindingInitialization of |BindingPropertyList| with arguments _value_ and _environment_. - 1. Let _nextNames_ be ? PropertyBindingInitialization of |BindingProperty| with arguments _value_ and _environment_. + 1. Let _boundNames_ be ? PropertyBindingInitialization of |BindingPropertyList| with arguments _value_ and _envRecord_. + 1. Let _nextNames_ be ? PropertyBindingInitialization of |BindingProperty| with arguments _value_ and _envRecord_. 1. Return the list-concatenation of _boundNames_ and _nextNames_. BindingProperty : SingleNameBinding 1. Let _name_ be the sole element of the BoundNames of |SingleNameBinding|. - 1. Perform ? KeyedBindingInitialization of |SingleNameBinding| with arguments _value_, _environment_, and _name_. + 1. Perform ? KeyedBindingInitialization of |SingleNameBinding| with arguments _value_, _envRecord_, and _name_. 1. Return « _name_ ». BindingProperty : PropertyName `:` BindingElement - 1. Let _P_ be ? Evaluation of |PropertyName|. - 1. Perform ? KeyedBindingInitialization of |BindingElement| with arguments _value_, _environment_, and _P_. - 1. Return « _P_ ». + 1. Let _propertyKey_ be ? Evaluation of |PropertyName|. + 1. Perform ? KeyedBindingInitialization of |BindingElement| with arguments _value_, _envRecord_, and _propertyKey_. + 1. Return « _propertyKey_ ». @@ -21397,7 +22240,7 @@

          Runtime Semantics: RestBindingInitialization ( _value_: an ECMAScript language value, - _environment_: an Environment Record or *undefined*, + _envRecord_: an Environment Record or *undefined*, _excludedNames_: a List of property keys, ): either a normal completion containing ~unused~ or an abrupt completion

          @@ -21405,10 +22248,10 @@

          BindingRestProperty : `...` BindingIdentifier - 1. Let _lhs_ be ? ResolveBinding(StringValue of |BindingIdentifier|, _environment_). + 1. Let _lhs_ be ? ResolveBinding(StringValue of |BindingIdentifier|, _envRecord_). 1. Let _restObj_ be OrdinaryObjectCreate(%Object.prototype%). 1. Perform ? CopyDataProperties(_restObj_, _value_, _excludedNames_). - 1. If _environment_ is *undefined*, return ? PutValue(_lhs_, _restObj_). + 1. If _envRecord_ is *undefined*, return ? PutValue(_lhs_, _restObj_). 1. Return ? InitializeReferencedBinding(_lhs_, _restObj_). @@ -21417,36 +22260,36 @@

          Runtime Semantics: KeyedBindingInitialization ( _value_: an ECMAScript language value, - _environment_: an Environment Record or *undefined*, + _envRecord_: an Environment Record or *undefined*, _propertyName_: a property key, ): either a normal completion containing ~unused~ or an abrupt completion

          -

          When *undefined* is passed for _environment_ it indicates that a PutValue operation should be used to assign the initialization value. This is the case for formal parameter lists of non-strict functions. In that case the formal parameter bindings are preinitialized in order to deal with the possibility of multiple parameters with the same name.

          +

          When *undefined* is passed for _envRecord_ it indicates that a PutValue operation should be used to assign the initialization value. This is the case for formal parameter lists of non-strict functions. In that case the formal parameter bindings are preinitialized in order to deal with the possibility of multiple parameters with the same name.

          BindingElement : BindingPattern Initializer? - 1. Let _v_ be ? GetV(_value_, _propertyName_). - 1. If |Initializer| is present and _v_ is *undefined*, then + 1. Set _value_ to ? GetV(_value_, _propertyName_). + 1. If |Initializer| is present and _value_ is *undefined*, then 1. Let _defaultValue_ be ? Evaluation of |Initializer|. - 1. Set _v_ to ? GetValue(_defaultValue_). - 1. Return ? BindingInitialization of |BindingPattern| with arguments _v_ and _environment_. + 1. Set _value_ to ? GetValue(_defaultValue_). + 1. Return ? BindingInitialization of |BindingPattern| with arguments _value_ and _envRecord_. SingleNameBinding : BindingIdentifier Initializer? 1. Let _bindingId_ be the StringValue of |BindingIdentifier|. - 1. Let _lhs_ be ? ResolveBinding(_bindingId_, _environment_). - 1. Let _v_ be ? GetV(_value_, _propertyName_). - 1. If |Initializer| is present and _v_ is *undefined*, then + 1. Let _lhs_ be ? ResolveBinding(_bindingId_, _envRecord_). + 1. Set _value_ to ? GetV(_value_, _propertyName_). + 1. If |Initializer| is present and _value_ is *undefined*, then 1. If IsAnonymousFunctionDefinition(|Initializer|) is *true*, then - 1. Set _v_ to ? NamedEvaluation of |Initializer| with argument _bindingId_. + 1. Set _value_ to ? NamedEvaluation of |Initializer| with argument _bindingId_. 1. Else, 1. Let _defaultValue_ be ? Evaluation of |Initializer|. - 1. Set _v_ to ? GetValue(_defaultValue_). - 1. If _environment_ is *undefined*, return ? PutValue(_lhs_, _v_). - 1. Return ? InitializeReferencedBinding(_lhs_, _v_). + 1. Set _value_ to ? GetValue(_defaultValue_). + 1. If _envRecord_ is *undefined*, return ? PutValue(_lhs_, _value_). + 1. Return ? InitializeReferencedBinding(_lhs_, _value_). @@ -21498,7 +22341,7 @@

          Syntax

          `if` `(` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] `else` Statement[?Yield, ?Await, ?Return] `if` `(` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] [lookahead != `else`] - The lookahead-restriction [lookahead ≠ `else`] resolves the classic "dangling else" problem in the usual way. That is, when the choice of associated `if` is otherwise ambiguous, the `else` is associated with the nearest (innermost) of the candidate `if`s + The lookahead-restriction [lookahead ≠ `else`] resolves the classic “dangling else” problem in the usual way. That is, when the choice of associated `if` is otherwise ambiguous, the `else` is associated with the nearest (innermost) of the candidate `if`s

          Static Semantics: Early Errors

          @@ -21538,11 +22381,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*).
          @@ -21640,14 +22481,14 @@

          DoWhileStatement : `do` Statement `while` `(` Expression `)` `;` - 1. Let _V_ be *undefined*. + 1. Let _iterationResult_ be *undefined*. 1. Repeat, 1. Let _stmtResult_ be Completion(Evaluation of |Statement|). - 1. If LoopContinues(_stmtResult_, _labelSet_) is *false*, return ? UpdateEmpty(_stmtResult_, _V_). - 1. If _stmtResult_.[[Value]] is not ~empty~, set _V_ to _stmtResult_.[[Value]]. + 1. If LoopContinues(_stmtResult_, _labelSet_) is *false*, return ? UpdateEmpty(_stmtResult_, _iterationResult_). + 1. If _stmtResult_.[[Value]] is not ~empty~, set _iterationResult_ to _stmtResult_.[[Value]]. 1. Let _exprRef_ be ? Evaluation of |Expression|. 1. Let _exprValue_ be ? GetValue(_exprRef_). - 1. If ToBoolean(_exprValue_) is *false*, return _V_. + 1. If ToBoolean(_exprValue_) is *false*, return _iterationResult_. @@ -21683,14 +22524,14 @@

          WhileStatement : `while` `(` Expression `)` Statement - 1. Let _V_ be *undefined*. + 1. Let _iterationResult_ be *undefined*. 1. Repeat, 1. Let _exprRef_ be ? Evaluation of |Expression|. 1. Let _exprValue_ be ? GetValue(_exprRef_). - 1. If ToBoolean(_exprValue_) is *false*, return _V_. + 1. If ToBoolean(_exprValue_) is *false*, return _iterationResult_. 1. Let _stmtResult_ be Completion(Evaluation of |Statement|). - 1. If LoopContinues(_stmtResult_, _labelSet_) is *false*, return ? UpdateEmpty(_stmtResult_, _V_). - 1. If _stmtResult_.[[Value]] is not ~empty~, set _V_ to _stmtResult_.[[Value]]. + 1. If LoopContinues(_stmtResult_, _labelSet_) is *false*, return ? UpdateEmpty(_stmtResult_, _iterationResult_). + 1. If _stmtResult_.[[Value]] is not ~empty~, set _iterationResult_ to _stmtResult_.[[Value]]. @@ -21742,15 +22583,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 @@ -21759,20 +22600,24 @@

          1. Let _loopEnv_ be NewDeclarativeEnvironment(_oldEnv_). 1. Let _isConst_ be IsConstantDeclaration of |LexicalDeclaration|. 1. Let _boundNames_ be the BoundNames of |LexicalDeclaration|. - 1. For each element _dn_ of _boundNames_, do + 1. For each element _name_ of _boundNames_, do 1. If _isConst_ is *true*, then - 1. Perform ! _loopEnv_.CreateImmutableBinding(_dn_, *true*). + 1. Perform ! _loopEnv_.CreateImmutableBinding(_name_, *true*). 1. Else, - 1. Perform ! _loopEnv_.CreateMutableBinding(_dn_, *false*). + 1. Perform ! _loopEnv_.CreateMutableBinding(_name_, *false*). 1. Set the running execution context's LexicalEnvironment to _loopEnv_. - 1. Let _forDcl_ be Completion(Evaluation of |LexicalDeclaration|). - 1. If _forDcl_ is an abrupt completion, then + 1. Let _forDecl_ be Completion(Evaluation of |LexicalDeclaration|). + 1. If _forDecl_ is an abrupt completion, then + 1. Set _forDecl_ to Completion(DisposeResources(_loopEnv_.[[DisposableResourceStack]], _forDecl_)). + 1. Assert: _forDecl_ is an abrupt completion. 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. Return ? _forDecl_. + 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 _bodyResult_ to Completion(DisposeResources(_loopEnv_.[[DisposableResourceStack]], _bodyResult_)). + 1. Assert: If _bodyResult_ is a normal completion, then _bodyResult_.[[Value]] is not ~empty~. 1. Set the running execution context's LexicalEnvironment to _oldEnv_. 1. Return ? _bodyResult_. @@ -21791,16 +22636,16 @@

          - 1. Let _V_ be *undefined*. + 1. Let _iterationResult_ be *undefined*. 1. Perform ? CreatePerIterationEnvironment(_perIterationBindings_). 1. Repeat, 1. If _test_ is not ~empty~, then 1. Let _testRef_ be ? Evaluation of _test_. 1. Let _testValue_ be ? GetValue(_testRef_). - 1. If ToBoolean(_testValue_) is *false*, return _V_. + 1. If ToBoolean(_testValue_) is *false*, return _iterationResult_. 1. Let _result_ be Completion(Evaluation of _stmt_). - 1. If LoopContinues(_result_, _labelSet_) is *false*, return ? UpdateEmpty(_result_, _V_). - 1. If _result_.[[Value]] is not ~empty~, set _V_ to _result_.[[Value]]. + 1. If LoopContinues(_result_, _labelSet_) is *false*, return ? UpdateEmpty(_result_, _iterationResult_). + 1. If _result_.[[Value]] is not ~empty~, set _iterationResult_ to _result_.[[Value]]. 1. Perform ? CreatePerIterationEnvironment(_perIterationBindings_). 1. If _increment_ is not ~empty~, then 1. Let _incRef_ be ? Evaluation of _increment_. @@ -21822,10 +22667,10 @@

          1. Let _outer_ be _lastIterationEnv_.[[OuterEnv]]. 1. Assert: _outer_ is not *null*. 1. Let _thisIterationEnv_ be NewDeclarativeEnvironment(_outer_). - 1. For each element _bn_ of _perIterationBindings_, do - 1. Perform ! _thisIterationEnv_.CreateMutableBinding(_bn_, *false*). - 1. Let _lastValue_ be ? _lastIterationEnv_.GetBindingValue(_bn_, *true*). - 1. Perform ! _thisIterationEnv_.InitializeBinding(_bn_, _lastValue_). + 1. For each element _name_ of _perIterationBindings_, do + 1. Perform ! _thisIterationEnv_.CreateMutableBinding(_name_, *false*). + 1. Let _lastValue_ be ? _lastIterationEnv_.GetBindingValue(_name_, *true*). + 1. Perform ! _thisIterationEnv_.InitializeBinding(_name_, _lastValue_). 1. Set the running execution context's LexicalEnvironment to _thisIterationEnv_. 1. Return ~unused~. @@ -21838,21 +22683,23 @@

          Syntax

          ForInOfStatement[Yield, Await, Return] : `for` `(` [lookahead != `let` `[`] LeftHandSideExpression[?Yield, ?Await] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] - `for` `(` `var` ForBinding[?Yield, ?Await] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] - `for` `(` ForDeclaration[?Yield, ?Await] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + `for` `(` `var` ForBinding[?Yield, ?Await, +Pattern] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + `for` `(` ForDeclaration[?Yield, ?Await, ~Using] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] `for` `(` [lookahead ∉ { `let`, `async` `of` }] LeftHandSideExpression[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] - `for` `(` `var` ForBinding[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] - `for` `(` ForDeclaration[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + `for` `(` `var` ForBinding[?Yield, ?Await, +Pattern] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + `for` `(` [lookahead != `using` `of`] ForDeclaration[?Yield, ?Await, +Using] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] [+Await] `for` `await` `(` [lookahead != `let`] LeftHandSideExpression[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] - [+Await] `for` `await` `(` `var` ForBinding[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] - [+Await] `for` `await` `(` ForDeclaration[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + [+Await] `for` `await` `(` `var` ForBinding[?Yield, ?Await, +Pattern] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + [+Await] `for` `await` `(` [lookahead != `using` `of`] ForDeclaration[?Yield, ?Await, +Using] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] - ForDeclaration[Yield, Await] : - LetOrConst ForBinding[?Yield, ?Await] + ForDeclaration[Yield, Await, Using] : + LetOrConst ForBinding[?Yield, ?Await, +Pattern] + [+Using] `using` [no LineTerminator here] ForBinding[?Yield, ?Await, ~Pattern] + [+Using, +Await] `await` [no LineTerminator here] `using` [no LineTerminator here] ForBinding[?Yield, +Await, ~Pattern] - ForBinding[Yield, Await] : + ForBinding[Yield, Await, Pattern] : BindingIdentifier[?Yield, ?Await] - BindingPattern[?Yield, ?Await] + [+Pattern] BindingPattern[?Yield, ?Await]

          This section is extended by Annex .

          @@ -21891,7 +22738,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~.
        @@ -21963,24 +22810,29 @@

        Static Semantics: IsDestructuring ( ): a Boolean

        Runtime Semantics: ForDeclarationBindingInitialization ( _value_: an ECMAScript language value, - _environment_: an Environment Record or *undefined*, + _envRecord_: an Environment Record, ): either a normal completion containing ~unused~ or an abrupt completion

        - -

        *undefined* is passed for _environment_ to indicate that a PutValue operation should be used to assign the initialization value. This is the case for `var` statements and the formal parameter lists of some non-strict functions (see ). In those cases a lexical binding is hoisted and preinitialized prior to evaluation of its initializer.

        -
        ForDeclaration : LetOrConst ForBinding - 1. Return ? BindingInitialization of |ForBinding| with arguments _value_ and _environment_. + 1. Return ? BindingInitialization of |ForBinding| with arguments _value_ and _envRecord_. + + + ForDeclaration : + `using` ForBinding + `await` `using` ForBinding + + + 1. Throw a *SyntaxError* exception.

        Runtime Semantics: ForDeclarationBindingInstantiation ( - _environment_: a Declarative Environment Record, + _envRecord_: a Declarative Environment Record, ): ~unused~

        @@ -21989,9 +22841,19 @@

        1. For each element _name_ of the BoundNames of |ForBinding|, do 1. If IsConstantDeclaration of |LetOrConst| is *true*, then - 1. Perform ! _environment_.CreateImmutableBinding(_name_, *true*). + 1. Perform ! _envRecord_.CreateImmutableBinding(_name_, *true*). 1. Else, - 1. Perform ! _environment_.CreateMutableBinding(_name_, *false*). + 1. Perform ! _envRecord_.CreateMutableBinding(_name_, *false*). + 1. Return ~unused~. + + + ForDeclaration : + `using` ForBinding + `await` `using` ForBinding + + + 1. For each element _name_ of the BoundNames of |ForBinding|, do + 1. Perform ! _envRecord_.CreateImmutableBinding(_name_, *true*). 1. Return ~unused~. @@ -22088,11 +22950,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_). @@ -22113,7 +22974,17 @@

        1. If _iteratorKind_ is not present, set _iteratorKind_ to ~sync~. 1. Let _oldEnv_ be the running execution context's LexicalEnvironment. - 1. Let _V_ be *undefined*. + 1. Let _iterationResult_ be *undefined*. + 1. If _lhsKind_ is ~lexical-binding~, then + 1. Assert: _lhs_ is a |ForDeclaration|. + 1. If IsAwaitUsingDeclaration of _lhs_ is *true*, then + 1. Let _declKind_ be ~async-dispose~. + 1. Else if IsUsingDeclaration of _lhs_ is *true*, then + 1. Let _declKind_ be ~sync-dispose~. + 1. Else, + 1. Let _declKind_ be ~normal~. + 1. Else, + 1. Let _declKind_ be ~normal~. 1. Let _destructuring_ be IsDestructuring of _lhs_. 1. If _destructuring_ is *true* and _lhsKind_ is ~assignment~, then 1. Assert: _lhs_ is a |LeftHandSideExpression|. @@ -22123,7 +22994,7 @@

        1. If _iteratorKind_ is ~async~, 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*, return _V_. + 1. If _done_ is *true*, return _iterationResult_. 1. Let _nextValue_ be ? IteratorValue(_nextResult_). 1. If _lhsKind_ is either ~assignment~ or ~var-binding~, then 1. If _destructuring_ is *true*, then @@ -22135,10 +23006,12 @@

        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, 1. Let _status_ be Completion(PutValue(_lhsRef_.[[Value]], _nextValue_)). + 1. Let _iterationEnv_ be *undefined*. 1. Else, 1. Assert: _lhsKind_ is ~lexical-binding~. 1. Assert: _lhs_ is a |ForDeclaration|. @@ -22151,26 +23024,35 @@

        1. Assert: _lhs_ binds a single name. 1. Let _lhsName_ be the sole element of the BoundNames of _lhs_. 1. Let _lhsRef_ be ! ResolveBinding(_lhsName_). - 1. Let _status_ be Completion(InitializeReferencedBinding(_lhsRef_, _nextValue_)). + 1. If _declKind_ is not ~normal~, then + 1. Assert: IsUnresolvableReference(_lhsRef_) is *false*. + 1. Let _base_ be _lhsRef_.[[Base]]. + 1. Assert: _base_ is a Declarative Environment Record. + 1. Let _status_ be Completion(AddDisposableResource(_base_.[[DisposableResourceStack]], _nextValue_, _declKind_)). + 1. Else, + 1. Let _status_ be NormalCompletion(~unused~). + 1. If _status_ is a normal completion, then + 1. Set _status_ to Completion(InitializeReferencedBinding(_lhsRef_, _nextValue_)). 1. If _status_ is an abrupt completion, then + 1. If _iterationEnv_ is not *undefined*, then + 1. Set _status_ to Completion(DisposeResources(_iterationEnv_.[[DisposableResourceStack]], _status_)). + 1. Assert: _status_ is an abrupt completion. 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. If _iterationEnv_ is not *undefined*, then + 1. Set _result_ to Completion(DisposeResources(_iterationEnv_.[[DisposableResourceStack]], _result_)). 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. If _result_.[[Value]] is not ~empty~, set _V_ to _result_.[[Value]]. + 1. Set _status_ to Completion(UpdateEmpty(_result_, _iterationResult_)). + 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 _iterationResult_ to _result_.[[Value]]. @@ -22191,22 +23073,22 @@

        Runtime Semantics: Evaluation

        EnumerateObjectProperties ( - _O_: an Object, - ): an Iterator + _obj_: an Object, + ): 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 _obj_. 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.

        -

        In addition, if neither _O_ nor any object in its prototype chain is a Proxy exotic object, TypedArray, module namespace exotic object, or implementation provided exotic object, then the iterator must behave as would the iterator given by CreateForInIterator(_O_) until one of the following occurs:

        +

        In addition, if neither _obj_ nor any object in its prototype chain is a Proxy exotic object, TypedArray, module namespace exotic object, or implementation provided exotic object, then the iterator must behave as would the iterator given by CreateForInIterator(_obj_) until one of the following occurs:

          -
        • the value of the [[Prototype]] internal slot of _O_ or an object in its prototype chain changes,
        • -
        • a property is removed from _O_ or an object in its prototype chain,
        • -
        • a property is added to an object in _O_'s prototype chain, or
        • -
        • the value of the [[Enumerable]] attribute of a property of _O_ or an object in its prototype chain changes.
        • +
        • the value of the [[Prototype]] internal slot of _obj_ or an object in its prototype chain changes,
        • +
        • a property is removed from _obj_ or an object in its prototype chain,
        • +
        • a property is added to an object in _obj_'s prototype chain, or
        • +
        • the value of the [[Enumerable]] attribute of a property of _obj_ or an object in its prototype chain changes.
        @@ -22238,21 +23120,21 @@

        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.

        CreateForInIterator ( - _object_: an Object, + _obj_: an Object, ): a For-In Iterator

        description
        -
        It is used to create a For-In Iterator object which iterates over the own and inherited enumerable string properties of _object_ in a specific order.
        +
        It is used to create a For-In Iterator object which iterates over the own and inherited enumerable string properties of _obj_ in a specific order.
        1. Let _iterator_ be OrdinaryObjectCreate(%ForInIteratorPrototype%, « [[Object]], [[ObjectWasVisited]], [[VisitedKeys]], [[RemainingKeys]] »). - 1. Set _iterator_.[[Object]] to _object_. + 1. Set _iterator_.[[Object]] to _obj_. 1. Set _iterator_.[[ObjectWasVisited]] to *false*. 1. Set _iterator_.[[VisitedKeys]] to a new empty List. 1. Set _iterator_.[[RemainingKeys]] to a new empty List. @@ -22264,39 +23146,39 @@

        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. Let _object_ be _O_.[[Object]]. + 1. Let _iterator_ be the *this* value. + 1. Assert: _iterator_ is an Object. + 1. Assert: _iterator_ has all of the internal slots of a For-In Iterator instance (). + 1. Let _obj_ be _iterator_.[[Object]]. 1. Repeat, - 1. If _O_.[[ObjectWasVisited]] is *false*, then - 1. Let _keys_ be ? _object_.[[OwnPropertyKeys]](). + 1. If _iterator_.[[ObjectWasVisited]] is *false*, then + 1. Let _keys_ be ? _obj_.[[OwnPropertyKeys]](). 1. For each element _key_ of _keys_, do 1. If _key_ is a String, then - 1. Append _key_ to _O_.[[RemainingKeys]]. - 1. Set _O_.[[ObjectWasVisited]] to *true*. - 1. Repeat, while _O_.[[RemainingKeys]] is not empty, - 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. If _desc_ is not *undefined*, then - 1. Append _r_ to _O_.[[VisitedKeys]]. - 1. If _desc_.[[Enumerable]] is *true*, return CreateIterResultObject(_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. Append _key_ to _iterator_.[[RemainingKeys]]. + 1. Set _iterator_.[[ObjectWasVisited]] to *true*. + 1. Repeat, while _iterator_.[[RemainingKeys]] is not empty, + 1. Let _key_ be the first element of _iterator_.[[RemainingKeys]]. + 1. Remove the first element from _iterator_.[[RemainingKeys]]. + 1. If _iterator_.[[VisitedKeys]] does not contain _key_, then + 1. Let _propertyDesc_ be ? _obj_.[[GetOwnProperty]](_key_). + 1. If _propertyDesc_ is not *undefined*, then + 1. Append _key_ to _iterator_.[[VisitedKeys]]. + 1. If _propertyDesc_.[[Enumerable]] is *true*, return CreateIteratorResultObject(_key_, *false*). + 1. Set _obj_ to ? _obj_.[[GetPrototypeOf]](). + 1. Set _iterator_.[[Object]] to _obj_. + 1. Set _iterator_.[[ObjectWasVisited]] to *false*. + 1. If _obj_ is *null*, return CreateIteratorResultObject(*undefined*, *true*).
        @@ -22306,17 +23188,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 .

        - - - - - + + + + + + + @@ -25806,7 +26726,7 @@

        Script Records

        ParseScript ( - _sourceText_: ECMAScript source text, + _sourceText_: a String or a sequence of Unicode code points, _realm_: a Realm Record, _hostDefined_: anything, ): a Script Record or a non-empty List of *SyntaxError* objects @@ -25846,10 +26766,10 @@

        1. Set the PrivateEnvironment of _scriptContext_ to *null*. 1. Suspend the running execution context. 1. Push _scriptContext_ onto the execution context stack; _scriptContext_ is now the running execution context. - 1. Let _script_ be _scriptRecord_.[[ECMAScriptCode]]. - 1. Let _result_ be Completion(GlobalDeclarationInstantiation(_script_, _globalEnv_)). + 1. Let _scriptNode_ be _scriptRecord_.[[ECMAScriptCode]]. + 1. Let _result_ be Completion(GlobalDeclarationInstantiation(_scriptNode_, _globalEnv_)). 1. If _result_ is a normal completion, then - 1. Set _result_ to Completion(Evaluation of _script_). + 1. Set _result_ to Completion(Evaluation of _scriptNode_). 1. If _result_ is a normal completion and _result_.[[Value]] is ~empty~, then 1. Set _result_ to NormalCompletion(*undefined*). 1. Suspend _scriptContext_ and remove it from the execution context stack. @@ -25859,75 +26779,89 @@

        - +

        GlobalDeclarationInstantiation ( _script_: a |Script| Parse Node, - _env_: a Global Environment Record, + _envRecord_: a Global Environment Record, ): either a normal completion containing ~unused~ or a throw completion

        description
        -
        _script_ is the |Script| for which the execution context is being established. _env_ is the global environment in which bindings are to be created.
        +
        _script_ is the |Script| for which the execution context is being established. _envRecord_ is the global environment in which bindings are to be created.

        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. Let _lexicalNames_ be the LexicallyDeclaredNames of _script_. + 1. Let _variableNames_ be the VarDeclaredNames of _script_. + 1. For each element _name_ of _lexicalNames_, do + 1. If HasLexicalDeclaration(_envRecord_, _name_) is *true*, throw a *SyntaxError* exception. + 1. Let _hasRestrictedGlobal_ be ? HasRestrictedGlobalProperty(_envRecord_, _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. Let _varDeclarations_ be the VarScopedDeclarations of _script_. - 1. Let _functionsToInitialize_ be a new empty List. - 1. Let _declaredFunctionNames_ be a new empty List. - 1. For each element _d_ of _varDeclarations_, in reverse List order, do - 1. If _d_ is not either a |VariableDeclaration|, a |ForBinding|, or a |BindingIdentifier|, then - 1. Assert: _d_ is either a |FunctionDeclaration|, a |GeneratorDeclaration|, an |AsyncFunctionDeclaration|, or an |AsyncGeneratorDeclaration|. + 1. For each element _name_ of _variableNames_, do + 1. If HasLexicalDeclaration(_envRecord_, _name_) is *true*, throw a *SyntaxError* exception. + 1. Let _variableDecls_ be the VarScopedDeclarations of _script_. + 1. Let _funcsToInitialize_ be a new empty List. + 1. Let _declaredFuncNames_ be a new empty List. + 1. For each element _variableDecl_ of _variableDecls_, in reverse List order, do + 1. If _variableDecl_ is not either a |VariableDeclaration|, a |ForBinding|, or a |BindingIdentifier|, then + 1. Assert: _variableDecl_ is either a |FunctionDeclaration|, a |GeneratorDeclaration|, an |AsyncFunctionDeclaration|, or an |AsyncGeneratorDeclaration|. 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. If _fnDefinable_ is *false*, throw a *TypeError* exception. - 1. Append _fn_ to _declaredFunctionNames_. - 1. Insert _d_ as the first element of _functionsToInitialize_. - 1. Let _declaredVarNames_ be a new empty List. - 1. For each element _d_ of _varDeclarations_, do - 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. If _vnDefinable_ is *false*, throw a *TypeError* exception. - 1. If _declaredVarNames_ does not contain _vn_, then - 1. Append _vn_ to _declaredVarNames_. + 1. Let _funcName_ be the sole element of the BoundNames of _variableDecl_. + 1. If _declaredFuncNames_ does not contain _funcName_, then + 1. Let _funcDefinable_ be ? CanDeclareGlobalFunction(_envRecord_, _funcName_). + 1. If _funcDefinable_ is *false*, throw a *TypeError* exception. + 1. Append _funcName_ to _declaredFuncNames_. + 1. Insert _variableDecl_ as the first element of _funcsToInitialize_. + 1. Let _declaredVariableNames_ be a new empty List. + 1. For each element _variableDecl_ of _variableDecls_, do + 1. If _variableDecl_ is either a |VariableDeclaration|, a |ForBinding|, or a |BindingIdentifier|, then + 1. For each String _name_ of the BoundNames of _variableDecl_, do + 1. If _declaredFuncNames_ does not contain _name_, then + 1. Let _variableDefinable_ be ? CanDeclareGlobalVar(_envRecord_, _name_). + 1. If _variableDefinable_ is *false*, throw a *TypeError* exception. + 1. If _declaredVariableNames_ does not contain _name_, then + 1. Append _name_ to _declaredVariableNames_. 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. Let _lexDeclarations_ be the LexicallyScopedDeclarations of _script_. + 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 _declaredFuncOrVariableNames_ be the list-concatenation of _declaredFuncNames_ and _declaredVariableNames_. + 1. For each |FunctionDeclaration| _funcDecl_ that is directly contained in the |StatementList| of any |Block|, |CaseClause|, or |DefaultClause| _x_ such that _script_ Contains _x_ is *true*, do + 1. Let _funcName_ be the StringValue of the |BindingIdentifier| of _funcDecl_. + 1. If replacing the |FunctionDeclaration| _funcDecl_ with a |VariableStatement| that has _funcName_ as a |BindingIdentifier| would not produce any Early Errors for _script_, then + 1. If HasLexicalDeclaration(_envRecord_, _funcName_) is *false*, then + 1. Let _funcDefinable_ be ? CanDeclareGlobalVar(_envRecord_, _funcName_). + 1. If _funcDefinable_ is *true*, then + 1. NOTE: A var binding for _funcName_ is only instantiated here if it is neither a VarDeclaredName nor the name of another |FunctionDeclaration|. + 1. If _declaredFuncOrVariableNames_ does not contain _funcName_, then + 1. Perform ? CreateGlobalVarBinding(_envRecord_, _funcName_, *false*). + 1. Append _funcName_ to _declaredFuncOrVariableNames_. + 1. [id="step-globaldeclarationinstantiation-alt-funcdecl-eval"] When the |FunctionDeclaration| _funcDecl_ is evaluated, perform the following steps in place of the |FunctionDeclaration| Evaluation algorithm provided in : + 1. Let _globalEnv_ be the running execution context's VariableEnvironment. + 1. Let _blockEnv_ be the running execution context's LexicalEnvironment. + 1. Let _funcObj_ be ! _blockEnv_.GetBindingValue(_funcName_, *false*). + 1. Perform ? _globalEnv_.SetMutableBinding(_funcName_, _funcObj_, *false*). + 1. Return ~unused~. + 1. Let _lexicalDecls_ be the LexicallyScopedDeclarations of _script_. 1. Let _privateEnv_ be *null*. - 1. For each element _d_ of _lexDeclarations_, do + 1. For each element _lexicalDecl_ of _lexicalDecls_, 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. For each element _name_ of the BoundNames of _lexicalDecl_, do + 1. If IsConstantDeclaration of _lexicalDecl_ is *true*, then + 1. Perform ? _envRecord_.CreateImmutableBinding(_name_, *true*). 1. Else, - 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. For each String _vn_ of _declaredVarNames_, do - 1. Perform ? _env_.CreateGlobalVarBinding(_vn_, *false*). + 1. Perform ? _envRecord_.CreateMutableBinding(_name_, *false*). + 1. For each Parse Node _funcDecl_ of _funcsToInitialize_, do + 1. Let _funcName_ be the sole element of the BoundNames of _funcDecl_. + 1. Let _funcObj_ be InstantiateFunctionObject of _funcDecl_ with arguments _envRecord_ and _privateEnv_. + 1. Perform ? CreateGlobalFunctionBinding(_envRecord_, _funcName_, _funcObj_, *false*). + 1. For each String _variableName_ of _declaredVariableNames_, do + 1. Perform ? CreateGlobalVarBinding(_envRecord_, _variableName_, *false*). 1. Return ~unused~. @@ -26020,14 +26954,171 @@

        1. Let _localNames_ be a new empty List. - 1. For each ImportEntry Record _i_ of _importEntries_, do - 1. Append _i_.[[LocalName]] to _localNames_. + 1. For each ImportEntry Record _importEntry_ of _importEntries_, do + 1. Append _importEntry_.[[LocalName]] to _localNames_. 1. Return _localNames_. + +

        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 +23338,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_). @@ -22501,14 +23385,14 @@

        Static Semantics: Early Errors

        Runtime Semantics: Evaluation

        WithStatement : `with` `(` Expression `)` Statement - 1. Let _val_ be ? Evaluation of |Expression|. - 1. Let _obj_ be ? ToObject(? GetValue(_val_)). + 1. Let _value_ be ? Evaluation of |Expression|. + 1. Let _obj_ be ? ToObject(? GetValue(_value_)). 1. Let _oldEnv_ be the running execution context's LexicalEnvironment. 1. Let _newEnv_ be NewObjectEnvironment(_obj_, *true*, _oldEnv_). 1. Set the running execution context's LexicalEnvironment to _newEnv_. - 1. Let _C_ be Completion(Evaluation of |Statement|). + 1. Let _stmtCompletion_ be Completion(Evaluation of |Statement|). 1. Set the running execution context's LexicalEnvironment to _oldEnv_. - 1. Return ? UpdateEmpty(_C_, *undefined*). + 1. Return ? UpdateEmpty(_stmtCompletion_, *undefined*).

        No matter how control leaves the embedded |Statement|, whether normally or by some form of abrupt completion or exception, the LexicalEnvironment is always restored to its former state.

        @@ -22538,17 +23422,33 @@

        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|.
        + CaseClause : `case` Expression `:` StatementList +
          +
        • + It is a Syntax Error if ContainsUsing of |StatementList| is *true*. +
        • +
        + DefaultClause : `default` `:` StatementList +
          +
        • + It is a Syntax Error if ContainsUsing of |StatementList| is *true*. +
        • +
        @@ -22565,78 +23465,78 @@

        CaseBlock : `{` CaseClauses `}` - 1. Let _V_ be *undefined*. - 1. Let _A_ be the List of |CaseClause| items in |CaseClauses|, in source text order. + 1. Let _resultValue_ be *undefined*. + 1. Let _caseClauses_ be the List of |CaseClause| items in |CaseClauses|, in source text order. 1. Let _found_ be *false*. - 1. For each |CaseClause| _C_ of _A_, do + 1. For each |CaseClause| _clause_ of _caseClauses_, do 1. If _found_ is *false*, then - 1. Set _found_ to ? CaseClauseIsSelected(_C_, _input_). + 1. Set _found_ to ? CaseClauseIsSelected(_clause_, _input_). 1. If _found_ is *true*, then - 1. Let _R_ be Completion(Evaluation of _C_). - 1. If _R_.[[Value]] is not ~empty~, set _V_ to _R_.[[Value]]. - 1. If _R_ is an abrupt completion, return ? UpdateEmpty(_R_, _V_). - 1. Return _V_. + 1. Let _completion_ be Completion(Evaluation of _clause_). + 1. If _completion_.[[Value]] is not ~empty~, set _resultValue_ to _completion_.[[Value]]. + 1. If _completion_ is an abrupt completion, return ? UpdateEmpty(_completion_, _resultValue_). + 1. Return _resultValue_. CaseBlock : `{` CaseClauses? DefaultClause CaseClauses? `}` - 1. Let _V_ be *undefined*. + 1. Let _resultValue_ be *undefined*. 1. If the first |CaseClauses| is present, then - 1. Let _A_ be the List of |CaseClause| items in the first |CaseClauses|, in source text order. + 1. Let _caseClauses_ be the List of |CaseClause| items in the first |CaseClauses|, in source text order. 1. Else, - 1. Let _A_ be a new empty List. + 1. Let _caseClauses_ be a new empty List. 1. Let _found_ be *false*. - 1. For each |CaseClause| _C_ of _A_, do + 1. For each |CaseClause| _clause_ of _caseClauses_, do 1. If _found_ is *false*, then - 1. Set _found_ to ? CaseClauseIsSelected(_C_, _input_). + 1. Set _found_ to ? CaseClauseIsSelected(_clause_, _input_). 1. If _found_ is *true*, then - 1. Let _R_ be Completion(Evaluation of _C_). - 1. If _R_.[[Value]] is not ~empty~, set _V_ to _R_.[[Value]]. - 1. If _R_ is an abrupt completion, return ? UpdateEmpty(_R_, _V_). + 1. Let _completion_ be Completion(Evaluation of _clause_). + 1. If _completion_.[[Value]] is not ~empty~, set _resultValue_ to _completion_.[[Value]]. + 1. If _completion_ is an abrupt completion, return ? UpdateEmpty(_completion_, _resultValue_). 1. Let _foundInB_ be *false*. 1. If the second |CaseClauses| is present, then - 1. Let _B_ be the List of |CaseClause| items in the second |CaseClauses|, in source text order. + 1. Let _secondCaseClauses_ be the List of |CaseClause| items in the second |CaseClauses|, in source text order. 1. Else, - 1. Let _B_ be a new empty List. + 1. Let _secondCaseClauses_ be a new empty List. 1. If _found_ is *false*, then - 1. For each |CaseClause| _C_ of _B_, do + 1. For each |CaseClause| _clause_ of _secondCaseClauses_, do 1. If _foundInB_ is *false*, then - 1. Set _foundInB_ to ? CaseClauseIsSelected(_C_, _input_). + 1. Set _foundInB_ to ? CaseClauseIsSelected(_clause_, _input_). 1. If _foundInB_ is *true*, then - 1. Let _R_ be Completion(Evaluation of |CaseClause| _C_). - 1. If _R_.[[Value]] is not ~empty~, set _V_ to _R_.[[Value]]. - 1. If _R_ is an abrupt completion, return ? UpdateEmpty(_R_, _V_). - 1. If _foundInB_ is *true*, return _V_. + 1. Let _completion_ be Completion(Evaluation of |CaseClause| _clause_). + 1. If _completion_.[[Value]] is not ~empty~, set _resultValue_ to _completion_.[[Value]]. + 1. If _completion_ is an abrupt completion, return ? UpdateEmpty(_completion_, _resultValue_). + 1. If _foundInB_ is *true*, return _resultValue_. 1. Let _defaultR_ be Completion(Evaluation of |DefaultClause|). - 1. If _defaultR_.[[Value]] is not ~empty~, set _V_ to _defaultR_.[[Value]]. - 1. If _defaultR_ is an abrupt completion, return ? UpdateEmpty(_defaultR_, _V_). + 1. If _defaultR_.[[Value]] is not ~empty~, set _resultValue_ to _defaultR_.[[Value]]. + 1. If _defaultR_ is an abrupt completion, return ? UpdateEmpty(_defaultR_, _resultValue_). 1. NOTE: The following is another complete iteration of the second |CaseClauses|. - 1. For each |CaseClause| _C_ of _B_, do - 1. Let _R_ be Completion(Evaluation of |CaseClause| _C_). - 1. If _R_.[[Value]] is not ~empty~, set _V_ to _R_.[[Value]]. - 1. If _R_ is an abrupt completion, return ? UpdateEmpty(_R_, _V_). - 1. Return _V_. + 1. For each |CaseClause| _clause_ of _secondCaseClauses_, do + 1. Let _completion_ be Completion(Evaluation of |CaseClause| _clause_). + 1. If _completion_.[[Value]] is not ~empty~, set _resultValue_ to _completion_.[[Value]]. + 1. If _completion_ is an abrupt completion, return ? UpdateEmpty(_completion_, _resultValue_). + 1. Return _resultValue_.

        CaseClauseIsSelected ( - _C_: a |CaseClause| Parse Node, + _caseClauseNode_: a |CaseClause| Parse Node, _input_: an ECMAScript language value, ): either a normal completion containing a Boolean or an abrupt completion

        description
        -
        It determines whether _C_ matches _input_.
        +
        It determines whether _caseClauseNode_ matches _input_.
        - 1. Assert: _C_ is an instance of the production CaseClause : `case` Expression `:` StatementList?. - 1. Let _exprRef_ be ? Evaluation of the |Expression| of _C_. + 1. Assert: _caseClauseNode_ is an instance of the production CaseClause : `case` Expression `:` StatementList?. + 1. Let _exprRef_ be ? Evaluation of the |Expression| of _caseClauseNode_. 1. Let _clauseSelector_ be ? GetValue(_exprRef_). 1. Return IsStrictlyEqual(_input_, _clauseSelector_). -

        This operation does not execute _C_'s |StatementList| (if any). The |CaseBlock| algorithm uses its return value to determine which |StatementList| to start executing.

        +

        This operation does not execute _caseClauseNode_'s |StatementList| (if any). The |CaseBlock| algorithm uses its return value to determine which |StatementList| to start executing.

        @@ -22650,9 +23550,10 @@

        Runtime Semantics: Evaluation

        1. Let _blockEnv_ be NewDeclarativeEnvironment(_oldEnv_). 1. Perform BlockDeclarationInstantiation(|CaseBlock|, _blockEnv_). 1. Set the running execution context's LexicalEnvironment to _blockEnv_. - 1. Let _R_ be Completion(CaseBlockEvaluation of |CaseBlock| with argument _switchValue_). + 1. Let _blockResult_ be Completion(CaseBlockEvaluation of |CaseBlock| with argument _switchValue_). + 1. Assert: _blockEnv_.[[DisposableResourceStack]] is an empty List. 1. Set the running execution context's LexicalEnvironment to _oldEnv_. - 1. Return _R_. + 1. Return _blockResult_.

        No matter how control leaves the |SwitchStatement| the LexicalEnvironment is always restored to its former state.

        @@ -22696,12 +23597,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 +23631,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

        @@ -22809,7 +23707,7 @@

        Runtime Semantics: Evaluation

        1. Let _exprRef_ be ? Evaluation of |Expression|. 1. Let _exprValue_ be ? GetValue(_exprRef_). - 1. Return ThrowCompletion(_exprValue_). + 1. Throw _exprValue_.
        @@ -22849,19 +23747,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

        @@ -22876,9 +23771,9 @@

        1. If _status_ is an abrupt completion, then 1. Set the running execution context's LexicalEnvironment to _oldEnv_. 1. Return ? _status_. - 1. Let _B_ be Completion(Evaluation of |Block|). + 1. Let _blockCompletion_ be Completion(Evaluation of |Block|). 1. Set the running execution context's LexicalEnvironment to _oldEnv_. - 1. Return ? _B_. + 1. Return ? _blockCompletion_. Catch : `catch` Block @@ -22893,26 +23788,26 @@

        Runtime Semantics: Evaluation

        TryStatement : `try` Block Catch - 1. Let _B_ be Completion(Evaluation of |Block|). - 1. If _B_ is a throw completion, let _C_ be Completion(CatchClauseEvaluation of |Catch| with argument _B_.[[Value]]). - 1. Else, let _C_ be _B_. - 1. Return ? UpdateEmpty(_C_, *undefined*). + 1. Let _blockResult_ be Completion(Evaluation of |Block|). + 1. If _blockResult_ is a throw completion, let _catchResult_ be Completion(CatchClauseEvaluation of |Catch| with argument _blockResult_.[[Value]]). + 1. Else, let _catchResult_ be _blockResult_. + 1. Return ? UpdateEmpty(_catchResult_, *undefined*). TryStatement : `try` Block Finally - 1. Let _B_ be Completion(Evaluation of |Block|). - 1. Let _F_ be Completion(Evaluation of |Finally|). - 1. If _F_ is a normal completion, set _F_ to _B_. - 1. Return ? UpdateEmpty(_F_, *undefined*). + 1. Let _blockResult_ be Completion(Evaluation of |Block|). + 1. Let _finallyResult_ be Completion(Evaluation of |Finally|). + 1. If _finallyResult_ is a normal completion, set _finallyResult_ to _blockResult_. + 1. Return ? UpdateEmpty(_finallyResult_, *undefined*). TryStatement : `try` Block Catch Finally - 1. Let _B_ be Completion(Evaluation of |Block|). - 1. If _B_ is a throw completion, let _C_ be Completion(CatchClauseEvaluation of |Catch| with argument _B_.[[Value]]). - 1. Else, let _C_ be _B_. - 1. Let _F_ be Completion(Evaluation of |Finally|). - 1. If _F_ is a normal completion, set _F_ to _C_. - 1. Return ? UpdateEmpty(_F_, *undefined*). + 1. Let _blockResult_ be Completion(Evaluation of |Block|). + 1. If _blockResult_ is a throw completion, let _catchResult_ be Completion(CatchClauseEvaluation of |Catch| with argument _blockResult_.[[Value]]). + 1. Else, let _catchResult_ be _blockResult_. + 1. Let _finallyResult_ be Completion(Evaluation of |Finally|). + 1. If _finallyResult_ is a normal completion, set _finallyResult_ to _catchResult_. + 1. Return ? UpdateEmpty(_finallyResult_, *undefined*). @@ -22935,8 +23830,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 +24086,7 @@

        Static Semantics: HasInitializer ( ): a Boolean

        -

        Static Semantics: ExpectedArgumentCount ( ): an integer

        +

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

        @@ -23327,30 +24221,33 @@

        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*.

        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 + _funcObj_: an ECMAScript function object, + _argList_: a List of ECMAScript language values, + ): a return completion or a throw completion

        FunctionBody : FunctionStatementList - 1. Perform ? FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). - 1. Return ? Evaluation of |FunctionStatementList|. + 1. Perform ? FunctionDeclarationInstantiation(_funcObj_, _argList_). + 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*).

        Runtime Semantics: InstantiateOrdinaryFunctionObject ( - _env_: an Environment Record, + _envRecord_: an Environment Record, _privateEnv_: a PrivateEnvironment Record or *null*, ): an ECMAScript function object

        @@ -23360,18 +24257,18 @@

        1. Let _name_ be the StringValue of |BindingIdentifier|. 1. Let _sourceText_ be the source text matched by |FunctionDeclaration|. - 1. Let _F_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, |FormalParameters|, |FunctionBody|, ~non-lexical-this~, _env_, _privateEnv_). - 1. Perform SetFunctionName(_F_, _name_). - 1. Perform MakeConstructor(_F_). - 1. Return _F_. + 1. Let _closure_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, |FormalParameters|, |FunctionBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). + 1. Perform SetFunctionName(_closure_, _name_). + 1. Perform MakeConstructor(_closure_). + 1. Return _closure_. FunctionDeclaration : `function` `(` FormalParameters `)` `{` FunctionBody `}` 1. Let _sourceText_ be the source text matched by |FunctionDeclaration|. - 1. Let _F_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, |FormalParameters|, |FunctionBody|, ~non-lexical-this~, _env_, _privateEnv_). - 1. Perform SetFunctionName(_F_, *"default"*). - 1. Perform MakeConstructor(_F_). - 1. Return _F_. + 1. Let _closure_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, |FormalParameters|, |FunctionBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). + 1. Perform SetFunctionName(_closure_, *"default"*). + 1. Perform MakeConstructor(_closure_). + 1. Return _closure_.

        An anonymous |FunctionDeclaration| can only occur as part of an `export default` declaration, and its function code is therefore always strict mode code.

        @@ -23388,11 +24285,11 @@

        FunctionExpression : `function` `(` FormalParameters `)` `{` FunctionBody `}` - 1. If _name_ is not present, set _name_ to *""*. - 1. Let _env_ be the LexicalEnvironment of the running execution context. + 1. If _name_ is not present, set _name_ to the empty String. + 1. Let _envRecord_ be the LexicalEnvironment of the running execution context. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. 1. Let _sourceText_ be the source text matched by |FunctionExpression|. - 1. Let _closure_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, |FormalParameters|, |FunctionBody|, ~non-lexical-this~, _env_, _privateEnv_). + 1. Let _closure_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, |FormalParameters|, |FunctionBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). 1. Perform SetFunctionName(_closure_, _name_). 1. Perform MakeConstructor(_closure_). 1. Return _closure_. @@ -23424,7 +24321,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 `}` @@ -23443,6 +24340,13 @@

        Runtime Semantics: Evaluation

        1. Return *undefined*. + FunctionStatementList : StatementList + + 1. Let _result_ be Completion(Evaluation of |StatementList|). + 1. Let _env_ be the running execution context's LexicalEnvironment. + 1. Assert: _env_ is a Declarative Environment Record. + 1. Return ? DisposeResources(_env_.[[DisposableResourceStack]], _result_). + @@ -23517,15 +24421,15 @@

        Static Semantics: ConciseBodyContainsUseStrict ( ): a Boolean

        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 + _funcObj_: an ECMAScript function object, + _argList_: a List of ECMAScript language values, + ): a return completion or a throw completion

        ConciseBody : ExpressionBody - 1. Perform ? FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). + 1. Perform ? FunctionDeclarationInstantiation(_funcObj_, _argList_). 1. Return ? Evaluation of |ExpressionBody|.
        @@ -23540,16 +24444,16 @@

        ArrowFunction : ArrowParameters `=>` ConciseBody - 1. If _name_ is not present, set _name_ to *""*. - 1. Let _env_ be the LexicalEnvironment of the running execution context. + 1. If _name_ is not present, set _name_ to the empty String. + 1. Let _envRecord_ be the LexicalEnvironment of the running execution context. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. 1. Let _sourceText_ be the source text matched by |ArrowFunction|. - 1. [id="step-arrowfunction-evaluation-functioncreate"] Let _closure_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, |ArrowParameters|, |ConciseBody|, ~lexical-this~, _env_, _privateEnv_). + 1. [id="step-arrowfunction-evaluation-functioncreate"] Let _closure_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, |ArrowParameters|, |ConciseBody|, ~lexical-this~, _envRecord_, _privateEnv_). 1. Perform SetFunctionName(_closure_, _name_). 1. Return _closure_. -

        An |ArrowFunction| does not define local bindings for `arguments`, `super`, `this`, or `new.target`. Any reference to `arguments`, `super`, `this`, or `new.target` within an |ArrowFunction| must resolve to a binding in a lexically enclosing environment. Typically this will be the Function Environment of an immediately enclosing function. Even though an |ArrowFunction| may contain references to `super`, the function object created in step is not made into a method by performing MakeMethod. An |ArrowFunction| that references `super` is always contained within a non-|ArrowFunction| and the necessary state to implement `super` is accessible via the _env_ that is captured by the function object of the |ArrowFunction|.

        +

        An |ArrowFunction| does not define local bindings for `arguments`, `super`, `this`, or `new.target`. Any reference to `arguments`, `super`, `this`, or `new.target` within an |ArrowFunction| must resolve to a binding in a lexically enclosing environment. Typically this will be the Function Environment of an immediately enclosing function. Even though an |ArrowFunction| may contain references to `super`, the function object created in step is not made into a method by performing MakeMethod. An |ArrowFunction| that references `super` is always contained within a non-|ArrowFunction| and the necessary state to implement `super` is accessible via the _envRecord_ that is captured by the function object of the |ArrowFunction|.

        @@ -23563,7 +24467,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_). @@ -23670,32 +24574,29 @@

        Static Semantics: SpecialMethod ( ): a Boolean

        Runtime Semantics: DefineMethod ( - _object_: an Object, - optional _functionPrototype_: an Object, + _obj_: an Object, + optional _proto_: an Object, ): either a normal completion containing a Record with fields [[Key]] (a property key) and [[Closure]] (an ECMAScript function object) or an abrupt completion

        MethodDefinition : ClassElementName `(` UniqueFormalParameters `)` `{` FunctionBody `}` - 1. Let _propKey_ be ? Evaluation of |ClassElementName|. - 1. Let _env_ be the running execution context's LexicalEnvironment. + 1. Let _propertyKey_ be ? Evaluation of |ClassElementName|. + 1. Let _envRecord_ be the running execution context's LexicalEnvironment. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. - 1. If _functionPrototype_ is present, then - 1. Let _prototype_ be _functionPrototype_. - 1. Else, - 1. Let _prototype_ be %Function.prototype%. + 1. If _proto_ is not present, set _proto_ to %Function.prototype%. 1. Let _sourceText_ be the source text matched by |MethodDefinition|. - 1. Let _closure_ be OrdinaryFunctionCreate(_prototype_, _sourceText_, |UniqueFormalParameters|, |FunctionBody|, ~non-lexical-this~, _env_, _privateEnv_). - 1. Perform MakeMethod(_closure_, _object_). - 1. Return the Record { [[Key]]: _propKey_, [[Closure]]: _closure_ }. + 1. Let _closure_ be OrdinaryFunctionCreate(_proto_, _sourceText_, |UniqueFormalParameters|, |FunctionBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). + 1. Perform MakeMethod(_closure_, _obj_). + 1. Return the Record { [[Key]]: _propertyKey_, [[Closure]]: _closure_ }.

        Runtime Semantics: MethodDefinitionEvaluation ( - _object_: an Object, + _obj_: an Object, _enumerable_: a Boolean, ): either a normal completion containing either a PrivateElement or ~unused~, or an abrupt completion

        @@ -23703,83 +24604,81 @@

        MethodDefinition : ClassElementName `(` UniqueFormalParameters `)` `{` FunctionBody `}` - 1. Let _methodDef_ be ? DefineMethod of |MethodDefinition| with argument _object_. + 1. Let _methodDef_ be ? DefineMethod of |MethodDefinition| with argument _obj_. 1. Perform SetFunctionName(_methodDef_.[[Closure]], _methodDef_.[[Key]]). - 1. Return ? DefineMethodProperty(_object_, _methodDef_.[[Key]], _methodDef_.[[Closure]], _enumerable_). + 1. Return ? DefineMethodProperty(_obj_, _methodDef_.[[Key]], _methodDef_.[[Closure]], _enumerable_). MethodDefinition : `get` ClassElementName `(` `)` `{` FunctionBody `}` - 1. Let _propKey_ be ? Evaluation of |ClassElementName|. - 1. Let _env_ be the running execution context's LexicalEnvironment. + 1. Let _propertyKey_ be ? Evaluation of |ClassElementName|. + 1. Let _envRecord_ be the running execution context's LexicalEnvironment. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. 1. Let _sourceText_ be the source text matched by |MethodDefinition|. - 1. Let _formalParameterList_ be an instance of the production FormalParameters : [empty]. - 1. Let _closure_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, _formalParameterList_, |FunctionBody|, ~non-lexical-this~, _env_, _privateEnv_). - 1. Perform MakeMethod(_closure_, _object_). - 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 _formalParamList_ be an instance of the production FormalParameters : [empty]. + 1. Let _closure_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, _formalParamList_, |FunctionBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). + 1. Perform MakeMethod(_closure_, _obj_). + 1. Perform SetFunctionName(_closure_, _propertyKey_, *"get"*). + 1. If _propertyKey_ is a Private Name, then + 1. Return PrivateElement { [[Key]]: _propertyKey_, [[Kind]]: ~accessor~, [[Getter]]: _closure_, [[Setter]]: *undefined* }. + 1. Let _propertyDesc_ be the PropertyDescriptor { [[Getter]]: _closure_, [[Enumerable]]: _enumerable_, [[Configurable]]: *true* }. + 1. Perform ? DefinePropertyOrThrow(_obj_, _propertyKey_, _propertyDesc_). + 1. Return ~unused~. MethodDefinition : `set` ClassElementName `(` PropertySetParameterList `)` `{` FunctionBody `}` - 1. Let _propKey_ be ? Evaluation of |ClassElementName|. - 1. Let _env_ be the running execution context's LexicalEnvironment. + 1. Let _propertyKey_ be ? Evaluation of |ClassElementName|. + 1. Let _envRecord_ be the running execution context's LexicalEnvironment. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. 1. Let _sourceText_ be the source text matched by |MethodDefinition|. - 1. Let _closure_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, |PropertySetParameterList|, |FunctionBody|, ~non-lexical-this~, _env_, _privateEnv_). - 1. Perform MakeMethod(_closure_, _object_). - 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 _closure_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, |PropertySetParameterList|, |FunctionBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). + 1. Perform MakeMethod(_closure_, _obj_). + 1. Perform SetFunctionName(_closure_, _propertyKey_, *"set"*). + 1. If _propertyKey_ is a Private Name, then + 1. Return PrivateElement { [[Key]]: _propertyKey_, [[Kind]]: ~accessor~, [[Getter]]: *undefined*, [[Setter]]: _closure_ }. + 1. Let _propertyDesc_ be the PropertyDescriptor { [[Setter]]: _closure_, [[Enumerable]]: _enumerable_, [[Configurable]]: *true* }. + 1. Perform ? DefinePropertyOrThrow(_obj_, _propertyKey_, _propertyDesc_). + 1. Return ~unused~. GeneratorMethod : `*` ClassElementName `(` UniqueFormalParameters `)` `{` GeneratorBody `}` - 1. Let _propKey_ be ? Evaluation of |ClassElementName|. - 1. Let _env_ be the running execution context's LexicalEnvironment. + 1. Let _propertyKey_ be ? Evaluation of |ClassElementName|. + 1. Let _envRecord_ be the running execution context's LexicalEnvironment. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. 1. Let _sourceText_ be the source text matched by |GeneratorMethod|. - 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. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). - 1. Return ? DefineMethodProperty(_object_, _propKey_, _closure_, _enumerable_). + 1. Let _closure_ be OrdinaryFunctionCreate(%GeneratorFunction.prototype%, _sourceText_, |UniqueFormalParameters|, |GeneratorBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). + 1. Perform MakeMethod(_closure_, _obj_). + 1. Perform SetFunctionName(_closure_, _propertyKey_). + 1. Let _proto_ be OrdinaryObjectCreate(%GeneratorPrototype%). + 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _proto_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Return ? DefineMethodProperty(_obj_, _propertyKey_, _closure_, _enumerable_). AsyncGeneratorMethod : `async` `*` ClassElementName `(` UniqueFormalParameters `)` `{` AsyncGeneratorBody `}` - 1. Let _propKey_ be ? Evaluation of |ClassElementName|. - 1. Let _env_ be the running execution context's LexicalEnvironment. + 1. Let _propertyKey_ be ? Evaluation of |ClassElementName|. + 1. Let _envRecord_ be the running execution context's LexicalEnvironment. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. 1. Let _sourceText_ be the source text matched by |AsyncGeneratorMethod|. - 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. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). - 1. Return ? DefineMethodProperty(_object_, _propKey_, _closure_, _enumerable_). + 1. Let _closure_ be OrdinaryFunctionCreate(%AsyncGeneratorFunction.prototype%, _sourceText_, |UniqueFormalParameters|, |AsyncGeneratorBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). + 1. Perform MakeMethod(_closure_, _obj_). + 1. Perform SetFunctionName(_closure_, _propertyKey_). + 1. Let _proto_ be OrdinaryObjectCreate(%AsyncGeneratorPrototype%). + 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _proto_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Return ? DefineMethodProperty(_obj_, _propertyKey_, _closure_, _enumerable_). AsyncMethod : `async` ClassElementName `(` UniqueFormalParameters `)` `{` AsyncFunctionBody `}` - 1. Let _propKey_ be ? Evaluation of |ClassElementName|. - 1. Let _env_ be the LexicalEnvironment of the running execution context. + 1. Let _propertyKey_ be ? Evaluation of |ClassElementName|. + 1. Let _envRecord_ be the LexicalEnvironment of the running execution context. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. 1. Let _sourceText_ be the source text matched by |AsyncMethod|. - 1. Let _closure_ be OrdinaryFunctionCreate(%AsyncFunction.prototype%, _sourceText_, |UniqueFormalParameters|, |AsyncFunctionBody|, ~non-lexical-this~, _env_, _privateEnv_). - 1. Perform MakeMethod(_closure_, _object_). - 1. Perform SetFunctionName(_closure_, _propKey_). - 1. Return ? DefineMethodProperty(_object_, _propKey_, _closure_, _enumerable_). + 1. Let _closure_ be OrdinaryFunctionCreate(%AsyncFunction.prototype%, _sourceText_, |UniqueFormalParameters|, |AsyncFunctionBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). + 1. Perform MakeMethod(_closure_, _obj_). + 1. Perform SetFunctionName(_closure_, _propertyKey_). + 1. Return ? DefineMethodProperty(_obj_, _propertyKey_, _closure_, _enumerable_). @@ -23875,26 +24774,27 @@

        Static Semantics: Early Errors

        Runtime Semantics: EvaluateGeneratorBody ( - _functionObject_: an ECMAScript function object, - _argumentsList_: a List of ECMAScript language values, + _funcObj_: an ECMAScript function object, + _argList_: a List of ECMAScript language values, ): a throw completion or a return completion

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

        Runtime Semantics: InstantiateGeneratorFunctionObject ( - _env_: an Environment Record, + _envRecord_: an Environment Record, _privateEnv_: a PrivateEnvironment Record or *null*, ): an ECMAScript function object

        @@ -23904,20 +24804,20 @@

        1. Let _name_ be the StringValue of |BindingIdentifier|. 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. Perform ! DefinePropertyOrThrow(_F_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). - 1. Return _F_. + 1. Let _closure_ be OrdinaryFunctionCreate(%GeneratorFunction.prototype%, _sourceText_, |FormalParameters|, |GeneratorBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). + 1. Perform SetFunctionName(_closure_, _name_). + 1. Let _proto_ be OrdinaryObjectCreate(%GeneratorPrototype%). + 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _proto_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Return _closure_. GeneratorDeclaration : `function` `*` `(` FormalParameters `)` `{` GeneratorBody `}` 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. Perform ! DefinePropertyOrThrow(_F_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). - 1. Return _F_. + 1. Let _closure_ be OrdinaryFunctionCreate(%GeneratorFunction.prototype%, _sourceText_, |FormalParameters|, |GeneratorBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). + 1. Perform SetFunctionName(_closure_, *"default"*). + 1. Let _proto_ be OrdinaryObjectCreate(%GeneratorPrototype%). + 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _proto_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Return _closure_.

        An anonymous |GeneratorDeclaration| can only occur as part of an `export default` declaration, and its function code is therefore always strict mode code.

        @@ -23934,14 +24834,14 @@

        GeneratorExpression : `function` `*` `(` FormalParameters `)` `{` GeneratorBody `}` - 1. If _name_ is not present, set _name_ to *""*. - 1. Let _env_ be the LexicalEnvironment of the running execution context. + 1. If _name_ is not present, set _name_ to the empty String. + 1. Let _envRecord_ be the LexicalEnvironment of the running execution context. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. 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. Let _closure_ be OrdinaryFunctionCreate(%GeneratorFunction.prototype%, _sourceText_, |FormalParameters|, |GeneratorBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). 1. Perform SetFunctionName(_closure_, _name_). - 1. Let _prototype_ be OrdinaryObjectCreate(%GeneratorFunction.prototype.prototype%). - 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Let _proto_ be OrdinaryObjectCreate(%GeneratorPrototype%). + 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _proto_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Return _closure_. GeneratorExpression : `function` `*` BindingIdentifier `(` FormalParameters `)` `{` GeneratorBody `}` @@ -23955,8 +24855,8 @@

        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. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Let _proto_ be OrdinaryObjectCreate(%GeneratorPrototype%). + 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _proto_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Perform ! _funcEnv_.InitializeBinding(_name_, _closure_). 1. Return _closure_. @@ -23985,38 +24885,39 @@

        Runtime Semantics: Evaluation

        YieldExpression : `yield` `*` AssignmentExpression - 1. Let _generatorKind_ be GetGeneratorKind(). + 1. Let _genKind_ be GetGeneratorKind(). + 1. Assert: _genKind_ 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_). + 1. Let _iteratorRecord_ be ? GetIterator(_value_, _genKind_). 1. Let _iterator_ be _iteratorRecord_.[[Iterator]]. 1. Let _received_ be NormalCompletion(*undefined*). 1. Repeat, 1. If _received_ is a normal completion, then 1. Let _innerResult_ be ? Call(_iteratorRecord_.[[NextMethod]], _iteratorRecord_.[[Iterator]], « _received_.[[Value]] »). - 1. If _generatorKind_ is ~async~, set _innerResult_ to ? Await(_innerResult_). + 1. If _genKind_ is ~async~, set _innerResult_ to ? Await(_innerResult_). 1. If _innerResult_ is not an Object, throw a *TypeError* exception. 1. Let _done_ be ? IteratorComplete(_innerResult_). 1. If _done_ is *true*, then 1. Return ? IteratorValue(_innerResult_). - 1. If _generatorKind_ is ~async~, set _received_ to Completion(AsyncGeneratorYield(? IteratorValue(_innerResult_))). + 1. If _genKind_ is ~async~, set _received_ to Completion(AsyncGeneratorYield(? IteratorValue(_innerResult_))). 1. Else, set _received_ to Completion(GeneratorYield(_innerResult_)). 1. Else if _received_ is a throw completion, then 1. Let _throw_ be ? GetMethod(_iterator_, *"throw"*). 1. If _throw_ is not *undefined*, then 1. Let _innerResult_ be ? Call(_throw_, _iterator_, « _received_.[[Value]] »). - 1. If _generatorKind_ is ~async~, set _innerResult_ to ? Await(_innerResult_). + 1. If _genKind_ is ~async~, set _innerResult_ to ? Await(_innerResult_). 1. NOTE: Exceptions from the inner iterator `throw` method are propagated. Normal completions from an inner `throw` method are processed similarly to an inner `next`. 1. If _innerResult_ is not an Object, throw a *TypeError* exception. 1. Let _done_ be ? IteratorComplete(_innerResult_). 1. If _done_ is *true*, then 1. Return ? IteratorValue(_innerResult_). - 1. If _generatorKind_ is ~async~, set _received_ to Completion(AsyncGeneratorYield(? IteratorValue(_innerResult_))). + 1. If _genKind_ is ~async~, set _received_ to Completion(AsyncGeneratorYield(? IteratorValue(_innerResult_))). 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. If _generatorKind_ is ~async~, perform ? AsyncIteratorClose(_iteratorRecord_, _closeCompletion_). + 1. Let _closeCompletion_ be NormalCompletion(~empty~). + 1. If _genKind_ 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. 1. Throw a *TypeError* exception. @@ -24024,18 +24925,18 @@

        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. If _generatorKind_ is ~async~, then - 1. Set _value_ to ? Await(_value_). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. + 1. Let _receivedValue_ be _received_.[[Value]]. + 1. If _genKind_ is ~async~, then + 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 _genKind_ 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. If _generatorKind_ is ~async~, set _received_ to Completion(AsyncGeneratorYield(? IteratorValue(_innerReturnResult_))). + 1. Let _returnedValue_ be ? IteratorValue(_innerReturnResult_). + 1. Return ReturnCompletion(_returnedValue_). + 1. If _genKind_ is ~async~, set _received_ to Completion(AsyncGeneratorYield(? IteratorValue(_innerReturnResult_))). 1. Else, set _received_ to Completion(GeneratorYield(_innerReturnResult_)).
        @@ -24100,8 +25001,8 @@

        Static Semantics: Early Errors

        Runtime Semantics: EvaluateAsyncGeneratorBody ( - _functionObject_: an ECMAScript function object, - _argumentsList_: a List of ECMAScript language values, + _funcObj_: an ECMAScript function object, + _argList_: a List of ECMAScript language values, ): a throw completion or a return completion

        @@ -24110,18 +25011,19 @@

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

        Runtime Semantics: InstantiateAsyncGeneratorFunctionObject ( - _env_: an Environment Record, + _envRecord_: an Environment Record, _privateEnv_: a PrivateEnvironment Record or *null*, ): an ECMAScript function object

        @@ -24133,22 +25035,22 @@

        1. Let _name_ be the StringValue of |BindingIdentifier|. 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. Perform ! DefinePropertyOrThrow(_F_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). - 1. Return _F_. + 1. Let _closure_ be OrdinaryFunctionCreate(%AsyncGeneratorFunction.prototype%, _sourceText_, |FormalParameters|, |AsyncGeneratorBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). + 1. Perform SetFunctionName(_closure_, _name_). + 1. Let _proto_ be OrdinaryObjectCreate(%AsyncGeneratorPrototype%). + 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _proto_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Return _closure_. AsyncGeneratorDeclaration : `async` `function` `*` `(` FormalParameters `)` `{` AsyncGeneratorBody `}` 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. Perform ! DefinePropertyOrThrow(_F_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). - 1. Return _F_. + 1. Let _closure_ be OrdinaryFunctionCreate(%AsyncGeneratorFunction.prototype%, _sourceText_, |FormalParameters|, |AsyncGeneratorBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). + 1. Perform SetFunctionName(_closure_, *"default"*). + 1. Let _proto_ be OrdinaryObjectCreate(%AsyncGeneratorPrototype%). + 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _proto_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Return _closure_.

        An anonymous |AsyncGeneratorDeclaration| can only occur as part of an `export default` declaration.

        @@ -24167,14 +25069,14 @@

        AsyncGeneratorExpression : `async` `function` `*` `(` FormalParameters `)` `{` AsyncGeneratorBody `}` - 1. If _name_ is not present, set _name_ to *""*. - 1. Let _env_ be the LexicalEnvironment of the running execution context. + 1. If _name_ is not present, set _name_ to the empty String. + 1. Let _envRecord_ be the LexicalEnvironment of the running execution context. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. 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. Let _closure_ be OrdinaryFunctionCreate(%AsyncGeneratorFunction.prototype%, _sourceText_, |FormalParameters|, |AsyncGeneratorBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). 1. Perform SetFunctionName(_closure_, _name_). - 1. Let _prototype_ be OrdinaryObjectCreate(%AsyncGeneratorFunction.prototype.prototype%). - 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Let _proto_ be OrdinaryObjectCreate(%AsyncGeneratorPrototype%). + 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _proto_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Return _closure_. @@ -24190,8 +25092,8 @@

        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. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Let _proto_ be OrdinaryObjectCreate(%AsyncGeneratorPrototype%). + 1. Perform ! DefinePropertyOrThrow(_closure_, *"prototype"*, PropertyDescriptor { [[Value]]: _proto_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Perform ! _funcEnv_.InitializeBinding(_name_, _closure_). 1. Return _closure_. @@ -24270,9 +25172,9 @@

        Static Semantics: Early Errors

      • It is a Syntax Error if |ClassHeritage| is not present and the following algorithm returns *true*:

        - 1. Let _constructor_ be the ConstructorMethod of |ClassBody|. - 1. If _constructor_ is ~empty~, return *false*. - 1. Return HasDirectSuper of _constructor_. + 1. Let _ctor_ be the ConstructorMethod of |ClassBody|. + 1. If _ctor_ is ~empty~, return *false*. + 1. Return HasDirectSuper of _ctor_.
      • @@ -24452,7 +25354,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_. @@ -24463,18 +25365,18 @@

        Static Semantics: PrototypePropertyNameList ( ): a List of property keys

        ClassElementList : ClassElement - 1. Let _propName_ be the PropName of |ClassElement|. - 1. If _propName_ is ~empty~, return a new empty List. + 1. Let _propertyName_ be the PropName of |ClassElement|. + 1. If _propertyName_ is ~empty~, return a new empty List. 1. If IsStatic of |ClassElement| is *true*, return a new empty List. - 1. Return « _propName_ ». + 1. Return « _propertyName_ ». ClassElementList : ClassElementList ClassElement 1. Let _list_ be the PrototypePropertyNameList of |ClassElementList|. - 1. Let _propName_ be the PropName of |ClassElement|. - 1. If _propName_ is ~empty~, return _list_. + 1. Let _propertyName_ be the PropName of |ClassElement|. + 1. If _propertyName_ is ~empty~, return _list_. 1. If IsStatic of |ClassElement| is *true*, return _list_. - 1. Return the list-concatenation of _list_ and « _propName_ ». + 1. Return the list-concatenation of _list_ and « _propertyName_ ». @@ -24671,7 +25573,7 @@

        Static Semantics: ContainsArguments ( ): a Boolean

        Runtime Semantics: ClassFieldDefinitionEvaluation ( - _homeObject_: an Object, + _homeObj_: an Object, ): either a normal completion containing a ClassFieldDefinition Record or an abrupt completion

        @@ -24682,12 +25584,12 @@

        1. Let _name_ be ? Evaluation of |ClassElementName|. 1. If |Initializer| is present, then - 1. Let _formalParameterList_ be an instance of the production FormalParameters : [empty]. - 1. Let _env_ be the LexicalEnvironment of the running execution context. + 1. Let _formalParamList_ be an instance of the production FormalParameters : [empty]. + 1. Let _envRecord_ be the LexicalEnvironment of the running execution context. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. 1. Let _sourceText_ be the empty sequence of Unicode code points. - 1. Let _initializer_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, _formalParameterList_, |Initializer|, ~non-lexical-this~, _env_, _privateEnv_). - 1. Perform MakeMethod(_initializer_, _homeObject_). + 1. Let _initializer_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, _formalParamList_, |Initializer|, ~non-lexical-this~, _envRecord_, _privateEnv_). + 1. Perform MakeMethod(_initializer_, _homeObj_). 1. Set _initializer_.[[ClassFieldInitializerName]] to _name_. 1. Else, 1. Let _initializer_ be ~empty~. @@ -24701,44 +25603,48 @@

        Runtime Semantics: ClassStaticBlockDefinitionEvaluation ( - _homeObject_: an Object, + _homeObj_: an Object, ): a ClassStaticBlockDefinition Record

        ClassStaticBlock : `static` `{` ClassStaticBlockBody `}` - 1. Let _lex_ be the running execution context's LexicalEnvironment. + 1. Let _lexicalEnv_ be the running execution context's LexicalEnvironment. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. 1. Let _sourceText_ be the empty sequence of Unicode code points. - 1. Let _formalParameters_ be an instance of the production FormalParameters : [empty]. - 1. [id="step-synthetic-class-static-block-fn"] Let _bodyFunction_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, _formalParameters_, |ClassStaticBlockBody|, ~non-lexical-this~, _lex_, _privateEnv_). - 1. Perform MakeMethod(_bodyFunction_, _homeObject_). - 1. Return the ClassStaticBlockDefinition Record { [[BodyFunction]]: _bodyFunction_ }. + 1. Let _formalParams_ be an instance of the production FormalParameters : [empty]. + 1. [id="step-synthetic-class-static-block-fn"] Let _bodyFunc_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, _formalParams_, |ClassStaticBlockBody|, ~non-lexical-this~, _lexicalEnv_, _privateEnv_). + 1. Perform MakeMethod(_bodyFunc_, _homeObj_). + 1. Return the ClassStaticBlockDefinition Record { [[BodyFunction]]: _bodyFunc_ }. - The function _bodyFunction_ is never directly accessible to ECMAScript code. + The function _bodyFunc_ is never directly accessible to ECMAScript code.

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

        ClassStaticBlockBody : ClassStaticBlockStatementList - 1. Assert: _functionObject_ is a synthetic function created by ClassStaticBlockDefinitionEvaluation step . - 1. Perform ! FunctionDeclarationInstantiation(_functionObject_, « »). - 1. Return ? Evaluation of |ClassStaticBlockStatementList|. + 1. Assert: _funcObj_ is a synthetic function created by ClassStaticBlockDefinitionEvaluation step . + 1. Perform ! FunctionDeclarationInstantiation(_funcObj_, « »). + 1. Let _result_ be Completion(Evaluation of |ClassStaticBlockStatementList|). + 1. Let _envRecord_ be the running execution context's LexicalEnvironment. + 1. Assert: _envRecord_ is a Declarative Environment Record. + 1. Perform ? DisposeResources(_envRecord_.[[DisposableResourceStack]], _result_). + 1. Return ReturnCompletion(*undefined*).

        Runtime Semantics: ClassElementEvaluation ( - _object_: an Object, + _obj_: an Object, ): either a normal completion containing either a ClassFieldDefinition Record, a ClassStaticBlockDefinition Record, a PrivateElement, or ~unused~, or an abrupt completion

        @@ -24750,7 +25656,7 @@

        `static` FieldDefinition `;` - 1. Return ? ClassFieldDefinitionEvaluation of |FieldDefinition| with argument _object_. + 1. Return ? ClassFieldDefinitionEvaluation of |FieldDefinition| with argument _obj_. @@ -24759,12 +25665,12 @@

        `static` MethodDefinition - 1. Return ? MethodDefinitionEvaluation of |MethodDefinition| with arguments _object_ and *false*. + 1. Return ? MethodDefinitionEvaluation of |MethodDefinition| with arguments _obj_ and *false*. ClassElement : ClassStaticBlock - 1. Return the ClassStaticBlockDefinitionEvaluation of |ClassStaticBlock| with argument _object_. + 1. Return the ClassStaticBlockDefinitionEvaluation of |ClassStaticBlock| with argument _obj_. @@ -24780,6 +25686,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

        @@ -24791,118 +25698,119 @@

        ClassTail : ClassHeritage? `{` ClassBody? `}` - 1. Let _env_ be the LexicalEnvironment of the running execution context. - 1. Let _classEnv_ be NewDeclarativeEnvironment(_env_). + 1. Let _envRecord_ be the LexicalEnvironment of the running execution context. + 1. Let _classEnv_ be NewDeclarativeEnvironment(_envRecord_). 1. If _classBinding_ is not *undefined*, then 1. Perform ! _classEnv_.CreateImmutableBinding(_classBinding_, *true*). - 1. Let _outerPrivateEnvironment_ be the running execution context's PrivateEnvironment. - 1. Let _classPrivateEnvironment_ be NewPrivateEnvironment(_outerPrivateEnvironment_). + 1. Let _outerPrivateEnv_ be the running execution context's PrivateEnvironment. + 1. Let _classPrivateEnv_ be NewPrivateEnvironment(_outerPrivateEnv_). 1. If |ClassBody| is present, then - 1. For each String _dn_ of the PrivateBoundIdentifiers of |ClassBody|, do - 1. If _classPrivateEnvironment_.[[Names]] contains a Private Name _pn_ such that _pn_.[[Description]] is _dn_, then + 1. For each String _description_ of the PrivateBoundIdentifiers of |ClassBody|, do + 1. If _classPrivateEnv_.[[Names]] contains a Private Name _privateName_ such that _privateName_.[[Description]] is _description_, then 1. Assert: This is only possible for getter/setter pairs. 1. Else, - 1. Let _name_ be a new Private Name whose [[Description]] is _dn_. - 1. Append _name_ to _classPrivateEnvironment_.[[Names]]. + 1. Let _name_ be a new Private Name whose [[Description]] is _description_. + 1. Append _name_ to _classPrivateEnv_.[[Names]]. 1. If |ClassHeritage| is not present, then 1. Let _protoParent_ be %Object.prototype%. - 1. Let _constructorParent_ be %Function.prototype%. + 1. Let _ctorParent_ be %Function.prototype%. 1. Else, 1. Set the running execution context's LexicalEnvironment to _classEnv_. - 1. NOTE: The running execution context's PrivateEnvironment is _outerPrivateEnvironment_ when evaluating |ClassHeritage|. + 1. NOTE: The running execution context's PrivateEnvironment is _outerPrivateEnv_ when evaluating |ClassHeritage|. 1. Let _superclassRef_ be Completion(Evaluation of |ClassHeritage|). - 1. Set the running execution context's LexicalEnvironment to _env_. + 1. Set the running execution context's LexicalEnvironment to _envRecord_. 1. Let _superclass_ be ? GetValue(? _superclassRef_). 1. If _superclass_ is *null*, then 1. Let _protoParent_ be *null*. - 1. Let _constructorParent_ be %Function.prototype%. + 1. Let _ctorParent_ be %Function.prototype%. 1. Else if IsConstructor(_superclass_) is *false*, then 1. Throw a *TypeError* exception. 1. Else, 1. Let _protoParent_ be ? Get(_superclass_, *"prototype"*). 1. If _protoParent_ is not an Object and _protoParent_ is not *null*, throw a *TypeError* exception. - 1. Let _constructorParent_ be _superclass_. + 1. Let _ctorParent_ be _superclass_. 1. Let _proto_ be OrdinaryObjectCreate(_protoParent_). - 1. If |ClassBody| is not present, let _constructor_ be ~empty~. - 1. Else, let _constructor_ be the ConstructorMethod of |ClassBody|. + 1. If |ClassBody| is not present, let _ctor_ be ~empty~. + 1. Else, let _ctor_ be the ConstructorMethod of |ClassBody|. 1. Set the running execution context's LexicalEnvironment to _classEnv_. - 1. Set the running execution context's PrivateEnvironment to _classPrivateEnvironment_. - 1. If _constructor_ is ~empty~, then - 1. Let _defaultConstructor_ be a new Abstract Closure with no parameters that captures nothing and performs the following steps when called: + 1. Set the running execution context's PrivateEnvironment to _classPrivateEnv_. + 1. If _ctor_ is ~empty~, then + 1. Let _defaultCtor_ be a new Abstract Closure with no parameters that captures nothing and performs the following steps when called: 1. Let _args_ be the List of arguments that was passed to this function by [[Call]] or [[Construct]]. 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. Let _func_ be ! _F_.[[GetPrototypeOf]](). + 1. Let _ctorFunc_ be the active function object. + 1. If _ctorFunc_.[[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 %Symbol.iterator% method on `%Array.prototype%`, this function does not. + 1. Let _func_ be ! _ctorFunc_.[[GetPrototypeOf]](). 1. If IsConstructor(_func_) is *false*, throw a *TypeError* exception. 1. Let _result_ be ? Construct(_func_, _args_, NewTarget). 1. Else, 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. Perform ? InitializeInstanceElements(_result_, _ctorFunc_). + 1. Return NormalCompletion(_result_). + 1. Let _ctorFunc_ be CreateBuiltinFunction(_defaultCtor_, 0, _className_, « [[ConstructorKind]], [[SourceText]], [[PrivateMethods]], [[Fields]] », the current Realm Record, _ctorParent_). 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. Perform MakeConstructor(_F_, *false*, _proto_). - 1. If |ClassHeritage| is present, set _F_.[[ConstructorKind]] to ~derived~. - 1. Perform ! DefineMethodProperty(_proto_, *"constructor"*, _F_, *false*). - 1. If |ClassBody| is not present, let _elements_ be a new empty List. - 1. Else, let _elements_ be the NonConstructorElements of |ClassBody|. + 1. Let _ctorInfo_ be ! DefineMethod of _ctor_ with arguments _proto_ and _ctorParent_. + 1. Let _ctorFunc_ be _ctorInfo_.[[Closure]]. + 1. Perform MakeClassConstructor(_ctorFunc_). + 1. Perform SetFunctionName(_ctorFunc_, _className_). + 1. Set _ctorFunc_.[[SourceText]] to _sourceText_. + 1. Perform MakeConstructor(_ctorFunc_, *false*, _proto_). + 1. If |ClassHeritage| is present, set _ctorFunc_.[[ConstructorKind]] to ~derived~. + 1. Perform ! DefineMethodProperty(_proto_, *"constructor"*, _ctorFunc_, *false*). + 1. If |ClassBody| is not present, let _classElements_ be a new empty List. + 1. Else, let _classElements_ be the NonConstructorElements of |ClassBody|. 1. Let _instancePrivateMethods_ be a new empty List. 1. Let _staticPrivateMethods_ be a new empty List. 1. Let _instanceFields_ be a new empty List. 1. Let _staticElements_ be a new empty List. - 1. For each |ClassElement| _e_ of _elements_, do - 1. If IsStatic of _e_ is *false*, then - 1. Let _element_ be Completion(ClassElementEvaluation of _e_ with argument _proto_). + 1. For each |ClassElement| _classElement_ of _classElements_, do + 1. If IsStatic of _classElement_ is *false*, then + 1. Let _element_ be Completion(ClassElementEvaluation of _classElement_ with argument _proto_). 1. Else, - 1. Let _element_ be Completion(ClassElementEvaluation of _e_ with argument _F_). + 1. Let _element_ be Completion(ClassElementEvaluation of _classElement_ with argument _ctorFunc_). 1. If _element_ is an abrupt completion, then - 1. Set the running execution context's LexicalEnvironment to _env_. - 1. Set the running execution context's PrivateEnvironment to _outerPrivateEnvironment_. + 1. Set the running execution context's LexicalEnvironment to _envRecord_. + 1. Set the running execution context's PrivateEnvironment to _outerPrivateEnv_. 1. Return ? _element_. 1. Set _element_ to ! _element_. 1. If _element_ is a PrivateElement, then 1. Assert: _element_.[[Kind]] is either ~method~ or ~accessor~. - 1. If IsStatic of _e_ is *false*, let _container_ be _instancePrivateMethods_. + 1. If IsStatic of _classElement_ is *false*, let _container_ be _instancePrivateMethods_. 1. Else, let _container_ be _staticPrivateMethods_. - 1. If _container_ contains a PrivateElement _pe_ such that _pe_.[[Key]] is _element_.[[Key]], then - 1. Assert: _element_.[[Kind]] and _pe_.[[Kind]] are both ~accessor~. - 1. If _element_.[[Get]] is *undefined*, then - 1. Let _combined_ be PrivateElement { [[Key]]: _element_.[[Key]], [[Kind]]: ~accessor~, [[Get]]: _pe_.[[Get]], [[Set]]: _element_.[[Set]] }. + 1. If _container_ contains a PrivateElement _existingElement_ such that _existingElement_.[[Key]] is _element_.[[Key]], then + 1. Assert: _element_.[[Kind]] and _existingElement_.[[Kind]] are both ~accessor~. + 1. If _element_.[[Getter]] is *undefined*, then + 1. Let _combined_ be PrivateElement { [[Key]]: _element_.[[Key]], [[Kind]]: ~accessor~, [[Getter]]: _existingElement_.[[Getter]], [[Setter]]: _element_.[[Setter]] }. 1. Else, - 1. Let _combined_ be PrivateElement { [[Key]]: _element_.[[Key]], [[Kind]]: ~accessor~, [[Get]]: _element_.[[Get]], [[Set]]: _pe_.[[Set]] }. - 1. Replace _pe_ in _container_ with _combined_. + 1. Let _combined_ be PrivateElement { [[Key]]: _element_.[[Key]], [[Kind]]: ~accessor~, [[Getter]]: _element_.[[Getter]], [[Setter]]: _existingElement_.[[Setter]] }. + 1. Replace _existingElement_ in _container_ with _combined_. 1. Else, 1. Append _element_ to _container_. 1. Else if _element_ is a ClassFieldDefinition Record, then - 1. If IsStatic of _e_ is *false*, append _element_ to _instanceFields_. + 1. If IsStatic of _classElement_ is *false*, append _element_ to _instanceFields_. 1. Else, append _element_ to _staticElements_. 1. Else if _element_ is a ClassStaticBlockDefinition Record, then 1. Append _element_ to _staticElements_. - 1. Set the running execution context's LexicalEnvironment to _env_. + 1. Set the running execution context's LexicalEnvironment to _envRecord_. 1. If _classBinding_ is not *undefined*, then - 1. Perform ! _classEnv_.InitializeBinding(_classBinding_, _F_). - 1. Set _F_.[[PrivateMethods]] to _instancePrivateMethods_. - 1. Set _F_.[[Fields]] to _instanceFields_. + 1. Perform ! _classEnv_.InitializeBinding(_classBinding_, _ctorFunc_). + 1. Set _ctorFunc_.[[PrivateMethods]] to _instancePrivateMethods_. + 1. Set _ctorFunc_.[[Fields]] to _instanceFields_. 1. For each PrivateElement _method_ of _staticPrivateMethods_, do - 1. Perform ! PrivateMethodOrAccessorAdd(_F_, _method_). + 1. Perform ! PrivateMethodOrAccessorAdd(_ctorFunc_, _method_). 1. For each element _elementRecord_ of _staticElements_, do 1. If _elementRecord_ is a ClassFieldDefinition Record, then - 1. Let _result_ be Completion(DefineField(_F_, _elementRecord_)). + 1. Let _result_ be Completion(DefineField(_ctorFunc_, _elementRecord_)). 1. Else, 1. Assert: _elementRecord_ is a ClassStaticBlockDefinition Record. - 1. Let _result_ be Completion(Call(_elementRecord_.[[BodyFunction]], _F_)). + 1. Let _result_ be Completion(Call(_elementRecord_.[[BodyFunction]], _ctorFunc_)). 1. If _result_ is an abrupt completion, then - 1. Set the running execution context's PrivateEnvironment to _outerPrivateEnvironment_. + 1. Set the running execution context's PrivateEnvironment to _outerPrivateEnv_. 1. Return ? _result_. - 1. Set the running execution context's PrivateEnvironment to _outerPrivateEnvironment_. - 1. Return _F_. + 1. Set the running execution context's PrivateEnvironment to _outerPrivateEnv_. + 1. Return _ctorFunc_. @@ -24913,17 +25821,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 _env_ be the running execution context's LexicalEnvironment. - 1. Perform ? InitializeBoundName(_className_, _value_, _env_). + 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 _envRecord_ be the running execution context's LexicalEnvironment. + 1. Perform ? InitializeBoundName(_className_, _value_, _envRecord_). 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,22 +25849,20 @@

        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*, the empty String, 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 1. Let _privateIdentifier_ be the StringValue of |PrivateIdentifier|. - 1. Let _privateEnvRec_ be the running execution context's PrivateEnvironment. - 1. Let _names_ be _privateEnvRec_.[[Names]]. + 1. Let _privateEnvRecord_ be the running execution context's PrivateEnvironment. + 1. Let _names_ be _privateEnvRecord_.[[Names]]. 1. Assert: Exactly one element of _names_ is a Private Name whose [[Description]] is _privateIdentifier_. 1. Let _privateName_ be the Private Name in _names_ whose [[Description]] is _privateIdentifier_. 1. Return _privateName_. @@ -25043,7 +25948,7 @@

        Static Semantics: Early Errors

        Runtime Semantics: InstantiateAsyncFunctionObject ( - _env_: an Environment Record, + _envRecord_: an Environment Record, _privateEnv_: a PrivateEnvironment Record or *null*, ): an ECMAScript function object

        @@ -25055,18 +25960,18 @@

        1. Let _name_ be the StringValue of |BindingIdentifier|. 1. Let _sourceText_ be the source text matched by |AsyncFunctionDeclaration|. - 1. Let _F_ be OrdinaryFunctionCreate(%AsyncFunction.prototype%, _sourceText_, |FormalParameters|, |AsyncFunctionBody|, ~non-lexical-this~, _env_, _privateEnv_). - 1. Perform SetFunctionName(_F_, _name_). - 1. Return _F_. + 1. Let _closure_ be OrdinaryFunctionCreate(%AsyncFunction.prototype%, _sourceText_, |FormalParameters|, |AsyncFunctionBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). + 1. Perform SetFunctionName(_closure_, _name_). + 1. Return _closure_. AsyncFunctionDeclaration : `async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` 1. Let _sourceText_ be the source text matched by |AsyncFunctionDeclaration|. - 1. Let _F_ be OrdinaryFunctionCreate(%AsyncFunction.prototype%, _sourceText_, |FormalParameters|, |AsyncFunctionBody|, ~non-lexical-this~, _env_, _privateEnv_). - 1. Perform SetFunctionName(_F_, *"default"*). - 1. Return _F_. + 1. Let _closure_ be OrdinaryFunctionCreate(%AsyncFunction.prototype%, _sourceText_, |FormalParameters|, |AsyncFunctionBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). + 1. Perform SetFunctionName(_closure_, *"default"*). + 1. Return _closure_. @@ -25082,11 +25987,11 @@

        AsyncFunctionExpression : `async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` - 1. If _name_ is not present, set _name_ to *""*. - 1. Let _env_ be the LexicalEnvironment of the running execution context. + 1. If _name_ is not present, set _name_ to the empty String. + 1. Let _envRecord_ be the LexicalEnvironment of the running execution context. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. 1. Let _sourceText_ be the source text matched by |AsyncFunctionExpression|. - 1. Let _closure_ be OrdinaryFunctionCreate(%AsyncFunction.prototype%, _sourceText_, |FormalParameters|, |AsyncFunctionBody|, ~non-lexical-this~, _env_, _privateEnv_). + 1. Let _closure_ be OrdinaryFunctionCreate(%AsyncFunction.prototype%, _sourceText_, |FormalParameters|, |AsyncFunctionBody|, ~non-lexical-this~, _envRecord_, _privateEnv_). 1. Perform SetFunctionName(_closure_, _name_). 1. Return _closure_. @@ -25114,8 +26019,8 @@

        Runtime Semantics: EvaluateAsyncFunctionBody ( - _functionObject_: an ECMAScript function object, - _argumentsList_: a List of ECMAScript language values, + _funcObj_: an ECMAScript function object, + _argList_: a List of ECMAScript language values, ): a return completion

        @@ -25125,12 +26030,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(_funcObj_, _argList_)). + 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]]). @@ -25143,6 +26048,13 @@

        Runtime Semantics: Evaluation

        1. Return InstantiateAsyncFunctionExpression of |AsyncFunctionExpression|. + + UnaryExpression : CoverAwaitExpressionAndAwaitUsingDeclarationHead + + + 1. Let _expr_ be the |AwaitExpression| that is covered by |CoverAwaitExpressionAndAwaitUsingDeclarationHead|. + 1. Return ? Evaluation of _expr_. + AwaitExpression : `await` UnaryExpression @@ -25221,8 +26133,8 @@

        Static Semantics: AsyncConciseBodyContainsUseStrict ( ): a Boolean

        Runtime Semantics: EvaluateAsyncConciseBody ( - _functionObject_: an ECMAScript function object, - _argumentsList_: a List of ECMAScript language values, + _funcObj_: an ECMAScript function object, + _argList_: a List of ECMAScript language values, ): a return completion

        @@ -25232,12 +26144,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(_funcObj_, _argList_)). + 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]]). @@ -25253,12 +26165,12 @@

        AsyncArrowFunction : `async` AsyncArrowBindingIdentifier `=>` AsyncConciseBody - 1. If _name_ is not present, set _name_ to *""*. - 1. Let _env_ be the LexicalEnvironment of the running execution context. + 1. If _name_ is not present, set _name_ to the empty String. + 1. Let _envRecord_ be the LexicalEnvironment of the running execution context. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. 1. Let _sourceText_ be the source text matched by |AsyncArrowFunction|. - 1. Let _parameters_ be |AsyncArrowBindingIdentifier|. - 1. Let _closure_ be OrdinaryFunctionCreate(%AsyncFunction.prototype%, _sourceText_, _parameters_, |AsyncConciseBody|, ~lexical-this~, _env_, _privateEnv_). + 1. Let _params_ be |AsyncArrowBindingIdentifier|. + 1. Let _closure_ be OrdinaryFunctionCreate(%AsyncFunction.prototype%, _sourceText_, _params_, |AsyncConciseBody|, ~lexical-this~, _envRecord_, _privateEnv_). 1. Perform SetFunctionName(_closure_, _name_). 1. Return _closure_. @@ -25266,13 +26178,13 @@

        AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead `=>` AsyncConciseBody - 1. If _name_ is not present, set _name_ to *""*. - 1. Let _env_ be the LexicalEnvironment of the running execution context. + 1. If _name_ is not present, set _name_ to the empty String. + 1. Let _envRecord_ be the LexicalEnvironment of the running execution context. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. 1. Let _sourceText_ be the source text matched by |AsyncArrowFunction|. 1. Let _head_ be the |AsyncArrowHead| that is covered by |CoverCallExpressionAndAsyncArrowHead|. - 1. Let _parameters_ be the |ArrowFormalParameters| of _head_. - 1. Let _closure_ be OrdinaryFunctionCreate(%AsyncFunction.prototype%, _sourceText_, _parameters_, |AsyncConciseBody|, ~lexical-this~, _env_, _privateEnv_). + 1. Let _params_ be the |ArrowFormalParameters| of _head_. + 1. Let _closure_ be OrdinaryFunctionCreate(%AsyncFunction.prototype%, _sourceText_, _params_, |AsyncConciseBody|, ~lexical-this~, _envRecord_, _privateEnv_). 1. Perform SetFunctionName(_closure_, _name_). 1. Return _closure_. @@ -25331,11 +26243,15 @@

        A potential tail position call that is immediately followed by return GetValue of the call result is also a possible tail position call. A function call cannot return a Reference Record, so such a GetValue operation will always return the same value as the actual function call result.

        + +

        A `using` declaration or `await using` declaration that precedes a call in the same |Block|, |ForStatement|, |ForInOfStatement|, |FunctionBody|, |GeneratorBody|, |AsyncGeneratorBody|, |AsyncFunctionBody|, or |ClassStaticBlockBody| prevents that call from being a possible tail position call.

        +
        StatementList : StatementList StatementListItem - 1. Let _has_ be HasCallInTailPosition of |StatementList| with argument _call_. + 1. Let _has_ be HasCallInTailPosition of the derived |StatementList| with argument _call_. 1. If _has_ is *true*, return *true*. + 1. If ContainsUsing of the derived |StatementList| is *true*, return *false*. 1. Return HasCallInTailPosition of |StatementListItem| with argument _call_. @@ -25527,7 +26443,7 @@

        `-` UnaryExpression `~` UnaryExpression `!` UnaryExpression - AwaitExpression + CoverAwaitExpressionAndAwaitUsingDeclarationHead CallExpression : SuperCall @@ -25714,6 +26630,9 @@

        Static Semantics: Early Errors

      • It is a Syntax Error if AllPrivateIdentifiersValid of |StatementList| with argument « » is *false* unless the source text containing |ScriptBody| is eval code that is being processed by a direct eval.
      • +
      • + It is a Syntax Error if ContainsUsing of |StatementList| is *true*. +
      • @@ -25723,7 +26642,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 +26702,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 ( + _x_: a ModuleRequest Record or a LoadedModuleRequest Record, + _y_: a ModuleRequest Record or a LoadedModuleRequest Record, + ): a Boolean +

        +
        +
        description
        +
        +
        + + + 1. If _x_.[[Specifier]] is not _y_.[[Specifier]], return *false*. + 1. Let _xAttrs_ be _x_.[[Attributes]]. + 1. Let _yAttrs_ be _y_.[[Attributes]]. + 1. Let _xAttrsCount_ be the number of elements in _xAttrs_. + 1. Let _yAttrsCount_ be the number of elements in _yAttrs_. + 1. If _xAttrsCount_ ≠ _yAttrsCount_, return *false*. + 1. For each ImportAttribute Record _xAttr_ of _xAttrs_, do + 1. If _yAttrs_ does not contain an ImportAttribute Record _yAttr_ such that _xAttr_.[[Key]] is _yAttr_.[[Key]] and _xAttr_.[[Value]] is _yAttr_.[[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 +27131,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 _moduleRequest_ of _additionalRequests_, do + 1. If _requests_ does not contain a ModuleRequest Record _otherModuleRequest_ such that ModuleRequestsEqual(_moduleRequest_, _otherModuleRequest_) is *true*, then + 1. Append _moduleRequest_ to _requests_. + 1. Return _requests_. ModuleItem : StatementListItem @@ -26053,17 +27144,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 _attrs_ be WithClauseToAttributes of |WithClause|. + 1. Return a List whose sole element is the ModuleRequest Record { [[Specifier]]: _specifier_, [[Attributes]]: _attrs_ }. + + 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 _attrs_ be WithClauseToAttributes of |WithClause|. + 1. Return a List whose sole element is the ModuleRequest Record { [[Specifier]]: _specifier_, [[Attributes]]: _attrs_ }. 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 _attrs_ be WithClauseToAttributes of |WithClause|. + 1. Return a List whose sole element is the ModuleRequest Record { [[Specifier]]: _specifier_, [[Attributes]]: _attrs_ }. ExportDeclaration : @@ -26082,7 +27196,7 @@

        Static Semantics: ModuleRequests ( ): a List of Strings

        Abstract Module Records

        A Module Record encapsulates structural information about the imports and exports of a single module. This information is used to link the imports and exports of sets of connected modules. A Module Record includes four fields that are only used when evaluating a module.

        -

        For specification purposes Module Record values are values of the Record specification type and can be thought of as existing in a simple object-oriented hierarchy where Module Record is an abstract class with both abstract and concrete subclasses. This specification defines the abstract subclass named Cyclic Module Record and its concrete subclass named Source Text Module Record. Other specifications and implementations may define additional Module Record subclasses corresponding to alternative module definition facilities that they defined.

        +

        For specification purposes Module Records are values of the Record specification type and can be thought of as existing in a simple object-oriented hierarchy where Module Record is an abstract class with both abstract and concrete subclasses. This specification defines the abstract subclass named Cyclic Module Record and its concrete subclass named Source Text Module Record. Other specifications and implementations may define additional Module Record subclasses corresponding to alternative module definition facilities that they defined.

        Module Record defines the fields listed in . All Module Definition subclasses include at least those fields. Module Record also defines the abstract method list in . All Module definition subclasses must provide concrete implementations of these abstract methods.

        @@ -26145,63 +27259,114 @@

        Abstract Module Records

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

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

        -

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

        + 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. Throw _promise_.[[PromiseResult]]. + 1. Return ~unused~. + +
        @@ -26210,17 +27375,19 @@

        Cyclic Module Records

        In addition to the fields defined in Cyclic Module Records have the additional fields listed in

        - - - - - + + + + + + + - - - - - @@ -26262,7 +27418,7 @@

        Cyclic Module Records

        an integer or ~empty~ @@ -26270,10 +27426,10 @@

        Cyclic Module Records

        [[RequestedModules]] @@ -26281,10 +27437,10 @@

        Cyclic Module Records

        [[LoadedModules]] @@ -26295,7 +27451,7 @@

        Cyclic Module Records

        a Cyclic Module Record or ~empty~ @@ -26311,13 +27467,13 @@

        Cyclic Module Records

        @@ -26355,31 +27511,44 @@

        Cyclic Module Records

        - Field Name - - Value Type - - Meaning -
        + Field Name + + Value Type + + Meaning +
        [[Status]] @@ -26240,18 +27407,7 @@

        Cyclic Module Records

        a throw completion or ~empty~
        - 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. + A throw completion representing the exception that occurred during evaluation. ~empty~ if no exception occurred or if [[Status]] is not ~evaluated~.
        - 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( [ _promiseCapability_ ] ) + ExecuteModule ( + optional _capability_: a PromiseCapability Record, + ): either a normal completion containing ~unused~ or a throw completion - 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. + 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. + + Within this specification it has definitions in the following types; hosts may provide additional types with their own definitions: +
        @@ -26388,17 +27557,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 +27628,415 @@

        Cyclic Module Records

        - -

        - LoadRequestedModules ( - optional _hostDefined_: anything, - ): a Promise -

        -
        -
        for
        -
        a Cyclic Module Record _module_
        - -
        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.
        -
        + +

        Implementation of Module Record Abstract Methods

        - - 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 following are the concrete methods for Cyclic Module Record that implement the corresponding Module Record abstract methods defined in .

        - - 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 _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _state_ be the GraphLoadingState Record { [[IsLoading]]: *true*, [[PendingModulesCount]]: 1, [[Visited]]: « », [[PromiseCapability]]: _promiseCapability_, [[HostDefined]]: _hostDefined_ }. + 1. Perform InnerModuleLoading(_state_, _module_). + 1. Return _promiseCapability_.[[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 _requiredModule_ of _stack_, do + 1. Assert: _requiredModule_.[[Status]] is ~linking~. + 1. Set _requiredModule_.[[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 _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Set _module_.[[TopLevelCapability]] to _promiseCapability_. + 1. Let _result_ be Completion(InnerModuleEvaluation(_module_, _stack_, 0)). + 1. If _result_ is an abrupt completion, then + 1. For each Cyclic Module Record _requiredModule_ of _stack_, do + 1. Assert: _requiredModule_.[[Status]] is ~evaluating~. + 1. Set _requiredModule_.[[Status]] to ~evaluated~. + 1. Set _requiredModule_.[[EvaluationError]] to _result_. + 1. Assert: _module_.[[Status]] is ~evaluated~. + 1. Assert: _module_.[[EvaluationError]] and _result_ are the same Completion Record. + 1. Perform ! Call(_promiseCapability_.[[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(_promiseCapability_.[[Resolve]], *undefined*, « *undefined* »). + 1. Assert: _stack_ is empty. + 1. Return _promiseCapability_.[[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~ -

        -
        -
        + +

        + 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.
        +
        - - 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~. - -
        - - -

        - 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 _promiseCapability_ 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(_promiseCapability_.[[Promise]], _onFulfilled_, _onRejected_). + 1. Perform ! _module_.ExecuteModule(_promiseCapability_). 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 _ancestorModule_ of _module_.[[AsyncParentModules]], do + 1. If _execList_ does not contain _ancestorModule_ and _ancestorModule_.[[CycleRoot]].[[EvaluationError]] is ~empty~, then + 1. Assert: _ancestorModule_.[[Status]] is ~evaluating-async~. + 1. Assert: _ancestorModule_.[[EvaluationError]] is ~empty~. + 1. Assert: _ancestorModule_.[[AsyncEvaluationOrder]] is an integer. + 1. Assert: _ancestorModule_.[[PendingAsyncDependencies]] > 0. + 1. Set _ancestorModule_.[[PendingAsyncDependencies]] to _ancestorModule_.[[PendingAsyncDependencies]] - 1. + 1. If _ancestorModule_.[[PendingAsyncDependencies]] = 0, then + 1. Append _ancestorModule_ to _execList_. + 1. If _ancestorModule_.[[HasTLA]] is *false*, perform GatherAvailableAncestors(_ancestorModule_, _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 _ancestorModule_ of _sortedExecList_, do + 1. If _ancestorModule_.[[Status]] is ~evaluated~, then + 1. Assert: _ancestorModule_.[[EvaluationError]] is not ~empty~. + 1. Else if _ancestorModule_.[[HasTLA]] is *true*, then + 1. Perform ExecuteAsyncModule(_ancestorModule_). 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(_ancestorModule_.ExecuteModule()). + 1. If _result_ is an abrupt completion, then + 1. Perform AsyncModuleExecutionRejected(_ancestorModule_, _result_.[[Value]]). + 1. Else, + 1. Set _ancestorModule_.[[AsyncEvaluationOrder]] to ~done~. + 1. Set _ancestorModule_.[[Status]] to ~evaluated~. + 1. If _ancestorModule_.[[TopLevelCapability]] is not ~empty~, then + 1. Assert: _ancestorModule_.[[CycleRoot]] and _ancestorModule_ are the same Module Record. + 1. Perform ! Call(_ancestorModule_.[[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 _ancestorModule_ of _module_.[[AsyncParentModules]], do + 1. Perform AsyncModuleExecutionRejected(_ancestorModule_, _error_). + 1. Return ~unused~. + +
        @@ -26864,10 +28048,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 +28060,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 +28069,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 +28086,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 +28094,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 +28162,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 +28256,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 +28300,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 +28344,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 +28382,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 +28431,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 +28474,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 +28529,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 +28624,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 :

        - - - - - + + + + + + + @@ -27392,10 +28653,10 @@

        Source Text Module Records

        [[ImportName]] @@ -27415,20 +28676,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|.
        - a String or ~namespace-object~ + a String or ~namespace~ - The name under which the desired binding is exported by the module identified by [[ModuleRequest]]. The value ~namespace-object~ indicates that the import request is for the target module's namespace object. + The name under which the desired binding is exported by the module identified by [[ModuleRequest]]. The value ~namespace~ indicates that the import request is for the target module's namespace object.
        - - - - - - + + + + + + + +
        - Import Statement Form - - [[ModuleRequest]] - - [[ImportName]] - - [[LocalName]] -
        + Import Statement Form + + [[ModuleRequest]] + + [[ImportName]] + + [[LocalName]] +
        `import v from "mod";` @@ -27451,7 +28714,7 @@

        Source Text Module Records

        *"mod"*
        - ~namespace-object~ + ~namespace~ *"ns"* @@ -27499,17 +28762,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 :

        - - - - - + + + + + + + @@ -27537,10 +28802,10 @@

        Source Text Module Records

        [[ImportName]] @@ -27560,23 +28825,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 +28791,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|.
        - a String, *null*, ~all~, or ~all-but-default~ + a String, *null*, ~namespace~, or ~all-but-default~ - The name under which the desired binding is exported by the module identified by [[ModuleRequest]]. *null* if the |ExportDeclaration| does not have a |ModuleSpecifier|. ~all~ is used for `export * as ns from "mod"` declarations. ~all-but-default~ is used for `export * from "mod"` declarations. + The name under which the desired binding is exported by the module identified by [[ModuleRequest]]. *null* if the |ExportDeclaration| does not have a |ModuleSpecifier|. ~namespace~ is used for `export * as ns from "mod"` declarations. ~all-but-default~ is used for `export * from "mod"` declarations.
        - - - - - - - + + + + + + + + +
        - Export Statement Form - - [[ExportName]] - - [[ModuleRequest]] - - [[ImportName]] - - [[LocalName]] -
        + Export Statement Form + + [[ExportName]] + + [[ModuleRequest]] + + [[ImportName]] + + [[LocalName]] +
        `export var v;` @@ -27741,7 +29008,7 @@

        Source Text Module Records

        *"mod"*
        - ~all~ + ~namespace~ *null* @@ -27755,7 +29022,7 @@

        Source Text Module Records

        ParseModule ( - _sourceText_: ECMAScript source text, + _sourceText_: a String or a sequence of Unicode code points, _realm_: a Realm Record, _hostDefined_: anything, ): a Source Text Module Record or a non-empty List of *SyntaxError* objects @@ -27774,236 +29041,439 @@

        1. Let _localExportEntries_ be a new empty List. 1. Let _starExportEntries_ be a new empty List. 1. Let _exportEntries_ be the ExportEntries of _body_. - 1. For each ExportEntry Record _ee_ of _exportEntries_, do - 1. If _ee_.[[ModuleRequest]] is *null*, then - 1. If _importedBoundNames_ does not contain _ee_.[[LocalName]], then - 1. Append _ee_ to _localExportEntries_. + 1. For each ExportEntry Record _exportEntry_ of _exportEntries_, do + 1. If _exportEntry_.[[ModuleRequest]] is *null*, then + 1. If _importedBoundNames_ does not contain _exportEntry_.[[LocalName]], then + 1. Append _exportEntry_ to _localExportEntries_. 1. Else, - 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. 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_. - 1. Else if _ee_.[[ImportName]] is ~all-but-default~, then - 1. Assert: _ee_.[[ExportName]] is *null*. - 1. Append _ee_ to _starExportEntries_. + 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 _importEntry_ be the element of _importEntries_ whose [[LocalName]] is _exportEntry_.[[LocalName]]. + 1. Append the ExportEntry Record { [[ModuleRequest]]: _importEntry_.[[ModuleRequest]], [[ImportName]]: _importEntry_.[[ImportName]], [[LocalName]]: *null*, [[ExportName]]: _exportEntry_.[[ExportName]] } to _indirectExportEntries_. + 1. Else if _exportEntry_.[[ImportName]] is ~all-but-default~, then + 1. Assert: _exportEntry_.[[ExportName]] is *null*. + 1. Append _exportEntry_ to _starExportEntries_. 1. Else, - 1. Append _ee_ to _indirectExportEntries_. + 1. Append _exportEntry_ 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 _exportEntry_ of _module_.[[LocalExportEntries]], do + 1. Assert: _module_ provides the direct binding for this export. + 1. Assert: _exportEntry_.[[ExportName]] is not *null*. + 1. Append _exportEntry_.[[ExportName]] to _exportedNames_. + 1. For each ExportEntry Record _exportEntry_ of _module_.[[IndirectExportEntries]], do + 1. Assert: _module_ imports a specific binding for this export. + 1. Assert: _exportEntry_.[[ExportName]] is not *null*. + 1. Append _exportEntry_.[[ExportName]] to _exportedNames_. + 1. For each ExportEntry Record _exportEntry_ of _module_.[[StarExportEntries]], do + 1. Assert: _exportEntry_.[[ModuleRequest]] is not *null*. + 1. Let _requestedModule_ be GetImportedModule(_module_, _exportEntry_.[[ModuleRequest]]). + 1. Let _starNames_ be _requestedModule_.GetExportedNames(_exportStarSet_). + 1. For each element _name_ of _starNames_, do + 1. If _name_ is not *"default"*, then + 1. If _exportedNames_ does not contain _name_, then + 1. Append _name_ 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]] } _record_ of _resolveSet_, do + 1. If _module_ and _record_.[[Module]] are the same Module Record and _exportName_ is _record_.[[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 _exportEntry_ of _module_.[[LocalExportEntries]], do + 1. If _exportEntry_.[[ExportName]] is _exportName_, then + 1. Assert: _module_ provides the direct binding for this export. + 1. Return ResolvedBinding Record { [[Module]]: _module_, [[BindingName]]: _exportEntry_.[[LocalName]] }. + 1. For each ExportEntry Record _exportEntry_ of _module_.[[IndirectExportEntries]], do + 1. If _exportEntry_.[[ExportName]] is _exportName_, then + 1. Assert: _exportEntry_.[[ModuleRequest]] is not *null*. + 1. Let _importedModule_ be GetImportedModule(_module_, _exportEntry_.[[ModuleRequest]]). + 1. If _exportEntry_.[[ImportName]] is ~namespace~, 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: _exportEntry_.[[ImportName]] is a String. + 1. Return _importedModule_.ResolveExport(_exportEntry_.[[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 _exportEntry_ of _module_.[[StarExportEntries]], do + 1. Assert: _exportEntry_.[[ModuleRequest]] is not *null*. + 1. Let _importedModule_ be GetImportedModule(_module_, _exportEntry_.[[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 _exportEntry_ of _module_.[[IndirectExportEntries]], do + 1. Assert: _exportEntry_.[[ExportName]] is not *null*. + 1. Let _resolution_ be _module_.ResolveExport(_exportEntry_.[[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 _envRecord_ be NewModuleEnvironment(_realm_.[[GlobalEnv]]). + 1. Set _module_.[[Environment]] to _envRecord_. + 1. For each ImportEntry Record _importEntry_ of _module_.[[ImportEntries]], do + 1. Let _importedModule_ be GetImportedModule(_module_, _importEntry_.[[ModuleRequest]]). + 1. If _importEntry_.[[ImportName]] is ~namespace~, then + 1. Let _namespace_ be GetModuleNamespace(_importedModule_). + 1. Perform ! _envRecord_.CreateImmutableBinding(_importEntry_.[[LocalName]], *true*). + 1. Perform ! _envRecord_.InitializeBinding(_importEntry_.[[LocalName]], _namespace_). + 1. Else, + 1. Assert: _importEntry_.[[ImportName]] is a String. + 1. Let _resolution_ be _importedModule_.ResolveExport(_importEntry_.[[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 ! _envRecord_.CreateImmutableBinding(_importEntry_.[[LocalName]], *true*). + 1. Perform ! _envRecord_.InitializeBinding(_importEntry_.[[LocalName]], _namespace_). + 1. Else, + 1. Perform CreateImportBinding(_envRecord_, _importEntry_.[[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 _variableDecls_ be the VarScopedDeclarations of _code_. + 1. Let _declaredVariableNames_ be a new empty List. + 1. For each element _variableDecl_ of _variableDecls_, do + 1. For each element _name_ of the BoundNames of _variableDecl_, do + 1. If _declaredVariableNames_ does not contain _name_, then + 1. Perform ! _envRecord_.CreateMutableBinding(_name_, *false*). + 1. Perform ! _envRecord_.InitializeBinding(_name_, *undefined*). + 1. Append _name_ to _declaredVariableNames_. + 1. Let _lexicalDecls_ be the LexicallyScopedDeclarations of _code_. + 1. Let _privateEnv_ be *null*. + 1. For each element _lexicalDecl_ of _lexicalDecls_, do + 1. For each element _name_ of the BoundNames of _lexicalDecl_, do + 1. If IsConstantDeclaration of _lexicalDecl_ is *true*, then + 1. Perform ! _envRecord_.CreateImmutableBinding(_name_, *true*). + 1. Else, + 1. Perform ! _envRecord_.CreateMutableBinding(_name_, *false*). + 1. If _lexicalDecl_ is either a |FunctionDeclaration|, a |GeneratorDeclaration|, an |AsyncFunctionDeclaration|, or an |AsyncGeneratorDeclaration|, then + 1. Let _funcObj_ be InstantiateFunctionObject of _lexicalDecl_ with arguments _envRecord_ and _privateEnv_. + 1. Perform ! _envRecord_.InitializeBinding(_name_, _funcObj_). + 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. Assert: _module_ has been linked and declarations in its module environment have been instantiated. + 1. Let _moduleContext_ be _module_.[[Context]]. + 1. If _module_.[[HasTLA]] is *false*, then + 1. Assert: _capability_ is not present. + 1. Let _env_ be _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. Set _result_ to Completion(DisposeResources(_env_.[[DisposableResourceStack]], _result_)). + 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 _envRecord_ be _module_.[[Environment]]. + 1. Assert: _envRecord_ is not ~empty~. + 1. Perform ! _envRecord_.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 _envRecord_ be NewModuleEnvironment(_realm_.[[GlobalEnv]]). + 1. Set _module_.[[Environment]] to _envRecord_. + 1. For each String _exportName_ of _module_.[[ExportNames]], do + 1. Perform ! _envRecord_.CreateMutableBinding(_exportName_, *false*). + 1. Perform ! _envRecord_.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 _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. IfAbruptRejectPromise(_result_, _promiseCapability_). + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « *undefined* »). + 1. Return _promiseCapability_.[[Promise]]. +
        +
        @@ -28011,7 +29481,7 @@

        GetImportedModule ( _referrer_: a Cyclic Module Record, - _specifier_: a String, + _request_: a ModuleRequest Record, ): a Module Record

        @@ -28020,8 +29490,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 +29501,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 +29522,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 +29562,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 +29574,49 @@

        + +

        + AllImportAttributesSupported ( + _attrs_: a List of ImportAttribute Records, + ): a Boolean +

        +
        +
        description
        +
        +
        + + 1. Let _supported_ be HostGetSupportedImportAttributes(). + 1. For each ImportAttribute Record _attr_ of _attrs_, do + 1. If _supported_ does not contain _attr_.[[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 +29674,8 @@

        Imports

        Syntax

        ImportDeclaration : - `import` ImportClause FromClause `;` - `import` ModuleSpecifier `;` + `import` ImportClause FromClause WithClause? `;` + `import` ModuleSpecifier WithClause? `;` ImportClause : ImportedDefaultBinding @@ -28190,6 +29711,18 @@

        Syntax

        ImportedBinding : BindingIdentifier[~Yield, +Await] + + WithClause : + `with` `{` `}` + `with` `{` WithEntries `,`? `}` + + WithEntries : + AttributeKey `:` StringLiteral + AttributeKey `:` StringLiteral `,` WithEntries + + AttributeKey : + IdentifierName + StringLiteral
        @@ -28200,6 +29733,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 +29764,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 +29778,7 @@

        Static Semantics: ImportEntries ( ): a List of ImportEntry Records

        Static Semantics: ImportEntriesForModule ( - _module_: a String, + _module_: a ModuleRequest Record, ): a List of ImportEntry Records

        @@ -28264,7 +29804,7 @@

        NameSpaceImport : `*` `as` ImportedBinding 1. Let _localName_ be the StringValue of |ImportedBinding|. - 1. Let _entry_ be the ImportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: ~namespace-object~, [[LocalName]]: _localName_ }. + 1. Let _entry_ be the ImportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: ~namespace~, [[LocalName]]: _localName_ }. 1. Return « _entry_ ». NamedImports : `{` `}` @@ -28291,6 +29831,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 _attrs_ be WithClauseToAttributes of |WithEntries|. + 1. Sort _attrs_ 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 _attrs_. + + + 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,10 +29875,10 @@

        Exports

        Syntax

        ExportDeclaration : - `export` ExportFromClause FromClause `;` + `export` ExportFromClause FromClause WithClause? `;` `export` NamedExports `;` `export` VariableStatement[~Yield, +Await] - `export` Declaration[~Yield, +Await] + `export` [lookahead ∉ { `using`, `await` }] Declaration[~Yield, +Await] `export` `default` HoistableDeclaration[~Yield, +Await, +Default] `export` `default` ClassDeclaration[~Yield, +Await, +Default] `export` `default` [lookahead ∉ { `function`, `async` [no LineTerminator here] `function`, `class` }] AssignmentExpression[+In, ~Yield, +Await] `;` @@ -28362,10 +29939,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 +30009,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 +30084,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 +30134,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

        @@ -28573,7 +30147,7 @@

        ExportFromClause : `*` `as` ModuleExportName 1. Let _exportName_ be the StringValue of |ModuleExportName|. - 1. Let _entry_ be the ExportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: ~all~, [[LocalName]]: *null*, [[ExportName]]: _exportName_ }. + 1. Let _entry_ be the ExportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: ~namespace~, [[LocalName]]: *null*, [[ExportName]]: _exportName_ }. 1. Return « _entry_ ». NamedExports : `{` `}` @@ -28643,7 +30217,7 @@

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

        Runtime Semantics: Evaluation

        ExportDeclaration : - `export` ExportFromClause FromClause `;` + `export` ExportFromClause FromClause WithClause? `;` `export` NamedExports `;` @@ -28666,8 +30240,8 @@

        Runtime Semantics: Evaluation

        1. Let _value_ be ? BindingClassDeclarationEvaluation of |ClassDeclaration|. 1. Let _className_ be the sole element of the BoundNames of |ClassDeclaration|. 1. If _className_ is *"\*default\*"*, then - 1. Let _env_ be the running execution context's LexicalEnvironment. - 1. Perform ? InitializeBoundName(*"\*default\*"*, _value_, _env_). + 1. Let _envRecord_ be the running execution context's LexicalEnvironment. + 1. Perform ? InitializeBoundName(*"\*default\*"*, _value_, _envRecord_). 1. Return ~empty~.
        ExportDeclaration : `export` `default` AssignmentExpression `;` @@ -28677,8 +30251,8 @@

        Runtime Semantics: Evaluation

        1. Else, 1. Let _rhs_ be ? Evaluation of |AssignmentExpression|. 1. Let _value_ be ? GetValue(_rhs_). - 1. Let _env_ be the running execution context's LexicalEnvironment. - 1. Perform ? InitializeBoundName(*"\*default\*"*, _value_, _env_). + 1. Let _envRecord_ be the running execution context's LexicalEnvironment. + 1. Perform ? InitializeBoundName(*"\*default\*"*, _value_, _envRecord_). 1. Return ~empty~. @@ -28709,7 +30283,7 @@

        Forbidden Extensions

        ECMAScript function objects defined using syntactic constructors in strict mode code must not be created with own properties named *"caller"* or *"arguments"*. Such own properties also must not be created for function objects defined using an |ArrowFunction|, |MethodDefinition|, |GeneratorDeclaration|, |GeneratorExpression|, |AsyncGeneratorDeclaration|, |AsyncGeneratorExpression|, |ClassDeclaration|, |ClassExpression|, |AsyncFunctionDeclaration|, |AsyncFunctionExpression|, or |AsyncArrowFunction| regardless of whether the definition is contained in strict mode code. Built-in functions, strict functions created using the Function constructor, generator functions created using the Generator constructor, async functions created using the AsyncFunction constructor, and functions created using the `bind` method also must not be created with such own properties.
      • - If an implementation extends any function object with an own property named *"caller"* the value of that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function object. If it is an accessor property, the function that is the value of the property's [[Get]] attribute must never return a strict function when called. + If an implementation extends any function object with an own property named *"caller"* the value of that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function object. If it is an accessor property, the function that is the value of the property's [[Getter]] attribute must never return a strict function when called.
      • Neither mapped nor unmapped arguments objects may be created with an own property named *"caller"*. @@ -28761,7 +30335,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.

        @@ -28793,35 +30367,38 @@

        globalThis

        Infinity

        -

        The value of `Infinity` is *+∞*𝔽 (see ). This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        +

        The initial value of the *"Infinity"* property of the global object is *+∞*𝔽 (see ).

        +

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        NaN

        -

        The value of `NaN` is *NaN* (see ). This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        +

        The initial value of the *"NaN"* property of the global object is *NaN* (see ).

        +

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        undefined

        -

        The value of `undefined` is *undefined* (see ). This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        +

        The initial value of the *"undefined"* property of the global object is *undefined* (see ).

        +

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        Function Properties of the Global Object

        - -

        eval ( _x_ )

        + +

        eval ( _source_ )

        This function is the %eval% intrinsic object.

        It performs the following steps when called:

        - 1. Return ? PerformEval(_x_, *false*, *false*). + 1. Return ? PerformEval(_source_, *false*, *false*).

        PerformEval ( - _x_: an ECMAScript language value, + _source_: an ECMAScript language value, _strictCaller_: a Boolean, _direct_: a Boolean, ): either a normal completion containing an ECMAScript language value or a throw completion @@ -28830,55 +30407,55 @@

      • 1. Assert: If _direct_ is *false*, then _strictCaller_ is also *false*. - 1. If _x_ is not a String, return _x_. + 1. If _source_ is not a String, return _source_. 1. Let _evalRealm_ be the current Realm Record. 1. NOTE: In the case of a direct eval, _evalRealm_ is the realm of both the caller of `eval` and of the `eval` function itself. - 1. Perform ? HostEnsureCanCompileStrings(_evalRealm_, « », _x_, _direct_). - 1. Let _inFunction_ be *false*. + 1. Perform ? HostEnsureCanCompileStrings(_evalRealm_, « », _source_, _direct_). + 1. Let _inFunc_ be *false*. 1. Let _inMethod_ be *false*. - 1. Let _inDerivedConstructor_ be *false*. + 1. Let _inDerivedCtor_ be *false*. 1. Let _inClassFieldInitializer_ be *false*. 1. If _direct_ is *true*, then - 1. Let _thisEnvRec_ be GetThisEnvironment(). - 1. If _thisEnvRec_ is a Function Environment Record, then - 1. Let _F_ be _thisEnvRec_.[[FunctionObject]]. - 1. Set _inFunction_ to *true*. - 1. Set _inMethod_ to _thisEnvRec_.HasSuperBinding(). - 1. If _F_.[[ConstructorKind]] is ~derived~, set _inDerivedConstructor_ to *true*. - 1. Let _classFieldInitializerName_ be _F_.[[ClassFieldInitializerName]]. + 1. Let _thisEnvRecord_ be GetThisEnvironment(). + 1. If _thisEnvRecord_ is a Function Environment Record, then + 1. Let _func_ be _thisEnvRecord_.[[FunctionObject]]. + 1. Set _inFunc_ to *true*. + 1. Set _inMethod_ to _thisEnvRecord_.HasSuperBinding(). + 1. If _func_.[[ConstructorKind]] is ~derived~, set _inDerivedCtor_ to *true*. + 1. Let _classFieldInitializerName_ be _func_.[[ClassFieldInitializerName]]. 1. If _classFieldInitializerName_ is not ~empty~, set _inClassFieldInitializer_ to *true*. 1. Perform the following substeps in an implementation-defined order, possibly interleaving parsing and error detection: - 1. Let _script_ be ParseText(_x_, |Script|). + 1. Let _script_ be ParseText(_source_, |Script|). 1. If _script_ is a List of errors, throw a *SyntaxError* exception. 1. If _script_ Contains |ScriptBody| is *false*, return *undefined*. 1. Let _body_ be the |ScriptBody| of _script_. - 1. If _inFunction_ is *false* and _body_ Contains |NewTarget|, throw a *SyntaxError* exception. + 1. If _inFunc_ is *false* and _body_ Contains |NewTarget|, throw a *SyntaxError* exception. 1. If _inMethod_ is *false* and _body_ Contains |SuperProperty|, throw a *SyntaxError* exception. - 1. If _inDerivedConstructor_ is *false* and _body_ Contains |SuperCall|, throw a *SyntaxError* exception. + 1. If _inDerivedCtor_ is *false* and _body_ Contains |SuperCall|, throw a *SyntaxError* exception. 1. If _inClassFieldInitializer_ is *true* and ContainsArguments of _body_ is *true*, throw a *SyntaxError* exception. 1. If _strictCaller_ is *true*, let _strictEval_ be *true*. 1. Else, let _strictEval_ be ScriptIsStrict of _script_. 1. Let _runningContext_ be the running execution context. 1. NOTE: If _direct_ is *true*, _runningContext_ will be the execution context that performed the direct eval. If _direct_ is *false*, _runningContext_ will be the execution context for the invocation of the `eval` function. 1. If _direct_ is *true*, then - 1. Let _lexEnv_ be NewDeclarativeEnvironment(_runningContext_'s LexicalEnvironment). - 1. Let _varEnv_ be _runningContext_'s VariableEnvironment. + 1. Let _lexicalEnv_ be NewDeclarativeEnvironment(_runningContext_'s LexicalEnvironment). + 1. Let _variableEnv_ be _runningContext_'s VariableEnvironment. 1. Let _privateEnv_ be _runningContext_'s PrivateEnvironment. 1. Else, - 1. Let _lexEnv_ be NewDeclarativeEnvironment(_evalRealm_.[[GlobalEnv]]). - 1. Let _varEnv_ be _evalRealm_.[[GlobalEnv]]. + 1. Let _lexicalEnv_ be NewDeclarativeEnvironment(_evalRealm_.[[GlobalEnv]]). + 1. Let _variableEnv_ be _evalRealm_.[[GlobalEnv]]. 1. Let _privateEnv_ be *null*. - 1. If _strictEval_ is *true*, set _varEnv_ to _lexEnv_. + 1. If _strictEval_ is *true*, set _variableEnv_ to _lexicalEnv_. 1. If _runningContext_ is not already suspended, suspend _runningContext_. 1. Let _evalContext_ be a new ECMAScript code execution context. 1. Set _evalContext_'s Function to *null*. 1. Set _evalContext_'s Realm to _evalRealm_. 1. Set _evalContext_'s ScriptOrModule to _runningContext_'s ScriptOrModule. - 1. Set _evalContext_'s VariableEnvironment to _varEnv_. - 1. Set _evalContext_'s LexicalEnvironment to _lexEnv_. + 1. Set _evalContext_'s VariableEnvironment to _variableEnv_. + 1. Set _evalContext_'s LexicalEnvironment to _lexicalEnv_. 1. Set _evalContext_'s PrivateEnvironment to _privateEnv_. 1. Push _evalContext_ onto the execution context stack; _evalContext_ is now the running execution context. - 1. Let _result_ be Completion(EvalDeclarationInstantiation(_body_, _varEnv_, _lexEnv_, _privateEnv_, _strictEval_)). + 1. Let _result_ be Completion(EvalDeclarationInstantiation(_body_, _variableEnv_, _lexicalEnv_, _privateEnv_, _strictEval_)). 1. If _result_ is a normal completion, then 1. Set _result_ to Completion(Evaluation of _body_). 1. If _result_ is a normal completion and _result_.[[Value]] is ~empty~, then @@ -28896,7 +30473,7 @@

        HostEnsureCanCompileStrings ( _calleeRealm_: a Realm Record, - _parameterStrings_: a List of Strings, + _paramStrings_: a List of Strings, _bodyString_: a String, _direct_: a Boolean, ): either a normal completion containing ~unused~ or a throw completion @@ -28906,47 +30483,43 @@

        It allows host environments to block certain ECMAScript functions which allow developers to interpret and evaluate strings as ECMAScript code.

        - _parameterStrings_ represents the strings that, when using one of the function constructors, will be concatenated together to build the parameters list. _bodyString_ represents the function body or the string passed to an `eval` call. + _paramStrings_ represents the strings that, when using one of the function constructors, will be concatenated together to build the parameters list. _bodyString_ represents the function body or the string passed to an `eval` call. _direct_ signifies whether the evaluation is a direct eval.

        The default implementation of HostEnsureCanCompileStrings is to return NormalCompletion(~unused~).

        - +

        EvalDeclarationInstantiation ( _body_: a |ScriptBody| Parse Node, - _varEnv_: an Environment Record, - _lexEnv_: a Declarative Environment Record, + _variableEnv_: an Environment Record, + _lexicalEnv_: a Declarative Environment Record, _privateEnv_: a PrivateEnvironment Record or *null*, _strict_: a Boolean, ): either a normal completion containing ~unused~ or a throw completion

        - - 1. Let _varNames_ be the VarDeclaredNames of _body_. - 1. Let _varDeclarations_ be the VarScopedDeclarations of _body_. + 1. Let _variableNames_ be the VarDeclaredNames of _body_. + 1. Let _variableDecls_ 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 _variableEnv_ is a Global Environment Record, then + 1. For each element _name_ of _variableNames_, do + 1. If HasLexicalDeclaration(_variableEnv_, _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. Let _thisEnv_ be _lexicalEnv_. 1. Assert: The following loop will terminate. - 1. Repeat, while _thisEnv_ and _varEnv_ are not the same Environment Record, + 1. Repeat, while _thisEnv_ and _variableEnv_ are not the same Environment Record, 1. If _thisEnv_ is not an Object Environment Record, then 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. For each element _name_ of _variableNames_, 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. @@ -28956,95 +30529,130 @@

        1. If _privateIdentifiers_ does not contain _binding_.[[Description]], append _binding_.[[Description]] to _privateIdentifiers_. 1. Set _pointer_ to _pointer_.[[OuterPrivateEnvironment]]. 1. If AllPrivateIdentifiersValid of _body_ with argument _privateIdentifiers_ is *false*, throw a *SyntaxError* exception. - 1. Let _functionsToInitialize_ be a new empty List. - 1. Let _declaredFunctionNames_ be a new empty List. - 1. For each element _d_ of _varDeclarations_, in reverse List order, do - 1. If _d_ is not either a |VariableDeclaration|, a |ForBinding|, or a |BindingIdentifier|, then - 1. Assert: _d_ is either a |FunctionDeclaration|, a |GeneratorDeclaration|, an |AsyncFunctionDeclaration|, or an |AsyncGeneratorDeclaration|. + 1. Let _funcsToInitialize_ be a new empty List. + 1. Let _declaredFuncNames_ be a new empty List. + 1. For each element _variableDecl_ of _variableDecls_, in reverse List order, do + 1. If _variableDecl_ is not either a |VariableDeclaration|, a |ForBinding|, or a |BindingIdentifier|, then + 1. Assert: _variableDecl_ is either a |FunctionDeclaration|, a |GeneratorDeclaration|, an |AsyncFunctionDeclaration|, or an |AsyncGeneratorDeclaration|. 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. If _varEnv_ is a Global Environment Record, then - 1. Let _fnDefinable_ be ? _varEnv_.CanDeclareGlobalFunction(_fn_). - 1. If _fnDefinable_ is *false*, throw a *TypeError* exception. - 1. Append _fn_ to _declaredFunctionNames_. - 1. Insert _d_ as the first element of _functionsToInitialize_. - 1. Let _declaredVarNames_ be a new empty List. - 1. For each element _d_ of _varDeclarations_, do - 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. If _varEnv_ is a Global Environment Record, then - 1. Let _vnDefinable_ be ? _varEnv_.CanDeclareGlobalVar(_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-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 + 1. Let _funcName_ be the sole element of the BoundNames of _variableDecl_. + 1. If _declaredFuncNames_ does not contain _funcName_, then + 1. If _variableEnv_ is a Global Environment Record, then + 1. Let _funcDefinable_ be ? CanDeclareGlobalFunction(_variableEnv_, _funcName_). + 1. If _funcDefinable_ is *false*, throw a *TypeError* exception. + 1. Append _funcName_ to _declaredFuncNames_. + 1. Insert _variableDecl_ as the first element of _funcsToInitialize_. + 1. Let _declaredVariableNames_ be a new empty List. + 1. For each element _variableDecl_ of _variableDecls_, do + 1. If _variableDecl_ is either a |VariableDeclaration|, a |ForBinding|, or a |BindingIdentifier|, then + 1. For each String _name_ of the BoundNames of _variableDecl_, do + 1. If _declaredFuncNames_ does not contain _name_, then + 1. If _variableEnv_ is a Global Environment Record, then + 1. Let _variableDefinable_ be ? CanDeclareGlobalVar(_variableEnv_, _name_). + 1. If _variableDefinable_ is *false*, throw a *TypeError* exception. + 1. If _declaredVariableNames_ does not contain _name_, then + 1. Append _name_ to _declaredVariableNames_. + 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 _declaredFuncOrVariableNames_ be the list-concatenation of _declaredFuncNames_ and _declaredVariableNames_. + 1. For each |FunctionDeclaration| _funcDecl_ that is directly contained in the |StatementList| of any |Block|, |CaseClause|, or |DefaultClause| _x_ such that _body_ Contains _x_ is *true*, do + 1. Let _funcName_ be the StringValue of the |BindingIdentifier| of _funcDecl_. + 1. If replacing the |FunctionDeclaration| _funcDecl_ with a |VariableStatement| that has _funcName_ as a |BindingIdentifier| would not produce any Early Errors for _body_, then + 1. Let _bindingExists_ be *false*. + 1. Set _thisEnv_ to _lexicalEnv_. + 1. Assert: The following loop will terminate. + 1. Repeat, while _thisEnv_ is not _variableEnv_, + 1. If _thisEnv_ is not an Object Environment Record, then + 1. If ! _thisEnv_.HasBinding(_funcName_) 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 _variableEnv_ is a Global Environment Record, then + 1. If HasLexicalDeclaration(_variableEnv_, _funcName_) is *false*, then + 1. Let _funcDefinable_ be ? CanDeclareGlobalVar(_variableEnv_, _funcName_). + 1. Else, + 1. Let _funcDefinable_ be *false*. + 1. Else, + 1. Let _funcDefinable_ be *true*. + 1. If _bindingExists_ is *false* and _funcDefinable_ is *true*, then + 1. If _declaredFuncOrVariableNames_ does not contain _funcName_, then + 1. If _variableEnv_ is a Global Environment Record, then + 1. Perform ? CreateGlobalVarBinding(_variableEnv_, _funcName_, *true*). + 1. Else, + 1. Set _bindingExists_ to ! _variableEnv_.HasBinding(_funcName_). + 1. If _bindingExists_ is *false*, then + 1. Perform ! _variableEnv_.CreateMutableBinding(_funcName_, *true*). + 1. Perform ! _variableEnv_.InitializeBinding(_funcName_, *undefined*). + 1. Append _funcName_ to _declaredFuncOrVariableNames_. + 1. [id="step-evaldeclarationinstantiation-alt-funcdecl-eval"] When the |FunctionDeclaration| _funcDecl_ is evaluated, perform the following steps in place of the |FunctionDeclaration| Evaluation algorithm provided in : + 1. Let _globalEnv_ be the running execution context's VariableEnvironment. + 1. Let _blockEnv_ be the running execution context's LexicalEnvironment. + 1. Let _funcObj_ be ! _blockEnv_.GetBindingValue(_funcName_, *false*). + 1. Perform ? _globalEnv_.SetMutableBinding(_funcName_, _funcObj_, *false*). + 1. Return ~unused~. + 1. [id="step-evaldeclarationinstantiation-post-validation"] NOTE: No abnormal terminations occur after this algorithm step unless _variableEnv_ is a Global Environment Record and the global object is a Proxy exotic object. + 1. Let _lexicalDecls_ be the LexicallyScopedDeclarations of _body_. + 1. For each element _lexicalDecl_ of _lexicalDecls_, 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 ? _lexEnv_.CreateImmutableBinding(_dn_, *true*). + 1. For each element _name_ of the BoundNames of _lexicalDecl_, do + 1. If IsConstantDeclaration of _lexicalDecl_ is *true*, then + 1. Perform ? _lexicalEnv_.CreateImmutableBinding(_name_, *true*). 1. Else, - 1. Perform ? _lexEnv_.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 _lexEnv_ and _privateEnv_. - 1. If _varEnv_ is a Global Environment Record, then - 1. Perform ? _varEnv_.CreateGlobalFunctionBinding(_fn_, _fo_, *true*). + 1. Perform ? _lexicalEnv_.CreateMutableBinding(_name_, *false*). + 1. For each Parse Node _funcDecl_ of _funcsToInitialize_, do + 1. Let _funcName_ be the sole element of the BoundNames of _funcDecl_. + 1. Let _funcObj_ be InstantiateFunctionObject of _funcDecl_ with arguments _lexicalEnv_ and _privateEnv_. + 1. If _variableEnv_ is a Global Environment Record, then + 1. Perform ? CreateGlobalFunctionBinding(_variableEnv_, _funcName_, _funcObj_, *true*). 1. Else, - 1. Let _bindingExists_ be ! _varEnv_.HasBinding(_fn_). + 1. Let _bindingExists_ be ! _variableEnv_.HasBinding(_funcName_). 1. If _bindingExists_ is *false*, then 1. NOTE: The following invocation cannot return an abrupt completion because of the validation preceding step . - 1. Perform ! _varEnv_.CreateMutableBinding(_fn_, *true*). - 1. Perform ! _varEnv_.InitializeBinding(_fn_, _fo_). + 1. Perform ! _variableEnv_.CreateMutableBinding(_funcName_, *true*). + 1. Perform ! _variableEnv_.InitializeBinding(_funcName_, _funcObj_). 1. Else, - 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 ! _variableEnv_.SetMutableBinding(_funcName_, _funcObj_, *false*). + 1. For each String _variableName_ of _declaredVariableNames_, do + 1. If _variableEnv_ is a Global Environment Record, then + 1. Perform ? CreateGlobalVarBinding(_variableEnv_, _variableName_, *true*). 1. Else, - 1. Let _bindingExists_ be ! _varEnv_.HasBinding(_vn_). + 1. Let _bindingExists_ be ! _variableEnv_.HasBinding(_variableName_). 1. If _bindingExists_ is *false*, then 1. NOTE: The following invocation cannot return an abrupt completion because of the validation preceding step . - 1. Perform ! _varEnv_.CreateMutableBinding(_vn_, *true*). - 1. Perform ! _varEnv_.InitializeBinding(_vn_, *undefined*). + 1. Perform ! _variableEnv_.CreateMutableBinding(_variableName_, *true*). + 1. Perform ! _variableEnv_.InitializeBinding(_variableName_, *undefined*). 1. Return ~unused~. - -

        An alternative version of this algorithm is described in .

        -
        - -

        isFinite ( _number_ )

        + +

        isFinite ( _value_ )

        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. Let _number_ be ? ToNumber(_value_). + 1. If _number_ is finite, return *true*. + 1. Return *false*.
        - -

        isNaN ( _number_ )

        + +

        isNaN ( _value_ )

        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. Let _number_ be ? ToNumber(_value_). + 1. If _number_ is *NaN*, return *true*. + 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,35 +30671,33 @@

        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.

        It performs the following steps when called:

        1. Let _inputString_ be ? ToString(_string_). - 1. Let _S_ be ! TrimString(_inputString_, ~start~). + 1. Let _radixMV_ be ℝ(? ToInt32(_radix_)). + 1. If _radixMV_ ≠ 0 and _radixMV_ is not in the inclusive interval from 2 to 36, return *NaN*. + 1. Let _trimmedString_ be ! TrimString(_inputString_, ~start~). + 1. If _trimmedString_ is the empty String, return *NaN*. 1. Let _sign_ be 1. - 1. If _S_ is not empty and the first code unit of _S_ is the code unit 0x002D (HYPHEN-MINUS), set _sign_ to -1. - 1. If _S_ is not empty and the first code unit of _S_ is either the code unit 0x002B (PLUS SIGN) or the code unit 0x002D (HYPHEN-MINUS), set _S_ to the substring of _S_ from index 1. - 1. Let _R_ be ℝ(? ToInt32(_radix_)). - 1. Let _stripPrefix_ be *true*. - 1. If _R_ ≠ 0, then - 1. If _R_ < 2 or _R_ > 36, return *NaN*. - 1. If _R_ ≠ 16, set _stripPrefix_ to *false*. - 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. 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. 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.) - 1. If _mathInt_ = 0, then - 1. If _sign_ = -1, return *-0*𝔽. - 1. Return *+0*𝔽. + 1. If the first code unit of _trimmedString_ is the code unit 0x002D (HYPHEN-MINUS), then + 1. Set _sign_ to -1. + 1. Set _trimmedString_ to the substring of _trimmedString_ from 1. + 1. Else if the first code unit of _trimmedString_ is the code unit 0x002B (PLUS SIGN), then + 1. Set _trimmedString_ to the substring of _trimmedString_ from 1. + 1. If _radixMV_ = 0 or _radixMV_ = 16, then + 1. If the length of _trimmedString_ ≥ 2 and the substring of _trimmedString_ from 0 to 2 is either *"0x"* or *"0X"*, then + 1. Set _trimmedString_ to the substring of _trimmedString_ from 2. + 1. Set _radixMV_ to 16. + 1. If _radixMV_ = 0, set _radixMV_ to 10. + 1. If _trimmedString_ contains a code unit that is not a radix-_radixMV_ digit, let _end_ be the index within _trimmedString_ of the first such code unit; else let _end_ be the length of _trimmedString_. + 1. Let _numberString_ be the substring of _trimmedString_ from 0 to _end_. + 1. If _numberString_ is empty, return *NaN*. + 1. Let _mathInt_ be the integer value that is represented by _numberString_ in radix-_radixMV_ notation, using the letters A through Z and a through z for digits with values 10 through 35. (However, if _radixMV_ = 10 and _numberString_ 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 _radixMV_ 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 _numberString_ in radix-_radixMV_ notation.) + 1. If _sign_ = -1 and _mathInt_ = 0, return *-0*𝔽. 1. Return 𝔽(_sign_ × _mathInt_). @@ -29109,7 +30715,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 +30727,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 +30739,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 +30751,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.

        @@ -29169,25 +30775,25 @@

        It performs URI encoding and escaping, interpreting _string_ as a sequence of UTF-16 encoded code points as described in . If a character is identified as unreserved in RFC 2396 or appears in _extraUnescaped_, it is not escaped.

        - 1. Let _len_ be the length of _string_. - 1. Let _R_ be the empty String. + 1. Let _length_ be the length of _string_. + 1. Let _result_ be the empty String. 1. Let _alwaysUnescaped_ be the string-concatenation of the ASCII word characters and *"-.!~\*'()"*. 1. Let _unescapedSet_ be the string-concatenation of _alwaysUnescaped_ and _extraUnescaped_. 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. Let _C_ be the code unit at index _k_ within _string_. - 1. If _unescapedSet_ contains _C_, then + 1. Repeat, while _k_ < _length_, + 1. Let _codeUnit_ be the code unit at index _k_ within _string_. + 1. If _unescapedSet_ contains _codeUnit_, then 1. Set _k_ to _k_ + 1. - 1. Set _R_ to the string-concatenation of _R_ and _C_. + 1. Set _result_ to the string-concatenation of _result_ and _codeUnit_. 1. Else, - 1. Let _cp_ be CodePointAt(_string_, _k_). - 1. If _cp_.[[IsUnpairedSurrogate]] is *true*, throw a *URIError* exception. - 1. Set _k_ to _k_ + _cp_.[[CodeUnitCount]]. - 1. Let _Octets_ be the List of octets resulting by applying the UTF-8 transformation to _cp_.[[CodePoint]]. - 1. For each element _octet_ of _Octets_, do + 1. Let _codePoint_ be CodePointAt(_string_, _k_). + 1. If _codePoint_.[[IsUnpairedSurrogate]] is *true*, throw a *URIError* exception. + 1. Set _k_ to _k_ + _codePoint_.[[CodeUnitCount]]. + 1. Let _octets_ be the List of octets resulting by applying the UTF-8 transformation to _codePoint_.[[CodePoint]]. + 1. For each element _octet_ of _octets_, do 1. Let _hex_ be the String representation of _octet_, formatted as an uppercase hexadecimal number. - 1. Set _R_ to the string-concatenation of _R_, *"%"*, and StringPad(_hex_, 2, *"0"*, ~start~). - 1. Return _R_. + 1. Set _result_ to the string-concatenation of _result_, *"%"*, and StringPad(_hex_, 2, *"0"*, ~start~). + 1. Return _result_.

        Because percent-encoding is used to represent individual octets, a single code point may be expressed as multiple consecutive escape sequences (one for each of its 8-bit UTF-8 code units).

        @@ -29206,42 +30812,42 @@

        It performs URI unescaping and decoding, preserving any escape sequences that correspond to Basic Latin characters in _preserveEscapeSet_.
        - 1. Let _len_ be the length of _string_. - 1. Let _R_ be the empty String. + 1. Let _length_ be the length of _string_. + 1. Let _result_ be the empty String. 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. Let _C_ be the code unit at index _k_ within _string_. - 1. Let _S_ be _C_. - 1. If _C_ is the code unit 0x0025 (PERCENT SIGN), then - 1. If _k_ + 3 > _len_, throw a *URIError* exception. + 1. Repeat, while _k_ < _length_, + 1. Let _codeUnit_ be the code unit at index _k_ within _string_. + 1. Let _segment_ be _codeUnit_. + 1. If _codeUnit_ is the code unit 0x0025 (PERCENT SIGN), then + 1. If _k_ + 3 > _length_, throw a *URIError* exception. 1. Let _escape_ be the substring of _string_ from _k_ to _k_ + 3. - 1. Let _B_ be ParseHexOctet(_string_, _k_ + 1). - 1. If _B_ is not an integer, throw a *URIError* exception. + 1. Let _firstOctet_ be ParseHexOctet(_string_, _k_ + 1). + 1. If _firstOctet_ is not an integer, throw a *URIError* exception. 1. Set _k_ to _k_ + 2. - 1. Let _n_ be the number of leading 1 bits in _B_. + 1. Let _n_ be the number of leading 1 bits in _firstOctet_. 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. Let _asciiChar_ be the code unit whose numeric value is _firstOctet_. + 1. If _preserveEscapeSet_ contains _asciiChar_, set _segment_ to _escape_; else set _segment_ to _asciiChar_. 1. Else, 1. If _n_ = 1 or _n_ > 4, throw a *URIError* exception. - 1. Let _Octets_ be « _B_ ». + 1. Let _octets_ be « _firstOctet_ ». 1. Let _j_ be 1. 1. Repeat, while _j_ < _n_, 1. Set _k_ to _k_ + 1. - 1. If _k_ + 3 > _len_, throw a *URIError* exception. + 1. If _k_ + 3 > _length_, throw a *URIError* exception. 1. If the code unit at index _k_ within _string_ is not the code unit 0x0025 (PERCENT SIGN), throw a *URIError* exception. 1. Let _continuationByte_ be ParseHexOctet(_string_, _k_ + 1). 1. If _continuationByte_ is not an integer, throw a *URIError* exception. - 1. Append _continuationByte_ to _Octets_. + 1. Append _continuationByte_ to _octets_. 1. Set _k_ to _k_ + 2. 1. Set _j_ to _j_ + 1. - 1. Assert: The length of _Octets_ is _n_. - 1. If _Octets_ does not contain a valid UTF-8 encoding of a Unicode code point, throw a *URIError* exception. - 1. Let _V_ be the code point obtained by applying the UTF-8 transformation to _Octets_, that is, from a List of octets into a 21-bit value. - 1. Set _S_ to UTF16EncodeCodePoint(_V_). - 1. Set _R_ to the string-concatenation of _R_ and _S_. + 1. Assert: The length of _octets_ is _n_. + 1. If _octets_ does not contain a valid UTF-8 encoding of a Unicode code point, throw a *URIError* exception. + 1. Let _codePoint_ be the code point obtained by applying the UTF-8 transformation to _octets_, that is, from a List of octets into a 21-bit value. + 1. Set _segment_ to UTF16EncodeCodePoint(_codePoint_). + 1. Set _result_ to the string-concatenation of _result_ and _segment_. 1. Set _k_ to _k_ + 1. - 1. Return _R_. + 1. Return _result_.

        RFC 3629 prohibits the decoding of invalid UTF-8 octet sequences. For example, the invalid sequence 0xC0 0x80 must not decode into the code unit 0x0000. Implementations of the Decode algorithm are required to throw a *URIError* when encountering such invalid sequences.

        @@ -29260,8 +30866,8 @@

        It parses a sequence of two hexadecimal characters at the specified _position_ in _string_ into an unsigned 8-bit integer.
        - 1. Let _len_ be the length of _string_. - 1. Assert: _position_ + 2 ≤ _len_. + 1. Let _length_ be the length of _string_. + 1. Assert: _position_ + 2 ≤ _length_. 1. Let _hexDigits_ be the substring of _string_ from _position_ to _position_ + 2. 1. Let _parseResult_ be ParseText(_hexDigits_, |HexDigits[~Sep]|). 1. If _parseResult_ is not a Parse Node, return _parseResult_. @@ -29291,6 +30897,11 @@

        ArrayBuffer ( . . . )

        See .

        + +

        AsyncDisposableStack ( . . . )

        +

        See .

        +
        +

        BigInt ( . . . )

        See .

        @@ -29321,6 +30932,11 @@

        Date ( . . . )

        See .

        + +

        DisposableStack ( . . . )

        +

        See .

        +
        +

        Error ( . . . )

        See .

        @@ -29331,11 +30947,16 @@

        EvalError ( . . . )

        See .

        - +

        FinalizationRegistry ( . . . )

        See .

        + +

        Float16Array ( . . . )

        +

        See .

        +
        +

        Float32Array ( . . . )

        See .

        @@ -29366,6 +30987,11 @@

        Int32Array ( . . . )

        See .

        + +

        Iterator ( . . . )

        +

        See .

        +
        +

        Map ( . . . )

        See .

        @@ -29421,6 +31047,11 @@

        String ( . . . )

        See .

        + +

        SuppressedError ( . . . )

        +

        See .

        +
        +

        Symbol ( . . . )

        See .

        @@ -29436,7 +31067,7 @@

        TypeError ( . . . )

        See .

        - +

        Uint8Array ( . . . )

        See .

        @@ -29519,8 +31150,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,114 +31167,113 @@

        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:

        - 1. Let _to_ be ? ToObject(_target_). - 1. If only one argument was passed, return _to_. + 1. Let _targetObj_ be ? ToObject(_target_). + 1. If only one argument was passed, return _targetObj_. 1. For each element _nextSource_ of _sources_, do 1. If _nextSource_ is neither *undefined* nor *null*, then 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. 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*). - 1. Return _to_. + 1. Let _propertyDesc_ be ? _from_.[[GetOwnProperty]](_nextKey_). + 1. If _propertyDesc_ is not *undefined* and _propertyDesc_.[[Enumerable]] is *true*, then + 1. Let _propertyValue_ be ? Get(_from_, _nextKey_). + 1. Perform ? Set(_targetObj_, _nextKey_, _propertyValue_, *true*). + 1. Return _targetObj_.

        The *"length"* property of this function is *2*𝔽.

        - -

        Object.create ( _O_, _Properties_ )

        + +

        Object.create ( _proto_, _properties_ )

        This function creates a new object with a specified prototype.

        It performs the following steps when called:

        - 1. If _O_ is not an Object and _O_ is not *null*, throw a *TypeError* exception. - 1. Let _obj_ be OrdinaryObjectCreate(_O_). - 1. If _Properties_ is not *undefined*, then - 1. Return ? ObjectDefineProperties(_obj_, _Properties_). + 1. If _proto_ is not an Object and _proto_ is not *null*, throw a *TypeError* exception. + 1. Let _obj_ be OrdinaryObjectCreate(_proto_). + 1. If _properties_ is not *undefined*, then + 1. Return ? ObjectDefineProperties(_obj_, _properties_). 1. Return _obj_.
        - -

        Object.defineProperties ( _O_, _Properties_ )

        + +

        Object.defineProperties ( _obj_, _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:

        - 1. If _O_ is not an Object, throw a *TypeError* exception. - 1. Return ? ObjectDefineProperties(_O_, _Properties_). + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. Return ? ObjectDefineProperties(_obj_, _properties_).

        ObjectDefineProperties ( - _O_: an Object, - _Properties_: an ECMAScript language value, + _obj_: an Object, + _properties_: an ECMAScript language value, ): either a normal completion containing an Object or a throw completion

        - 1. Let _props_ be ? ToObject(_Properties_). - 1. Let _keys_ be ? _props_.[[OwnPropertyKeys]](). - 1. Let _descriptors_ be a new empty List. + 1. Set _properties_ to ? ToObject(_properties_). + 1. Let _keys_ be ? _properties_.[[OwnPropertyKeys]](). + 1. Let _propertyDescs_ be a new empty List. 1. For each element _nextKey_ of _keys_, do - 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_). - 1. Append the Record { [[Key]]: _nextKey_, [[Descriptor]]: _desc_ } to _descriptors_. - 1. For each element _property_ of _descriptors_, do - 1. Perform ? DefinePropertyOrThrow(_O_, _property_.[[Key]], _property_.[[Descriptor]]). - 1. Return _O_. + 1. Let _currentPropertyDesc_ be ? _properties_.[[GetOwnProperty]](_nextKey_). + 1. If _currentPropertyDesc_ is not *undefined* and _currentPropertyDesc_.[[Enumerable]] is *true*, then + 1. Let _propertyDescObj_ be ? Get(_properties_, _nextKey_). + 1. Let _propertyDesc_ be ? ToPropertyDescriptor(_propertyDescObj_). + 1. Append the Record { [[Key]]: _nextKey_, [[Descriptor]]: _propertyDesc_ } to _propertyDescs_. + 1. For each element _property_ of _propertyDescs_, do + 1. Perform ? DefinePropertyOrThrow(_obj_, _property_.[[Key]], _property_.[[Descriptor]]). + 1. Return _obj_.
        - -

        Object.defineProperty ( _O_, _P_, _Attributes_ )

        + +

        Object.defineProperty ( _obj_, _key_, _attrs_ )

        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:

        - 1. If _O_ is not an Object, throw a *TypeError* exception. - 1. Let _key_ be ? ToPropertyKey(_P_). - 1. Let _desc_ be ? ToPropertyDescriptor(_Attributes_). - 1. Perform ? DefinePropertyOrThrow(_O_, _key_, _desc_). - 1. Return _O_. + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. Let _propertyKey_ be ? ToPropertyKey(_key_). + 1. Let _propertyDesc_ be ? ToPropertyDescriptor(_attrs_). + 1. Perform ? DefinePropertyOrThrow(_obj_, _propertyKey_, _propertyDesc_). + 1. Return _obj_.
        - -

        Object.entries ( _O_ )

        + +

        Object.entries ( _obj_ )

        This function performs the following steps when called:

        - 1. Let _obj_ be ? ToObject(_O_). - 1. Let _entryList_ be ? EnumerableOwnProperties(_obj_, ~key+value~). + 1. Let _coerced_ be ? ToObject(_obj_). + 1. Let _entryList_ be ? EnumerableOwnProperties(_coerced_, ~key+value~). 1. Return CreateArrayFromList(_entryList_).
        - -

        Object.freeze ( _O_ )

        + +

        Object.freeze ( _obj_ )

        This function performs the following steps when called:

        - 1. If _O_ is not an Object, return _O_. - 1. Let _status_ be ? SetIntegrityLevel(_O_, ~frozen~). + 1. If _obj_ is not an Object, return _obj_. + 1. Let _status_ be ? SetIntegrityLevel(_obj_, ~frozen~). 1. If _status_ is *false*, throw a *TypeError* exception. - 1. Return _O_. + 1. Return _obj_.
        - +

        Object.fromEntries ( _iterable_ )

        This function performs the following steps when called:

        @@ -29653,7 +31283,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,58 +31292,58 @@

        Object.fromEntries ( _iterable_ )

        - -

        Object.getOwnPropertyDescriptor ( _O_, _P_ )

        + +

        Object.getOwnPropertyDescriptor ( _obj_, _key_ )

        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. Return FromPropertyDescriptor(_desc_). + 1. Let _coerced_ be ? ToObject(_obj_). + 1. Let _propertyKey_ be ? ToPropertyKey(_key_). + 1. Let _propertyDesc_ be ? _coerced_.[[GetOwnProperty]](_propertyKey_). + 1. Return FromPropertyDescriptor(_propertyDesc_).
        - -

        Object.getOwnPropertyDescriptors ( _O_ )

        + +

        Object.getOwnPropertyDescriptors ( _obj_ )

        This function performs the following steps when called:

        - 1. Let _obj_ be ? ToObject(_O_). - 1. Let _ownKeys_ be ? _obj_.[[OwnPropertyKeys]](). - 1. Let _descriptors_ be OrdinaryObjectCreate(%Object.prototype%). + 1. Let _coerced_ be ? ToObject(_obj_). + 1. Let _ownKeys_ be ? _coerced_.[[OwnPropertyKeys]](). + 1. Let _descs_ be OrdinaryObjectCreate(%Object.prototype%). 1. For each element _key_ of _ownKeys_, do - 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_. + 1. Let _propertyDesc_ be ? _coerced_.[[GetOwnProperty]](_key_). + 1. Let _propertyDescObj_ be FromPropertyDescriptor(_propertyDesc_). + 1. If _propertyDescObj_ is not *undefined*, perform ! CreateDataPropertyOrThrow(_descs_, _key_, _propertyDescObj_). + 1. Return _descs_.
        - -

        Object.getOwnPropertyNames ( _O_ )

        + +

        Object.getOwnPropertyNames ( _obj_ )

        This function performs the following steps when called:

        - 1. Return CreateArrayFromList(? GetOwnPropertyKeys(_O_, ~string~)). + 1. Return CreateArrayFromList(? GetOwnPropertyKeys(_obj_, ~string~)).
        - -

        Object.getOwnPropertySymbols ( _O_ )

        + +

        Object.getOwnPropertySymbols ( _obj_ )

        This function performs the following steps when called:

        - 1. Return CreateArrayFromList(? GetOwnPropertyKeys(_O_, ~symbol~)). + 1. Return CreateArrayFromList(? GetOwnPropertyKeys(_obj_, ~symbol~)).

        GetOwnPropertyKeys ( - _O_: an ECMAScript language value, + _value_: an ECMAScript language value, _type_: ~string~ or ~symbol~, ): either a normal completion containing a List of property keys or a throw completion

        - 1. Let _obj_ be ? ToObject(_O_). + 1. Let _obj_ be ? ToObject(_value_). 1. Let _keys_ be ? _obj_.[[OwnPropertyKeys]](). 1. Let _nameList_ be a new empty List. 1. For each element _nextKey_ of _keys_, do @@ -29724,44 +31354,44 @@

        - -

        Object.getPrototypeOf ( _O_ )

        + +

        Object.getPrototypeOf ( _obj_ )

        This function performs the following steps when called:

        - 1. Let _obj_ be ? ToObject(_O_). - 1. Return ? _obj_.[[GetPrototypeOf]](). + 1. Let _coerced_ be ? ToObject(_obj_). + 1. Return ? _coerced_.[[GetPrototypeOf]]().
        - -

        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]]). - 1. Perform ! CreateDataPropertyOrThrow(_obj_, _g_.[[Key]], _elements_). + 1. For each Record { [[Key]], [[Elements]] } _group_ of _groups_, do + 1. Let _elements_ be CreateArrayFromList(_group_.[[Elements]]). + 1. Perform ! CreateDataPropertyOrThrow(_obj_, _group_.[[Key]], _elements_). 1. Return _obj_.
        - -

        Object.hasOwn ( _O_, _P_ )

        + +

        Object.hasOwn ( _obj_, _key_ )

        This function performs the following steps when called:

        - 1. Let _obj_ be ? ToObject(_O_). - 1. Let _key_ be ? ToPropertyKey(_P_). - 1. Return ? HasOwnProperty(_obj_, _key_). + 1. Let _coerced_ be ? ToObject(_obj_). + 1. Let _propertyKey_ be ? ToPropertyKey(_key_). + 1. Return ? HasOwnProperty(_coerced_, _propertyKey_).
        - +

        Object.is ( _value1_, _value2_ )

        This function performs the following steps when called:

        @@ -29769,51 +31399,51 @@

        Object.is ( _value1_, _value2_ )

        - -

        Object.isExtensible ( _O_ )

        + +

        Object.isExtensible ( _obj_ )

        This function performs the following steps when called:

        - 1. If _O_ is not an Object, return *false*. - 1. Return ? IsExtensible(_O_). + 1. If _obj_ is not an Object, return *false*. + 1. Return ? IsExtensible(_obj_).
        - -

        Object.isFrozen ( _O_ )

        + +

        Object.isFrozen ( _obj_ )

        This function performs the following steps when called:

        - 1. If _O_ is not an Object, return *true*. - 1. Return ? TestIntegrityLevel(_O_, ~frozen~). + 1. If _obj_ is not an Object, return *true*. + 1. Return ? TestIntegrityLevel(_obj_, ~frozen~).
        - -

        Object.isSealed ( _O_ )

        + +

        Object.isSealed ( _obj_ )

        This function performs the following steps when called:

        - 1. If _O_ is not an Object, return *true*. - 1. Return ? TestIntegrityLevel(_O_, ~sealed~). + 1. If _obj_ is not an Object, return *true*. + 1. Return ? TestIntegrityLevel(_obj_, ~sealed~).
        - -

        Object.keys ( _O_ )

        + +

        Object.keys ( _obj_ )

        This function performs the following steps when called:

        - 1. Let _obj_ be ? ToObject(_O_). - 1. Let _keyList_ be ? EnumerableOwnProperties(_obj_, ~key~). + 1. Let _coerced_ be ? ToObject(_obj_). + 1. Let _keyList_ be ? EnumerableOwnProperties(_coerced_, ~key~). 1. Return CreateArrayFromList(_keyList_).
        - -

        Object.preventExtensions ( _O_ )

        + +

        Object.preventExtensions ( _obj_ )

        This function performs the following steps when called:

        - 1. If _O_ is not an Object, return _O_. - 1. Let _status_ be ? _O_.[[PreventExtensions]](). + 1. If _obj_ is not an Object, return _obj_. + 1. Let _status_ be ? _obj_.[[PreventExtensions]](). 1. If _status_ is *false*, throw a *TypeError* exception. - 1. Return _O_. + 1. Return _obj_.
        @@ -29823,36 +31453,36 @@

        Object.prototype

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        - -

        Object.seal ( _O_ )

        + +

        Object.seal ( _obj_ )

        This function performs the following steps when called:

        - 1. If _O_ is not an Object, return _O_. - 1. Let _status_ be ? SetIntegrityLevel(_O_, ~sealed~). + 1. If _obj_ is not an Object, return _obj_. + 1. Let _status_ be ? SetIntegrityLevel(_obj_, ~sealed~). 1. If _status_ is *false*, throw a *TypeError* exception. - 1. Return _O_. + 1. Return _obj_.
        - -

        Object.setPrototypeOf ( _O_, _proto_ )

        + +

        Object.setPrototypeOf ( _obj_, _proto_ )

        This function performs the following steps when called:

        - 1. Set _O_ to ? RequireObjectCoercible(_O_). + 1. Perform ? RequireObjectCoercible(_obj_). 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. If _obj_ is not an Object, return _obj_. + 1. Let _status_ be ? _obj_.[[SetPrototypeOf]](_proto_). 1. If _status_ is *false*, throw a *TypeError* exception. - 1. Return _O_. + 1. Return _obj_.
        - -

        Object.values ( _O_ )

        + +

        Object.values ( _obj_ )

        This function performs the following steps when called:

        - 1. Let _obj_ be ? ToObject(_O_). - 1. Let _valueList_ be ? EnumerableOwnProperties(_obj_, ~value~). + 1. Let _coerced_ be ? ToObject(_obj_). + 1. Let _valueList_ be ? EnumerableOwnProperties(_coerced_, ~value~). 1. Return CreateArrayFromList(_valueList_).
        @@ -29873,44 +31503,44 @@

        Object.prototype.constructor

        The initial value of `Object.prototype.constructor` is %Object%.

        - -

        Object.prototype.hasOwnProperty ( _V_ )

        + +

        Object.prototype.hasOwnProperty ( _value_ )

        This method performs the following steps when called:

        - 1. [id="step-hasownproperty-topropertykey"] Let _P_ be ? ToPropertyKey(_V_). - 1. [id="step-hasownproperty-toobject"] Let _O_ be ? ToObject(*this* value). - 1. Return ? HasOwnProperty(_O_, _P_). + 1. [id="step-hasownproperty-topropertykey"] Let _propertyKey_ be ? ToPropertyKey(_value_). + 1. [id="step-hasownproperty-toobject"] Let _obj_ be ? ToObject(*this* value). + 1. Return ? HasOwnProperty(_obj_, _propertyKey_).

        The ordering of steps and is chosen to ensure that any exception that would have been thrown by step in previous editions of this specification will continue to be thrown even if the *this* value is *undefined* or *null*.

        - -

        Object.prototype.isPrototypeOf ( _V_ )

        + +

        Object.prototype.isPrototypeOf ( _value_ )

        This method performs the following steps when called:

        - 1. [id="step-isprototypeof-check-object"] If _V_ is not an Object, return *false*. - 1. [id="step-isprototypeof-toobject"] Let _O_ be ? ToObject(*this* value). + 1. [id="step-isprototypeof-check-object"] If _value_ is not an Object, return *false*. + 1. [id="step-isprototypeof-toobject"] Let _obj_ be ? ToObject(*this* value). 1. Repeat, - 1. Set _V_ to ? _V_.[[GetPrototypeOf]](). - 1. If _V_ is *null*, return *false*. - 1. If SameValue(_O_, _V_) is *true*, return *true*. + 1. Set _value_ to ? _value_.[[GetPrototypeOf]](). + 1. If _value_ is *null*, return *false*. + 1. If SameValue(_obj_, _value_) is *true*, return *true*. -

        The ordering of steps and preserves the behaviour specified by previous editions of this specification for the case where _V_ is not an object and the *this* value is *undefined* or *null*.

        +

        The ordering of steps and preserves the behaviour specified by previous editions of this specification for the case where _value_ is not an object and the *this* value is *undefined* or *null*.

        - -

        Object.prototype.propertyIsEnumerable ( _V_ )

        + +

        Object.prototype.propertyIsEnumerable ( _value_ )

        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. If _desc_ is *undefined*, return *false*. - 1. Return _desc_.[[Enumerable]]. + 1. [id="step-propertyisenumerable-topropertykey"] Let _propertyKey_ be ? ToPropertyKey(_value_). + 1. [id="step-propertyisenumerable-toobject"] Let _obj_ be ? ToObject(*this* value). + 1. Let _propertyDesc_ be ? _obj_.[[GetOwnProperty]](_propertyKey_). + 1. If _propertyDesc_ is *undefined*, return *false*. + 1. Return _propertyDesc_.[[Enumerable]].

        This method does not consider objects in the prototype chain.

        @@ -29920,12 +31550,12 @@

        Object.prototype.propertyIsEnumerable ( _V_ )

        - +

        Object.prototype.toLocaleString ( [ _reserved1_ [ , _reserved2_ ] ] )

        This method performs the following steps when called:

        - 1. Let _O_ be the *this* value. - 1. Return ? Invoke(_O_, *"toString"*). + 1. Let _thisValue_ be the *this* value. + 1. Return ? Invoke(_thisValue_, *"toString"*).

        The optional parameters to this method are not used but are intended to correspond to the parameter pattern used by ECMA-402 `toLocaleString` methods. Implementations that do not include ECMA-402 support must not use those parameter positions for other purposes.

        @@ -29936,34 +31566,34 @@

        Object.prototype.toLocaleString ( [ _reserved1_ [ , _reserved2_ ] ] )

        - +

        Object.prototype.toString ( )

        This method performs the following steps when called:

        1. If the *this* value is *undefined*, return *"[object Undefined]"*. 1. If the *this* value is *null*, return *"[object Null]"*. - 1. Let _O_ be ! ToObject(*this* value). - 1. Let _isArray_ be ? IsArray(_O_). + 1. Let _obj_ be ! ToObject(*this* value). + 1. Let _isArray_ be ? IsArray(_obj_). 1. If _isArray_ is *true*, let _builtinTag_ be *"Array"*. - 1. Else if _O_ has a [[ParameterMap]] internal slot, let _builtinTag_ be *"Arguments"*. - 1. Else if _O_ has a [[Call]] internal method, let _builtinTag_ be *"Function"*. - 1. Else if _O_ has an [[ErrorData]] internal slot, let _builtinTag_ be *"Error"*. - 1. Else if _O_ has a [[BooleanData]] internal slot, let _builtinTag_ be *"Boolean"*. - 1. Else if _O_ has a [[NumberData]] internal slot, let _builtinTag_ be *"Number"*. - 1. Else if _O_ has a [[StringData]] internal slot, let _builtinTag_ be *"String"*. - 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 if _obj_ has a [[ParameterMap]] internal slot, let _builtinTag_ be *"Arguments"*. + 1. Else if _obj_ has a [[Call]] internal method, let _builtinTag_ be *"Function"*. + 1. Else if _obj_ has an [[ErrorData]] internal slot, let _builtinTag_ be *"Error"*. + 1. Else if _obj_ has a [[BooleanData]] internal slot, let _builtinTag_ be *"Boolean"*. + 1. Else if _obj_ has a [[NumberData]] internal slot, let _builtinTag_ be *"Number"*. + 1. Else if _obj_ has a [[StringData]] internal slot, let _builtinTag_ be *"String"*. + 1. Else if _obj_ has a [[DateValue]] internal slot, let _builtinTag_ be *"Date"*. + 1. Else if _obj_ 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(_obj_, %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:

        @@ -29973,25 +31603,26 @@

        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:

        +

        `Object.prototype.__proto__` is an accessor property with attributes { [[Enumerable]]: *false*, [[Configurable]]: *true* }. The [[Getter]] and [[Setter]] 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:

        +

        The value of the [[Getter]] attribute is a built-in function that requires no arguments. It performs the following steps when called:

        - 1. Let _O_ be ? ToObject(*this* value). - 1. Return ? _O_.[[GetPrototypeOf]](). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Return ? _obj_.[[GetPrototypeOf]]().
        - +

        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:

        +

        The value of the [[Setter]] 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 _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). 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. If _thisValue_ is not an Object, return *undefined*. + 1. Let _status_ be ? _thisValue_.[[SetPrototypeOf]](_proto_). 1. If _status_ is *false*, throw a *TypeError* exception. 1. Return *undefined*. @@ -30001,61 +31632,61 @@

        set Object.prototype.__proto__

        Legacy Object.prototype Accessor Methods

        - -

        Object.prototype.__defineGetter__ ( _P_, _getter_ )

        + +

        Object.prototype.__defineGetter__ ( _key_, _getter_ )

        This method performs the following steps when called:

        - 1. Let _O_ be ? ToObject(*this* value). + 1. Let _obj_ be ? ToObject(*this* value). 1. If IsCallable(_getter_) is *false*, throw a *TypeError* exception. - 1. Let _desc_ be PropertyDescriptor { [[Get]]: _getter_, [[Enumerable]]: *true*, [[Configurable]]: *true* }. - 1. Let _key_ be ? ToPropertyKey(_P_). - 1. Perform ? DefinePropertyOrThrow(_O_, _key_, _desc_). + 1. Let _propertyDesc_ be PropertyDescriptor { [[Getter]]: _getter_, [[Enumerable]]: *true*, [[Configurable]]: *true* }. + 1. Let _propertyKey_ be ? ToPropertyKey(_key_). + 1. Perform ? DefinePropertyOrThrow(_obj_, _propertyKey_, _propertyDesc_). 1. Return *undefined*.
        - -

        Object.prototype.__defineSetter__ ( _P_, _setter_ )

        + +

        Object.prototype.__defineSetter__ ( _key_, _setter_ )

        This method performs the following steps when called:

        - 1. Let _O_ be ? ToObject(*this* value). + 1. Let _obj_ be ? ToObject(*this* value). 1. If IsCallable(_setter_) is *false*, throw a *TypeError* exception. - 1. Let _desc_ be PropertyDescriptor { [[Set]]: _setter_, [[Enumerable]]: *true*, [[Configurable]]: *true* }. - 1. Let _key_ be ? ToPropertyKey(_P_). - 1. Perform ? DefinePropertyOrThrow(_O_, _key_, _desc_). + 1. Let _propertyDesc_ be PropertyDescriptor { [[Setter]]: _setter_, [[Enumerable]]: *true*, [[Configurable]]: *true* }. + 1. Let _propertyKey_ be ? ToPropertyKey(_key_). + 1. Perform ? DefinePropertyOrThrow(_obj_, _propertyKey_, _propertyDesc_). 1. Return *undefined*.
        - -

        Object.prototype.__lookupGetter__ ( _P_ )

        + +

        Object.prototype.__lookupGetter__ ( _key_ )

        This method performs the following steps when called:

        - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _key_ be ? ToPropertyKey(_P_). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _propertyKey_ be ? ToPropertyKey(_key_). 1. Repeat, - 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_key_). - 1. If _desc_ is not *undefined*, then - 1. If IsAccessorDescriptor(_desc_) is *true*, return _desc_.[[Get]]. + 1. Let _propertyDesc_ be ? _obj_.[[GetOwnProperty]](_propertyKey_). + 1. If _propertyDesc_ is not *undefined*, then + 1. If IsAccessorDescriptor(_propertyDesc_) is *true*, return _propertyDesc_.[[Getter]]. 1. Return *undefined*. - 1. Set _O_ to ? _O_.[[GetPrototypeOf]](). - 1. If _O_ is *null*, return *undefined*. + 1. Set _obj_ to ? _obj_.[[GetPrototypeOf]](). + 1. If _obj_ is *null*, return *undefined*.
        - -

        Object.prototype.__lookupSetter__ ( _P_ )

        + +

        Object.prototype.__lookupSetter__ ( _key_ )

        This method performs the following steps when called:

        - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _key_ be ? ToPropertyKey(_P_). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _propertyKey_ be ? ToPropertyKey(_key_). 1. Repeat, - 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_key_). - 1. If _desc_ is not *undefined*, then - 1. If IsAccessorDescriptor(_desc_) is *true*, return _desc_.[[Set]]. + 1. Let _propertyDesc_ be ? _obj_.[[GetOwnProperty]](_propertyKey_). + 1. If _propertyDesc_ is not *undefined*, then + 1. If IsAccessorDescriptor(_propertyDesc_) is *true*, return _propertyDesc_.[[Setter]]. 1. Return *undefined*. - 1. Set _O_ to ? _O_.[[GetPrototypeOf]](). - 1. If _O_ is *null*, return *undefined*. + 1. Set _obj_ to ? _obj_.[[GetPrototypeOf]](). + 1. If _obj_ is *null*, return *undefined*.
        @@ -30080,14 +31711,14 @@

        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_ )

        + +

        Function ( ..._paramArgs_, _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:

        - 1. Let _C_ be the active function object. + 1. Let _ctor_ be the active function object. 1. If _bodyArg_ is not present, set _bodyArg_ to the empty String. - 1. Return ? CreateDynamicFunction(_C_, NewTarget, ~normal~, _parameterArgs_, _bodyArg_). + 1. Return ? CreateDynamicFunction(_ctor_, NewTarget, ~normal~, _paramArgs_, _bodyArg_).

        It is permissible but not necessary to have one argument for each formal parameter to be specified. For example, all three of the following expressions produce the same result:

        @@ -30101,85 +31732,85 @@

        Function ( ..._parameterArgs_, _bodyArg_ )

        CreateDynamicFunction ( - _constructor_: a constructor, - _newTarget_: a constructor, + _ctor_: a constructor, + _newTarget_: a constructor or *undefined*, _kind_: ~normal~, ~generator~, ~async~, or ~async-generator~, - _parameterArgs_: a List of ECMAScript language values, + _paramArgs_: a List of ECMAScript language values, _bodyArg_: an ECMAScript language value, ): either a normal completion containing an ECMAScript function object or a throw completion

        description
        -
        _constructor_ is the constructor function that is performing this action. _newTarget_ is the constructor that `new` was initially applied to. _parameterArgs_ and _bodyArg_ reflect the argument values that were passed to _constructor_.
        +
        _ctor_ is the constructor function that is performing this action. _newTarget_ is the constructor that `new` was initially applied to. _paramArgs_ and _bodyArg_ reflect the argument values that were passed to _ctor_.
        - 1. If _newTarget_ is *undefined*, set _newTarget_ to _constructor_. + 1. If _newTarget_ is *undefined*, set _newTarget_ to _ctor_. 1. If _kind_ is ~normal~, then 1. Let _prefix_ be *"function"*. - 1. Let _exprSym_ be the grammar symbol |FunctionExpression|. - 1. Let _bodySym_ be the grammar symbol |FunctionBody[~Yield, ~Await]|. - 1. Let _parameterSym_ be the grammar symbol |FormalParameters[~Yield, ~Await]|. + 1. Let _exprGrammar_ be the grammar symbol |FunctionExpression|. + 1. Let _bodyGrammar_ be the grammar symbol |FunctionBody[~Yield, ~Await]|. + 1. Let _paramGrammar_ be the grammar symbol |FormalParameters[~Yield, ~Await]|. 1. Let _fallbackProto_ be *"%Function.prototype%"*. 1. Else if _kind_ is ~generator~, then 1. Let _prefix_ be *"function\*"*. - 1. Let _exprSym_ be the grammar symbol |GeneratorExpression|. - 1. Let _bodySym_ be the grammar symbol |GeneratorBody|. - 1. Let _parameterSym_ be the grammar symbol |FormalParameters[+Yield, ~Await]|. + 1. Let _exprGrammar_ be the grammar symbol |GeneratorExpression|. + 1. Let _bodyGrammar_ be the grammar symbol |GeneratorBody|. + 1. Let _paramGrammar_ be the grammar symbol |FormalParameters[+Yield, ~Await]|. 1. Let _fallbackProto_ be *"%GeneratorFunction.prototype%"*. 1. Else if _kind_ is ~async~, then 1. Let _prefix_ be *"async function"*. - 1. Let _exprSym_ be the grammar symbol |AsyncFunctionExpression|. - 1. Let _bodySym_ be the grammar symbol |AsyncFunctionBody|. - 1. Let _parameterSym_ be the grammar symbol |FormalParameters[~Yield, +Await]|. + 1. Let _exprGrammar_ be the grammar symbol |AsyncFunctionExpression|. + 1. Let _bodyGrammar_ be the grammar symbol |AsyncFunctionBody|. + 1. Let _paramGrammar_ be the grammar symbol |FormalParameters[~Yield, +Await]|. 1. Let _fallbackProto_ be *"%AsyncFunction.prototype%"*. 1. Else, 1. Assert: _kind_ is ~async-generator~. 1. Let _prefix_ be *"async function\*"*. - 1. Let _exprSym_ be the grammar symbol |AsyncGeneratorExpression|. - 1. Let _bodySym_ be the grammar symbol |AsyncGeneratorBody|. - 1. Let _parameterSym_ be the grammar symbol |FormalParameters[+Yield, +Await]|. + 1. Let _exprGrammar_ be the grammar symbol |AsyncGeneratorExpression|. + 1. Let _bodyGrammar_ be the grammar symbol |AsyncGeneratorBody|. + 1. Let _paramGrammar_ be the grammar symbol |FormalParameters[+Yield, +Await]|. 1. Let _fallbackProto_ be *"%AsyncGeneratorFunction.prototype%"*. - 1. Let _argCount_ be the number of elements in _parameterArgs_. - 1. Let _parameterStrings_ be a new empty List. - 1. For each element _arg_ of _parameterArgs_, do - 1. Append ? ToString(_arg_) to _parameterStrings_. + 1. Let _argCount_ be the number of elements in _paramArgs_. + 1. Let _paramStrings_ be a new empty List. + 1. For each element _arg_ of _paramArgs_, do + 1. Append ? ToString(_arg_) to _paramStrings_. 1. Let _bodyString_ be ? ToString(_bodyArg_). 1. Let _currentRealm_ be the current Realm Record. - 1. Perform ? HostEnsureCanCompileStrings(_currentRealm_, _parameterStrings_, _bodyString_, *false*). - 1. Let _P_ be the empty String. + 1. Perform ? HostEnsureCanCompileStrings(_currentRealm_, _paramStrings_, _bodyString_, *false*). + 1. Let _paramString_ be the empty String. 1. If _argCount_ > 0, then - 1. Set _P_ to _parameterStrings_[0]. + 1. Set _paramString_ to _paramStrings_[0]. 1. Let _k_ be 1. 1. Repeat, while _k_ < _argCount_, - 1. Let _nextArgString_ be _parameterStrings_[_k_]. - 1. Set _P_ to the string-concatenation of _P_, *","* (a comma), and _nextArgString_. + 1. Let _nextArgString_ be _paramStrings_[_k_]. + 1. Set _paramString_ to the string-concatenation of _paramString_, *","* (a comma), and _nextArgString_. 1. Set _k_ to _k_ + 1. 1. Let _bodyParseString_ be the string-concatenation of 0x000A (LINE FEED), _bodyString_, and 0x000A (LINE FEED). - 1. Let _sourceString_ be the string-concatenation of _prefix_, *" anonymous("*, _P_, 0x000A (LINE FEED), *") {"*, _bodyParseString_, and *"}"*. + 1. Let _sourceString_ be the string-concatenation of _prefix_, *" anonymous("*, _paramString_, 0x000A (LINE FEED), *") {"*, _bodyParseString_, and *"}"*. 1. Let _sourceText_ be StringToCodePoints(_sourceString_). - 1. Let _parameters_ be ParseText(_P_, _parameterSym_). - 1. If _parameters_ is a List of errors, throw a *SyntaxError* exception. - 1. Let _body_ be ParseText(_bodyParseString_, _bodySym_). + 1. Let _params_ be ParseText(_paramString_, _paramGrammar_). + 1. If _params_ is a List of errors, throw a *SyntaxError* exception. + 1. Let _body_ be ParseText(_bodyParseString_, _bodyGrammar_). 1. If _body_ is a List of errors, throw a *SyntaxError* exception. 1. NOTE: The parameters and body are parsed separately to ensure that each is valid alone. For example, `new Function("/*", "*/ ) {")` does not evaluate to a function. - 1. NOTE: If this step is reached, _sourceText_ must have the syntax of _exprSym_ (although the reverse implication does not hold). The purpose of the next two steps is to enforce any Early Error rules which apply to _exprSym_ directly. - 1. Let _expr_ be ParseText(_sourceText_, _exprSym_). + 1. NOTE: If this step is reached, _sourceText_ must have the syntax of _exprGrammar_ (although the reverse implication does not hold). The purpose of the next two steps is to enforce any Early Error rules which apply to _exprGrammar_ directly. + 1. Let _expr_ be ParseText(_sourceText_, _exprGrammar_). 1. If _expr_ is a List of errors, throw a *SyntaxError* exception. - 1. Let _proto_ be ? GetPrototypeFromConstructor(_newTarget_, _fallbackProto_). - 1. Let _env_ be _currentRealm_.[[GlobalEnv]]. + 1. Let _funcProto_ be ? GetPrototypeFromConstructor(_newTarget_, _fallbackProto_). + 1. Let _envRecord_ be _currentRealm_.[[GlobalEnv]]. 1. Let _privateEnv_ be *null*. - 1. Let _F_ be OrdinaryFunctionCreate(_proto_, _sourceText_, _parameters_, _body_, ~non-lexical-this~, _env_, _privateEnv_). - 1. Perform SetFunctionName(_F_, *"anonymous"*). + 1. Let _func_ be OrdinaryFunctionCreate(_funcProto_, _sourceText_, _params_, _body_, ~non-lexical-this~, _envRecord_, _privateEnv_). + 1. Perform SetFunctionName(_func_, *"anonymous"*). 1. If _kind_ is ~generator~, then - 1. Let _prototype_ be OrdinaryObjectCreate(%GeneratorFunction.prototype.prototype%). - 1. Perform ! DefinePropertyOrThrow(_F_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Let _protoProto_ be OrdinaryObjectCreate(%GeneratorPrototype%). + 1. Perform ! DefinePropertyOrThrow(_func_, *"prototype"*, PropertyDescriptor { [[Value]]: _protoProto_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Else if _kind_ is ~async-generator~, then - 1. Let _prototype_ be OrdinaryObjectCreate(%AsyncGeneratorFunction.prototype.prototype%). - 1. Perform ! DefinePropertyOrThrow(_F_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Let _protoProto_ be OrdinaryObjectCreate(%AsyncGeneratorPrototype%). + 1. Perform ! DefinePropertyOrThrow(_func_, *"prototype"*, PropertyDescriptor { [[Value]]: _protoProto_, [[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. Return _F_. + 1. Perform MakeConstructor(_func_). + 1. NOTE: Functions whose _kind_ is ~async~ are not constructable and do not have a [[Construct]] internal method or a *"prototype"* property. + 1. Return _func_.

        CreateDynamicFunction defines a *"prototype"* property on any function it creates whose _kind_ is not ~async~ to provide for the possibility that the function will be used as a constructor.

        @@ -30222,7 +31853,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,42 +31874,42 @@

        Function.prototype.apply ( _thisArg_, _argArray_ )

        - +

        Function.prototype.bind ( _thisArg_, ..._args_ )

        This method performs the following steps when called:

        - 1. Let _Target_ be the *this* value. - 1. If IsCallable(_Target_) is *false*, throw a *TypeError* exception. - 1. Let _F_ be ? BoundFunctionCreate(_Target_, _thisArg_, _args_). - 1. Let _L_ be 0. - 1. Let _targetHasLength_ be ? HasOwnProperty(_Target_, *"length"*). + 1. Let _target_ be the *this* value. + 1. If IsCallable(_target_) is *false*, throw a *TypeError* exception. + 1. Let _boundFunc_ be ? BoundFunctionCreate(_target_, _thisArg_, _args_). + 1. Let _length_ be 0. + 1. Let _targetHasLength_ be ? HasOwnProperty(_target_, *"length"*). 1. If _targetHasLength_ is *true*, then - 1. Let _targetLen_ be ? Get(_Target_, *"length"*). - 1. If _targetLen_ is a Number, then - 1. If _targetLen_ is *+∞*𝔽, then - 1. Set _L_ to +∞. - 1. Else if _targetLen_ is *-∞*𝔽, then - 1. Set _L_ to 0. + 1. Let _targetLength_ be ? Get(_target_, *"length"*). + 1. If _targetLength_ is a Number, then + 1. If _targetLength_ is *+∞*𝔽, then + 1. Set _length_ to +∞. + 1. Else if _targetLength_ is *-∞*𝔽, then + 1. Set _length_ to 0. 1. Else, - 1. Let _targetLenAsInt_ be ! ToIntegerOrInfinity(_targetLen_). - 1. Assert: _targetLenAsInt_ is finite. + 1. Let _targetLengthAsInt_ be ! ToIntegerOrInfinity(_targetLength_). + 1. Assert: _targetLengthAsInt_ is finite. 1. Let _argCount_ be the number of elements in _args_. - 1. Set _L_ to max(_targetLenAsInt_ - _argCount_, 0). - 1. Perform SetFunctionLength(_F_, _L_). - 1. Let _targetName_ be ? Get(_Target_, *"name"*). + 1. Set _length_ to max(_targetLengthAsInt_ - _argCount_, 0). + 1. Perform SetFunctionLength(_boundFunc_, _length_). + 1. Let _targetName_ be ? Get(_target_, *"name"*). 1. If _targetName_ is not a String, set _targetName_ to the empty String. - 1. Perform SetFunctionName(_F_, _targetName_, *"bound"*). - 1. Return _F_. + 1. Perform SetFunctionName(_boundFunc_, _targetName_, *"bound"*). + 1. Return _boundFunc_.

        Function objects created using `Function.prototype.bind` are exotic objects. They also do not have a *"prototype"* property.

        -

        If _Target_ is either an arrow function or a bound function exotic object, then the _thisArg_ passed to this method will not be used by subsequent calls to _F_.

        +

        If _target_ is either an arrow function or a bound function exotic object, then the _thisArg_ passed to this method will not be used by subsequent calls to _func_.

        - +

        Function.prototype.call ( _thisArg_, ..._args_ )

        This method performs the following steps when called:

        @@ -30300,14 +31931,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,24 +31953,24 @@

        Function.prototype.toString ( )

        - -

        Function.prototype [ @@hasInstance ] ( _V_ )

        + +

        Function.prototype [ %Symbol.hasInstance% ] ( _value_ )

        This method performs the following steps when called:

        - 1. Let _F_ be the *this* value. - 1. Return ? OrdinaryHasInstance(_F_, _V_). + 1. Let _thisValue_ be the *this* value. + 1. Return ? OrdinaryHasInstance(_thisValue_, _value_).

        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 +31990,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,15 +32035,15 @@

        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:

        - 1. Let _b_ be ToBoolean(_value_). - 1. If NewTarget is *undefined*, return _b_. - 1. Let _O_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%Boolean.prototype%"*, « [[BooleanData]] »). - 1. Set _O_.[[BooleanData]] to _b_. - 1. Return _O_. + 1. Let _bool_ be ToBoolean(_value_). + 1. If NewTarget is *undefined*, return _bool_. + 1. Let _obj_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%Boolean.prototype%"*, « [[BooleanData]] »). + 1. Set _obj_.[[BooleanData]] to _bool_. + 1. Return _obj_.
        @@ -30447,16 +32078,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. Let _bool_ be ? ThisBooleanValue(*this* value). + 1. If _bool_ is *true*, return *"true"*. + 1. Return *"false"*.
        - +

        Boolean.prototype.valueOf ( )

        This method performs the following steps when called:

        @@ -30466,17 +32098,17 @@

        Boolean.prototype.valueOf ( )

        ThisBooleanValue ( - _value_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing a Boolean or a throw completion

        - 1. If _value_ is a Boolean, return _value_. - 1. If _value_ is an Object and _value_ has a [[BooleanData]] internal slot, then - 1. Let _b_ be _value_.[[BooleanData]]. - 1. Assert: _b_ is a Boolean. - 1. Return _b_. + 1. If _arg_ is a Boolean, return _arg_. + 1. If _arg_ is an Object and _arg_ has a [[BooleanData]] internal slot, then + 1. Let _bool_ be _arg_.[[BooleanData]]. + 1. Assert: _bool_ is a Boolean. + 1. Return _bool_. 1. Throw a *TypeError* exception.
        @@ -30504,7 +32136,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,98 +32158,62 @@

        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. Let _agentRecord_ be the Agent Record of the surrounding agent. + 1. Let _globalSymbolRegistry_ be _agentRecord_.[[GlobalSymbolRegistry]]. + 1. For each element _element_ of _globalSymbolRegistry_, do + 1. If _element_.[[Key]] is _stringKey_, return _element_.[[Symbol]]. + 1. Assert: _globalSymbolRegistry_ 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 _globalSymbolRegistry_. 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 .

        - - - - - - - - - - - - - - - - - -
        - Field Name - - Value - - Usage -
        - [[Key]] - - a String - - A string key used to globally identify a Symbol. -
        - [[Symbol]] - - a Symbol - - A symbol that can be retrieved from any realm. -
        -

        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_ )

        + +

        Symbol.keyFor ( _symbol_ )

        This function performs the following steps when called:

        - 1. If _sym_ is not a Symbol, throw a *TypeError* exception. - 1. Return KeyForSymbol(_sym_). + 1. If _symbol_ is not a Symbol, throw a *TypeError* exception. + 1. Return KeyForSymbol(_symbol_).

        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 +32225,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,42 +32281,41 @@

        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:

        - 1. Let _s_ be the *this* value. - 1. Let _sym_ be ? ThisSymbolValue(_s_). - 1. Return _sym_.[[Description]]. + 1. Let _symbol_ be ? ThisSymbolValue(*this* value). + 1. Return _symbol_.[[Description]].
        - +

        Symbol.prototype.toString ( )

        This method performs the following steps when called:

        - 1. Let _sym_ be ? ThisSymbolValue(*this* value). - 1. Return SymbolDescriptiveString(_sym_). + 1. Let _symbol_ be ? ThisSymbolValue(*this* value). + 1. Return SymbolDescriptiveString(_symbol_).

        SymbolDescriptiveString ( - _sym_: a Symbol, + _symbol_: a Symbol, ): a String

        - 1. Let _desc_ be _sym_'s [[Description]] value. - 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 *")"*. + 1. Let _description_ be _symbol_.[[Description]]. + 1. If _description_ is *undefined*, set _description_ to the empty String. + 1. Assert: _description_ is a String. + 1. Return the string-concatenation of *"Symbol("*, _description_, and *")"*.
        - +

        Symbol.prototype.valueOf ( )

        This method performs the following steps when called:

        @@ -30730,24 +32325,24 @@

        Symbol.prototype.valueOf ( )

        ThisSymbolValue ( - _value_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing a Symbol or a throw completion

        - 1. If _value_ is a Symbol, return _value_. - 1. If _value_ is an Object and _value_ has a [[SymbolData]] internal slot, then - 1. Let _s_ be _value_.[[SymbolData]]. - 1. Assert: _s_ is a Symbol. - 1. Return _s_. + 1. If _arg_ is a Symbol, return _arg_. + 1. If _arg_ is an Object and _arg_ has a [[SymbolData]] internal slot, then + 1. Let _symbol_ be _arg_.[[SymbolData]]. + 1. Assert: _symbol_ is a Symbol. + 1. Return _symbol_. 1. Throw a *TypeError* exception.
        - -

        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 +32355,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* }.

        @@ -30775,20 +32370,49 @@

        Properties of Symbol Instances

        Abstract Operations for Symbols

        + +

        GlobalSymbolRegistry Records

        +

        A GlobalSymbolRegistry Record is a Record used to associate a String key with a Symbol value registered through Symbol.for.

        +

        GlobalSymbolRegistry Records have the fields listed in .

        + + + + + + + + + + + + + + + + + + + +
        Field NameValueUsage
        [[Key]]a StringA string key used to globally identify a Symbol.
        [[Symbol]]a SymbolA symbol that can be retrieved from any realm.
        +
        +
        +

        KeyForSymbol ( - _sym_: a Symbol, + _symbol_: a Symbol, ): a String or *undefined*

        description
        -
        If _sym_ is in the GlobalSymbolRegistry (see ) the String used to register _sym_ will be returned.
        +
        If _symbol_ is in the surrounding agent's [[GlobalSymbolRegistry]] List, the String used to register _symbol_ 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. Let _agentRecord_ be the Agent Record of the surrounding agent. + 1. Let _globalSymbolRegistry_ be _agentRecord_.[[GlobalSymbolRegistry]]. + 1. For each element _element_ of _globalSymbolRegistry_, do + 1. If SameValue(_element_.[[Symbol]], _symbol_) is *true*, return _element_.[[Key]]. + 1. Assert: _globalSymbolRegistry_ does not currently contain an entry for _symbol_. 1. Return *undefined*.
        @@ -30798,7 +32422,7 @@

        Error Objects

        Instances of Error objects are thrown as exceptions when runtime errors occur. The Error objects may also serve as base objects for user-defined exception classes.

        -

        When an ECMAScript implementation detects a runtime error, it throws a new instance of one of the _NativeError_ objects defined in or a new instance of the AggregateError object defined in .

        +

        When an ECMAScript implementation detects a runtime error, it throws a new instance of one of the _NativeError_ objects defined in or a new instance of either the AggregateError object defined in , or the SuppressedError object defined in . Each of these objects has the structure described below, differing only in the name used as the constructor name instead of _NativeError_, in the *"name"* property of the prototype object, in the implementation-defined *"message"* property of the prototype object, and in the presence of the %AggregateError%-specific *"errors"* property or the %SuppressedError%-specific *"error"* and *"suppressed"* properties.

        The Error Constructor

        @@ -30810,17 +32434,17 @@

        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:

        1. If NewTarget is *undefined*, let _newTarget_ be the active function object; else let _newTarget_ be NewTarget. - 1. Let _O_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%Error.prototype%"*, « [[ErrorData]] »). + 1. Let _obj_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%Error.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_. + 1. Let _messageString_ be ? ToString(_message_). + 1. Perform CreateNonEnumerableDataPropertyOrThrow(_obj_, *"message"*, _messageString_). + 1. Perform ? InstallErrorCause(_obj_, _options_). + 1. Return _obj_.
        @@ -30833,6 +32457,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,31 +32499,31 @@

        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. 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 _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_. + 1. Let _obj_ be the *this* value. + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. Let _name_ be ? Get(_obj_, *"name"*). + 1. If _name_ is *undefined*, set _name_ to *"Error"*; else set _name_ to ? ToString(_name_). + 1. Let _message_ be ? Get(_obj_, *"message"*). + 1. If _message_ is *undefined*, set _message_ to the empty String; else set _message_ to ? ToString(_message_). + 1. If _name_ is the empty String, return _message_. + 1. If _message_ is the empty String, return _name_. + 1. Return the string-concatenation of _name_, the code unit 0x003A (COLON), the code unit 0x0020 (SPACE), and _message_.

        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, SuppressedError, and _NativeError_ instances as Error objects within `Object.prototype.toString` and `Error.isError`.

        Native Error Types Used in This Standard

        -

        A new instance of one of the _NativeError_ objects below or of the AggregateError object is thrown when a runtime error is detected. All _NativeError_ objects share the same structure, as described in .

        +

        A new instance of one of the _NativeError_ objects below or of either the AggregateError object or SuppressedError object is thrown when a runtime error is detected. All _NativeError_ objects share the same structure, as described in .

        EvalError

        @@ -30941,19 +32575,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 _obj_ 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_. + 1. Let _messageString_ be ? ToString(_message_). + 1. Perform CreateNonEnumerableDataPropertyOrThrow(_obj_, *"message"*, _messageString_). + 1. Perform ? InstallErrorCause(_obj_, _options_). + 1. Return _obj_. -

        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 +32634,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, SuppressedError, or _NativeError_ instances.

        @@ -31017,19 +32651,19 @@

        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:

        1. If NewTarget is *undefined*, let _newTarget_ be the active function object; else let _newTarget_ be NewTarget. - 1. Let _O_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%AggregateError.prototype%"*, « [[ErrorData]] »). + 1. Let _obj_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%AggregateError.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. Let _messageString_ be ? ToString(_message_). + 1. Perform CreateNonEnumerableDataPropertyOrThrow(_obj_, *"message"*, _messageString_). + 1. Perform ? InstallErrorCause(_obj_, _options_). 1. Let _errorsList_ be ? IteratorToList(? GetIterator(_errors_, ~sync~)). - 1. Perform ! DefinePropertyOrThrow(_O_, *"errors"*, PropertyDescriptor { [[Configurable]]: *true*, [[Enumerable]]: *false*, [[Writable]]: *true*, [[Value]]: CreateArrayFromList(_errorsList_) }). - 1. Return _O_. + 1. Perform ! DefinePropertyOrThrow(_obj_, *"errors"*, PropertyDescriptor { [[Configurable]]: *true*, [[Enumerable]]: *false*, [[Writable]]: *true*, [[Value]]: CreateArrayFromList(_errorsList_) }). + 1. Return _obj_.
        @@ -31077,7 +32711,83 @@

        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, SuppressedError, or _NativeError_ instances.

        +
        +
        + + +

        SuppressedError Objects

        + + +

        The SuppressedError Constructor

        +

        The SuppressedError constructor:

        +
          +
        • is %SuppressedError%.
        • +
        • is the initial value of the *"SuppressedError"* property of the global object.
        • +
        • creates and initializes a new SuppressedError object when called as a function rather than as a constructor. Thus the function call `SuppressedError(…)` is equivalent to the object creation expression `new SuppressedError(…)` with the same arguments.
        • +
        • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified SuppressedError behaviour must include a `super` call to the SuppressedError constructor to create and initialize subclass instances with an [[ErrorData]] internal slot.
        • +
        + + +

        SuppressedError ( _error_, _suppressed_, _message_ )

        +

        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 _obj_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%SuppressedError.prototype%"*, « [[ErrorData]] »). + 1. If _message_ is not *undefined*, then + 1. Let _messageString_ be ? ToString(_message_). + 1. Perform CreateNonEnumerableDataPropertyOrThrow(_obj_, *"message"*, _messageString_). + 1. Perform CreateNonEnumerableDataPropertyOrThrow(_obj_, *"error"*, _error_). + 1. Perform CreateNonEnumerableDataPropertyOrThrow(_obj_, *"suppressed"*, _suppressed_). + 1. Return _obj_. + +
        +
        + + +

        Properties of the SuppressedError Constructor

        +

        The SuppressedError constructor:

        +
          +
        • has a [[Prototype]] internal slot whose value is %Error%.
        • +
        • has the following properties:
        • +
        + + +

        SuppressedError.prototype

        +

        The initial value of `SuppressedError.prototype` is the SuppressedError prototype object.

        +

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        +
        +
        + + +

        Properties of the SuppressedError Prototype Object

        +

        The SuppressedError prototype object:

        +
          +
        • is %SuppressedError.prototype%.
        • +
        • is an ordinary object.
        • +
        • is not an Error instance or a SuppressedError instance and does not have an [[ErrorData]] internal slot.
        • +
        • has a [[Prototype]] internal slot whose value is %Error.prototype%.
        • +
        + + +

        SuppressedError.prototype.constructor

        +

        The initial value of `SuppressedError.prototype.constructor` is %SuppressedError%.

        +
        + + +

        SuppressedError.prototype.message

        +

        The initial value of `SuppressedError.prototype.message` is the empty String.

        +
        + + +

        SuppressedError.prototype.name

        +

        The initial value of `SuppressedError.prototype.name` is *"SuppressedError"*.

        +
        +
        + + +

        Properties of SuppressedError Instances

        +

        SuppressedError instances are ordinary objects that inherit properties from their SuppressedError prototype object and have an [[ErrorData]] internal slot whose value is *undefined*. The only specified use of [[ErrorData]] is to identify Error, AggregateError, SuppressedError, and _NativeError_ instances as Error objects within `Object.prototype.toString` and `Error.isError`.

        @@ -31087,18 +32797,18 @@

        Abstract Operations for Error Objects

        InstallErrorCause ( - _O_: an Object, + _obj_: an Object, _options_: an ECMAScript language value, ): either a normal completion containing ~unused~ or a throw completion

        description
        -
        It is used to create a *"cause"* property on _O_ when a *"cause"* property is present on _options_.
        +
        It is used to create a *"cause"* property on _obj_ when a *"cause"* property is present on _options_.
        1. If _options_ is an Object and ? HasProperty(_options_, *"cause"*) is *true*, then 1. Let _cause_ be ? Get(_options_, *"cause"*). - 1. Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"cause"*, _cause_). + 1. Perform CreateNonEnumerableDataPropertyOrThrow(_obj_, *"cause"*, _cause_). 1. Return ~unused~.
        @@ -31123,20 +32833,20 @@

        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. Let _primitive_ be ? ToNumeric(_value_). + 1. If _primitive_ is a BigInt, let _n_ be 𝔽(ℝ(_primitive_)). + 1. Else, let _n_ be _primitive_. 1. Else, 1. Let _n_ be *+0*𝔽. 1. If NewTarget is *undefined*, return _n_. - 1. Let _O_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%Number.prototype%"*, « [[NumberData]] »). - 1. Set _O_.[[NumberData]] to _n_. - 1. Return _O_. + 1. Let _obj_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%Number.prototype%"*, « [[NumberData]] »). + 1. Set _obj_.[[NumberData]] to _n_. + 1. Return _obj_.
        @@ -31155,45 +32865,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.

        +

        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 +32953,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,90 +32993,90 @@

        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:

        - 1. Let _x_ be ? ThisNumberValue(*this* value). - 1. Let _f_ be ? ToIntegerOrInfinity(_fractionDigits_). - 1. Assert: If _fractionDigits_ is *undefined*, then _f_ is 0. - 1. If _x_ is not finite, return Number::toString(_x_, 10). - 1. If _f_ < 0 or _f_ > 100, throw a *RangeError* exception. - 1. Set _x_ to ℝ(_x_). - 1. Let _s_ be the empty String. - 1. If _x_ < 0, then - 1. Set _s_ to *"-"*. - 1. Set _x_ to -_x_. - 1. If _x_ = 0, then - 1. Let _m_ be the String value consisting of _f_ + 1 occurrences of the code unit 0x0030 (DIGIT ZERO). - 1. Let _e_ be 0. + 1. Let _number_ be ? ThisNumberValue(*this* value). + 1. Let _fractionCount_ be ? ToIntegerOrInfinity(_fractionDigits_). + 1. Assert: If _fractionDigits_ is *undefined*, then _fractionCount_ is 0. + 1. If _number_ is not finite, return Number::toString(_number_, 10). + 1. If _fractionCount_ < 0 or _fractionCount_ > 100, throw a *RangeError* exception. + 1. Set _number_ to ℝ(_number_). + 1. Let _sign_ be the empty String. + 1. If _number_ < 0, then + 1. Set _sign_ to *"-"*. + 1. Set _number_ to -_number_. + 1. If _number_ = 0, then + 1. Let _significand_ be the String value consisting of _fractionCount_ + 1 occurrences of the code unit 0x0030 (DIGIT ZERO). + 1. Let _exponent_ be 0. 1. Else, 1. If _fractionDigits_ is not *undefined*, then - 1. Let _e_ and _n_ be integers such that 10_f_ ≤ _n_ < 10_f_ + 1 and for which _n_ × 10_e_ - _f_ - _x_ is as close to zero as possible. If there are two such sets of _e_ and _n_, pick the _e_ and _n_ for which _n_ × 10_e_ - _f_ is larger. + 1. Let _exponent_ and _intSignificand_ be integers such that 10_fractionCount_ ≤ _intSignificand_ < 10_fractionCount_ + 1 and for which _intSignificand_ × 10_exponent_ - _fractionCount_ - _number_ is as close to zero as possible. If there are two such sets of _exponent_ and _intSignificand_, pick the _exponent_ and _intSignificand_ for which _intSignificand_ × 10_exponent_ - _fractionCount_ is larger. 1. Else, - 1. [id="step-number-proto-toexponential-intermediate-values"] 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. Note that the decimal representation of _n_ has _ff_ + 1 digits, _n_ is not divisible by 10, and the least significant digit of _n_ is not necessarily uniquely determined by these criteria. - 1. Set _f_ to _ff_. - 1. 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 _a_ be the first code unit of _m_. - 1. Let _b_ be the other _f_ code units of _m_. - 1. Set _m_ to the string-concatenation of _a_, *"."*, and _b_. - 1. If _e_ = 0, then - 1. Let _c_ be *"+"*. - 1. Let _d_ be *"0"*. + 1. [id="step-number-proto-toexponential-intermediate-values"] Let _exponent_, _intSignificand_, and _ff_ be integers such that _ff_ ≥ 0, 10_ff_ ≤ _intSignificand_ < 10_ff_ + 1, 𝔽(_intSignificand_ × 10_exponent_ - _ff_) is 𝔽(_number_), and _ff_ is as small as possible. Note that the decimal representation of _intSignificand_ has _ff_ + 1 digits, _intSignificand_ is not divisible by 10, and the least significant digit of _intSignificand_ is not necessarily uniquely determined by these criteria. + 1. Set _fractionCount_ to _ff_. + 1. Let _significand_ be the String value consisting of the digits of the decimal representation of _intSignificand_ (in order, with no leading zeroes). + 1. If _fractionCount_ ≠ 0, then + 1. Let _intPart_ be the first code unit of _significand_. + 1. Let _fractionalPart_ be the other _fractionCount_ code units of _significand_. + 1. Set _significand_ to the string-concatenation of _intPart_, *"."*, and _fractionalPart_. + 1. If _exponent_ = 0, then + 1. Let _exponentSign_ be *"+"*. + 1. Let _exponentDigits_ be *"0"*. 1. Else, - 1. If _e_ > 0, then - 1. Let _c_ be *"+"*. + 1. If _exponent_ > 0, then + 1. Let _exponentSign_ be *"+"*. 1. Else, - 1. Assert: _e_ < 0. - 1. Let _c_ be *"-"*. - 1. Set _e_ to -_e_. - 1. Let _d_ be the String value consisting of the digits of the decimal representation of _e_ (in order, with no leading zeroes). - 1. Set _m_ to the string-concatenation of _m_, *"e"*, _c_, and _d_. - 1. Return the string-concatenation of _s_ and _m_. + 1. Assert: _exponent_ < 0. + 1. Let _exponentSign_ be *"-"*. + 1. Set _exponent_ to -_exponent_. + 1. Let _exponentDigits_ be the String value consisting of the digits of the decimal representation of _exponent_ (in order, with no leading zeroes). + 1. Set _significand_ to the string-concatenation of _significand_, *"e"*, _exponentSign_, and _exponentDigits_. + 1. Return the string-concatenation of _sign_ and _significand_.

        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 _exponent_, _intSignificand_, and _ff_ be integers such that _ff_ ≥ 0, 10_ff_ ≤ _intSignificand_ < 10_ff_ + 1, 𝔽(_intSignificand_ × 10_exponent_ - _ff_) is 𝔽(_number_), and _ff_ is as small as possible. If there are multiple possibilities for _intSignificand_, choose _intSignificand_ such that 𝔽(_intSignificand_ × 10_exponent_ - _ff_) is closest to 𝔽(_number_). If there are two such possible values of _intSignificand_, 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.

        It performs the following steps when called:

        - 1. Let _x_ be ? ThisNumberValue(*this* value). - 1. Let _f_ be ? ToIntegerOrInfinity(_fractionDigits_). - 1. Assert: If _fractionDigits_ is *undefined*, then _f_ is 0. - 1. If _f_ is not finite, throw a *RangeError* exception. - 1. If _f_ < 0 or _f_ > 100, throw a *RangeError* exception. - 1. If _x_ is not finite, return Number::toString(_x_, 10). - 1. Set _x_ to ℝ(_x_). - 1. Let _s_ be the empty String. - 1. If _x_ < 0, then - 1. Set _s_ to *"-"*. - 1. Set _x_ to -_x_. - 1. If _x_ ≥ 1021, then - 1. Let _m_ be ! ToString(𝔽(_x_)). + 1. Let _number_ be ? ThisNumberValue(*this* value). + 1. Let _fractionCount_ be ? ToIntegerOrInfinity(_fractionDigits_). + 1. Assert: If _fractionDigits_ is *undefined*, then _fractionCount_ is 0. + 1. If _fractionCount_ is not finite, throw a *RangeError* exception. + 1. If _fractionCount_ < 0 or _fractionCount_ > 100, throw a *RangeError* exception. + 1. If _number_ is not finite, return Number::toString(_number_, 10). + 1. Set _number_ to ℝ(_number_). + 1. Let _sign_ be the empty String. + 1. If _number_ < 0, then + 1. Set _sign_ to *"-"*. + 1. Set _number_ to -_number_. + 1. If _number_ ≥ 1021, then + 1. Let _digitString_ be ! ToString(𝔽(_number_)). 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 _f_ ≠ 0, then - 1. Let _k_ be the length of _m_. - 1. If _k_ ≤ _f_, then - 1. Let _z_ be the String value consisting of _f_ + 1 - _k_ occurrences of the code unit 0x0030 (DIGIT ZERO). - 1. Set _m_ to the string-concatenation of _z_ and _m_. - 1. Set _k_ to _f_ + 1. - 1. Let _a_ be the first _k_ - _f_ code units of _m_. - 1. Let _b_ be the other _f_ code units of _m_. - 1. Set _m_ to the string-concatenation of _a_, *"."*, and _b_. - 1. Return the string-concatenation of _s_ and _m_. + 1. Let _intValue_ be an integer for which _intValue_ / 10_fractionCount_ - _number_ is as close to zero as possible. If there are two such _intValue_, pick the larger _intValue_. + 1. If _intValue_ = 0, let _digitString_ be *"0"*; else let _digitString_ be the String value consisting of the digits of the decimal representation of _intValue_ (in order, with no leading zeroes). + 1. If _fractionCount_ ≠ 0, then + 1. Let _digitCount_ be the length of _digitString_. + 1. If _digitCount_ ≤ _fractionCount_, then + 1. Let _zeroPad_ be the String value consisting of _fractionCount_ + 1 - _digitCount_ occurrences of the code unit 0x0030 (DIGIT ZERO). + 1. Set _digitString_ to the string-concatenation of _zeroPad_ and _digitString_. + 1. Set _digitCount_ to _fractionCount_ + 1. + 1. Let _intPart_ be the first _digitCount_ - _fractionCount_ code units of _digitString_. + 1. Let _fractionalPart_ be the other _fractionCount_ code units of _digitString_. + 1. Set _digitString_ to the string-concatenation of _intPart_, *"."*, and _fractionalPart_. + 1. Return the string-concatenation of _sign_ and _digitString_.

        The output of `toFixed` may be more precise than `toString` for some values because toString only prints enough significant digits to distinguish the number from adjacent Number values. For example,

        @@ -31376,58 +33087,58 @@

        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:

        - 1. Let _x_ be ? ThisNumberValue(*this* value). - 1. If _precision_ is *undefined*, return ! ToString(_x_). - 1. Let _p_ be ? ToIntegerOrInfinity(_precision_). - 1. If _x_ is not finite, return Number::toString(_x_, 10). - 1. If _p_ < 1 or _p_ > 100, throw a *RangeError* exception. - 1. Set _x_ to ℝ(_x_). - 1. Let _s_ be the empty String. - 1. If _x_ < 0, then - 1. Set _s_ to the code unit 0x002D (HYPHEN-MINUS). - 1. Set _x_ to -_x_. - 1. If _x_ = 0, then - 1. Let _m_ be the String value consisting of _p_ occurrences of the code unit 0x0030 (DIGIT ZERO). - 1. Let _e_ be 0. + 1. Let _number_ be ? ThisNumberValue(*this* value). + 1. If _precision_ is *undefined*, return ! ToString(_number_). + 1. Let _precisionCount_ be ? ToIntegerOrInfinity(_precision_). + 1. If _number_ is not finite, return Number::toString(_number_, 10). + 1. If _precisionCount_ < 1 or _precisionCount_ > 100, throw a *RangeError* exception. + 1. Set _number_ to ℝ(_number_). + 1. Let _sign_ be the empty String. + 1. If _number_ < 0, then + 1. Set _sign_ to the code unit 0x002D (HYPHEN-MINUS). + 1. Set _number_ to -_number_. + 1. If _number_ = 0, then + 1. Let _significand_ be the String value consisting of _precisionCount_ occurrences of the code unit 0x0030 (DIGIT ZERO). + 1. Let _exponent_ be 0. 1. Else, - 1. Let _e_ and _n_ be integers such that 10_p_ - 1 ≤ _n_ < 10_p_ and for which _n_ × 10_e_ - _p_ + 1 - _x_ is as close to zero as possible. If there are two such sets of _e_ and _n_, pick the _e_ and _n_ for which _n_ × 10_e_ - _p_ + 1 is larger. - 1. Let _m_ be the String value consisting of the digits of the decimal representation of _n_ (in order, with no leading zeroes). - 1. If _e_ < -6 or _e_ ≥ _p_, then - 1. Assert: _e_ ≠ 0. - 1. If _p_ ≠ 1, then - 1. Let _a_ be the first code unit of _m_. - 1. Let _b_ be the other _p_ - 1 code units of _m_. - 1. Set _m_ to the string-concatenation of _a_, *"."*, and _b_. - 1. If _e_ > 0, then - 1. Let _c_ be the code unit 0x002B (PLUS SIGN). + 1. Let _exponent_ and _intSignificand_ be integers such that 10_precisionCount_ - 1 ≤ _intSignificand_ < 10_precisionCount_ and for which _intSignificand_ × 10_exponent_ - _precisionCount_ + 1 - _number_ is as close to zero as possible. If there are two such sets of _exponent_ and _intSignificand_, pick the _exponent_ and _intSignificand_ for which _intSignificand_ × 10_exponent_ - _precisionCount_ + 1 is larger. + 1. Let _significand_ be the String value consisting of the digits of the decimal representation of _intSignificand_ (in order, with no leading zeroes). + 1. If _exponent_ < -6 or _exponent_ ≥ _precisionCount_, then + 1. Assert: _exponent_ ≠ 0. + 1. If _precisionCount_ ≠ 1, then + 1. Let _intPart_ be the first code unit of _significand_. + 1. Let _fractionalPart_ be the other _precisionCount_ - 1 code units of _significand_. + 1. Set _significand_ to the string-concatenation of _intPart_, *"."*, and _fractionalPart_. + 1. If _exponent_ > 0, then + 1. Let _exponentSign_ be the code unit 0x002B (PLUS SIGN). 1. Else, - 1. Assert: _e_ < 0. - 1. Let _c_ be the code unit 0x002D (HYPHEN-MINUS). - 1. Set _e_ to -_e_. - 1. Let _d_ be the String value consisting of the digits of the decimal representation of _e_ (in order, with no leading zeroes). - 1. Return the string-concatenation of _s_, _m_, the code unit 0x0065 (LATIN SMALL LETTER E), _c_, and _d_. - 1. If _e_ = _p_ - 1, return the string-concatenation of _s_ and _m_. - 1. If _e_ ≥ 0, then - 1. Set _m_ to the string-concatenation of the first _e_ + 1 code units of _m_, the code unit 0x002E (FULL STOP), and the remaining _p_ - (_e_ + 1) code units of _m_. + 1. Assert: _exponent_ < 0. + 1. Let _exponentSign_ be the code unit 0x002D (HYPHEN-MINUS). + 1. Set _exponent_ to -_exponent_. + 1. Let _exponentDigits_ be the String value consisting of the digits of the decimal representation of _exponent_ (in order, with no leading zeroes). + 1. Return the string-concatenation of _sign_, _significand_, the code unit 0x0065 (LATIN SMALL LETTER E), _exponentSign_, and _exponentDigits_. + 1. If _exponent_ = _precisionCount_ - 1, return the string-concatenation of _sign_ and _significand_. + 1. If _exponent_ ≥ 0, then + 1. Set _significand_ to the string-concatenation of the first _exponent_ + 1 code units of _significand_, the code unit 0x002E (FULL STOP), and the remaining _precisionCount_ - (_exponent_ + 1) code units of _significand_. 1. Else, - 1. Set _m_ to the string-concatenation of the code unit 0x0030 (DIGIT ZERO), the code unit 0x002E (FULL STOP), -(_e_ + 1) occurrences of the code unit 0x0030 (DIGIT ZERO), and the String _m_. - 1. Return the string-concatenation of _s_ and _m_. + 1. Set _significand_ to the string-concatenation of the code unit 0x0030 (DIGIT ZERO), the code unit 0x002E (FULL STOP), -(_exponent_ + 1) occurrences of the code unit 0x0030 (DIGIT ZERO), and the String _significand_. + 1. Return the string-concatenation of _sign_ and _significand_.
        - +

        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 +33155,7 @@

        Number.prototype.toString ( [ _radix_ ] )

        The *"length"* property of this method is *1*𝔽.

        - +

        Number.prototype.valueOf ( )

        1. Return ? ThisNumberValue(*this* value). @@ -31453,17 +33164,17 @@

        Number.prototype.valueOf ( )

        ThisNumberValue ( - _value_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing a Number or a throw completion

        - 1. If _value_ is a Number, return _value_. - 1. If _value_ is an Object and _value_ has a [[NumberData]] internal slot, then - 1. Let _n_ be _value_.[[NumberData]]. - 1. Assert: _n_ is a Number. - 1. Return _n_. + 1. If _arg_ is a Number, return _arg_. + 1. If _arg_ is an Object and _arg_ has a [[NumberData]] internal slot, then + 1. Let _number_ be _arg_.[[NumberData]]. + 1. Assert: _number_ is a Number. + 1. Return _number_. 1. Throw a *TypeError* exception.
        @@ -31489,14 +33200,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. Let _primitive_ be ? ToPrimitive(_value_, ~number~). + 1. If _primitive_ is a Number, return ? NumberToBigInt(_primitive_). + 1. Return ? ToBigInt(_primitive_). @@ -31508,7 +33219,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 +33234,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. Let _remainder_ be ℝ(_bigint_) modulo 2_bits_. + 1. If _remainder_ ≥ 2_bits_ - 1, return ℤ(_remainder_ - 2_bits_). + 1. Return ℤ(_remainder_).
        - +

        BigInt.asUintN ( _bits_, _bigint_ )

        This function performs the following steps when called:

        @@ -31567,14 +33279,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 +33302,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). @@ -31599,24 +33311,24 @@

        BigInt.prototype.valueOf ( )

        ThisBigIntValue ( - _value_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing a BigInt or a throw completion

        - 1. If _value_ is a BigInt, return _value_. - 1. If _value_ is an Object and _value_ has a [[BigIntData]] internal slot, then - 1. Assert: _value_.[[BigIntData]] is a BigInt. - 1. Return _value_.[[BigIntData]]. + 1. If _arg_ is a BigInt, return _arg_. + 1. If _arg_ is an Object and _arg_ has a [[BigIntData]] internal slot, then + 1. Assert: _arg_.[[BigIntData]] is a BigInt. + 1. Return _arg_.[[BigIntData]]. 1. Throw a *TypeError* exception.
        - -

        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 +33415,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 +33425,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 +33443,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 +33451,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 +33464,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 +33476,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 +33500,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 +33514,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:

        @@ -31838,28 +33550,28 @@

        Math.atan2 ( _y_, _x_ )

        1. If _nx_ is *-∞*𝔽, return an implementation-approximated Number value representing -π. 1. If _nx_ is either *+0*𝔽 or *-0*𝔽, return an implementation-approximated Number value representing -π / 2. 1. Assert: _nx_ is finite and is neither *+0*𝔽 nor *-0*𝔽. - 1. Let _r_ be the inverse tangent of abs(ℝ(_ny_) / ℝ(_nx_)). + 1. Let _result_ be the inverse tangent of abs(ℝ(_ny_) / ℝ(_nx_)). 1. If _nx_ < *-0*𝔽, then - 1. If _ny_ > *+0*𝔽, set _r_ to π - _r_. - 1. Else, set _r_ to -π + _r_. + 1. If _ny_ > *+0*𝔽, set _result_ to π - _result_. + 1. Else, set _result_ to -π + _result_. 1. Else, - 1. If _ny_ < *-0*𝔽, set _r_ to -_r_. - 1. Return an implementation-approximated Number value representing _r_. + 1. If _ny_ < *-0*𝔽, set _result_ to -_result_. + 1. Return an implementation-approximated Number value representing _result_.
        - +

        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 +33587,7 @@

        Math.ceil ( _x_ )

        - +

        Math.clz32 ( _x_ )

        This function performs the following steps when called:

        @@ -31888,7 +33600,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 +33608,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 +33621,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 +33637,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 +33649,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 +33670,7 @@

        Math.floor ( _x_ )

        - +

        Math.fround ( _x_ )

        This function performs the following steps when called:

        @@ -31970,7 +33683,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 +33724,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 +33746,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 +33759,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 +33773,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 +33787,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 +33813,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:

        @@ -32099,12 +33830,12 @@

        Math.min ( ..._args_ )

        1. Return _lowest_. -

        The comparison of values to determine the largest value is done using the IsLessThan algorithm except that *+0*𝔽 is considered to be larger than *-0*𝔽.

        +

        The comparison of values to determine the smallest value is done using the IsLessThan algorithm except that *+0*𝔽 is considered to be larger than *-0*𝔽.

        The *"length"* property of this function is *2*𝔽.

        - +

        Math.pow ( _base_, _exponent_ )

        This function performs the following steps when called:

        @@ -32114,13 +33845,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 +33866,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 +33882,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 +33890,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 +33916,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 +33974,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 +33987,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:

        @@ -32242,7 +34019,7 @@

        Overview of Date Objects and Definitions of Abstract Operations

        Time Values and Time Range

        Time measurement in ECMAScript is analogous to time measurement in POSIX, in particular sharing definition in terms of the proleptic Gregorian calendar, an epoch of midnight at the beginning of 1 January 1970 UTC, and an accounting of every day as comprising exactly 86,400 seconds (each of which is 1000 milliseconds long).

        -

        An ECMAScript time value is a Number, either a finite integral Number representing an instant in time to millisecond precision or *NaN* representing no specific instant. A time value that is a multiple of 24 × 60 × 60 × 1000 = 86,400,000 (i.e., is 86,400,000 × _d_ for some integer _d_) represents the instant at the start of the UTC day that follows the epoch by _d_ whole UTC days (preceding the epoch for negative _d_). Every other finite time value _t_ is defined relative to the greatest preceding time value _s_ that is such a multiple, and represents the instant that occurs within the same UTC day as _s_ but follows it by (_t_ - _s_) milliseconds.

        +

        An ECMAScript time value is a Number, either a finite integral Number representing an instant in time to millisecond precision or *NaN* representing no specific instant. A time value that is a multiple of 24 × 60 × 60 × 1000 = 86,400,000 (i.e., is 86,400,000 × _d_ for some integer _d_) represents the instant at the start of the UTC day that follows the epoch by _d_ whole UTC days (preceding the epoch for negative _d_). Every other finite time value _tv_ is defined relative to the greatest preceding time value _s_ that is such a multiple, and represents the instant that occurs within the same UTC day as _s_ but follows it by (_tv_ - _s_) milliseconds.

        Time values do not account for UTC leap seconds—there are no time values representing instants within positive leap seconds, and there are time values representing instants removed from the UTC timeline by negative leap seconds. However, the definition of time values nonetheless yields piecewise alignment with UTC, with discontinuities only at leap second boundaries and zero difference outside of leap seconds.

        A Number can exactly represent all integers from -9,007,199,254,740,992 to 9,007,199,254,740,992 ( and ). A time value supports a slightly smaller range of -8,640,000,000,000,000 to 8,640,000,000,000,000 milliseconds. This yields a supported time value range of exactly -100,000,000 days to 100,000,000 days relative to midnight at the beginning of 1 January 1970 UTC.

        The exact moment of midnight at the beginning of 1 January 1970 UTC is represented by the time value *+0*𝔽.

        @@ -32267,30 +34044,30 @@

        Time-related Constants

        Day ( - _t_: a finite time value, + _tv_: a finite time value, ): an integral Number

        description
        -
        It returns the day number of the day in which _t_ falls.
        +
        It returns the day number of the day in which _tv_ falls.
        - 1. Return 𝔽(floor(ℝ(_t_ / msPerDay))). + 1. Return 𝔽(floor(ℝ(_tv_ / msPerDay))).

        TimeWithinDay ( - _t_: a finite time value, + _tv_: a finite time value, ): an integral Number in the interval from *+0*𝔽 (inclusive) to msPerDay (exclusive)

        description
        -
        It returns the number of milliseconds since the start of the day in which _t_ falls.
        +
        It returns the number of milliseconds since the start of the day in which _tv_ falls.
        - 1. Return 𝔽(ℝ(_t_) modulo ℝ(msPerDay)). + 1. Return 𝔽(ℝ(_tv_) modulo ℝ(msPerDay)).
        @@ -32325,12 +34102,12 @@

        1. Let _ry_ be ℝ(_y_). - 1. [declared="numYears1,numYears4,numYears100,numYears400"] NOTE: In the following steps, _numYears1_, _numYears4_, _numYears100_, and _numYears400_ represent the number of years divisible by 1, 4, 100, and 400, respectively, that occur between the epoch and the start of year _y_. The number is negative if _y_ is before the epoch. - 1. Let _numYears1_ be (_ry_ - 1970). - 1. Let _numYears4_ be floor((_ry_ - 1969) / 4). - 1. Let _numYears100_ be floor((_ry_ - 1901) / 100). - 1. Let _numYears400_ be floor((_ry_ - 1601) / 400). - 1. Return 𝔽(365 × _numYears1_ + _numYears4_ - _numYears100_ + _numYears400_). + 1. [declared="numberYears1,numberYears4,numberYears100,numberYears400"] NOTE: In the following steps, _numberYears1_, _numberYears4_, _numberYears100_, and _numberYears400_ represent the number of years divisible by 1, 4, 100, and 400, respectively, that occur between the epoch and the start of year _y_. The number is negative if _y_ is before the epoch. + 1. Let _numberYears1_ be (_ry_ - 1970). + 1. Let _numberYears4_ be floor((_ry_ - 1969) / 4). + 1. Let _numberYears100_ be floor((_ry_ - 1901) / 100). + 1. Let _numberYears400_ be floor((_ry_ - 1601) / 400). + 1. Return 𝔽(365 × _numberYears1_ + _numberYears4_ - _numberYears100_ + _numberYears400_). @@ -32352,59 +34129,60 @@

        YearFromTime ( - _t_: a finite time value, + _tv_: a finite time value, ): an integral Number

        description
        -
        It returns the year in which _t_ falls.
        +
        It returns the year in which _tv_ falls.
        - 1. [declared="y"] Return the largest integral Number _y_ (closest to +∞) such that TimeFromYear(_y_) ≤ _t_. + 1. [declared="y"] Return the largest integral Number _y_ (closest to +∞) such that TimeFromYear(_y_) ≤ _tv_.

        DayWithinYear ( - _t_: a finite time value, + _tv_: a finite time value, ): an integral Number in the inclusive interval from *+0*𝔽 to *365*𝔽

        - 1. Return Day(_t_) - DayFromYear(YearFromTime(_t_)). + 1. Return Day(_tv_) - DayFromYear(YearFromTime(_tv_)).

        InLeapYear ( - _t_: a finite time value, + _tv_: a finite time value, ): *+0*𝔽 or *1*𝔽

        description
        -
        It returns *1*𝔽 if _t_ is within a leap year and *+0*𝔽 otherwise.
        +
        It returns *1*𝔽 if _tv_ is within a leap year and *+0*𝔽 otherwise.
        - 1. If DaysInYear(YearFromTime(_t_)) is *366*𝔽, return *1*𝔽; else return *+0*𝔽. + 1. If DaysInYear(YearFromTime(_tv_)) is *366*𝔽, return *1*𝔽. + 1. Return *+0*𝔽.

        MonthFromTime ( - _t_: a finite time value, + _tv_: a finite time value, ): an integral Number in the inclusive interval from *+0*𝔽 to *11*𝔽

        description
        -
        It returns a Number identifying the month in which _t_ falls. A month value of *+0*𝔽 specifies January; *1*𝔽 specifies February; *2*𝔽 specifies March; *3*𝔽 specifies April; *4*𝔽 specifies May; *5*𝔽 specifies June; *6*𝔽 specifies July; *7*𝔽 specifies August; *8*𝔽 specifies September; *9*𝔽 specifies October; *10*𝔽 specifies November; and *11*𝔽 specifies December. Note that MonthFromTime(*+0*𝔽) = *+0*𝔽, corresponding to Thursday, 1 January 1970.
        +
        It returns a Number identifying the month in which _tv_ falls. A month value of *+0*𝔽 specifies January; *1*𝔽 specifies February; *2*𝔽 specifies March; *3*𝔽 specifies April; *4*𝔽 specifies May; *5*𝔽 specifies June; *6*𝔽 specifies July; *7*𝔽 specifies August; *8*𝔽 specifies September; *9*𝔽 specifies October; *10*𝔽 specifies November; and *11*𝔽 specifies December. Note that MonthFromTime(*+0*𝔽) = *+0*𝔽, corresponding to Thursday, 1 January 1970.
        - 1. Let _inLeapYear_ be InLeapYear(_t_). - 1. Let _dayWithinYear_ be DayWithinYear(_t_). + 1. Let _inLeapYear_ be InLeapYear(_tv_). + 1. Let _dayWithinYear_ be DayWithinYear(_tv_). 1. If _dayWithinYear_ < *31*𝔽, return *+0*𝔽. 1. If _dayWithinYear_ < *59*𝔽 + _inLeapYear_, return *1*𝔽. 1. If _dayWithinYear_ < *90*𝔽 + _inLeapYear_, return *2*𝔽. @@ -32424,17 +34202,17 @@

        DateFromTime ( - _t_: a finite time value, + _tv_: a finite time value, ): an integral Number in the inclusive interval from *1*𝔽 to *31*𝔽

        description
        -
        It returns the day of the month in which _t_ falls.
        +
        It returns the day of the month in which _tv_ falls.
        - 1. Let _inLeapYear_ be InLeapYear(_t_). - 1. Let _dayWithinYear_ be DayWithinYear(_t_). - 1. Let _month_ be MonthFromTime(_t_). + 1. Let _inLeapYear_ be InLeapYear(_tv_). + 1. Let _dayWithinYear_ be DayWithinYear(_tv_). + 1. Let _month_ be MonthFromTime(_tv_). 1. If _month_ is *+0*𝔽, return _dayWithinYear_ + *1*𝔽. 1. If _month_ is *1*𝔽, return _dayWithinYear_ - *30*𝔽. 1. If _month_ is *2*𝔽, return _dayWithinYear_ - *58*𝔽 - _inLeapYear_. @@ -32454,75 +34232,75 @@

        WeekDay ( - _t_: a finite time value, + _tv_: a finite time value, ): an integral Number in the inclusive interval from *+0*𝔽 to *6*𝔽

        description
        -
        It returns a Number identifying the day of the week in which _t_ falls. A weekday value of *+0*𝔽 specifies Sunday; *1*𝔽 specifies Monday; *2*𝔽 specifies Tuesday; *3*𝔽 specifies Wednesday; *4*𝔽 specifies Thursday; *5*𝔽 specifies Friday; and *6*𝔽 specifies Saturday. Note that WeekDay(*+0*𝔽) = *4*𝔽, corresponding to Thursday, 1 January 1970.
        +
        It returns a Number identifying the day of the week in which _tv_ falls. A weekday value of *+0*𝔽 specifies Sunday; *1*𝔽 specifies Monday; *2*𝔽 specifies Tuesday; *3*𝔽 specifies Wednesday; *4*𝔽 specifies Thursday; *5*𝔽 specifies Friday; and *6*𝔽 specifies Saturday. Note that WeekDay(*+0*𝔽) = *4*𝔽, corresponding to Thursday, 1 January 1970.
        - 1. Return 𝔽(ℝ(Day(_t_) + *4*𝔽) modulo 7). + 1. Return 𝔽(ℝ(Day(_tv_) + *4*𝔽) modulo 7).

        HourFromTime ( - _t_: a finite time value, + _tv_: a finite time value, ): an integral Number in the inclusive interval from *+0*𝔽 to *23*𝔽

        description
        -
        It returns the hour of the day in which _t_ falls.
        +
        It returns the hour of the day in which _tv_ falls.
        - 1. Return 𝔽(floor(ℝ(_t_ / msPerHour)) modulo HoursPerDay). + 1. Return 𝔽(floor(ℝ(_tv_ / msPerHour)) modulo HoursPerDay).

        MinFromTime ( - _t_: a finite time value, + _tv_: a finite time value, ): an integral Number in the inclusive interval from *+0*𝔽 to *59*𝔽

        description
        -
        It returns the minute of the hour in which _t_ falls.
        +
        It returns the minute of the hour in which _tv_ falls.
        - 1. Return 𝔽(floor(ℝ(_t_ / msPerMinute)) modulo MinutesPerHour). + 1. Return 𝔽(floor(ℝ(_tv_ / msPerMinute)) modulo MinutesPerHour).

        SecFromTime ( - _t_: a finite time value, + _tv_: a finite time value, ): an integral Number in the inclusive interval from *+0*𝔽 to *59*𝔽

        description
        -
        It returns the second of the minute in which _t_ falls.
        +
        It returns the second of the minute in which _tv_ falls.
        - 1. Return 𝔽(floor(ℝ(_t_ / msPerSecond)) modulo SecondsPerMinute). + 1. Return 𝔽(floor(ℝ(_tv_ / msPerSecond)) modulo SecondsPerMinute).

        msFromTime ( - _t_: a finite time value, + _tv_: a finite time value, ): an integral Number in the inclusive interval from *+0*𝔽 to *999*𝔽

        description
        -
        It returns the millisecond of the second in which _t_ falls.
        +
        It returns the millisecond of the second in which _tv_ falls.
        - 1. Return 𝔽(ℝ(_t_) modulo ℝ(msPerSecond)). + 1. Return 𝔽(ℝ(_tv_) modulo ℝ(msPerSecond)).
        @@ -32644,11 +34422,13 @@

        Time Zone Identifier Record

        Time Zone Identifier Records have the fields listed in .

        - - - - - + + + + + + + @@ -32691,7 +34471,7 @@

        AvailableNamedTimeZoneIdentifiers ( ): a List of Time Zone Identifier Record 1. NOTE: An implementation may need to resolve _identifier_ iteratively to obtain the primary time zone identifier. 1. Let _record_ be the Time Zone Identifier Record { [[Identifier]]: _identifier_, [[PrimaryIdentifier]]: _primary_ }. 1. Append _record_ to _result_. - 1. Assert: _result_ contains a Time Zone Identifier Record _r_ such that _r_.[[Identifier]] is *"UTC"* and _r_.[[PrimaryIdentifier]] is *"UTC"*. + 1. Assert: _result_ contains a Time Zone Identifier Record _record_ such that _record_.[[Identifier]] is *"UTC"* and _record_.[[PrimaryIdentifier]] is *"UTC"*. 1. Return _result_. @@ -32723,14 +34503,14 @@

        SystemTimeZoneIdentifier ( ): a String

        LocalTime ( - _t_: a finite time value, + _tv_: a finite time value, ): an integral Number

        description
        - It converts _t_ from UTC to local time. - The local political rules for standard time and daylight saving time in effect at _t_ should be used to determine the result in the way specified in this section. + It converts _tv_ from UTC to local time. + The local political rules for standard time and daylight saving time in effect at _tv_ should be used to determine the result in the way specified in this section.
        @@ -32738,19 +34518,19 @@

        1. If IsTimeZoneOffsetString(_systemTimeZoneIdentifier_) is *true*, then 1. Let _offsetNs_ be ParseTimeZoneOffsetString(_systemTimeZoneIdentifier_). 1. Else, - 1. Let _offsetNs_ be GetNamedTimeZoneOffsetNanoseconds(_systemTimeZoneIdentifier_, ℤ(ℝ(_t_) × 106)). + 1. Let _offsetNs_ be GetNamedTimeZoneOffsetNanoseconds(_systemTimeZoneIdentifier_, ℤ(ℝ(_tv_) × 106)). 1. Let _offsetMs_ be truncate(_offsetNs_ / 106). - 1. Return _t_ + 𝔽(_offsetMs_). + 1. Return _tv_ + 𝔽(_offsetMs_). -

        If political rules for the local time _t_ are not available within the implementation, the result is _t_ because SystemTimeZoneIdentifier returns *"UTC"* and GetNamedTimeZoneOffsetNanoseconds returns 0.

        +

        If political rules for the local time _tv_ are not available within the implementation, the result is _tv_ because SystemTimeZoneIdentifier returns *"UTC"* and GetNamedTimeZoneOffsetNanoseconds returns 0.

        It is required for time zone aware implementations (and recommended for all others) to use the time zone information of the IANA Time Zone Database https://www.iana.org/time-zones/.

        -

        Two different input time values _t_UTC are converted to the same local time tlocal at a negative time zone transition when there are repeated times (e.g. the daylight saving time ends or the time zone adjustment is decreased.).

        -

        LocalTime(UTC(_t_local)) is not necessarily always equal to _t_local. Correspondingly, UTC(LocalTime(_t_UTC)) is not necessarily always equal to _t_UTC.

        +

        Two different input time values _tv_UTC are converted to the same local time tlocal at a negative time zone transition when there are repeated times (e.g. the daylight saving time ends or the time zone adjustment is decreased.).

        +

        LocalTime(UTC(_tv_local)) is not necessarily always equal to _tv_local. Correspondingly, UTC(LocalTime(_tv_UTC)) is not necessarily always equal to _tv_UTC.

        @@ -32840,7 +34620,7 @@

        _year_: a Number, _month_: a Number, _date_: a Number, - ): a Number + ): a finite Number or *NaN*

        description
        @@ -32854,8 +34634,8 @@

        1. Let _ym_ be _y_ + 𝔽(floor(ℝ(_m_) / 12)). 1. If _ym_ is not finite, return *NaN*. 1. Let _mn_ be 𝔽(ℝ(_m_) modulo 12). - 1. Find a finite time value _t_ such that YearFromTime(_t_) is _ym_, MonthFromTime(_t_) is _mn_, and DateFromTime(_t_) is *1*𝔽; but if this is not possible (because some argument is out of range), return *NaN*. - 1. Return Day(_t_) + _dt_ - *1*𝔽. + 1. Find a finite time value _tv_ such that YearFromTime(_tv_) is _ym_, MonthFromTime(_tv_) is _mn_, and DateFromTime(_tv_) is *1*𝔽; but if this is not possible (because some argument is out of range), return *NaN*. + 1. Return Day(_tv_) + _dt_ - *1*𝔽. @@ -32864,7 +34644,7 @@

        MakeDate ( _day_: a Number, _time_: a Number, - ): a Number + ): a finite Number or *NaN*

        description
        @@ -32886,10 +34666,10 @@

        description
        -
        It returns the full year associated with the integer part of _year_, interpreting any value in the inclusive interval from 0 to 99 as a count of years since the start of 1900. For alignment with the proleptic Gregorian calendar, "full year" is defined as the signed count of complete years since the start of year 0 (1 B.C.).
        +
        It returns the full year associated with the integer part of _year_, interpreting any value in the inclusive interval from 0 to 99 as a count of years since the start of 1900. For alignment with the proleptic Gregorian calendar, “full year” is defined as the signed count of complete years since the start of year 0 (1 B.C.).
        - 1. If _year_ is *NaN*, return *NaN*. + 1. If _year_ is one of *NaN*, *+∞*𝔽, or *-∞*𝔽, return *NaN*. 1. Let _truncated_ be ! ToIntegerOrInfinity(_year_). 1. If _truncated_ is in the inclusive interval from 0 to 99, return *1900*𝔽 + 𝔽(_truncated_). 1. Return 𝔽(_truncated_). @@ -32900,7 +34680,7 @@

        TimeClip ( _time_: a Number, - ): a Number + ): a time value

        description
        @@ -33031,7 +34811,7 @@

        Date Time String Format

        A string containing out-of-bounds or nonconforming elements is not a valid instance of this format.

        -

        As every day both starts and ends with midnight, the two notations `00:00` and `24:00` are available to distinguish the two midnights that can be associated with one date. This means that the following two notations refer to exactly the same point in time: `1995-02-04T24:00` and `1995-02-05T00:00`. This interpretation of the latter form as "end of a calendar day" is consistent with ISO 8601, even though that specification reserves it for describing time intervals and does not permit it within representations of single points in time.

        +

        As every day both starts and ends with midnight, the two notations `00:00` and `24:00` are available to distinguish the two midnights that can be associated with one date. This means that the following two notations refer to exactly the same point in time: `1995-02-04T24:00` and `1995-02-05T00:00`. This interpretation of the latter form as “end of a calendar day” is consistent with ISO 8601, even though that specification reserves it for describing time intervals and does not permit it within representations of single points in time.

        There exists no international standard that specifies abbreviations for civil time zones like CET, EST, etc. and sometimes the same abbreviation is even used for two very different time zones. For this reason, both ISO 8601 and this format specify numeric representations of time zone offsets.

        @@ -33084,46 +34864,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 +34945,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 +34990,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:

        @@ -33276,9 +35024,9 @@

        Date ( ..._values_ )

        1. Let _yr_ be MakeFullYear(_y_). 1. Let _finalDate_ be MakeDate(MakeDay(_yr_, _m_, _dt_), MakeTime(_h_, _min_, _s_, _milli_)). 1. Let _dv_ be TimeClip(UTC(_finalDate_)). - 1. Let _O_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%Date.prototype%"*, « [[DateValue]] »). - 1. Set _O_.[[DateValue]] to _dv_. - 1. Return _O_. + 1. Let _obj_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%Date.prototype%"*, « [[DateValue]] »). + 1. Set _obj_.[[DateValue]] to _dv_. + 1. Return _obj_.
        @@ -33292,12 +35040,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 +35069,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,251 +35106,251 @@

        Date.prototype.constructor

        The initial value of `Date.prototype.constructor` is %Date%.

        - +

        Date.prototype.getDate ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return DateFromTime(LocalTime(_t_)). + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return DateFromTime(LocalTime(_tv_)).
        - +

        Date.prototype.getDay ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return WeekDay(LocalTime(_t_)). + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return WeekDay(LocalTime(_tv_)).
        - +

        Date.prototype.getFullYear ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return YearFromTime(LocalTime(_t_)). + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return YearFromTime(LocalTime(_tv_)).
        - +

        Date.prototype.getHours ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return HourFromTime(LocalTime(_t_)). + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return HourFromTime(LocalTime(_tv_)).
        - +

        Date.prototype.getMilliseconds ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return msFromTime(LocalTime(_t_)). + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return msFromTime(LocalTime(_tv_)).
        - +

        Date.prototype.getMinutes ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return MinFromTime(LocalTime(_t_)). + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return MinFromTime(LocalTime(_tv_)).
        - +

        Date.prototype.getMonth ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return MonthFromTime(LocalTime(_t_)). + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return MonthFromTime(LocalTime(_tv_)).
        - +

        Date.prototype.getSeconds ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return SecFromTime(LocalTime(_t_)). + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return SecFromTime(LocalTime(_tv_)).
        - +

        Date.prototype.getTime ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Return _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Return _dateObj_.[[DateValue]].
        - +

        Date.prototype.getTimezoneOffset ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return (_t_ - LocalTime(_t_)) / msPerMinute. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return (_tv_ - LocalTime(_tv_)) / msPerMinute.
        - +

        Date.prototype.getUTCDate ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return DateFromTime(_t_). + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return DateFromTime(_tv_).
        - +

        Date.prototype.getUTCDay ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return WeekDay(_t_). + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return WeekDay(_tv_).
        - +

        Date.prototype.getUTCFullYear ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return YearFromTime(_t_). + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return YearFromTime(_tv_).
        - +

        Date.prototype.getUTCHours ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return HourFromTime(_t_). + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return HourFromTime(_tv_).
        - +

        Date.prototype.getUTCMilliseconds ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return msFromTime(_t_). + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return msFromTime(_tv_).
        - +

        Date.prototype.getUTCMinutes ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return MinFromTime(_t_). + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return MinFromTime(_tv_).
        - +

        Date.prototype.getUTCMonth ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return MonthFromTime(_t_). + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return MonthFromTime(_tv_).
        - +

        Date.prototype.getUTCSeconds ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return SecFromTime(_t_). + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return SecFromTime(_tv_).
        - +

        Date.prototype.setDate ( _date_ )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. 1. Let _dt_ be ? ToNumber(_date_). - 1. If _t_ is *NaN*, return *NaN*. - 1. Set _t_ to LocalTime(_t_). - 1. Let _newDate_ be MakeDate(MakeDay(YearFromTime(_t_), MonthFromTime(_t_), _dt_), TimeWithinDay(_t_)). + 1. If _tv_ is *NaN*, return *NaN*. + 1. Set _tv_ to LocalTime(_tv_). + 1. Let _newDate_ be MakeDate(MakeDay(YearFromTime(_tv_), MonthFromTime(_tv_), _dt_), TimeWithinDay(_tv_)). 1. Let _u_ be TimeClip(UTC(_newDate_)). - 1. Set _dateObject_.[[DateValue]] to _u_. + 1. Set _dateObj_.[[DateValue]] to _u_. 1. Return _u_.
        - +

        Date.prototype.setFullYear ( _year_ [ , _month_ [ , _date_ ] ] )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[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. Let _newDate_ be MakeDate(MakeDay(_y_, _m_, _dt_), TimeWithinDay(_t_)). + 1. If _tv_ is *NaN*, set _tv_ to *+0*𝔽; else set _tv_ to LocalTime(_tv_). + 1. If _month_ is present, let _m_ be ? ToNumber(_month_); else let _m_ be MonthFromTime(_tv_). + 1. If _date_ is present, let _dt_ be ? ToNumber(_date_); else let _dt_ be DateFromTime(_tv_). + 1. Let _newDate_ be MakeDate(MakeDay(_y_, _m_, _dt_), TimeWithinDay(_tv_)). 1. Let _u_ be TimeClip(UTC(_newDate_)). - 1. Set _dateObject_.[[DateValue]] to _u_. + 1. Set _dateObj_.[[DateValue]] to _u_. 1. Return _u_.

        The *"length"* property of this method is *3*𝔽.

        @@ -33611,25 +35359,25 @@

        Date.prototype.setFullYear ( _year_ [ , _month_ [ , _date_ ] ] )

        - +

        Date.prototype.setHours ( _hour_ [ , _min_ [ , _sec_ [ , _ms_ ] ] ] )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. 1. Let _h_ be ? ToNumber(_hour_). 1. If _min_ is present, let _m_ be ? ToNumber(_min_). 1. If _sec_ is present, let _s_ be ? ToNumber(_sec_). 1. If _ms_ is present, let _milli_ be ? ToNumber(_ms_). - 1. If _t_ is *NaN*, return *NaN*. - 1. Set _t_ to LocalTime(_t_). - 1. If _min_ is not present, let _m_ be MinFromTime(_t_). - 1. If _sec_ is not present, let _s_ be SecFromTime(_t_). - 1. If _ms_ is not present, let _milli_ be msFromTime(_t_). - 1. Let _date_ be MakeDate(Day(_t_), MakeTime(_h_, _m_, _s_, _milli_)). + 1. If _tv_ is *NaN*, return *NaN*. + 1. Set _tv_ to LocalTime(_tv_). + 1. If _min_ is not present, let _m_ be MinFromTime(_tv_). + 1. If _sec_ is not present, let _s_ be SecFromTime(_tv_). + 1. If _ms_ is not present, let _milli_ be msFromTime(_tv_). + 1. Let _date_ be MakeDate(Day(_tv_), MakeTime(_h_, _m_, _s_, _milli_)). 1. Let _u_ be TimeClip(UTC(_date_)). - 1. Set _dateObject_.[[DateValue]] to _u_. + 1. Set _dateObj_.[[DateValue]] to _u_. 1. Return _u_.

        The *"length"* property of this method is *4*𝔽.

        @@ -33638,40 +35386,40 @@

        Date.prototype.setHours ( _hour_ [ , _min_ [ , _sec_ [ , _ms_ ] ] ] )

        - +

        Date.prototype.setMilliseconds ( _ms_ )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. 1. Set _ms_ to ? ToNumber(_ms_). - 1. If _t_ is *NaN*, return *NaN*. - 1. Set _t_ to LocalTime(_t_). - 1. Let _time_ be MakeTime(HourFromTime(_t_), MinFromTime(_t_), SecFromTime(_t_), _ms_). - 1. Let _u_ be TimeClip(UTC(MakeDate(Day(_t_), _time_))). - 1. Set _dateObject_.[[DateValue]] to _u_. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Set _tv_ to LocalTime(_tv_). + 1. Let _time_ be MakeTime(HourFromTime(_tv_), MinFromTime(_tv_), SecFromTime(_tv_), _ms_). + 1. Let _u_ be TimeClip(UTC(MakeDate(Day(_tv_), _time_))). + 1. Set _dateObj_.[[DateValue]] to _u_. 1. Return _u_.
        - +

        Date.prototype.setMinutes ( _min_ [ , _sec_ [ , _ms_ ] ] )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. 1. Let _m_ be ? ToNumber(_min_). 1. If _sec_ is present, let _s_ be ? ToNumber(_sec_). 1. If _ms_ is present, let _milli_ be ? ToNumber(_ms_). - 1. If _t_ is *NaN*, return *NaN*. - 1. Set _t_ to LocalTime(_t_). - 1. If _sec_ is not present, let _s_ be SecFromTime(_t_). - 1. If _ms_ is not present, let _milli_ be msFromTime(_t_). - 1. Let _date_ be MakeDate(Day(_t_), MakeTime(HourFromTime(_t_), _m_, _s_, _milli_)). + 1. If _tv_ is *NaN*, return *NaN*. + 1. Set _tv_ to LocalTime(_tv_). + 1. If _sec_ is not present, let _s_ be SecFromTime(_tv_). + 1. If _ms_ is not present, let _milli_ be msFromTime(_tv_). + 1. Let _date_ be MakeDate(Day(_tv_), MakeTime(HourFromTime(_tv_), _m_, _s_, _milli_)). 1. Let _u_ be TimeClip(UTC(_date_)). - 1. Set _dateObject_.[[DateValue]] to _u_. + 1. Set _dateObj_.[[DateValue]] to _u_. 1. Return _u_.

        The *"length"* property of this method is *3*𝔽.

        @@ -33680,21 +35428,21 @@

        Date.prototype.setMinutes ( _min_ [ , _sec_ [ , _ms_ ] ] )

        - +

        Date.prototype.setMonth ( _month_ [ , _date_ ] )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. 1. Let _m_ be ? ToNumber(_month_). 1. If _date_ is present, let _dt_ be ? ToNumber(_date_). - 1. If _t_ is *NaN*, return *NaN*. - 1. Set _t_ to LocalTime(_t_). - 1. If _date_ is not present, let _dt_ be DateFromTime(_t_). - 1. Let _newDate_ be MakeDate(MakeDay(YearFromTime(_t_), _m_, _dt_), TimeWithinDay(_t_)). + 1. If _tv_ is *NaN*, return *NaN*. + 1. Set _tv_ to LocalTime(_tv_). + 1. If _date_ is not present, let _dt_ be DateFromTime(_tv_). + 1. Let _newDate_ be MakeDate(MakeDay(YearFromTime(_tv_), _m_, _dt_), TimeWithinDay(_tv_)). 1. Let _u_ be TimeClip(UTC(_newDate_)). - 1. Set _dateObject_.[[DateValue]] to _u_. + 1. Set _dateObj_.[[DateValue]] to _u_. 1. Return _u_.

        The *"length"* property of this method is *2*𝔽.

        @@ -33703,21 +35451,21 @@

        Date.prototype.setMonth ( _month_ [ , _date_ ] )

        - +

        Date.prototype.setSeconds ( _sec_ [ , _ms_ ] )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. 1. Let _s_ be ? ToNumber(_sec_). 1. If _ms_ is present, let _milli_ be ? ToNumber(_ms_). - 1. If _t_ is *NaN*, return *NaN*. - 1. Set _t_ to LocalTime(_t_). - 1. If _ms_ is not present, let _milli_ be msFromTime(_t_). - 1. Let _date_ be MakeDate(Day(_t_), MakeTime(HourFromTime(_t_), MinFromTime(_t_), _s_, _milli_)). + 1. If _tv_ is *NaN*, return *NaN*. + 1. Set _tv_ to LocalTime(_tv_). + 1. If _ms_ is not present, let _milli_ be msFromTime(_tv_). + 1. Let _date_ be MakeDate(Day(_tv_), MakeTime(HourFromTime(_tv_), MinFromTime(_tv_), _s_, _milli_)). 1. Let _u_ be TimeClip(UTC(_date_)). - 1. Set _dateObject_.[[DateValue]] to _u_. + 1. Set _dateObj_.[[DateValue]] to _u_. 1. Return _u_.

        The *"length"* property of this method is *2*𝔽.

        @@ -33726,49 +35474,49 @@

        Date.prototype.setSeconds ( _sec_ [ , _ms_ ] )

        - +

        Date.prototype.setTime ( _time_ )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). 1. Let _t_ be ? ToNumber(_time_). 1. Let _v_ be TimeClip(_t_). - 1. Set _dateObject_.[[DateValue]] to _v_. + 1. Set _dateObj_.[[DateValue]] to _v_. 1. Return _v_.
        - +

        Date.prototype.setUTCDate ( _date_ )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. 1. Let _dt_ be ? ToNumber(_date_). - 1. If _t_ is *NaN*, return *NaN*. - 1. Let _newDate_ be MakeDate(MakeDay(YearFromTime(_t_), MonthFromTime(_t_), _dt_), TimeWithinDay(_t_)). + 1. If _tv_ is *NaN*, return *NaN*. + 1. Let _newDate_ be MakeDate(MakeDay(YearFromTime(_tv_), MonthFromTime(_tv_), _dt_), TimeWithinDay(_tv_)). 1. Let _v_ be TimeClip(_newDate_). - 1. Set _dateObject_.[[DateValue]] to _v_. + 1. Set _dateObj_.[[DateValue]] to _v_. 1. Return _v_.
        - +

        Date.prototype.setUTCFullYear ( _year_ [ , _month_ [ , _date_ ] ] )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, set _t_ to *+0*𝔽. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, set _tv_ 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. Let _newDate_ be MakeDate(MakeDay(_y_, _m_, _dt_), TimeWithinDay(_t_)). + 1. If _month_ is present, let _m_ be ? ToNumber(_month_); else let _m_ be MonthFromTime(_tv_). + 1. If _date_ is present, let _dt_ be ? ToNumber(_date_); else let _dt_ be DateFromTime(_tv_). + 1. Let _newDate_ be MakeDate(MakeDay(_y_, _m_, _dt_), TimeWithinDay(_tv_)). 1. Let _v_ be TimeClip(_newDate_). - 1. Set _dateObject_.[[DateValue]] to _v_. + 1. Set _dateObj_.[[DateValue]] to _v_. 1. Return _v_.

        The *"length"* property of this method is *3*𝔽.

        @@ -33777,24 +35525,24 @@

        Date.prototype.setUTCFullYear ( _year_ [ , _month_ [ , _date_ ] ] )

        - +

        Date.prototype.setUTCHours ( _hour_ [ , _min_ [ , _sec_ [ , _ms_ ] ] ] )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. 1. Let _h_ be ? ToNumber(_hour_). 1. If _min_ is present, let _m_ be ? ToNumber(_min_). 1. If _sec_ is present, let _s_ be ? ToNumber(_sec_). 1. If _ms_ is present, let _milli_ be ? ToNumber(_ms_). - 1. If _t_ is *NaN*, return *NaN*. - 1. If _min_ is not present, let _m_ be MinFromTime(_t_). - 1. If _sec_ is not present, let _s_ be SecFromTime(_t_). - 1. If _ms_ is not present, let _milli_ be msFromTime(_t_). - 1. Let _date_ be MakeDate(Day(_t_), MakeTime(_h_, _m_, _s_, _milli_)). + 1. If _tv_ is *NaN*, return *NaN*. + 1. If _min_ is not present, let _m_ be MinFromTime(_tv_). + 1. If _sec_ is not present, let _s_ be SecFromTime(_tv_). + 1. If _ms_ is not present, let _milli_ be msFromTime(_tv_). + 1. Let _date_ be MakeDate(Day(_tv_), MakeTime(_h_, _m_, _s_, _milli_)). 1. Let _v_ be TimeClip(_date_). - 1. Set _dateObject_.[[DateValue]] to _v_. + 1. Set _dateObj_.[[DateValue]] to _v_. 1. Return _v_.

        The *"length"* property of this method is *4*𝔽.

        @@ -33803,38 +35551,38 @@

        Date.prototype.setUTCHours ( _hour_ [ , _min_ [ , _sec_ [ , _ms_ ] ] ] )

        - +

        Date.prototype.setUTCMilliseconds ( _ms_ )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. 1. Set _ms_ to ? ToNumber(_ms_). - 1. If _t_ is *NaN*, return *NaN*. - 1. Let _time_ be MakeTime(HourFromTime(_t_), MinFromTime(_t_), SecFromTime(_t_), _ms_). - 1. Let _v_ be TimeClip(MakeDate(Day(_t_), _time_)). - 1. Set _dateObject_.[[DateValue]] to _v_. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Let _time_ be MakeTime(HourFromTime(_tv_), MinFromTime(_tv_), SecFromTime(_tv_), _ms_). + 1. Let _v_ be TimeClip(MakeDate(Day(_tv_), _time_)). + 1. Set _dateObj_.[[DateValue]] to _v_. 1. Return _v_.
        - +

        Date.prototype.setUTCMinutes ( _min_ [ , _sec_ [ , _ms_ ] ] )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. 1. Let _m_ be ? ToNumber(_min_). 1. If _sec_ is present, let _s_ be ? ToNumber(_sec_). 1. If _ms_ is present, let _milli_ be ? ToNumber(_ms_). - 1. If _t_ is *NaN*, return *NaN*. - 1. If _sec_ is not present, let _s_ be SecFromTime(_t_). - 1. If _ms_ is not present, let _milli_ be msFromTime(_t_). - 1. Let _date_ be MakeDate(Day(_t_), MakeTime(HourFromTime(_t_), _m_, _s_, _milli_)). + 1. If _tv_ is *NaN*, return *NaN*. + 1. If _sec_ is not present, let _s_ be SecFromTime(_tv_). + 1. If _ms_ is not present, let _milli_ be msFromTime(_tv_). + 1. Let _date_ be MakeDate(Day(_tv_), MakeTime(HourFromTime(_tv_), _m_, _s_, _milli_)). 1. Let _v_ be TimeClip(_date_). - 1. Set _dateObject_.[[DateValue]] to _v_. + 1. Set _dateObj_.[[DateValue]] to _v_. 1. Return _v_.

        The *"length"* property of this method is *3*𝔽.

        @@ -33843,20 +35591,20 @@

        Date.prototype.setUTCMinutes ( _min_ [ , _sec_ [ , _ms_ ] ] )

        - +

        Date.prototype.setUTCMonth ( _month_ [ , _date_ ] )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. 1. Let _m_ be ? ToNumber(_month_). 1. If _date_ is present, let _dt_ be ? ToNumber(_date_). - 1. If _t_ is *NaN*, return *NaN*. - 1. If _date_ is not present, let _dt_ be DateFromTime(_t_). - 1. Let _newDate_ be MakeDate(MakeDay(YearFromTime(_t_), _m_, _dt_), TimeWithinDay(_t_)). + 1. If _tv_ is *NaN*, return *NaN*. + 1. If _date_ is not present, let _dt_ be DateFromTime(_tv_). + 1. Let _newDate_ be MakeDate(MakeDay(YearFromTime(_tv_), _m_, _dt_), TimeWithinDay(_tv_)). 1. Let _v_ be TimeClip(_newDate_). - 1. Set _dateObject_.[[DateValue]] to _v_. + 1. Set _dateObj_.[[DateValue]] to _v_. 1. Return _v_.

        The *"length"* property of this method is *2*𝔽.

        @@ -33865,20 +35613,20 @@

        Date.prototype.setUTCMonth ( _month_ [ , _date_ ] )

        - +

        Date.prototype.setUTCSeconds ( _sec_ [ , _ms_ ] )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. 1. Let _s_ be ? ToNumber(_sec_). 1. If _ms_ is present, let _milli_ be ? ToNumber(_ms_). - 1. If _t_ is *NaN*, return *NaN*. - 1. If _ms_ is not present, let _milli_ be msFromTime(_t_). - 1. Let _date_ be MakeDate(Day(_t_), MakeTime(HourFromTime(_t_), MinFromTime(_t_), _s_, _milli_)). + 1. If _tv_ is *NaN*, return *NaN*. + 1. If _ms_ is not present, let _milli_ be msFromTime(_tv_). + 1. Let _date_ be MakeDate(Day(_tv_), MakeTime(HourFromTime(_tv_), MinFromTime(_tv_), _s_, _milli_)). 1. Let _v_ be TimeClip(_date_). - 1. Set _dateObject_.[[DateValue]] to _v_. + 1. Set _dateObj_.[[DateValue]] to _v_. 1. Return _v_.

        The *"length"* property of this method is *2*𝔽.

        @@ -33887,26 +35635,26 @@

        Date.prototype.setUTCSeconds ( _sec_ [ , _ms_ ] )

        - +

        Date.prototype.toDateString ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _tv_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. 1. If _tv_ is *NaN*, return *"Invalid Date"*. 1. Let _t_ be LocalTime(_tv_). 1. Return DateString(_t_).
        - +

        Date.prototype.toISOString ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _tv_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. 1. If _tv_ is *NaN*, throw a *RangeError* exception. 1. Assert: _tv_ is an integral Number. 1. If _tv_ corresponds with a year that cannot be represented in the Date Time String Format, throw a *RangeError* exception. @@ -33914,15 +35662,15 @@

        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:

        - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _tv_ be ? ToPrimitive(_O_, ~number~). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _tv_ be ? ToPrimitive(_obj_, ~number~). 1. If _tv_ is a Number and _tv_ is not finite, return *null*. - 1. Return ? Invoke(_O_, *"toISOString"*). + 1. Return ? Invoke(_obj_, *"toISOString"*).

        The argument is ignored.

        @@ -33932,34 +35680,34 @@

        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:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _tv_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. 1. Return ToDateString(_tv_). @@ -33998,20 +35746,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 +35822,16 @@

        - - - - + + + + + +
        - Number - - Name -
        + Number + + Name +
        *+0*𝔽 @@ -34218,68 +35970,68 @@

        1. If _tv_ is *NaN*, return *"Invalid Date"*. - 1. Let _t_ be LocalTime(_tv_). - 1. Return the string-concatenation of DateString(_t_), the code unit 0x0020 (SPACE), TimeString(_t_), and TimeZoneString(_tv_). + 1. Let _localTime_ be LocalTime(_tv_). + 1. Return the string-concatenation of DateString(_localTime_), the code unit 0x0020 (SPACE), TimeString(_localTime_), and TimeZoneString(_tv_). - +

        Date.prototype.toTimeString ( )

        This method performs the following steps when called:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _tv_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. 1. If _tv_ is *NaN*, return *"Invalid Date"*. - 1. Let _t_ be LocalTime(_tv_). - 1. Return the string-concatenation of TimeString(_t_) and TimeZoneString(_tv_). + 1. Let _localTime_ be LocalTime(_tv_). + 1. Return the string-concatenation of TimeString(_localTime_) and TimeZoneString(_tv_).
        - +

        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.

        +

        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:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _tv_ be _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. 1. If _tv_ is *NaN*, return *"Invalid Date"*. 1. Let _weekday_ be the Name of the entry in with the Number WeekDay(_tv_). 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:

        - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Return _dateObject_.[[DateValue]]. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Return _dateObj_.[[DateValue]].
        - -

        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:

        - 1. Let _O_ be the *this* value. - 1. If _O_ is not an Object, throw a *TypeError* exception. + 1. Let _obj_ be the *this* value. + 1. If _obj_ is not an Object, throw a *TypeError* exception. 1. If _hint_ is either *"string"* or *"default"*, then 1. Let _tryFirst_ be ~string~. 1. Else if _hint_ is *"number"*, then 1. Let _tryFirst_ be ~number~. 1. Else, 1. Throw a *TypeError* exception. - 1. Return ? OrdinaryToPrimitive(_O_, _tryFirst_). + 1. Return ? OrdinaryToPrimitive(_obj_, _tryFirst_).

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        The value of the *"name"* property of this method is *"[Symbol.toPrimitive]"*.

        @@ -34310,17 +36062,17 @@

        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:

        1. If _value_ is not present, then - 1. Let _s_ be the empty String. + 1. Let _string_ be the empty String. 1. Else, 1. If NewTarget is *undefined* and _value_ is a Symbol, return SymbolDescriptiveString(_value_). - 1. Let _s_ be ? ToString(_value_). - 1. If NewTarget is *undefined*, return _s_. - 1. Return StringCreate(_s_, ? GetPrototypeFromConstructor(NewTarget, *"%String.prototype%"*)). + 1. Let _string_ be ? ToString(_value_). + 1. If NewTarget is *undefined*, return _string_. + 1. Return StringCreate(_string_, ? GetPrototypeFromConstructor(NewTarget, *"%String.prototype%"*)).
        @@ -34333,7 +36085,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 +36099,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 +36107,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 +36122,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:

        @@ -34380,17 +36132,17 @@

        String.raw ( _template_, ..._substitutions_ )

        1. Let _literals_ be ? ToObject(? Get(_cooked_, *"raw"*)). 1. Let _literalCount_ be ? LengthOfArrayLike(_literals_). 1. If _literalCount_ ≤ 0, return the empty String. - 1. Let _R_ be the empty String. + 1. Let _result_ be the empty String. 1. Let _nextIndex_ be 0. 1. Repeat, - 1. Let _nextLiteralVal_ be ? Get(_literals_, ! ToString(𝔽(_nextIndex_))). - 1. Let _nextLiteral_ be ? ToString(_nextLiteralVal_). - 1. Set _R_ to the string-concatenation of _R_ and _nextLiteral_. - 1. If _nextIndex_ + 1 = _literalCount_, return _R_. + 1. Let _nextLiteralValue_ be ? Get(_literals_, ! ToString(𝔽(_nextIndex_))). + 1. Let _nextLiteral_ be ? ToString(_nextLiteralValue_). + 1. Set _result_ to the string-concatenation of _result_ and _nextLiteral_. + 1. If _nextIndex_ + 1 = _literalCount_, return _result_. 1. If _nextIndex_ < _substitutionCount_, then - 1. Let _nextSubVal_ be _substitutions_[_nextIndex_]. - 1. Let _nextSub_ be ? ToString(_nextSubVal_). - 1. Set _R_ to the string-concatenation of _R_ and _nextSub_. + 1. Let _nextSubValue_ be _substitutions_[_nextIndex_]. + 1. Let _nextSub_ be ? ToString(_nextSubValue_). + 1. Set _result_ to the string-concatenation of _result_ and _nextSub_. 1. Set _nextIndex_ to _nextIndex_ + 1. @@ -34411,95 +36163,100 @@

        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 _S_ be ? ToString(_O_). - 1. Let _len_ be the length of _S_. + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Let _length_ be the length of _string_. 1. Let _relativeIndex_ be ? ToIntegerOrInfinity(_index_). 1. If _relativeIndex_ ≥ 0, then 1. Let _k_ be _relativeIndex_. 1. Else, - 1. Let _k_ be _len_ + _relativeIndex_. - 1. If _k_ < 0 or _k_ ≥ _len_, return *undefined*. - 1. Return the substring of _S_ from _k_ to _k_ + 1. + 1. Let _k_ be _length_ + _relativeIndex_. + 1. If _k_ < 0 or _k_ ≥ _length_, return *undefined*. + 1. Return the substring of _string_ from _k_ to _k_ + 1.
        - -

        String.prototype.charAt ( _pos_ )

        + +

        String.prototype.charAt ( _position_ )

        -

        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.

        +

        This method returns a single element String containing the code unit at index _position_ 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.

        If `pos` is an integral Number, then the result of `x.charAt(pos)` is equivalent to the result of `x.substring(pos, pos + 1)`.

        This method performs the following steps when called:

        - 1. Let _O_ be ? RequireObjectCoercible(*this* value). - 1. Let _S_ be ? ToString(_O_). - 1. Let _position_ be ? ToIntegerOrInfinity(_pos_). - 1. Let _size_ be the length of _S_. + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Set _position_ to ? ToIntegerOrInfinity(_position_). + 1. Let _size_ be the length of _string_. 1. If _position_ < 0 or _position_ ≥ _size_, return the empty String. - 1. Return the substring of _S_ from _position_ to _position_ + 1. + 1. Return the substring of _string_ from _position_ to _position_ + 1.

        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.charCodeAt ( _pos_ )

        + +

        String.prototype.charCodeAt ( _position_ )

        -

        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 returns a Number (a non-negative integral Number less than 216) that is the numeric value of the code unit at index _position_ 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 _S_ be ? ToString(_O_). - 1. Let _position_ be ? ToIntegerOrInfinity(_pos_). - 1. Let _size_ be the length of _S_. + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Set _position_ to ? ToIntegerOrInfinity(_position_). + 1. Let _size_ be the length of _string_. 1. If _position_ < 0 or _position_ ≥ _size_, return *NaN*. - 1. Return the Number value for the numeric value of the code unit at index _position_ within the String _S_. + 1. Return the Number value for the numeric value of the code unit at index _position_ within the String _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.codePointAt ( _pos_ )

        + +

        String.prototype.codePointAt ( _position_ )

        -

        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 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 _position_ 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 _position_, the result is the code unit at _position_.

        This method performs the following steps when called:

        - 1. Let _O_ be ? RequireObjectCoercible(*this* value). - 1. Let _S_ be ? ToString(_O_). - 1. Let _position_ be ? ToIntegerOrInfinity(_pos_). - 1. Let _size_ be the length of _S_. + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Set _position_ to ? ToIntegerOrInfinity(_position_). + 1. Let _size_ be the length of _string_. 1. If _position_ < 0 or _position_ ≥ _size_, return *undefined*. - 1. Let _cp_ be CodePointAt(_S_, _position_). - 1. Return 𝔽(_cp_.[[CodePoint]]). + 1. Let _codePoint_ be CodePointAt(_string_, _position_). + 1. Return 𝔽(_codePoint_.[[CodePoint]]).

        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.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 _S_ be ? ToString(_O_). - 1. Let _R_ be _S_. + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Let _result_ be _string_. 1. For each element _next_ of _args_, do 1. Let _nextString_ be ? ToString(_next_). - 1. Set _R_ to the string-concatenation of _R_ and _nextString_. - 1. Return _R_. + 1. Set _result_ to the string-concatenation of _result_ and _nextString_. + 1. Return _result_.

        The *"length"* property of this method is *1*𝔽.

        @@ -34512,29 +36269,27 @@

        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 _S_ be ? ToString(_O_). - 1. Let _isRegExp_ be ? IsRegExp(_searchString_). - 1. If _isRegExp_ is *true*, throw a *TypeError* exception. - 1. Let _searchStr_ be ? ToString(_searchString_). - 1. Let _len_ be the length of _S_. - 1. If _endPosition_ is *undefined*, let _pos_ be _len_; else let _pos_ be ? ToIntegerOrInfinity(_endPosition_). - 1. Let _end_ be the result of clamping _pos_ between 0 and _len_. - 1. Let _searchLength_ be the length of _searchStr_. + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Let _isRegexp_ be ? IsRegExp(_searchString_). + 1. If _isRegexp_ is *true*, throw a *TypeError* exception. + 1. Set _searchString_ to ? ToString(_searchString_). + 1. Let _length_ be the length of _string_. + 1. If _endPosition_ is *undefined*, let _position_ be _length_; else let _position_ be ? ToIntegerOrInfinity(_endPosition_). + 1. Let _end_ be the result of clamping _position_ between 0 and _length_. + 1. Let _searchLength_ be the length of _searchString_. 1. If _searchLength_ = 0, return *true*. 1. Let _start_ be _end_ - _searchLength_. 1. If _start_ < 0, return *false*. - 1. Let _substring_ be the substring of _S_ from _start_ to _end_. - 1. If _substring_ is _searchStr_, return *true*. + 1. Let _substring_ be the substring of _string_ from _start_ to _end_. + 1. If _substring_ is _searchString_, return *true*. 1. Return *false*. - -

        This method returns *true* if the sequence of code units of _searchString_ converted to a String is the same as the corresponding code units of this object (converted to a String) starting at _endPosition_ - length(this). Otherwise it returns *false*.

        -

        Throwing an exception if the first argument is a RegExp is specified in order to allow future editions to define extensions that allow such argument values.

        @@ -34543,20 +36298,21 @@

        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 _S_ be ? ToString(_O_). - 1. Let _isRegExp_ be ? IsRegExp(_searchString_). - 1. If _isRegExp_ is *true*, throw a *TypeError* exception. - 1. Let _searchStr_ be ? ToString(_searchString_). - 1. Let _pos_ be ? ToIntegerOrInfinity(_position_). - 1. Assert: If _position_ is *undefined*, then _pos_ is 0. - 1. Let _len_ be the length of _S_. - 1. Let _start_ be the result of clamping _pos_ between 0 and _len_. - 1. Let _index_ be StringIndexOf(_S_, _searchStr_, _start_). + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Let _isRegexp_ be ? IsRegExp(_searchString_). + 1. If _isRegexp_ is *true*, throw a *TypeError* exception. + 1. Set _searchString_ to ? ToString(_searchString_). + 1. Let _positionInt_ be ? ToIntegerOrInfinity(_position_). + 1. Assert: If _position_ is *undefined*, then _positionInt_ is 0. + 1. Let _length_ be the length of _string_. + 1. Let _start_ be the result of clamping _positionInt_ between 0 and _length_. + 1. Let _index_ be StringIndexOf(_string_, _searchString_, _start_). 1. If _index_ is ~not-found~, return *false*. 1. Return *true*. @@ -34571,21 +36327,22 @@

        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 _S_ be ? ToString(_O_). - 1. Let _searchStr_ be ? ToString(_searchString_). - 1. Let _pos_ be ? ToIntegerOrInfinity(_position_). - 1. Assert: If _position_ is *undefined*, then _pos_ is 0. - 1. Let _len_ be the length of _S_. - 1. Let _start_ be the result of clamping _pos_ between 0 and _len_. - 1. Let _result_ be StringIndexOf(_S_, _searchStr_, _start_). + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Set _searchString_ to ? ToString(_searchString_). + 1. Let _positionInt_ be ? ToIntegerOrInfinity(_position_). + 1. Assert: If _position_ is *undefined*, then _positionInt_ is 0. + 1. Let _length_ be the length of _string_. + 1. Let _start_ be the result of clamping _positionInt_ between 0 and _length_. + 1. Let _result_ be StringIndexOf(_string_, _searchString_, _start_). 1. If _result_ is ~not-found~, return *-1*𝔽. 1. Return 𝔽(_result_). @@ -34594,33 +36351,36 @@

        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 _S_ be ? ToString(_O_). - 1. Return IsStringWellFormedUnicode(_S_). + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Return IsStringWellFormedUnicode(_string_).
        - +

        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 _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. Let _len_ be the length of _S_. - 1. Let _searchLen_ be the length of _searchStr_. - 1. Let _start_ be the result of clamping _pos_ between 0 and _len_ - _searchLen_. - 1. Let _result_ be StringLastIndexOf(_S_, _searchStr_, _start_). + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Set _searchString_ to ? ToString(_searchString_). + 1. Let _numberPosition_ be ? ToNumber(_position_). + 1. Assert: If _position_ is *undefined*, then _numberPosition_ is *NaN*. + 1. If _numberPosition_ is *NaN*, set _position_ to +∞; else set _position_ to ! ToIntegerOrInfinity(_numberPosition_). + 1. Let _length_ be the length of _string_. + 1. Let _searchLength_ be the length of _searchString_. + 1. If _length_ < _searchLength_, return *-1*𝔽. + 1. Let _start_ be the result of clamping _position_ between 0 and _length_ - _searchLength_. + 1. Let _result_ be StringLastIndexOf(_string_, _searchString_, _start_). 1. If _result_ is ~not-found~, return *-1*𝔽. 1. Return 𝔽(_result_). @@ -34629,14 +36389,15 @@

        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_).

        +

        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 _string_) 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 _string_ is ordered before _thatValue_, positive when _string_ is ordered after _thatValue_, and zero in all other cases (representing no relative ordering between _string_ 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 _S_ be ? ToString(_O_). + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). 1. Let _thatValue_ be ? ToString(_that_).

        The meaning of the optional second and third parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not assign any other interpretation to those parameter positions.

        @@ -34675,86 +36436,91 @@

        String.prototype.localeCompare ( _that_ [ , _reserved1_ [ , _reserved2_ ] ] - -

        String.prototype.match ( _regexp_ )

        + +

        String.prototype.match ( _regexpOrPattern_ )

        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 _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. If _regexpOrPattern_ is an Object, then + 1. Let _matcher_ be ? GetMethod(_regexpOrPattern_, %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 ? Call(_matcher_, _regexpOrPattern_, « _thisValue_ »). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Let _regexp_ be ? RegExpCreate(_regexpOrPattern_, *undefined*). + 1. Return ? Invoke(_regexp_, %Symbol.match%, « _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.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.

        + +

        String.prototype.matchAll ( _regexpOrPattern_ )

        +

        This method performs a regular expression match of the String representing the *this* value against _regexpOrPattern_ 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 _isRegExp_ be ? IsRegExp(_regexp_). - 1. If _isRegExp_ is *true*, then - 1. Let _flags_ be ? Get(_regexp_, *"flags"*). + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. If _regexpOrPattern_ is an Object, then + 1. Let _isRegexp_ be ? IsRegExp(_regexpOrPattern_). + 1. If _isRegexp_ is *true*, then + 1. Let _flags_ be ? Get(_regexpOrPattern_, *"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(_regexpOrPattern_, %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 ? Call(_matcher_, _regexpOrPattern_, « _thisValue_ »). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Let _regexp_ be ? RegExpCreate(_regexpOrPattern_, *"g"*). + 1. Return ? Invoke(_regexp_, %Symbol.matchAll%, « _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. 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 _S_ be ? ToString(_O_). - 1. If _form_ is *undefined*, let _f_ be *"NFC"*. - 1. Else, let _f_ be ? ToString(_form_). - 1. If _f_ is not one of *"NFC"*, *"NFD"*, *"NFKC"*, or *"NFKD"*, throw a *RangeError* exception. - 1. Let _ns_ be the String value that is the result of normalizing _S_ into the normalization form named by _f_ as specified in the latest Unicode Standard, Normalization Forms. - 1. Return _ns_. + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). + 1. If _form_ is *undefined*, set _form_ to *"NFC"*. + 1. Else, set _form_ to ? ToString(_form_). + 1. If _form_ is not one of *"NFC"*, *"NFD"*, *"NFKC"*, or *"NFKD"*, throw a *RangeError* exception. + 1. Let _normal_ be the String value that is the result of normalizing _string_ into the normalization form named by _form_ as specified in the latest Unicode Standard, Normalization Forms. + 1. Return _normal_.

        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.padEnd ( _maxLength_ [ , _fillString_ ] )

        This method performs the following steps when called:

        - 1. Let _O_ be ? RequireObjectCoercible(*this* value). - 1. Return ? StringPaddingBuiltinsImpl(_O_, _maxLength_, _fillString_, ~end~). + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Return ? StringPaddingBuiltinsImpl(_thisValue_, _maxLength_, _fillString_, ~end~).
        - +

        String.prototype.padStart ( _maxLength_ [ , _fillString_ ] )

        This method performs the following steps when called:

        - 1. Let _O_ be ? RequireObjectCoercible(*this* value). - 1. Return ? StringPaddingBuiltinsImpl(_O_, _maxLength_, _fillString_, ~start~). + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Return ? StringPaddingBuiltinsImpl(_thisValue_, _maxLength_, _fillString_, ~start~).

        StringPaddingBuiltinsImpl ( - _O_: an ECMAScript language value, + _thisValue_: an ECMAScript language value, _maxLength_: an ECMAScript language value, _fillString_: an ECMAScript language value, _placement_: ~start~ or ~end~, @@ -34763,20 +36529,20 @@

        - 1. Let _S_ be ? ToString(_O_). + 1. Let _string_ be ? ToString(_thisValue_). 1. Let _intMaxLength_ be ℝ(? ToLength(_maxLength_)). - 1. Let _stringLength_ be the length of _S_. - 1. If _intMaxLength_ ≤ _stringLength_, return _S_. + 1. Let _stringLength_ be the length of _string_. + 1. If _intMaxLength_ ≤ _stringLength_, return _string_. 1. If _fillString_ is *undefined*, set _fillString_ to the String value consisting solely of the code unit 0x0020 (SPACE). 1. Else, set _fillString_ to ? ToString(_fillString_). - 1. Return StringPad(_S_, _intMaxLength_, _fillString_, _placement_). + 1. Return StringPad(_string_, _intMaxLength_, _fillString_, _placement_).

        StringPad ( - _S_: a String, + _string_: a String, _maxLength_: a non-negative integer, _fillString_: a String, _placement_: ~start~ or ~end~, @@ -34785,16 +36551,16 @@

        - 1. Let _stringLength_ be the length of _S_. - 1. If _maxLength_ ≤ _stringLength_, return _S_. - 1. If _fillString_ is the empty String, return _S_. - 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. Let _stringLength_ be the length of _string_. + 1. If _maxLength_ ≤ _stringLength_, return _string_. + 1. If _fillString_ is the empty String, return _string_. + 1. Let _fillLength_ be _maxLength_ - _stringLength_. + 1. Let _truncatedStringFiller_ be the String value consisting of repeated concatenations of _fillString_ truncated to length _fillLength_. + 1. If _placement_ is ~start~, return the string-concatenation of _truncatedStringFiller_ and _string_. + 1. Return the string-concatenation of _string_ and _truncatedStringFiller_. -

        The argument _maxLength_ will be clamped such that it can be no smaller than the length of _S_.

        +

        The argument _maxLength_ will be clamped such that it can be no smaller than the length of _string_.

        The argument _fillString_ defaults to *" "* (the String value consisting of the code unit 0x0020 SPACE).

        @@ -34811,22 +36577,23 @@

        - 1. Let _S_ be the String representation of _n_, formatted as a decimal number. - 1. Return StringPad(_S_, _minLength_, *"0"*, ~start~). + 1. Let _string_ be the String representation of _n_, formatted as a decimal number. + 1. Return StringPad(_string_, _minLength_, *"0"*, ~start~). - +

        String.prototype.repeat ( _count_ )

        This method performs the following steps when called:

        - 1. Let _O_ be ? RequireObjectCoercible(*this* value). - 1. Let _S_ be ? ToString(_O_). + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). 1. Let _n_ be ? ToIntegerOrInfinity(_count_). 1. If _n_ < 0 or _n_ = +∞, throw a *RangeError* exception. 1. If _n_ = 0, return the empty String. - 1. Return the String value that is made from _n_ copies of _S_ appended together. + 1. Return the String value that is made from _n_ copies of _string_ appended together.

        This method creates the String value consisting of the code units of the *this* value (converted to String) repeated _count_ times.

        @@ -34836,16 +36603,17 @@

        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 _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 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_). + 1. Return ? Call(_replacer_, _searchValue_, « _thisValue_, _replaceValue_ »). + 1. Let _string_ be ? ToString(_thisValue_). 1. Let _searchString_ be ? ToString(_searchValue_). 1. Let _functionalReplace_ be IsCallable(_replaceValue_). 1. If _functionalReplace_ is *false*, then @@ -34871,7 +36639,7 @@

        String.prototype.replace ( _searchValue_, _replaceValue_ )

        GetSubstitution ( _matched_: a String, - _str_: a String, + _string_: a String, _position_: a non-negative integer, _captures_: a List of either Strings or *undefined*, _namedCaptures_: an Object or *undefined*, @@ -34883,7 +36651,7 @@

        For the purposes of this abstract operation, a decimal digit is a code unit in the inclusive interval from 0x0030 (DIGIT ZERO) to 0x0039 (DIGIT NINE).
        - 1. Let _stringLength_ be the length of _str_. + 1. Let _stringLength_ be the length of _string_. 1. Assert: _position_ ≤ _stringLength_. 1. Let _result_ be the empty String. 1. Let _templateRemainder_ be _replacementTemplate_. @@ -34894,29 +36662,29 @@

        1. Let _refReplacement_ be *"$"*. 1. Else if _templateRemainder_ starts with *"$`"*, then 1. Let _ref_ be *"$`"*. - 1. Let _refReplacement_ be the substring of _str_ from 0 to _position_. + 1. Let _refReplacement_ be the substring of _string_ from 0 to _position_. 1. Else if _templateRemainder_ starts with *"$&"*, then 1. Let _ref_ be *"$&"*. 1. Let _refReplacement_ be _matched_. 1. Else if _templateRemainder_ starts with *"$'"* (0x0024 (DOLLAR SIGN) followed by 0x0027 (APOSTROPHE)), then 1. Let _ref_ be *"$'"*. 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. Let _tailPosition_ be _position_ + _matchLength_. + 1. Let _refReplacement_ be the substring of _string_ from min(_tailPosition_, _stringLength_). + 1. NOTE: _tailPosition_ 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. - 1. Let _captureLen_ be the number of elements in _captures_. - 1. If _index_ > _captureLen_ and _digitCount_ = 2, then + 1. Let _captureLength_ be the number of elements in _captures_. + 1. If _index_ > _captureLength_ and _digitCount_ = 2, then 1. NOTE: When a two-digit replacement pattern specifies an index exceeding the count of capturing groups, it is treated as a one-digit replacement pattern followed by a literal digit. 1. Set _digitCount_ to 1. 1. Set _digits_ to the substring of _digits_ from 0 to 1. 1. Set _index_ to ℝ(StringToNumber(_digits_)). 1. Let _ref_ be the substring of _templateRemainder_ from 0 to 1 + _digitCount_. - 1. If 1 ≤ _index_ ≤ _captureLen_, then + 1. If 1 ≤ _index_ ≤ _captureLength_, then 1. Let _capture_ be _captures_[_index_ - 1]. 1. If _capture_ is *undefined*, then 1. Let _refReplacement_ be the empty String. @@ -34925,13 +36693,13 @@

        1. Else, 1. Let _refReplacement_ be _ref_. 1. Else if _templateRemainder_ starts with *"$<"*, then - 1. Let _gtPos_ be StringIndexOf(_templateRemainder_, *">"*, 0). - 1. If _gtPos_ is ~not-found~ or _namedCaptures_ is *undefined*, then + 1. Let _gtPosition_ be StringIndexOf(_templateRemainder_, *">"*, 0). + 1. If _gtPosition_ is ~not-found~ or _namedCaptures_ is *undefined*, then 1. Let _ref_ be *"$<"*. 1. Let _refReplacement_ be _ref_. 1. Else, - 1. Let _ref_ be the substring of _templateRemainder_ from 0 to _gtPos_ + 1. - 1. Let _groupName_ be the substring of _templateRemainder_ from 2 to _gtPos_. + 1. Let _ref_ be the substring of _templateRemainder_ from 0 to _gtPosition_ + 1. + 1. Let _groupName_ be the substring of _templateRemainder_ from 2 to _gtPosition_. 1. Assert: _namedCaptures_ is an Object. 1. Let _capture_ be ? Get(_namedCaptures_, _groupName_). 1. If _capture_ is *undefined*, then @@ -34949,21 +36717,22 @@

        - +

        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 _isRegExp_ be ? IsRegExp(_searchValue_). - 1. If _isRegExp_ is *true*, then + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 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_). + 1. Return ? Call(_replacer_, _searchValue_, « _thisValue_, _replaceValue_ »). + 1. Let _string_ be ? ToString(_thisValue_). 1. Let _searchString_ be ? ToString(_searchValue_). 1. Let _functionalReplace_ be IsCallable(_replaceValue_). 1. If _functionalReplace_ is *false*, then @@ -34977,98 +36746,103 @@

        String.prototype.replaceAll ( _searchValue_, _replaceValue_ )

        1. Set _position_ to StringIndexOf(_string_, _searchString_, _position_ + _advanceBy_). 1. Let _endOfLastMatch_ be 0. 1. Let _result_ be the empty String. - 1. For each element _p_ of _matchPositions_, do - 1. Let _preserved_ be the substring of _string_ from _endOfLastMatch_ to _p_. + 1. For each element _matchPosition_ of _matchPositions_, do + 1. Let _preserved_ be the substring of _string_ from _endOfLastMatch_ to _matchPosition_. 1. If _functionalReplace_ is *true*, then - 1. Let _replacement_ be ? ToString(? Call(_replaceValue_, *undefined*, « _searchString_, 𝔽(_p_), _string_ »)). + 1. Let _replacement_ be ? ToString(? Call(_replaceValue_, *undefined*, « _searchString_, 𝔽(_matchPosition_), _string_ »)). 1. Else, 1. Assert: _replaceValue_ is a String. 1. Let _captures_ be a new empty List. - 1. Let _replacement_ be ! GetSubstitution(_searchString_, _string_, _p_, _captures_, *undefined*, _replaceValue_). + 1. Let _replacement_ be ! GetSubstitution(_searchString_, _string_, _matchPosition_, _captures_, *undefined*, _replaceValue_). 1. Set _result_ to the string-concatenation of _result_, _preserved_, and _replacement_. - 1. Set _endOfLastMatch_ to _p_ + _searchLength_. + 1. Set _endOfLastMatch_ to _matchPosition_ + _searchLength_. 1. If _endOfLastMatch_ < the length of _string_, then 1. Set _result_ to the string-concatenation of _result_ and the substring of _string_ from _endOfLastMatch_. 1. Return _result_.
        - -

        String.prototype.search ( _regexp_ )

        + +

        String.prototype.search ( _regexpOrPattern_ )

        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 _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. If _regexpOrPattern_ is an Object, then + 1. Let _searcher_ be ? GetMethod(_regexpOrPattern_, %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 ? Call(_searcher_, _regexpOrPattern_, « _thisValue_ »). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Let _regexp_ be ? RegExpCreate(_regexpOrPattern_, *undefined*). + 1. Return ? Invoke(_regexp_, %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 _S_ be ? ToString(_O_). - 1. Let _len_ be the length of _S_. + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Let _length_ be the length of _string_. 1. Let _intStart_ be ? ToIntegerOrInfinity(_start_). 1. If _intStart_ = -∞, let _from_ be 0. - 1. Else if _intStart_ < 0, let _from_ be max(_len_ + _intStart_, 0). - 1. Else, let _from_ be min(_intStart_, _len_). - 1. If _end_ is *undefined*, let _intEnd_ be _len_; else let _intEnd_ be ? ToIntegerOrInfinity(_end_). + 1. Else if _intStart_ < 0, let _from_ be max(_length_ + _intStart_, 0). + 1. Else, let _from_ be min(_intStart_, _length_). + 1. If _end_ is *undefined*, let _intEnd_ be _length_; else let _intEnd_ be ? ToIntegerOrInfinity(_end_). 1. If _intEnd_ = -∞, let _to_ be 0. - 1. Else if _intEnd_ < 0, let _to_ be max(_len_ + _intEnd_, 0). - 1. Else, let _to_ be min(_intEnd_, _len_). + 1. Else if _intEnd_ < 0, let _to_ be max(_length_ + _intEnd_, 0). + 1. Else, let _to_ be min(_intEnd_, _length_). 1. If _from_ ≥ _to_, return the empty String. - 1. Return the substring of _S_ from _from_ to _to_. + 1. Return the substring of _string_ from _from_ to _to_.

        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.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 _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 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_). + 1. Return ? Call(_splitter_, _separator_, « _thisValue_, _limit_ »). + 1. Let _string_ be ? ToString(_thisValue_). 1. If _limit_ is *undefined*, let _lim_ be 232 - 1; else let _lim_ be ℝ(? ToUint32(_limit_)). - 1. Let _R_ be ? ToString(_separator_). + 1. Let _separatorString_ be ? ToString(_separator_). 1. If _lim_ = 0, then 1. Return CreateArrayFromList(« »). 1. If _separator_ is *undefined*, then - 1. Return CreateArrayFromList(« _S_ »). - 1. Let _separatorLength_ be the length of _R_. + 1. Return CreateArrayFromList(« _string_ »). + 1. Let _separatorLength_ be the length of _separatorString_. 1. If _separatorLength_ = 0, then - 1. Let _head_ be the substring of _S_ from 0 to _lim_. + 1. Let _stringLength_ be the length of _string_. + 1. Let _outLength_ be the result of clamping _lim_ between 0 and _stringLength_. + 1. Let _head_ be the substring of _string_ from 0 to _outLength_. 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_ »). + 1. If _string_ is the empty String, return CreateArrayFromList(« _string_ »). 1. Let _substrings_ be a new empty List. - 1. Let _i_ be 0. - 1. Let _j_ be StringIndexOf(_S_, _R_, 0). - 1. Repeat, while _j_ is not ~not-found~, - 1. Let _T_ be the substring of _S_ from _i_ to _j_. - 1. Append _T_ to _substrings_. + 1. Let _searchStart_ be 0. + 1. Let _matchIndex_ be StringIndexOf(_string_, _separatorString_, 0). + 1. Repeat, while _matchIndex_ is not ~not-found~, + 1. Let _substring_ be the substring of _string_ from _searchStart_ to _matchIndex_. + 1. Append _substring_ to _substrings_. 1. If the number of elements in _substrings_ is _lim_, return CreateArrayFromList(_substrings_). - 1. Set _i_ to _j_ + _separatorLength_. - 1. Set _j_ to StringIndexOf(_S_, _R_, _i_). - 1. Let _T_ be the substring of _S_ from _i_. - 1. Append _T_ to _substrings_. + 1. Set _searchStart_ to _matchIndex_ + _separatorLength_. + 1. Set _matchIndex_ to StringIndexOf(_string_, _separatorString_, _searchStart_). + 1. Let _substring_ be the substring of _string_ from _searchStart_. + 1. Append _substring_ to _substrings_. 1. Return CreateArrayFromList(_substrings_). @@ -35081,29 +36855,27 @@

        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 _S_ be ? ToString(_O_). - 1. Let _isRegExp_ be ? IsRegExp(_searchString_). - 1. If _isRegExp_ is *true*, throw a *TypeError* exception. - 1. Let _searchStr_ be ? ToString(_searchString_). - 1. Let _len_ be the length of _S_. - 1. If _position_ is *undefined*, let _pos_ be 0; else let _pos_ be ? ToIntegerOrInfinity(_position_). - 1. Let _start_ be the result of clamping _pos_ between 0 and _len_. - 1. Let _searchLength_ be the length of _searchStr_. + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Let _isRegexp_ be ? IsRegExp(_searchString_). + 1. If _isRegexp_ is *true*, throw a *TypeError* exception. + 1. Set _searchString_ to ? ToString(_searchString_). + 1. Let _length_ be the length of _string_. + 1. If _position_ is *undefined*, set _position_ to 0; else set _position_ to ? ToIntegerOrInfinity(_position_). + 1. Let _start_ be the result of clamping _position_ between 0 and _length_. + 1. Let _searchLength_ be the length of _searchString_. 1. If _searchLength_ = 0, return *true*. 1. Let _end_ be _start_ + _searchLength_. - 1. If _end_ > _len_, return *false*. - 1. Let _substring_ be the substring of _S_ from _start_ to _end_. - 1. If _substring_ is _searchStr_, return *true*. + 1. If _end_ > _length_, return *false*. + 1. Let _substring_ be the substring of _string_ from _start_ to _end_. + 1. If _substring_ is _searchString_, return *true*. 1. Return *false*. - -

        This method returns *true* if the sequence of code units of _searchString_ converted to a String is the same as the corresponding code units of this object (converted to a String) starting at index _position_. Otherwise it returns *false*.

        -

        Throwing an exception if the first argument is a RegExp is specified in order to allow future editions to define extensions that allow such argument values.

        @@ -35112,30 +36884,31 @@

        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 _S_ be ? ToString(_O_). - 1. Let _len_ be the length of _S_. + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Let _length_ be the length of _string_. 1. Let _intStart_ be ? ToIntegerOrInfinity(_start_). - 1. If _end_ is *undefined*, let _intEnd_ be _len_; else let _intEnd_ be ? ToIntegerOrInfinity(_end_). - 1. Let _finalStart_ be the result of clamping _intStart_ between 0 and _len_. - 1. Let _finalEnd_ be the result of clamping _intEnd_ between 0 and _len_. + 1. If _end_ is *undefined*, let _intEnd_ be _length_; else let _intEnd_ be ? ToIntegerOrInfinity(_end_). + 1. Let _finalStart_ be the result of clamping _intStart_ between 0 and _length_. + 1. Let _finalEnd_ be the result of clamping _intEnd_ between 0 and _length_. 1. Let _from_ be min(_finalStart_, _finalEnd_). 1. Let _to_ be max(_finalStart_, _finalEnd_). - 1. Return the substring of _S_ from _from_ to _to_. + 1. Return the substring of _string_ from _from_ to _to_.

        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.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 +36919,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,17 +36930,18 @@

        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 _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 _L_ be CodePointsToString(_lowerText_). - 1. Return _L_. + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Let _sText_ be StringToCodePoints(_string_). + 1. Let _lowerText_ be toLowercase(_sText_), according to the Unicode Default Case Conversion algorithm. + 1. Let _lowercaseString_ be CodePointsToString(_lowerText_). + 1. Return _lowercaseString_.

        The result must be derived according to the locale-insensitive case mappings in the Unicode Character Database (this explicitly includes not only the file UnicodeData.txt, but also all locale-insensitive mappings in the file SpecialCasing.txt that accompanies it).

        @@ -35178,7 +36952,7 @@

        String.prototype.toLowerCase ( )

        - +

        String.prototype.toString ( )

        This method performs the following steps when called:

        @@ -35189,7 +36963,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,34 +36972,35 @@

        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 _S_ be ? ToString(_O_). - 1. Let _strLen_ be the length of _S_. + 1. Let _thisValue_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_thisValue_). + 1. Let _string_ be ? ToString(_thisValue_). + 1. Let _stringLength_ be the length of _string_. 1. Let _k_ be 0. 1. Let _result_ be the empty String. - 1. Repeat, while _k_ < _strLen_, - 1. Let _cp_ be CodePointAt(_S_, _k_). - 1. If _cp_.[[IsUnpairedSurrogate]] is *true*, then + 1. Repeat, while _k_ < _stringLength_, + 1. Let _codePoint_ be CodePointAt(_string_, _k_). + 1. If _codePoint_.[[IsUnpairedSurrogate]] is *true*, then 1. Set _result_ to the string-concatenation of _result_ and 0xFFFD (REPLACEMENT CHARACTER). 1. Else, - 1. Set _result_ to the string-concatenation of _result_ and UTF16EncodeCodePoint(_cp_.[[CodePoint]]). - 1. Set _k_ to _k_ + _cp_.[[CodeUnitCount]]. + 1. Set _result_ to the string-concatenation of _result_ and UTF16EncodeCodePoint(_codePoint_.[[CodePoint]]). + 1. Set _k_ to _k_ + _codePoint_.[[CodeUnitCount]]. 1. Return _result_.
        - +

        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:

        - 1. Let _S_ be the *this* value. - 1. Return ? TrimString(_S_, ~start+end~). + 1. Let _thisValue_ be the *this* value. + 1. Return ? TrimString(_thisValue_, ~start+end~).

        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.

        @@ -35234,57 +37009,57 @@

        String.prototype.trim ( )

        TrimString ( - _string_: an ECMAScript language value, + _arg_: an ECMAScript language value, _where_: ~start~, ~end~, or ~start+end~, ): either a normal completion containing a String or a throw completion

        description
        -
        It interprets _string_ as a sequence of UTF-16 encoded code points, as described in .
        +
        It interprets _arg_ 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(_arg_). + 1. Let _string_ be ? ToString(_arg_). 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. Let _trimmedString_ be the String value that is a copy of _string_ with leading white space removed. 1. Else if _where_ is ~end~, then - 1. Let _T_ be the String value that is a copy of _S_ with trailing white space removed. + 1. Let _trimmedString_ be the String value that is a copy of _string_ with trailing white space removed. 1. Else, 1. Assert: _where_ is ~start+end~. - 1. Let _T_ be the String value that is a copy of _S_ with both leading and trailing white space removed. - 1. Return _T_. + 1. Let _trimmedString_ be the String value that is a copy of _string_ with both leading and trailing white space removed. + 1. Return _trimmedString_.

        The definition of white space is the union of |WhiteSpace| and |LineTerminator|. When determining whether a Unicode code point is in Unicode general category “Space_Separator” (“Zs”), code unit sequences are interpreted as UTF-16 encoded code point sequences as specified in .

        - +

        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:

        - 1. Let _S_ be the *this* value. - 1. Return ? TrimString(_S_, ~end~). + 1. Let _string_ be the *this* value. + 1. Return ? TrimString(_string_, ~end~).

        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.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:

        - 1. Let _S_ be the *this* value. - 1. Return ? TrimString(_S_, ~start~). + 1. Let _string_ be the *this* value. + 1. Return ? TrimString(_string_, ~start~).

        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.valueOf ( )

        This method performs the following steps when called:

        @@ -35294,39 +37069,40 @@

        String.prototype.valueOf ( )

        ThisStringValue ( - _value_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing a String or a throw completion

        - 1. If _value_ is a String, return _value_. - 1. If _value_ is an Object and _value_ has a [[StringData]] internal slot, then - 1. Let _s_ be _value_.[[StringData]]. - 1. Assert: _s_ is a String. - 1. Return _s_. + 1. If _arg_ is a String, return _arg_. + 1. If _arg_ is an Object and _arg_ has a [[StringData]] internal slot, then + 1. Let _string_ be _arg_.[[StringData]]. + 1. Assert: _string_ is a String. + 1. Return _string_. 1. Throw a *TypeError* exception.
        - -

        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 _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_. + 1. Let _string_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_string_). + 1. Set _string_ to ? ToString(_string_). + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _string_ and performs the following steps when called: + 1. Let _length_ be the length of _string_. 1. Let _position_ be 0. - 1. Repeat, while _position_ < _len_, - 1. Let _cp_ be CodePointAt(_s_, _position_). - 1. Let _nextIndex_ be _position_ + _cp_.[[CodeUnitCount]]. - 1. Let _resultString_ be the substring of _s_ from _position_ to _nextIndex_. + 1. Repeat, while _position_ < _length_, + 1. Let _codePoint_ be CodePointAt(_string_, _position_). + 1. Let _nextIndex_ be _position_ + _codePoint_.[[CodeUnitCount]]. + 1. Let _resultString_ be the substring of _string_ 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 +37123,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 +37207,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 +37451,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 +37460,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 +37538,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 +37547,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 `}` @@ -35777,39 +37582,55 @@

            Static Semantics: Early Errors

            Static Semantics: CountLeftCapturingParensWithin ( - _node_: a Parse Node, + _parseNode_: a Parse Node, ): a non-negative integer

            description
            -
            It returns the number of left-capturing parentheses in _node_. A left-capturing parenthesis is any `(` pattern character that is matched by the `(` terminal of the Atom :: `(` GroupSpecifier? Disjunction `)` production.
            +
            It returns the number of left-capturing parentheses in _parseNode_. A left-capturing parenthesis is any `(` pattern character that is matched by the `(` terminal of the Atom :: `(` GroupSpecifier? Disjunction `)` production.

            This section is amended in .

            - 1. Assert: _node_ is an instance of a production in the RegExp Pattern grammar. - 1. Return the number of Atom :: `(` GroupSpecifier? Disjunction `)` Parse Nodes contained within _node_. + 1. Assert: _parseNode_ is an instance of a production in the RegExp Pattern grammar. + 1. Return the number of Atom :: `(` GroupSpecifier? Disjunction `)` Parse Nodes contained within _parseNode_.

            Static Semantics: CountLeftCapturingParensBefore ( - _node_: a Parse Node, + _parseNode_: a Parse Node, ): a non-negative integer

            description
            -
            It returns the number of left-capturing parentheses within the enclosing pattern that occur to the left of _node_.
            +
            It returns the number of left-capturing parentheses within the enclosing pattern that occur to the left of _parseNode_.

            This section is amended in .

            - 1. Assert: _node_ is an instance of a production in the RegExp Pattern grammar. - 1. Let _pattern_ be the |Pattern| containing _node_. - 1. Return the number of Atom :: `(` GroupSpecifier? Disjunction `)` Parse Nodes contained within _pattern_ that either occur before _node_ or contain _node_. + 1. Assert: _parseNode_ is an instance of a production in the RegExp Pattern grammar. + 1. Let _pattern_ be the |Pattern| containing _parseNode_. + 1. Return the number of Atom :: `(` GroupSpecifier? Disjunction `)` Parse Nodes contained within _pattern_ that either occur before _parseNode_ or contain _parseNode_. + +
            + + +

            + 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*.
            @@ -35877,8 +37698,8 @@

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

            ClassAtomNoDash :: SourceCharacter but not one of `\` or `]` or `-` - 1. Let _ch_ be the code point matched by |SourceCharacter|. - 1. Return the numeric value of _ch_. + 1. Let _codePoint_ be the code point matched by |SourceCharacter|. + 1. Return the numeric value of _codePoint_. ClassEscape :: `b` @@ -35898,23 +37719,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` @@ -36004,8 +37827,8 @@

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

            CharacterEscape :: `c` AsciiLetter - 1. Let _ch_ be the code point matched by |AsciiLetter|. - 1. Let _i_ be the numeric value of _ch_. + 1. Let _codePoint_ be the code point matched by |AsciiLetter|. + 1. Let _i_ be the numeric value of _codePoint_. 1. Return the remainder of dividing _i_ by 32. CharacterEscape :: `0` [lookahead ∉ DecimalDigit] @@ -36023,8 +37846,8 @@

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

            1. Let _lead_ be the CharacterValue of |HexLeadSurrogate|. 1. Let _trail_ be the CharacterValue of |HexTrailSurrogate|. - 1. Let _cp_ be UTF16SurrogatePairToCodePoint(_lead_, _trail_). - 1. Return the numeric value of _cp_. + 1. Let _codePoint_ be UTF16SurrogatePairToCodePoint(_lead_, _trail_). + 1. Return the numeric value of _codePoint_. RegExpUnicodeEscapeSequence :: `u` Hex4Digits @@ -36046,18 +37869,18 @@

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

            CharacterEscape :: IdentityEscape - 1. Let _ch_ be the code point matched by |IdentityEscape|. - 1. Return the numeric value of _ch_. + 1. Let _codePoint_ be the code point matched by |IdentityEscape|. + 1. Return the numeric value of _codePoint_. ClassSetCharacter :: SourceCharacter but not ClassSetSyntaxCharacter - 1. Let _ch_ be the code point matched by |SourceCharacter|. - 1. Return the numeric value of _ch_. + 1. Let _codePoint_ be the code point matched by |SourceCharacter|. + 1. Return the numeric value of _codePoint_. ClassSetCharacter :: `\` ClassSetReservedPunctuator - 1. Let _ch_ be the code point matched by |ClassSetReservedPunctuator|. - 1. Return the numeric value of _ch_. + 1. Let _codePoint_ be the code point matched by |ClassSetReservedPunctuator|. + 1. Return the numeric value of _codePoint_. ClassSetCharacter :: `\b` @@ -36097,7 +37920,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? @@ -36163,9 +37986,9 @@

            1. Let _name_ be the CapturingGroupName of _thisGroupName_. 1. Let _pattern_ be the |Pattern| containing _thisGroupName_. 1. Let _result_ be a new empty List. - 1. For each |GroupSpecifier| _gs_ that _pattern_ contains, do - 1. If the CapturingGroupName of _gs_ is _name_, then - 1. Append _gs_ to _result_. + 1. For each |GroupSpecifier| _groupSpecifier_ that _pattern_ contains, do + 1. If the CapturingGroupName of _groupSpecifier_ is _name_, then + 1. Append _groupSpecifier_ to _result_. 1. Return _result_. @@ -36189,14 +38012,14 @@

            Static Semantics: RegExpIdentifierCodePoints ( ): a List of code points

            RegExpIdentifierName :: RegExpIdentifierStart - 1. Let _cp_ be the RegExpIdentifierCodePoint of |RegExpIdentifierStart|. - 1. Return « _cp_ ». + 1. Let _codePoint_ be the RegExpIdentifierCodePoint of |RegExpIdentifierStart|. + 1. Return « _codePoint_ ». RegExpIdentifierName :: RegExpIdentifierName RegExpIdentifierPart - 1. Let _cps_ be the RegExpIdentifierCodePoints of the derived |RegExpIdentifierName|. - 1. Let _cp_ be the RegExpIdentifierCodePoint of |RegExpIdentifierPart|. - 1. Return the list-concatenation of _cps_ and « _cp_ ». + 1. Let _codePoints_ be the RegExpIdentifierCodePoints of the derived |RegExpIdentifierName|. + 1. Let _codePoint_ be the RegExpIdentifierCodePoint of |RegExpIdentifierPart|. + 1. Return the list-concatenation of _codePoints_ and « _codePoint_ ». @@ -36252,10 +38075,10 @@

            Notation

            A CharSetElement is one of the two following entities:
            • - If _rer_.[[UnicodeSets]] is *false*, then a CharSetElement is a character in the sense of the Pattern Semantics above. + If _regexpRecord_.[[UnicodeSets]] is *false*, then a CharSetElement is a character in the sense of the Pattern Semantics above.
            • - If _rer_.[[UnicodeSets]] is *true*, then a CharSetElement is a sequence whose elements are characters in the sense of the Pattern Semantics above. This includes the empty sequence, sequences of one character, and sequences of more than one character. For convenience, when working with CharSetElements of this kind, an individual character is treated interchangeably with a sequence of one character. + If _regexpRecord_.[[UnicodeSets]] is *true*, then a CharSetElement is a sequence whose elements are characters in the sense of the Pattern Semantics above. This includes the empty sequence, sequences of one character, and sequences of more than one character. For convenience, when working with CharSetElements of this kind, an individual character is treated interchangeably with a sequence of one character.
            @@ -36263,33 +38086,32 @@

            Notation

            A CharSet is a mathematical set of CharSetElements.
          • - 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 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 MatchResult is either a MatchState or the special token ~failure~ that indicates that the match failed. + 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 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 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 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.
          • RegExp Records

            -

            A RegExp Record is a Record value used to store information about a RegExp that is needed during compilation and possibly during matching.

            +

            A RegExp Record is a Record used to store information about a RegExp that is needed during compilation and possibly during matching.

            It has the following fields:

            - - - - - + + + + + + + @@ -36328,22 +38150,22 @@

            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 + _regexpRecord_: a RegExp Record, + ): an Abstract Closure that takes a List of characters and a non-negative integer and returns either a MatchState or ~failure~

            Pattern :: Disjunction - 1. Let _m_ be CompileSubpattern of |Disjunction| with arguments _rer_ and ~forward~. - 1. Return a new Abstract Closure with parameters (_Input_, _index_) that captures _rer_ and _m_ and performs the following steps when called: - 1. Assert: _Input_ is a List of characters. - 1. Assert: 0 ≤ _index_ ≤ the number of elements in _Input_. + 1. Let _m_ be CompileSubpattern of |Disjunction| with arguments _regexpRecord_ and ~forward~. + 1. Return a new Abstract Closure with parameters (_input_, _index_) that captures _regexpRecord_ and _m_ and performs the following steps when called: + 1. Assert: _input_ is a List of characters. + 1. Assert: 0 ≤ _index_ ≤ the number of elements in _input_. 1. Let _c_ be a new MatcherContinuation with parameters (_y_) that captures nothing and performs the following steps when called: 1. Assert: _y_ is a MatchState. 1. Return _y_. - 1. Let _cap_ be a List of _rer_.[[CapturingGroupsCount]] *undefined* values, indexed 1 through _rer_.[[CapturingGroupsCount]]. - 1. Let _x_ be the MatchState { [[Input]]: _Input_, [[EndIndex]]: _index_, [[Captures]]: _cap_ }. + 1. Let _capability_ be a List of _regexpRecord_.[[CapturingGroupsCount]] *undefined* values, indexed 1 through _regexpRecord_.[[CapturingGroupsCount]]. + 1. Let _x_ be the MatchState { [[Input]]: _input_, [[EndIndex]]: _index_, [[Captures]]: _capability_ }. 1. Return _m_(_x_, _c_). @@ -36354,7 +38176,7 @@

            Runtime Semantics: CompileSubpattern ( - _rer_: a RegExp Record, + _regexpRecord_: a RegExp Record, _direction_: ~forward~ or ~backward~, ): a Matcher

            @@ -36367,8 +38189,8 @@

            Disjunction :: Alternative `|` Disjunction - 1. Let _m1_ be CompileSubpattern of |Alternative| with arguments _rer_ and _direction_. - 1. Let _m2_ be CompileSubpattern of |Disjunction| with arguments _rer_ and _direction_. + 1. Let _m1_ be CompileSubpattern of |Alternative| with arguments _regexpRecord_ and _direction_. + 1. Let _m2_ be CompileSubpattern of |Disjunction| with arguments _regexpRecord_ and _direction_. 1. Return MatchTwoAlternatives(_m1_, _m2_). @@ -36390,29 +38212,29 @@

            Alternative :: Alternative Term - 1. Let _m1_ be CompileSubpattern of |Alternative| with arguments _rer_ and _direction_. - 1. Let _m2_ be CompileSubpattern of |Term| with arguments _rer_ and _direction_. + 1. Let _m1_ be CompileSubpattern of |Alternative| with arguments _regexpRecord_ and _direction_. + 1. Let _m2_ be CompileSubpattern of |Term| with arguments _regexpRecord_ and _direction_. 1. Return MatchSequence(_m1_, _m2_, _direction_). -

            Consecutive |Term|s try to simultaneously match consecutive portions of _Input_. When _direction_ is ~forward~, if the left |Alternative|, the right |Term|, and the sequel of the regular expression all have choice points, all choices in the sequel are tried before moving on to the next choice in the right |Term|, and all choices in the right |Term| are tried before moving on to the next choice in the left |Alternative|. When _direction_ is ~backward~, the evaluation order of |Alternative| and |Term| are reversed.

            +

            Consecutive |Term|s try to simultaneously match consecutive portions of _input_. When _direction_ is ~forward~, if the left |Alternative|, the right |Term|, and the sequel of the regular expression all have choice points, all choices in the sequel are tried before moving on to the next choice in the right |Term|, and all choices in the right |Term| are tried before moving on to the next choice in the left |Alternative|. When _direction_ is ~backward~, the evaluation order of |Alternative| and |Term| are reversed.

            Term :: Assertion - 1. Return CompileAssertion of |Assertion| with argument _rer_. + 1. Return CompileAssertion of |Assertion| with argument _regexpRecord_.

            The resulting Matcher is independent of _direction_.

            Term :: Atom - 1. Return CompileAtom of |Atom| with arguments _rer_ and _direction_. + 1. Return CompileAtom of |Atom| with arguments _regexpRecord_ and _direction_. Term :: Atom Quantifier - 1. Let _m_ be CompileAtom of |Atom| with arguments _rer_ and _direction_. + 1. Let _m_ be CompileAtom of |Atom| with arguments _regexpRecord_ and _direction_. 1. Let _q_ be CompileQuantifier of |Quantifier|. 1. Assert: _q_.[[Min]] ≤ _q_.[[Max]]. 1. Let _parenIndex_ be CountLeftCapturingParensBefore(|Term|). @@ -36430,35 +38252,35 @@

            _min_: a non-negative integer, _max_: a non-negative integer or +∞, _greedy_: a Boolean, - _x_: a MatchState, - _c_: a MatcherContinuation, + _matchState_: a MatchState, + _continue_: a MatcherContinuation, _parenIndex_: a non-negative integer, _parenCount_: a non-negative integer, - ): a MatchResult + ): either a MatchState or ~failure~

            - 1. If _max_ = 0, return _c_(_x_). - 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. If _max_ = 0, return _continue_(_matchState_). + 1. Let _d_ be a new MatcherContinuation with parameters (_y_) that captures _m_, _min_, _max_, _greedy_, _matchState_, _continue_, _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. 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*. - 1. Let _Input_ be _x_.[[Input]]. - 1. Let _e_ be _x_.[[EndIndex]]. - 1. Let _xr_ be the MatchState { [[Input]]: _Input_, [[EndIndex]]: _e_, [[Captures]]: _cap_ }. + 1. [id="step-repeatmatcher-done"] If _min_ = 0 and _y_.[[EndIndex]] = _matchState_.[[EndIndex]], return ~failure~. + 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_, _continue_, _parenIndex_, _parenCount_). + 1. Let _capability_ be a copy of _matchState_.[[Captures]]. + 1. [id="step-repeatmatcher-clear-captures"] For each integer _k_ in the inclusive interval from _parenIndex_ + 1 to _parenIndex_ + _parenCount_, set _capability_[_k_] to *undefined*. + 1. Let _input_ be _matchState_.[[Input]]. + 1. Let _e_ be _matchState_.[[EndIndex]]. + 1. Let _xr_ be the MatchState { [[Input]]: _input_, [[EndIndex]]: _e_, [[Captures]]: _capability_ }. 1. If _min_ ≠ 0, return _m_(_xr_, _d_). 1. If _greedy_ is *false*, then - 1. Let _z_ be _c_(_x_). + 1. Let _z_ be _continue_(_matchState_). 1. If _z_ is not ~failure~, return _z_. 1. Return _m_(_xr_, _d_). 1. Let _z_ be _m_(_xr_, _d_). 1. If _z_ is not ~failure~, return _z_. - 1. Return _c_(_x_). + 1. Return _continue_(_matchState_).

            An |Atom| followed by a |Quantifier| is repeated the number of times specified by the |Quantifier|. A |Quantifier| can be non-greedy, in which case the |Atom| pattern is repeated as few times as possible while still matching the sequel, or it can be greedy, in which case the |Atom| pattern is repeated as many times as possible while still matching the sequel. The |Atom| pattern is repeated rather than the input character sequence that it matches, so different repetitions of the |Atom| can match different input substrings.

            @@ -36507,10 +38329,10 @@

            EmptyMatcher ( ): a Matcher

            - 1. Return a new Matcher with parameters (_x_, _c_) that captures nothing and performs the following steps when called: - 1. Assert: _x_ is a MatchState. - 1. Assert: _c_ is a MatcherContinuation. - 1. Return _c_(_x_). + 1. Return a new Matcher with parameters (_matchState_, _continue_) that captures nothing and performs the following steps when called: + 1. Assert: _matchState_ is a MatchState. + 1. Assert: _continue_ is a MatcherContinuation. + 1. Return _continue_(_matchState_). @@ -36524,12 +38346,12 @@

            - 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 _r_ be _m1_(_x_, _c_). - 1. If _r_ is not ~failure~, return _r_. - 1. Return _m2_(_x_, _c_). + 1. Return a new Matcher with parameters (_matchState_, _continue_) that captures _m1_ and _m2_ and performs the following steps when called: + 1. Assert: _matchState_ is a MatchState. + 1. Assert: _continue_ is a MatcherContinuation. + 1. Let _result_ be _m1_(_matchState_, _continue_). + 1. If _result_ is not ~failure~, return _result_. + 1. Return _m2_(_matchState_, _continue_). @@ -36545,22 +38367,21 @@

            1. If _direction_ is ~forward~, then - 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 _m2_ and performs the following steps when called: + 1. Return a new Matcher with parameters (_matchState_, _continue_) that captures _m1_ and _m2_ and performs the following steps when called: + 1. Assert: _matchState_ is a MatchState. + 1. Assert: _continue_ is a MatcherContinuation. + 1. Let _d_ be a new MatcherContinuation with parameters (_y_) that captures _continue_ and _m2_ and performs the following steps when called: 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. Return _m2_(_y_, _continue_). + 1. Return _m1_(_matchState_, _d_). + 1. Assert: _direction_ is ~backward~. + 1. Return a new Matcher with parameters (_matchState_, _continue_) that captures _m1_ and _m2_ and performs the following steps when called: + 1. Assert: _matchState_ is a MatchState. + 1. Assert: _continue_ is a MatcherContinuation. + 1. Let _d_ be a new MatcherContinuation with parameters (_y_) that captures _continue_ and _m1_ and performs the following steps when called: + 1. Assert: _y_ is a MatchState. + 1. Return _m1_(_y_, _continue_). + 1. Return _m2_(_matchState_, _d_). @@ -36568,7 +38389,7 @@

            Runtime Semantics: CompileAssertion ( - _rer_: a RegExp Record, + _regexpRecord_: a RegExp Record, ): a Matcher

            @@ -36578,71 +38399,71 @@

            Assertion :: `^` - 1. Return a new Matcher with parameters (_x_, _c_) that captures _rer_ 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 _e_ be _x_.[[EndIndex]]. - 1. If _e_ = 0, or if _rer_.[[Multiline]] is *true* and the character _Input_[_e_ - 1] is matched by |LineTerminator|, then - 1. Return _c_(_x_). + 1. Return a new Matcher with parameters (_matchState_, _continue_) that captures _regexpRecord_ and performs the following steps when called: + 1. Assert: _matchState_ is a MatchState. + 1. Assert: _continue_ is a MatcherContinuation. + 1. Let _input_ be _matchState_.[[Input]]. + 1. Let _e_ be _matchState_.[[EndIndex]]. + 1. If _e_ = 0, or if _regexpRecord_.[[Multiline]] is *true* and the character _input_[_e_ - 1] is matched by |LineTerminator|, then + 1. Return _continue_(_matchState_). 1. Return ~failure~. -

            Even when the `y` flag is used with a pattern, `^` always matches only at the beginning of _Input_, or (if _rer_.[[Multiline]] is *true*) at the beginning of a line.

            +

            Even when the `y` flag is used with a pattern, `^` always matches only at the beginning of _input_, or (if _regexpRecord_.[[Multiline]] is *true*) at the beginning of a line.

            Assertion :: `$` - 1. Return a new Matcher with parameters (_x_, _c_) that captures _rer_ 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 _e_ be _x_.[[EndIndex]]. - 1. Let _InputLength_ be the number of elements in _Input_. - 1. If _e_ = _InputLength_, or if _rer_.[[Multiline]] is *true* and the character _Input_[_e_] is matched by |LineTerminator|, then - 1. Return _c_(_x_). + 1. Return a new Matcher with parameters (_matchState_, _continue_) that captures _regexpRecord_ and performs the following steps when called: + 1. Assert: _matchState_ is a MatchState. + 1. Assert: _continue_ is a MatcherContinuation. + 1. Let _input_ be _matchState_.[[Input]]. + 1. Let _e_ be _matchState_.[[EndIndex]]. + 1. Let _inputLength_ be the number of elements in _input_. + 1. If _e_ = _inputLength_, or if _regexpRecord_.[[Multiline]] is *true* and the character _input_[_e_] is matched by |LineTerminator|, then + 1. Return _continue_(_matchState_). 1. Return ~failure~. Assertion :: `\b` - 1. Return a new Matcher with parameters (_x_, _c_) that captures _rer_ 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 _e_ be _x_.[[EndIndex]]. - 1. Let _a_ be IsWordChar(_rer_, _Input_, _e_ - 1). - 1. Let _b_ be IsWordChar(_rer_, _Input_, _e_). - 1. If _a_ is *true* and _b_ is *false*, or if _a_ is *false* and _b_ is *true*, return _c_(_x_). + 1. Return a new Matcher with parameters (_matchState_, _continue_) that captures _regexpRecord_ and performs the following steps when called: + 1. Assert: _matchState_ is a MatchState. + 1. Assert: _continue_ is a MatcherContinuation. + 1. Let _input_ be _matchState_.[[Input]]. + 1. Let _e_ be _matchState_.[[EndIndex]]. + 1. Let _a_ be IsWordChar(_regexpRecord_, _input_, _e_ - 1). + 1. Let _b_ be IsWordChar(_regexpRecord_, _input_, _e_). + 1. If _a_ is *true* and _b_ is *false*, or if _a_ is *false* and _b_ is *true*, return _continue_(_matchState_). 1. Return ~failure~. Assertion :: `\B` - 1. Return a new Matcher with parameters (_x_, _c_) that captures _rer_ 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 _e_ be _x_.[[EndIndex]]. - 1. Let _a_ be IsWordChar(_rer_, _Input_, _e_ - 1). - 1. Let _b_ be IsWordChar(_rer_, _Input_, _e_). - 1. If _a_ is *true* and _b_ is *true*, or if _a_ is *false* and _b_ is *false*, return _c_(_x_). + 1. Return a new Matcher with parameters (_matchState_, _continue_) that captures _regexpRecord_ and performs the following steps when called: + 1. Assert: _matchState_ is a MatchState. + 1. Assert: _continue_ is a MatcherContinuation. + 1. Let _input_ be _matchState_.[[Input]]. + 1. Let _e_ be _matchState_.[[EndIndex]]. + 1. Let _a_ be IsWordChar(_regexpRecord_, _input_, _e_ - 1). + 1. Let _b_ be IsWordChar(_regexpRecord_, _input_, _e_). + 1. If _a_ is *true* and _b_ is *true*, or if _a_ is *false* and _b_ is *false*, return _continue_(_matchState_). 1. Return ~failure~. Assertion :: `(?=` Disjunction `)` - 1. Let _m_ be CompileSubpattern of |Disjunction| with arguments _rer_ and ~forward~. - 1. Return a new Matcher with parameters (_x_, _c_) that captures _m_ and performs the following steps when called: - 1. Assert: _x_ is a MatchState. - 1. Assert: _c_ is a MatcherContinuation. + 1. Let _m_ be CompileSubpattern of |Disjunction| with arguments _regexpRecord_ and ~forward~. + 1. Return a new Matcher with parameters (_matchState_, _continue_) that captures _m_ and performs the following steps when called: + 1. Assert: _matchState_ is a MatchState. + 1. Assert: _continue_ is a MatcherContinuation. 1. Let _d_ be a new MatcherContinuation with parameters (_y_) that captures nothing and performs the following steps when called: 1. Assert: _y_ is a MatchState. 1. Return _y_. - 1. Let _r_ be _m_(_x_, _d_). - 1. If _r_ is ~failure~, return ~failure~. - 1. Assert: _r_ is a MatchState. - 1. Let _cap_ be _r_.[[Captures]]. - 1. Let _Input_ be _x_.[[Input]]. - 1. Let _xe_ be _x_.[[EndIndex]]. - 1. Let _z_ be the MatchState { [[Input]]: _Input_, [[EndIndex]]: _xe_, [[Captures]]: _cap_ }. - 1. Return _c_(_z_). + 1. Let _result_ be _m_(_matchState_, _d_). + 1. If _result_ is ~failure~, return ~failure~. + 1. Assert: _result_ is a MatchState. + 1. Let _capability_ be _result_.[[Captures]]. + 1. Let _input_ be _matchState_.[[Input]]. + 1. Let _xe_ be _matchState_.[[EndIndex]]. + 1. Let _z_ be the MatchState { [[Input]]: _input_, [[EndIndex]]: _xe_, [[Captures]]: _capability_ }. + 1. Return _continue_(_z_).

            The form `(?=` |Disjunction| `)` specifies a zero-width positive lookahead. In order for it to succeed, the pattern inside |Disjunction| must match at the current position, but the current position is not advanced before matching the sequel. If |Disjunction| can match at the current position in several ways, only the first one is tried. Unlike other regular expression operators, there is no backtracking into a `(?=` form (this unusual behaviour is inherited from Perl). This only matters when the |Disjunction| contains capturing parentheses and the sequel of the pattern contains backreferences to those captures.

            @@ -36659,16 +38480,16 @@

            Assertion :: `(?!` Disjunction `)` - 1. Let _m_ be CompileSubpattern of |Disjunction| with arguments _rer_ and ~forward~. - 1. Return a new Matcher with parameters (_x_, _c_) that captures _m_ and performs the following steps when called: - 1. Assert: _x_ is a MatchState. - 1. Assert: _c_ is a MatcherContinuation. + 1. Let _m_ be CompileSubpattern of |Disjunction| with arguments _regexpRecord_ and ~forward~. + 1. Return a new Matcher with parameters (_matchState_, _continue_) that captures _m_ and performs the following steps when called: + 1. Assert: _matchState_ is a MatchState. + 1. Assert: _continue_ is a MatcherContinuation. 1. Let _d_ be a new MatcherContinuation with parameters (_y_) that captures nothing and performs the following steps when called: 1. Assert: _y_ is a MatchState. 1. Return _y_. - 1. Let _r_ be _m_(_x_, _d_). - 1. If _r_ is not ~failure~, return ~failure~. - 1. Return _c_(_x_). + 1. Let _result_ be _m_(_matchState_, _d_). + 1. If _result_ is not ~failure~, return ~failure~. + 1. Return _continue_(_matchState_).

            The form `(?!` |Disjunction| `)` specifies a zero-width negative lookahead. In order for it to succeed, the pattern inside |Disjunction| must fail to match at the current position. The current position is not advanced before matching the sequel. |Disjunction| can contain capturing parentheses, but backreferences to them only make sense from within |Disjunction| itself. Backreferences to these capturing parentheses from elsewhere in the pattern always return *undefined* because the negative lookahead must fail for the pattern to succeed. For example,

            @@ -36678,51 +38499,51 @@

            Assertion :: `(?<=` Disjunction `)` - 1. Let _m_ be CompileSubpattern of |Disjunction| with arguments _rer_ and ~backward~. - 1. Return a new Matcher with parameters (_x_, _c_) that captures _m_ and performs the following steps when called: - 1. Assert: _x_ is a MatchState. - 1. Assert: _c_ is a MatcherContinuation. + 1. Let _m_ be CompileSubpattern of |Disjunction| with arguments _regexpRecord_ and ~backward~. + 1. Return a new Matcher with parameters (_matchState_, _continue_) that captures _m_ and performs the following steps when called: + 1. Assert: _matchState_ is a MatchState. + 1. Assert: _continue_ is a MatcherContinuation. 1. Let _d_ be a new MatcherContinuation with parameters (_y_) that captures nothing and performs the following steps when called: 1. Assert: _y_ is a MatchState. 1. Return _y_. - 1. Let _r_ be _m_(_x_, _d_). - 1. If _r_ is ~failure~, return ~failure~. - 1. Assert: _r_ is a MatchState. - 1. Let _cap_ be _r_.[[Captures]]. - 1. Let _Input_ be _x_.[[Input]]. - 1. Let _xe_ be _x_.[[EndIndex]]. - 1. Let _z_ be the MatchState { [[Input]]: _Input_, [[EndIndex]]: _xe_, [[Captures]]: _cap_ }. - 1. Return _c_(_z_). + 1. Let _result_ be _m_(_matchState_, _d_). + 1. If _result_ is ~failure~, return ~failure~. + 1. Assert: _result_ is a MatchState. + 1. Let _capability_ be _result_.[[Captures]]. + 1. Let _input_ be _matchState_.[[Input]]. + 1. Let _xe_ be _matchState_.[[EndIndex]]. + 1. Let _z_ be the MatchState { [[Input]]: _input_, [[EndIndex]]: _xe_, [[Captures]]: _capability_ }. + 1. Return _continue_(_z_). Assertion :: `(?<!` Disjunction `)` - 1. Let _m_ be CompileSubpattern of |Disjunction| with arguments _rer_ and ~backward~. - 1. Return a new Matcher with parameters (_x_, _c_) that captures _m_ and performs the following steps when called: - 1. Assert: _x_ is a MatchState. - 1. Assert: _c_ is a MatcherContinuation. + 1. Let _m_ be CompileSubpattern of |Disjunction| with arguments _regexpRecord_ and ~backward~. + 1. Return a new Matcher with parameters (_matchState_, _continue_) that captures _m_ and performs the following steps when called: + 1. Assert: _matchState_ is a MatchState. + 1. Assert: _continue_ is a MatcherContinuation. 1. Let _d_ be a new MatcherContinuation with parameters (_y_) that captures nothing and performs the following steps when called: 1. Assert: _y_ is a MatchState. 1. Return _y_. - 1. Let _r_ be _m_(_x_, _d_). - 1. If _r_ is not ~failure~, return ~failure~. - 1. Return _c_(_x_). + 1. Let _result_ be _m_(_matchState_, _d_). + 1. If _result_ is not ~failure~, return ~failure~. + 1. Return _continue_(_matchState_).

            IsWordChar ( - _rer_: a RegExp Record, - _Input_: a List of characters, + _regexpRecord_: a RegExp Record, + _input_: a List of characters, _e_: an integer, ): a Boolean

            - 1. Let _InputLength_ be the number of elements in _Input_. - 1. If _e_ = -1 or _e_ = _InputLength_, return *false*. - 1. Let _c_ be the character _Input_[_e_]. - 1. If WordCharacters(_rer_) contains _c_, return *true*. + 1. Let _inputLength_ be the number of elements in _input_. + 1. If _e_ = -1 or _e_ = _inputLength_, return *false*. + 1. Let _char_ be the character _input_[_e_]. + 1. If WordCharacters(_regexpRecord_) contains _char_, return *true*. 1. Return *false*.
            @@ -36781,7 +38602,7 @@

            Runtime Semantics: CompileQuantifierPrefix ( ): a Record with fields [[Min]]

            Runtime Semantics: CompileAtom ( - _rer_: a RegExp Record, + _regexpRecord_: a RegExp Record, _direction_: ~forward~ or ~backward~, ): a Matcher

            @@ -36794,51 +38615,51 @@

            Atom :: PatternCharacter - 1. Let _ch_ be the character matched by |PatternCharacter|. - 1. Let _A_ be a one-element CharSet containing the character _ch_. - 1. Return CharacterSetMatcher(_rer_, _A_, *false*, _direction_). + 1. Let _char_ be the character matched by |PatternCharacter|. + 1. Let _charSet_ be a one-element CharSet containing the character _char_. + 1. Return CharacterSetMatcher(_regexpRecord_, _charSet_, *false*, _direction_). Atom :: `.` - 1. Let _A_ be AllCharacters(_rer_). - 1. If _rer_.[[DotAll]] is not *true*, then - 1. Remove from _A_ all characters corresponding to a code point on the right-hand side of the |LineTerminator| production. - 1. Return CharacterSetMatcher(_rer_, _A_, *false*, _direction_). + 1. Let _charSet_ be AllCharacters(_regexpRecord_). + 1. If _regexpRecord_.[[DotAll]] is not *true*, then + 1. Remove from _charSet_ all characters corresponding to a code point on the right-hand side of the |LineTerminator| production. + 1. Return CharacterSetMatcher(_regexpRecord_, _charSet_, *false*, _direction_). Atom :: CharacterClass - 1. Let _cc_ be CompileCharacterClass of |CharacterClass| with argument _rer_. + 1. Let _cc_ be CompileCharacterClass of |CharacterClass| with argument _regexpRecord_. 1. Let _cs_ be _cc_.[[CharSet]]. - 1. If _rer_.[[UnicodeSets]] is *false*, or if every CharSetElement of _cs_ consists of a single character (including if _cs_ is empty), return CharacterSetMatcher(_rer_, _cs_, _cc_.[[Invert]], _direction_). + 1. If _regexpRecord_.[[UnicodeSets]] is *false* or every CharSetElement of _cs_ consists of a single character (including if _cs_ is empty), return CharacterSetMatcher(_regexpRecord_, _cs_, _cc_.[[Invert]], _direction_). 1. Assert: _cc_.[[Invert]] is *false*. - 1. Let _lm_ be an empty List of Matchers. + 1. Let _listOfMatchers_ be an empty List of Matchers. 1. For each CharSetElement _s_ in _cs_ containing more than 1 character, iterating in descending order of length, do 1. Let _cs2_ be a one-element CharSet containing the last code point of _s_. - 1. Let _m2_ be CharacterSetMatcher(_rer_, _cs2_, *false*, _direction_). + 1. Let _m2_ be CharacterSetMatcher(_regexpRecord_, _cs2_, *false*, _direction_). 1. For each code point _c1_ in _s_, iterating backwards from its second-to-last code point, do 1. Let _cs1_ be a one-element CharSet containing _c1_. - 1. Let _m1_ be CharacterSetMatcher(_rer_, _cs1_, *false*, _direction_). + 1. Let _m1_ be CharacterSetMatcher(_regexpRecord_, _cs1_, *false*, _direction_). 1. Set _m2_ to MatchSequence(_m1_, _m2_, _direction_). - 1. Append _m2_ to _lm_. + 1. Append _m2_ to _listOfMatchers_. 1. Let _singles_ be the CharSet containing every CharSetElement of _cs_ that consists of a single character. - 1. Append CharacterSetMatcher(_rer_, _singles_, *false*, _direction_) to _lm_. - 1. If _cs_ contains the empty sequence of characters, append EmptyMatcher() to _lm_. - 1. Let _m2_ be the last Matcher in _lm_. - 1. For each Matcher _m1_ of _lm_, iterating backwards from its second-to-last element, do + 1. Append CharacterSetMatcher(_regexpRecord_, _singles_, *false*, _direction_) to _listOfMatchers_. + 1. If _cs_ contains the empty sequence of characters, append EmptyMatcher() to _listOfMatchers_. + 1. Let _m2_ be the last Matcher in _listOfMatchers_. + 1. For each Matcher _m1_ of _listOfMatchers_, iterating backwards from its second-to-last element, do 1. Set _m2_ to MatchTwoAlternatives(_m1_, _m2_). 1. Return _m2_. Atom :: `(` GroupSpecifier? Disjunction `)` - 1. Let _m_ be CompileSubpattern of |Disjunction| with arguments _rer_ and _direction_. + 1. Let _m_ be CompileSubpattern of |Disjunction| with arguments _regexpRecord_ and _direction_. 1. Let _parenIndex_ be CountLeftCapturingParensBefore(|Atom|). 1. Return a new Matcher with parameters (_x_, _c_) that captures _direction_, _m_, and _parenIndex_ 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 _x_, _c_, _direction_, and _parenIndex_ and performs the following steps when called: 1. Assert: _y_ is a MatchState. - 1. Let _cap_ be a copy of _y_.[[Captures]]. - 1. Let _Input_ be _x_.[[Input]]. + 1. Let _capability_ be a copy of _y_.[[Captures]]. + 1. Let _input_ be _x_.[[Input]]. 1. Let _xe_ be _x_.[[EndIndex]]. 1. Let _ye_ be _y_.[[EndIndex]]. 1. If _direction_ is ~forward~, then @@ -36848,71 +38669,82 @@

            1. Assert: _direction_ is ~backward~. 1. Assert: _ye_ ≤ _xe_. 1. Let _r_ be the CaptureRange { [[StartIndex]]: _ye_, [[EndIndex]]: _xe_ }. - 1. Set _cap_[_parenIndex_ + 1] to _r_. - 1. Let _z_ be the MatchState { [[Input]]: _Input_, [[EndIndex]]: _ye_, [[Captures]]: _cap_ }. + 1. Set _capability_[_parenIndex_ + 1] to _r_. + 1. Let _z_ be the MatchState { [[Input]]: _input_, [[EndIndex]]: _ye_, [[Captures]]: _capability_ }. 1. Return _c_(_z_). 1. Return _m_(_x_, _d_).

            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. Return CompileSubpattern of |Disjunction| with arguments _rer_ and _direction_. + 1. Let _addModifiers_ be the source text matched by |RegularExpressionModifiers|. + 1. Let _removeModifiers_ be the empty String. + 1. Let _modifiedRer_ be UpdateModifiers(_regexpRecord_, CodePointsToString(_addModifiers_), _removeModifiers_). + 1. Return CompileSubpattern of |Disjunction| with arguments _modifiedRer_ and _direction_. + + Atom :: `(?` RegularExpressionModifiers `-` RegularExpressionModifiers `:` Disjunction `)` + + 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(_regexpRecord_, CodePointsToString(_addModifiers_), CodePointsToString(_removeModifiers_)). + 1. Return CompileSubpattern of |Disjunction| with arguments _modifiedRer_ and _direction_. AtomEscape :: DecimalEscape 1. Let _n_ be the CapturingGroupNumber of |DecimalEscape|. - 1. Assert: _n_ ≤ _rer_.[[CapturingGroupsCount]]. - 1. Return BackreferenceMatcher(_rer_, _n_, _direction_). + 1. Assert: _n_ ≤ _regexpRecord_.[[CapturingGroupsCount]]. + 1. Return BackreferenceMatcher(_regexpRecord_, « _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.

            AtomEscape :: CharacterEscape - 1. Let _cv_ be the CharacterValue of |CharacterEscape|. - 1. Let _ch_ be the character whose character value is _cv_. - 1. Let _A_ be a one-element CharSet containing the character _ch_. - 1. Return CharacterSetMatcher(_rer_, _A_, *false*, _direction_). + 1. Let _charValue_ be the CharacterValue of |CharacterEscape|. + 1. Let _char_ be the character whose character value is _charValue_. + 1. Let _charSet_ be a one-element CharSet containing the character _char_. + 1. Return CharacterSetMatcher(_regexpRecord_, _charSet_, *false*, _direction_). AtomEscape :: CharacterClassEscape - 1. Let _cs_ be CompileToCharSet of |CharacterClassEscape| with argument _rer_. - 1. If _rer_.[[UnicodeSets]] is *false*, or if every CharSetElement of _cs_ consists of a single character (including if _cs_ is empty), return CharacterSetMatcher(_rer_, _cs_, *false*, _direction_). - 1. Let _lm_ be an empty List of Matchers. + 1. Let _cs_ be CompileToCharSet of |CharacterClassEscape| with argument _regexpRecord_. + 1. If _regexpRecord_.[[UnicodeSets]] is *false* or every CharSetElement of _cs_ consists of a single character (including if _cs_ is empty), return CharacterSetMatcher(_regexpRecord_, _cs_, *false*, _direction_). + 1. Let _listOfMatchers_ be an empty List of Matchers. 1. For each CharSetElement _s_ in _cs_ containing more than 1 character, iterating in descending order of length, do 1. Let _cs2_ be a one-element CharSet containing the last code point of _s_. - 1. Let _m2_ be CharacterSetMatcher(_rer_, _cs2_, *false*, _direction_). + 1. Let _m2_ be CharacterSetMatcher(_regexpRecord_, _cs2_, *false*, _direction_). 1. For each code point _c1_ in _s_, iterating backwards from its second-to-last code point, do 1. Let _cs1_ be a one-element CharSet containing _c1_. - 1. Let _m1_ be CharacterSetMatcher(_rer_, _cs1_, *false*, _direction_). + 1. Let _m1_ be CharacterSetMatcher(_regexpRecord_, _cs1_, *false*, _direction_). 1. Set _m2_ to MatchSequence(_m1_, _m2_, _direction_). - 1. Append _m2_ to _lm_. + 1. Append _m2_ to _listOfMatchers_. 1. Let _singles_ be the CharSet containing every CharSetElement of _cs_ that consists of a single character. - 1. Append CharacterSetMatcher(_rer_, _singles_, *false*, _direction_) to _lm_. - 1. If _cs_ contains the empty sequence of characters, append EmptyMatcher() to _lm_. - 1. Let _m2_ be the last Matcher in _lm_. - 1. For each Matcher _m1_ of _lm_, iterating backwards from its second-to-last element, do + 1. Append CharacterSetMatcher(_regexpRecord_, _singles_, *false*, _direction_) to _listOfMatchers_. + 1. If _cs_ contains the empty sequence of characters, append EmptyMatcher() to _listOfMatchers_. + 1. Let _m2_ be the last Matcher in _listOfMatchers_. + 1. For each Matcher _m1_ of _listOfMatchers_, iterating backwards from its second-to-last element, do 1. Set _m2_ to MatchTwoAlternatives(_m1_, _m2_). 1. Return _m2_. 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(_regexpRecord_, _parenIndices_, _direction_).

            CharacterSetMatcher ( - _rer_: a RegExp Record, - _A_: a CharSet, + _regexpRecord_: a RegExp Record, + _charSet_: a CharSet, _invert_: a Boolean, _direction_: ~forward~ or ~backward~, ): a Matcher @@ -36920,26 +38752,26 @@

            - 1. If _rer_.[[UnicodeSets]] is *true*, then + 1. If _regexpRecord_.[[UnicodeSets]] is *true*, then 1. Assert: _invert_ is *false*. - 1. Assert: Every CharSetElement of _A_ consists of a single character. - 1. Return a new Matcher with parameters (_x_, _c_) that captures _rer_, _A_, _invert_, and _direction_ and performs the following steps when called: + 1. Assert: Every CharSetElement of _charSet_ consists of a single character. + 1. Return a new Matcher with parameters (_x_, _c_) that captures _regexpRecord_, _charSet_, _invert_, 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 _e_ be _x_.[[EndIndex]]. - 1. If _direction_ is ~forward~, let _f_ be _e_ + 1. - 1. Else, let _f_ be _e_ - 1. - 1. Let _InputLength_ be the number of elements in _Input_. - 1. If _f_ < 0 or _f_ > _InputLength_, return ~failure~. - 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. Let _input_ be _x_.[[Input]]. + 1. Let _endIndex_ be _x_.[[EndIndex]]. + 1. If _direction_ is ~forward~, let _f_ be _endIndex_ + 1. + 1. Else, let _f_ be _endIndex_ - 1. + 1. Let _inputLength_ be the number of elements in _input_. + 1. If _f_ < 0 or _f_ > _inputLength_, return ~failure~. + 1. Let _index_ be min(_endIndex_, _f_). + 1. Let _char_ be the character _input_[_index_]. + 1. Let _cc_ be Canonicalize(_regexpRecord_, _char_). + 1. If there exists a CharSetElement in _charSet_ containing exactly one character _a_ such that Canonicalize(_regexpRecord_, _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]]. - 1. Let _y_ be the MatchState { [[Input]]: _Input_, [[EndIndex]]: _f_, [[Captures]]: _cap_ }. + 1. Let _capability_ be _x_.[[Captures]]. + 1. Let _y_ be the MatchState { [[Input]]: _input_, [[EndIndex]]: _f_, [[Captures]]: _capability_ }. 1. Return _c_(_y_). @@ -36947,33 +38779,36 @@

            BackreferenceMatcher ( - _rer_: a RegExp Record, - _n_: a positive integer, + _regexpRecord_: a RegExp Record, + _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 _regexpRecord_, _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 _input_ be _x_.[[Input]]. + 1. Let _capability_ be _x_.[[Captures]]. + 1. Let _r_ be *undefined*. + 1. For each integer _n_ of _ns_, do + 1. If _capability_[_n_] is not *undefined*, then + 1. Assert: _r_ is *undefined*. + 1. Set _r_ to _capability_[_n_]. 1. If _r_ is *undefined*, return _c_(_x_). - 1. Let _e_ be _x_.[[EndIndex]]. + 1. Let _endIndex_ be _x_.[[EndIndex]]. 1. Let _rs_ be _r_.[[StartIndex]]. 1. Let _re_ be _r_.[[EndIndex]]. - 1. Let _len_ be _re_ - _rs_. - 1. If _direction_ is ~forward~, let _f_ be _e_ + _len_. - 1. Else, let _f_ be _e_ - _len_. - 1. Let _InputLength_ be the number of elements in _Input_. - 1. If _f_ < 0 or _f_ > _InputLength_, return ~failure~. - 1. Let _g_ be min(_e_, _f_). - 1. If there exists an integer _i_ in the interval from 0 (inclusive) to _len_ (exclusive) such that Canonicalize(_rer_, _Input_[_rs_ + _i_]) is not Canonicalize(_rer_, _Input_[_g_ + _i_]), return ~failure~. - 1. Let _y_ be the MatchState { [[Input]]: _Input_, [[EndIndex]]: _f_, [[Captures]]: _cap_ }. + 1. Let _length_ be _re_ - _rs_. + 1. If _direction_ is ~forward~, let _f_ be _endIndex_ + _length_. + 1. Else, let _f_ be _endIndex_ - _length_. + 1. Let _inputLength_ be the number of elements in _input_. + 1. If _f_ < 0 or _f_ > _inputLength_, return ~failure~. + 1. Let _g_ be min(_endIndex_, _f_). + 1. If there exists an integer _i_ in the interval from 0 (inclusive) to _length_ (exclusive) such that Canonicalize(_regexpRecord_, _input_[_rs_ + _i_]) is not Canonicalize(_regexpRecord_, _input_[_g_ + _i_]), return ~failure~. + 1. Let _y_ be the MatchState { [[Input]]: _input_, [[EndIndex]]: _f_, [[Captures]]: _capability_ }. 1. Return _c_(_y_).
            @@ -36981,59 +38816,87 @@

            Canonicalize ( - _rer_: a RegExp Record, - _ch_: a character, + _regexpRecord_: a RegExp Record, + _char_: a character, ): a character

            - 1. If HasEitherUnicodeFlag(_rer_) is *true* and _rer_.[[IgnoreCase]] is *true*, then - 1. If the file CaseFolding.txt of the Unicode Character Database provides a simple or common case folding mapping for _ch_, return the result of applying that mapping to _ch_. - 1. Return _ch_. - 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 _uStr_ be CodePointsToString(_u_). - 1. If the length of _uStr_ ≠ 1, return _ch_. - 1. Let _cu_ be _uStr_'s single code unit element. - 1. If the numeric value of _ch_ ≥ 128 and the numeric value of _cu_ < 128, return _ch_. - 1. Return _cu_. + 1. If HasEitherUnicodeFlag(_regexpRecord_) is *true* and _regexpRecord_.[[IgnoreCase]] is *true*, then + 1. If the file CaseFolding.txt of the Unicode Character Database provides a simple or common case folding mapping for _char_, return the result of applying that mapping to _char_. + 1. Return _char_. + 1. If _regexpRecord_.[[IgnoreCase]] is *false*, return _char_. + 1. Assert: _char_ is a UTF-16 code unit. + 1. Let _codePoint_ be the code point whose numeric value is the numeric value of _char_. + 1. Let _u_ be toUppercase(« _codePoint_ »), according to the Unicode Default Case Conversion algorithm. + 1. Let _uString_ be CodePointsToString(_u_). + 1. If the length of _uString_ ≠ 1, return _char_. + 1. Let _codeUnit_ be _uString_'s single code unit element. + 1. If the numeric value of _char_ ≥ 128 and the numeric value of _codeUnit_ < 128, return _char_. + 1. Return _codeUnit_. -

            In case-insignificant matches when HasEitherUnicodeFlag(_rer_) is *true*, all characters are implicitly case-folded using the simple mapping provided by the Unicode Standard immediately before they are compared. The simple mapping always maps to a single code point, so it does not map, for example, `ß` (U+00DF LATIN SMALL LETTER SHARP S) to `ss` or `SS`. It may however map code points outside the Basic Latin block to code points within it—for example, `ſ` (U+017F LATIN SMALL LETTER LONG S) case-folds to `s` (U+0073 LATIN SMALL LETTER S) and `K` (U+212A KELVIN SIGN) case-folds to `k` (U+006B LATIN SMALL LETTER K). Strings containing those code points are matched by regular expressions such as `/[a-z]/ui`.

            -

            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`.

            +

            In case-insignificant matches when HasEitherUnicodeFlag(_regexpRecord_) is *true*, all characters are implicitly case-folded using the simple mapping provided by the Unicode Standard immediately before they are compared. The simple mapping always maps to a single code point, so it does not map, for example, `ß` (U+00DF LATIN SMALL LETTER SHARP S) to `ss` or `SS`. It may however map code points outside the Basic Latin block to code points within it—for example, `ſ` (U+017F LATIN SMALL LETTER LONG S) case-folds to `s` (U+0073 LATIN SMALL LETTER S) and `K` (U+212A KELVIN SIGN) case-folds to `k` (U+006B LATIN SMALL LETTER K). Strings containing those code points are matched by regular expressions such as `/[a-z]/ui`.

            +

            In case-insignificant matches when HasEitherUnicodeFlag(_regexpRecord_) 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 ( + _regexpRecord_: 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 _regexpRecord_.[[IgnoreCase]]. + 1. Let _multiline_ be _regexpRecord_.[[Multiline]]. + 1. Let _dotAll_ be _regexpRecord_.[[DotAll]]. + 1. Let _unicode_ be _regexpRecord_.[[Unicode]]. + 1. Let _unicodeSets_ be _regexpRecord_.[[UnicodeSets]]. + 1. Let _capturingGroupsCount_ be _regexpRecord_.[[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_ }. + +

            Runtime Semantics: CompileCharacterClass ( - _rer_: a RegExp Record, + _regexpRecord_: a RegExp Record, ): a Record with fields [[CharSet]] (a CharSet) and [[Invert]] (a Boolean)

            CharacterClass :: `[` ClassContents `]` - 1. Let _A_ be CompileToCharSet of |ClassContents| with argument _rer_. - 1. Return the Record { [[CharSet]]: _A_, [[Invert]]: *false* }. + 1. Let _charSet_ be CompileToCharSet of |ClassContents| with argument _regexpRecord_. + 1. Return the Record { [[CharSet]]: _charSet_, [[Invert]]: *false* }. CharacterClass :: `[^` ClassContents `]` - 1. Let _A_ be CompileToCharSet of |ClassContents| with argument _rer_. - 1. If _rer_.[[UnicodeSets]] is *true*, then - 1. Return the Record { [[CharSet]]: CharacterComplement(_rer_, _A_), [[Invert]]: *false* }. - 1. Return the Record { [[CharSet]]: _A_, [[Invert]]: *true* }. + 1. Let _charSet_ be CompileToCharSet of |ClassContents| with argument _regexpRecord_. + 1. If _regexpRecord_.[[UnicodeSets]] is *true*, then + 1. Return the Record { [[CharSet]]: CharacterComplement(_regexpRecord_, _charSet_), [[Invert]]: *false* }. + 1. Return the Record { [[CharSet]]: _charSet_, [[Invert]]: *true* }.

            Runtime Semantics: CompileToCharSet ( - _rer_: a RegExp Record, + _regexpRecord_: a RegExp Record, ): a CharSet

            @@ -37051,33 +38914,33 @@

            NonemptyClassRanges :: ClassAtom NonemptyClassRangesNoDash - 1. Let _A_ be CompileToCharSet of |ClassAtom| with argument _rer_. - 1. Let _B_ be CompileToCharSet of |NonemptyClassRangesNoDash| with argument _rer_. - 1. Return the union of CharSets _A_ and _B_. + 1. Let _charSet_ be CompileToCharSet of |ClassAtom| with argument _regexpRecord_. + 1. Let _otherSet_ be CompileToCharSet of |NonemptyClassRangesNoDash| with argument _regexpRecord_. + 1. Return the union of CharSets _charSet_ and _otherSet_. NonemptyClassRanges :: ClassAtom `-` ClassAtom ClassContents - 1. Let _A_ be CompileToCharSet of the first |ClassAtom| with argument _rer_. - 1. Let _B_ be CompileToCharSet of the second |ClassAtom| with argument _rer_. - 1. Let _C_ be CompileToCharSet of |ClassContents| with argument _rer_. - 1. Let _D_ be CharacterRange(_A_, _B_). - 1. Return the union of _D_ and _C_. + 1. Let _charSet_ be CompileToCharSet of the first |ClassAtom| with argument _regexpRecord_. + 1. Let _otherSet_ be CompileToCharSet of the second |ClassAtom| with argument _regexpRecord_. + 1. Let _remainingSet_ be CompileToCharSet of |ClassContents| with argument _regexpRecord_. + 1. Let _rangeSet_ be CharacterRange(_charSet_, _otherSet_). + 1. Return the union of _rangeSet_ and _remainingSet_. NonemptyClassRangesNoDash :: ClassAtomNoDash NonemptyClassRangesNoDash - 1. Let _A_ be CompileToCharSet of |ClassAtomNoDash| with argument _rer_. - 1. Let _B_ be CompileToCharSet of |NonemptyClassRangesNoDash| with argument _rer_. - 1. Return the union of CharSets _A_ and _B_. + 1. Let _charSet_ be CompileToCharSet of |ClassAtomNoDash| with argument _regexpRecord_. + 1. Let _otherSet_ be CompileToCharSet of |NonemptyClassRangesNoDash| with argument _regexpRecord_. + 1. Return the union of CharSets _charSet_ and _otherSet_. NonemptyClassRangesNoDash :: ClassAtomNoDash `-` ClassAtom ClassContents - 1. Let _A_ be CompileToCharSet of |ClassAtomNoDash| with argument _rer_. - 1. Let _B_ be CompileToCharSet of |ClassAtom| with argument _rer_. - 1. Let _C_ be CompileToCharSet of |ClassContents| with argument _rer_. - 1. Let _D_ be CharacterRange(_A_, _B_). - 1. Return the union of _D_ and _C_. + 1. Let _charSet_ be CompileToCharSet of |ClassAtomNoDash| with argument _regexpRecord_. + 1. Let _otherSet_ be CompileToCharSet of |ClassAtom| with argument _regexpRecord_. + 1. Let _remainingSet_ be CompileToCharSet of |ClassContents| with argument _regexpRecord_. + 1. Let _rangeSet_ be CharacterRange(_charSet_, _otherSet_). + 1. Return the union of _rangeSet_ and _remainingSet_.

            |ClassContents| can expand into a single |ClassAtom| and/or ranges of two |ClassAtom| separated by dashes. In the latter case the |ClassContents| includes all characters between the first |ClassAtom| and the second |ClassAtom|, inclusive; an error occurs if either |ClassAtom| does not represent a single character (for example, if one is \w) or if the first |ClassAtom|'s character value is strictly greater than the second |ClassAtom|'s character value.

            @@ -37109,9 +38972,9 @@

            CharacterEscape - 1. Let _cv_ be the CharacterValue of this |ClassEscape|. - 1. Let _c_ be the character whose character value is _cv_. - 1. Return the CharSet containing the single character _c_. + 1. Let _charValue_ be the CharacterValue of this |ClassEscape|. + 1. Let _char_ be the character whose character value is _charValue_. + 1. Return the CharSet containing the single character _char_.

            A |ClassAtom| can use any of the escape sequences that are allowed in the rest of the regular expression except for `\\b`, `\\B`, and backreferences. Inside a |CharacterClass|, `\\b` means the backspace character, while `\\B` and backreferences raise errors. Using a backreference inside a |ClassAtom| causes an error.

            @@ -37124,8 +38987,8 @@

            CharacterClassEscape :: `D` - 1. Let _S_ be the CharSet returned by CharacterClassEscape :: `d`. - 1. Return CharacterComplement(_rer_, _S_). + 1. Let _charSet_ be the CharSet returned by CharacterClassEscape :: `d`. + 1. Return CharacterComplement(_regexpRecord_, _charSet_). CharacterClassEscape :: `s` @@ -37133,155 +38996,155 @@

            CharacterClassEscape :: `S` - 1. Let _S_ be the CharSet returned by CharacterClassEscape :: `s`. - 1. Return CharacterComplement(_rer_, _S_). + 1. Let _charSet_ be the CharSet returned by CharacterClassEscape :: `s`. + 1. Return CharacterComplement(_regexpRecord_, _charSet_). CharacterClassEscape :: `w` - 1. Return MaybeSimpleCaseFolding(_rer_, WordCharacters(_rer_)). + 1. Return MaybeSimpleCaseFolding(_regexpRecord_, WordCharacters(_regexpRecord_)). CharacterClassEscape :: `W` - 1. Let _S_ be the CharSet returned by CharacterClassEscape :: `w`. - 1. Return CharacterComplement(_rer_, _S_). + 1. Let _charSet_ be the CharSet returned by CharacterClassEscape :: `w`. + 1. Return CharacterComplement(_regexpRecord_, _charSet_). CharacterClassEscape :: `p{` UnicodePropertyValueExpression `}` - 1. Return CompileToCharSet of |UnicodePropertyValueExpression| with argument _rer_. + 1. Return CompileToCharSet of |UnicodePropertyValueExpression| with argument _regexpRecord_. CharacterClassEscape :: `P{` UnicodePropertyValueExpression `}` - 1. Let _S_ be CompileToCharSet of |UnicodePropertyValueExpression| with argument _rer_. - 1. Assert: _S_ contains only single code points. - 1. Return CharacterComplement(_rer_, _S_). + 1. Let _charSet_ be CompileToCharSet of |UnicodePropertyValueExpression| with argument _regexpRecord_. + 1. Assert: _charSet_ contains only single code points. + 1. Return CharacterComplement(_regexpRecord_, _charSet_). UnicodePropertyValueExpression :: UnicodePropertyName `=` UnicodePropertyValue 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. Let _p_ be UnicodeMatchProperty(_regexpRecord_, _ps_). + 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_. - 1. Return MaybeSimpleCaseFolding(_rer_, _A_). + 1. Let _charSet_ be the CharSet containing all Unicode code points whose character database definition includes the property _p_ with value _v_. + 1. Return MaybeSimpleCaseFolding(_regexpRecord_, _charSet_). UnicodePropertyValueExpression :: LoneUnicodePropertyNameOrValue 1. Let _s_ be the source text matched by |LoneUnicodePropertyNameOrValue|. 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. Let _A_ be the CharSet containing all CharSetElements whose character database definition includes the property _p_ with value “True”. - 1. Return MaybeSimpleCaseFolding(_rer_, _A_). + 1. Let _p_ be UnicodeMatchProperty(_regexpRecord_, _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. Let _charSet_ be the CharSet containing all CharSetElements whose character database definition includes the property _p_ with value “True”. + 1. Return MaybeSimpleCaseFolding(_regexpRecord_, _charSet_). ClassUnion :: ClassSetRange ClassUnion? - 1. Let _A_ be CompileToCharSet of |ClassSetRange| with argument _rer_. + 1. Let _charSet_ be CompileToCharSet of |ClassSetRange| with argument _regexpRecord_. 1. If |ClassUnion| is present, then - 1. Let _B_ be CompileToCharSet of |ClassUnion| with argument _rer_. - 1. Return the union of CharSets _A_ and _B_. - 1. Return _A_. + 1. Let _otherSet_ be CompileToCharSet of |ClassUnion| with argument _regexpRecord_. + 1. Return the union of CharSets _charSet_ and _otherSet_. + 1. Return _charSet_. ClassUnion :: ClassSetOperand ClassUnion? - 1. Let _A_ be CompileToCharSet of |ClassSetOperand| with argument _rer_. + 1. Let _charSet_ be CompileToCharSet of |ClassSetOperand| with argument _regexpRecord_. 1. If |ClassUnion| is present, then - 1. Let _B_ be CompileToCharSet of |ClassUnion| with argument _rer_. - 1. Return the union of CharSets _A_ and _B_. - 1. Return _A_. + 1. Let _otherSet_ be CompileToCharSet of |ClassUnion| with argument _regexpRecord_. + 1. Return the union of CharSets _charSet_ and _otherSet_. + 1. Return _charSet_. ClassIntersection :: ClassSetOperand `&&` ClassSetOperand - 1. Let _A_ be CompileToCharSet of the first |ClassSetOperand| with argument _rer_. - 1. Let _B_ be CompileToCharSet of the second |ClassSetOperand| with argument _rer_. - 1. Return the intersection of CharSets _A_ and _B_. + 1. Let _charSet_ be CompileToCharSet of the first |ClassSetOperand| with argument _regexpRecord_. + 1. Let _otherSet_ be CompileToCharSet of the second |ClassSetOperand| with argument _regexpRecord_. + 1. Return the intersection of CharSets _charSet_ and _otherSet_. ClassIntersection :: ClassIntersection `&&` ClassSetOperand - 1. Let _A_ be CompileToCharSet of the |ClassIntersection| with argument _rer_. - 1. Let _B_ be CompileToCharSet of the |ClassSetOperand| with argument _rer_. - 1. Return the intersection of CharSets _A_ and _B_. + 1. Let _charSet_ be CompileToCharSet of the |ClassIntersection| with argument _regexpRecord_. + 1. Let _otherSet_ be CompileToCharSet of the |ClassSetOperand| with argument _regexpRecord_. + 1. Return the intersection of CharSets _charSet_ and _otherSet_. ClassSubtraction :: ClassSetOperand `--` ClassSetOperand - 1. Let _A_ be CompileToCharSet of the first |ClassSetOperand| with argument _rer_. - 1. Let _B_ be CompileToCharSet of the second |ClassSetOperand| with argument _rer_. - 1. Return the CharSet containing the CharSetElements of _A_ which are not also CharSetElements of _B_. + 1. Let _charSet_ be CompileToCharSet of the first |ClassSetOperand| with argument _regexpRecord_. + 1. Let _otherSet_ be CompileToCharSet of the second |ClassSetOperand| with argument _regexpRecord_. + 1. Return the CharSet containing the CharSetElements of _charSet_ which are not also CharSetElements of _otherSet_. ClassSubtraction :: ClassSubtraction `--` ClassSetOperand - 1. Let _A_ be CompileToCharSet of the |ClassSubtraction| with argument _rer_. - 1. Let _B_ be CompileToCharSet of the |ClassSetOperand| with argument _rer_. - 1. Return the CharSet containing the CharSetElements of _A_ which are not also CharSetElements of _B_. + 1. Let _charSet_ be CompileToCharSet of the |ClassSubtraction| with argument _regexpRecord_. + 1. Let _otherSet_ be CompileToCharSet of the |ClassSetOperand| with argument _regexpRecord_. + 1. Return the CharSet containing the CharSetElements of _charSet_ which are not also CharSetElements of _otherSet_. ClassSetRange :: ClassSetCharacter `-` ClassSetCharacter - 1. Let _A_ be CompileToCharSet of the first |ClassSetCharacter| with argument _rer_. - 1. Let _B_ be CompileToCharSet of the second |ClassSetCharacter| with argument _rer_. - 1. Return MaybeSimpleCaseFolding(_rer_, CharacterRange(_A_, _B_)). + 1. Let _charSet_ be CompileToCharSet of the first |ClassSetCharacter| with argument _regexpRecord_. + 1. Let _otherSet_ be CompileToCharSet of the second |ClassSetCharacter| with argument _regexpRecord_. + 1. Return MaybeSimpleCaseFolding(_regexpRecord_, CharacterRange(_charSet_, _otherSet_)). -

            The result will often consist of two or more ranges. When UnicodeSets is *true* and IgnoreCase is *true*, then MaybeSimpleCaseFolding(_rer_, [Ā-č]) will include only the odd-numbered code points of that range.

            +

            The result will often consist of two or more ranges. When UnicodeSets is *true* and IgnoreCase is *true*, then MaybeSimpleCaseFolding(_regexpRecord_, [Ā-č]) will include only the odd-numbered code points of that range.

            ClassSetOperand :: ClassSetCharacter - 1. Let _A_ be CompileToCharSet of |ClassSetCharacter| with argument _rer_. - 1. Return MaybeSimpleCaseFolding(_rer_, _A_). + 1. Let _charSet_ be CompileToCharSet of |ClassSetCharacter| with argument _regexpRecord_. + 1. Return MaybeSimpleCaseFolding(_regexpRecord_, _charSet_). ClassSetOperand :: ClassStringDisjunction - 1. Let _A_ be CompileToCharSet of |ClassStringDisjunction| with argument _rer_. - 1. Return MaybeSimpleCaseFolding(_rer_, _A_). + 1. Let _charSet_ be CompileToCharSet of |ClassStringDisjunction| with argument _regexpRecord_. + 1. Return MaybeSimpleCaseFolding(_regexpRecord_, _charSet_). ClassSetOperand :: NestedClass - 1. Return CompileToCharSet of |NestedClass| with argument _rer_. + 1. Return CompileToCharSet of |NestedClass| with argument _regexpRecord_. NestedClass :: `[` ClassContents `]` - 1. Return CompileToCharSet of |ClassContents| with argument _rer_. + 1. Return CompileToCharSet of |ClassContents| with argument _regexpRecord_. NestedClass :: `[^` ClassContents `]` - 1. Let _A_ be CompileToCharSet of |ClassContents| with argument _rer_. - 1. Return CharacterComplement(_rer_, _A_). + 1. Let _charSet_ be CompileToCharSet of |ClassContents| with argument _regexpRecord_. + 1. Return CharacterComplement(_regexpRecord_, _charSet_). NestedClass :: `\` CharacterClassEscape - 1. Return CompileToCharSet of |CharacterClassEscape| with argument _rer_. + 1. Return CompileToCharSet of |CharacterClassEscape| with argument _regexpRecord_. ClassStringDisjunction :: `\q{` ClassStringDisjunctionContents `}` - 1. Return CompileToCharSet of |ClassStringDisjunctionContents| with argument _rer_. + 1. Return CompileToCharSet of |ClassStringDisjunctionContents| with argument _regexpRecord_. ClassStringDisjunctionContents :: ClassString - 1. Let _s_ be CompileClassSetString of |ClassString| with argument _rer_. + 1. Let _s_ be CompileClassSetString of |ClassString| with argument _regexpRecord_. 1. Return the CharSet containing the one string _s_. ClassStringDisjunctionContents :: ClassString `|` ClassStringDisjunctionContents - 1. Let _s_ be CompileClassSetString of |ClassString| with argument _rer_. - 1. Let _A_ be the CharSet containing the one string _s_. - 1. Let _B_ be CompileToCharSet of |ClassStringDisjunctionContents| with argument _rer_. - 1. Return the union of CharSets _A_ and _B_. + 1. Let _s_ be CompileClassSetString of |ClassString| with argument _regexpRecord_. + 1. Let _charSet_ be the CharSet containing the one string _s_. + 1. Let _otherSet_ be CompileToCharSet of |ClassStringDisjunctionContents| with argument _regexpRecord_. + 1. Return the union of CharSets _charSet_ and _otherSet_. @@ -37292,9 +39155,9 @@

            `\` ClassSetReservedPunctuator - 1. Let _cv_ be the CharacterValue of this |ClassSetCharacter|. - 1. Let _c_ be the character whose character value is _cv_. - 1. Return the CharSet containing the single character _c_. + 1. Let _charValue_ be the CharacterValue of this |ClassSetCharacter|. + 1. Let _char_ be the character whose character value is _charValue_. + 1. Return the CharSet containing the single character _char_. ClassSetCharacter :: `\b` @@ -37304,16 +39167,16 @@

            CharacterRange ( - _A_: a CharSet, - _B_: a CharSet, + _charSet_: a CharSet, + _otherSet_: a CharSet, ): a CharSet

            - 1. Assert: _A_ and _B_ each contain exactly one character. - 1. Let _a_ be the one character in CharSet _A_. - 1. Let _b_ be the one character in CharSet _B_. + 1. Assert: _charSet_ and _otherSet_ each contain exactly one character. + 1. Let _a_ be the one character in CharSet _charSet_. + 1. Let _b_ be the one character in CharSet _otherSet_. 1. Let _i_ be the character value of character _a_. 1. Let _j_ be the character value of character _b_. 1. Assert: _i_ ≤ _j_. @@ -37324,14 +39187,13 @@

            HasEitherUnicodeFlag ( - _rer_: a RegExp Record, + _regexpRecord_: a RegExp Record, ): a Boolean

            - 1. If _rer_.[[Unicode]] is *true* or _rer_.[[UnicodeSets]] is *true*, then - 1. Return *true*. + 1. If _regexpRecord_.[[Unicode]] is *true* or _regexpRecord_.[[UnicodeSets]] is *true*, return *true*. 1. Return *false*.
            @@ -37339,17 +39201,17 @@

            WordCharacters ( - _rer_: a RegExp Record, + _regexpRecord_: a RegExp Record, ): a CharSet

            description
            -
            Returns a CharSet containing the characters considered "word characters" for the purposes of `\\b`, `\\B`, `\\w`, and `\\W`
            +
            Returns a CharSet containing the characters considered “word characters” for the purposes of `\\b`, `\\B`, `\\w`, and `\\W`.
            1. Let _basicWordChars_ be the CharSet containing every character in the ASCII word characters. - 1. Let _extraWordChars_ be the CharSet containing all characters _c_ such that _c_ is not in _basicWordChars_ but Canonicalize(_rer_, _c_) is in _basicWordChars_. - 1. Assert: _extraWordChars_ is empty unless HasEitherUnicodeFlag(_rer_) is *true* and _rer_.[[IgnoreCase]] is *true*. + 1. Let _extraWordChars_ be the CharSet containing all characters _c_ such that _c_ is not in _basicWordChars_ but Canonicalize(_regexpRecord_, _c_) is in _basicWordChars_. + 1. Assert: _extraWordChars_ is empty unless HasEitherUnicodeFlag(_regexpRecord_) is *true* and _regexpRecord_.[[IgnoreCase]] is *true*. 1. Return the union of _basicWordChars_ and _extraWordChars_.
            @@ -37357,7 +39219,7 @@

            AllCharacters ( - _rer_: a RegExp Record, + _regexpRecord_: a RegExp Record, ): a CharSet

            @@ -37365,72 +39227,71 @@

            Returns the set of “all characters” according to the regular expression flags.

            - 1. If _rer_.[[UnicodeSets]] is *true* and _rer_.[[IgnoreCase]] is *true*, then + 1. If _regexpRecord_.[[UnicodeSets]] is *true* and _regexpRecord_.[[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(_regexpRecord_) 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.

            MaybeSimpleCaseFolding ( - _rer_: a RegExp Record, - _A_: a CharSet, + _regexpRecord_: a RegExp Record, + _charSet_: a CharSet, ): a CharSet

            description
            -
            If _rer_.[[UnicodeSets]] is *false* or _rer_.[[IgnoreCase]] is *false*, it returns _A_. Otherwise, it uses the Simple Case Folding (scf(_cp_)) definitions in the file CaseFolding.txt of the Unicode Character Database (each of which maps a single code point to another single code point) to map each CharSetElement of _A_ character-by-character into a canonical form and returns the resulting CharSet.
            +
            If _regexpRecord_.[[UnicodeSets]] is *false* or _regexpRecord_.[[IgnoreCase]] is *false*, it returns _charSet_. Otherwise, it uses the Simple Case Folding (scf(_codePoint_)) definitions in the file CaseFolding.txt of the Unicode Character Database (each of which maps a single code point to another single code point) to map each CharSetElement of _charSet_ character-by-character into a canonical form and returns the resulting CharSet.
            - 1. If _rer_.[[UnicodeSets]] is *false* or _rer_.[[IgnoreCase]] is *false*, return _A_. - 1. Let _B_ be a new empty CharSet. - 1. For each CharSetElement _s_ of _A_, do + 1. If _regexpRecord_.[[UnicodeSets]] is *false* or _regexpRecord_.[[IgnoreCase]] is *false*, return _charSet_. + 1. Let _otherSet_ be a new empty CharSet. + 1. For each CharSetElement _s_ of _charSet_, do 1. Let _t_ be an empty sequence of characters. - 1. For each single code point _cp_ in _s_, do - 1. Append scf(_cp_) to _t_. - 1. Add _t_ to _B_. - 1. Return _B_. + 1. For each single code point _codePoint_ in _s_, do + 1. Append scf(_codePoint_) to _t_. + 1. Add _t_ to _otherSet_. + 1. Return _otherSet_.

            CharacterComplement ( - _rer_: a RegExp Record, - _S_: a CharSet, + _regexpRecord_: a RegExp Record, + _complement_: a CharSet, ): a CharSet

            - 1. Let _A_ be AllCharacters(_rer_). - 1. Return the CharSet containing the CharSetElements of _A_ which are not also CharSetElements of _S_. + 1. Let _charSet_ be AllCharacters(_regexpRecord_). + 1. Return the CharSet containing the CharSetElements of _charSet_ which are not also CharSetElements of _complement_.

            UnicodeMatchProperty ( - _rer_: a RegExp Record, + _regexpRecord_: 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 _regexpRecord_.[[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 +39314,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_. @@ -37471,7 +39332,7 @@

            Runtime Semantics: CompileClassSetString ( - _rer_: a RegExp Record, + _regexpRecord_: a RegExp Record, ): a sequence of characters

            @@ -37483,14 +39344,14 @@

            ClassString :: NonEmptyClassString - 1. Return CompileClassSetString of |NonEmptyClassString| with argument _rer_. + 1. Return CompileClassSetString of |NonEmptyClassString| with argument _regexpRecord_. NonEmptyClassString :: ClassSetCharacter NonEmptyClassString? - 1. Let _cs_ be CompileToCharSet of |ClassSetCharacter| with argument _rer_. + 1. Let _cs_ be CompileToCharSet of |ClassSetCharacter| with argument _regexpRecord_. 1. Let _s1_ be the sequence of characters that is the single CharSetElement of _cs_. 1. If |NonEmptyClassString| is present, then - 1. Let _s2_ be CompileClassSetString of |NonEmptyClassString| with argument _rer_. + 1. Let _s2_ be CompileClassSetString of |NonEmptyClassString| with argument _regexpRecord_. 1. Return the concatenation of _s1_ and _s2_. 1. Return _s1_. @@ -37503,15 +39364,15 @@

            Abstract Operations for RegExp Creation

            RegExpCreate ( - _P_: an ECMAScript language value, - _F_: a String or *undefined*, + _pattern_: an ECMAScript language value, + _flags_: a String or *undefined*, ): either a normal completion containing an Object or a throw completion

            1. Let _obj_ be ! RegExpAlloc(%RegExp%). - 1. Return ? RegExpInitialize(_obj_, _P_, _F_). + 1. Return ? RegExpInitialize(_obj_, _pattern_, _flags_).
            @@ -37541,30 +39402,31 @@

            - 1. If _pattern_ is *undefined*, let _P_ be the empty String. - 1. Else, let _P_ be ? ToString(_pattern_). - 1. If _flags_ is *undefined*, let _F_ be the empty String. - 1. Else, let _F_ be ? ToString(_flags_). - 1. If _F_ contains any code unit other than *"d"*, *"g"*, *"i"*, *"m"*, *"s"*, *"u"*, *"v"*, or *"y"*, or if _F_ contains any code unit more than once, throw a *SyntaxError* exception. - 1. If _F_ contains *"i"*, let _i_ be *true*; else let _i_ be *false*. - 1. If _F_ contains *"m"*, let _m_ be *true*; else let _m_ be *false*. - 1. If _F_ contains *"s"*, let _s_ be *true*; else let _s_ be *false*. - 1. If _F_ contains *"u"*, let _u_ be *true*; else let _u_ be *false*. - 1. If _F_ contains *"v"*, let _v_ be *true*; else let _v_ be *false*. + 1. If _pattern_ is *undefined*, set _pattern_ to the empty String. + 1. Else, set _pattern_ to ? ToString(_pattern_). + 1. If _flags_ is *undefined*, set _flags_ to the empty String. + 1. Else, set _flags_ to ? ToString(_flags_). + 1. If _flags_ contains any code unit other than *"d"*, *"g"*, *"i"*, *"m"*, *"s"*, *"u"*, *"v"*, or *"y"*, throw a *SyntaxError* exception. + 1. If _flags_ contains any code unit more than once, throw a *SyntaxError* exception. + 1. If _flags_ contains *"i"*, let _i_ be *true*; else let _i_ be *false*. + 1. If _flags_ contains *"m"*, let _m_ be *true*; else let _m_ be *false*. + 1. If _flags_ contains *"s"*, let _s_ be *true*; else let _s_ be *false*. + 1. If _flags_ contains *"u"*, let _u_ be *true*; else let _u_ be *false*. + 1. If _flags_ contains *"v"*, let _v_ be *true*; else let _v_ be *false*. 1. If _u_ is *true* or _v_ is *true*, then - 1. Let _patternText_ be StringToCodePoints(_P_). + 1. Let _patternText_ be StringToCodePoints(_pattern_). 1. Else, - 1. Let _patternText_ be the result of interpreting each of _P_'s 16-bit elements as a Unicode BMP code point. UTF-16 decoding is not applied to the elements. + 1. Let _patternText_ be the result of interpreting each of _pattern_'s 16-bit elements 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 non-empty List of *SyntaxError* objects, throw a *SyntaxError* exception. 1. Assert: _parseResult_ is a |Pattern| Parse Node. - 1. Set _obj_.[[OriginalSource]] to _P_. - 1. Set _obj_.[[OriginalFlags]] to _F_. + 1. Set _obj_.[[OriginalSource]] to _pattern_. + 1. Set _obj_.[[OriginalFlags]] to _flags_. 1. Let _capturingGroupsCount_ be CountLeftCapturingParensWithin(_parseResult_). - 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. Let _regexpRecord_ be the RegExp Record { [[IgnoreCase]]: _i_, [[Multiline]]: _m_, [[DotAll]]: _s_, [[Unicode]]: _u_, [[UnicodeSets]]: _v_, [[CapturingGroupsCount]]: _capturingGroupsCount_ }. + 1. Set _obj_.[[RegExpRecord]] to _regexpRecord_. + 1. Set _obj_.[[RegExpMatcher]] to CompilePattern of _parseResult_ with argument _regexpRecord_. + 1. Perform ? Set(_obj_, *"lastIndex"*, *+0*𝔽, *true*). 1. Return _obj_. @@ -37607,33 +39469,29 @@

            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_ )

            + +

            RegExp ( _patternOrRegexp_, _flags_ )

            This function performs the following steps when called:

            - 1. Let _patternIsRegExp_ be ? IsRegExp(_pattern_). + 1. Let _patternIsRegExp_ be ? IsRegExp(_patternOrRegexp_). 1. If NewTarget is *undefined*, then 1. Let _newTarget_ be the active function object. 1. If _patternIsRegExp_ is *true* and _flags_ is *undefined*, then - 1. Let _patternConstructor_ be ? Get(_pattern_, *"constructor"*). - 1. If SameValue(_newTarget_, _patternConstructor_) is *true*, return _pattern_. + 1. Let _patternCtor_ be ? Get(_patternOrRegexp_, *"constructor"*). + 1. If SameValue(_newTarget_, _patternCtor_) is *true*, return _patternOrRegexp_. 1. Else, 1. Let _newTarget_ be NewTarget. - 1. If _pattern_ is an Object and _pattern_ has a [[RegExpMatcher]] internal slot, then - 1. Let _P_ be _pattern_.[[OriginalSource]]. - 1. If _flags_ is *undefined*, let _F_ be _pattern_.[[OriginalFlags]]. - 1. Else, let _F_ be _flags_. + 1. If _patternOrRegexp_ is an Object and _patternOrRegexp_ has a [[RegExpMatcher]] internal slot, then + 1. Let _patternSource_ be _patternOrRegexp_.[[OriginalSource]]. + 1. If _flags_ is *undefined*, set _flags_ to _patternOrRegexp_.[[OriginalFlags]]. 1. Else if _patternIsRegExp_ is *true*, then - 1. Let _P_ be ? Get(_pattern_, *"source"*). + 1. Let _patternSource_ be ? Get(_patternOrRegexp_, *"source"*). 1. If _flags_ is *undefined*, then - 1. Let _F_ be ? Get(_pattern_, *"flags"*). - 1. Else, - 1. Let _F_ be _flags_. + 1. Set _flags_ to ? Get(_patternOrRegexp_, *"flags"*). 1. Else, - 1. Let _P_ be _pattern_. - 1. Let _F_ be _flags_. - 1. Let _O_ be ? RegExpAlloc(_newTarget_). - 1. Return ? RegExpInitialize(_O_, _P_, _F_). + 1. Let _patternSource_ be _patternOrRegexp_. + 1. Let _obj_ be ? RegExpAlloc(_newTarget_). + 1. Return ? RegExpInitialize(_obj_, _patternSource_, _flags_).

            If pattern is supplied using a |StringLiteral|, the usual escape sequence substitutions are performed before the String is processed by this function. If pattern must contain an escape sequence to be recognized by this function, any U+005C (REVERSE SOLIDUS) code points must be escaped within the |StringLiteral| to prevent them being removed when the contents of the |StringLiteral| are formed.

            @@ -37649,21 +39507,79 @@

            Properties of the RegExp Constructor

          • has the following properties:
          • + +

            RegExp.escape ( _string_ )

            +

            This function returns a copy of _string_ 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 _string_ is not a String, throw a *TypeError* exception. + 1. Let _escaped_ be the empty String. + 1. Let _codePointList_ be StringToCodePoints(_string_). + 1. For each code point _codePoint_ of _codePointList_, do + 1. If _escaped_ is the empty String and _codePoint_ 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 _string_ 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 _codePoint_. + 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(_codePoint_). + 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 ( + _codePoint_: a code point, + ): a String +

            +
            +
            description
            +
            It returns a String representing a |Pattern| for matching _codePoint_. If _codePoint_ is white space or an ASCII punctuator, the returned value is an escape sequence. Otherwise, the returned value is a String representation of _codePoint_ itself.
            +
            + + + 1. If _codePoint_ is matched by |SyntaxCharacter| or _codePoint_ is U+002F (SOLIDUS), then + 1. Return the string-concatenation of 0x005C (REVERSE SOLIDUS) and UTF16EncodeCodePoint(_codePoint_). + 1. If _codePoint_ 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 _codePoint_. + 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 _codePoint_, _codePoint_ is matched by either |WhiteSpace| or |LineTerminator|, or _codePoint_ has the same numeric value as a leading surrogate or trailing surrogate, then + 1. Let _codePointNumber_ be the numeric value of _codePoint_. + 1. If _codePointNumber_ ≤ 0xFF, then + 1. Let _hex_ be Number::toString(𝔽(_codePointNumber_), 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(_codePoint_). + 1. For each code unit _codeUnit_ of _codeUnits_, do + 1. Set _escaped_ to the string-concatenation of _escaped_ and UnicodeEscape(_codeUnit_). + 1. Return _escaped_. + 1. Return UTF16EncodeCodePoint(_codePoint_). + +
            +
            +

            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,50 +39602,50 @@

            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:

            - 1. Let _R_ be the *this* value. - 1. Perform ? RequireInternalSlot(_R_, [[RegExpMatcher]]). - 1. Let _S_ be ? ToString(_string_). - 1. Return ? RegExpBuiltinExec(_R_, _S_). + 1. Let _regexp_ be the *this* value. + 1. Perform ? RequireInternalSlot(_regexp_, [[RegExpMatcher]]). + 1. Set _string_ to ? ToString(_string_). + 1. Return ? RegExpBuiltinExec(_regexp_, _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:

            - 1. Let _R_ be the *this* value. - 1. Let _cu_ be the code unit 0x0073 (LATIN SMALL LETTER S). - 1. Return ? RegExpHasFlag(_R_, _cu_). + 1. Let _regexp_ be the *this* value. + 1. Let _codeUnit_ be the code unit 0x0073 (LATIN SMALL LETTER S). + 1. Return ? RegExpHasFlag(_regexp_, _codeUnit_).
            - +

            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:

            - 1. Let _R_ be the *this* value. - 1. If _R_ is not an Object, throw a *TypeError* exception. + 1. Let _regexp_ be the *this* value. + 1. If _regexp_ is not an Object, throw a *TypeError* exception. 1. Let _codeUnits_ be a new empty List. - 1. Let _hasIndices_ be ToBoolean(? Get(_R_, *"hasIndices"*)). + 1. Let _hasIndices_ be ToBoolean(? Get(_regexp_, *"hasIndices"*)). 1. If _hasIndices_ is *true*, append the code unit 0x0064 (LATIN SMALL LETTER D) to _codeUnits_. - 1. Let _global_ be ToBoolean(? Get(_R_, *"global"*)). + 1. Let _global_ be ToBoolean(? Get(_regexp_, *"global"*)). 1. If _global_ is *true*, append the code unit 0x0067 (LATIN SMALL LETTER G) to _codeUnits_. - 1. Let _ignoreCase_ be ToBoolean(? Get(_R_, *"ignoreCase"*)). + 1. Let _ignoreCase_ be ToBoolean(? Get(_regexp_, *"ignoreCase"*)). 1. If _ignoreCase_ is *true*, append the code unit 0x0069 (LATIN SMALL LETTER I) to _codeUnits_. - 1. Let _multiline_ be ToBoolean(? Get(_R_, *"multiline"*)). + 1. Let _multiline_ be ToBoolean(? Get(_regexp_, *"multiline"*)). 1. If _multiline_ is *true*, append the code unit 0x006D (LATIN SMALL LETTER M) to _codeUnits_. - 1. Let _dotAll_ be ToBoolean(? Get(_R_, *"dotAll"*)). + 1. Let _dotAll_ be ToBoolean(? Get(_regexp_, *"dotAll"*)). 1. If _dotAll_ is *true*, append the code unit 0x0073 (LATIN SMALL LETTER S) to _codeUnits_. - 1. Let _unicode_ be ToBoolean(? Get(_R_, *"unicode"*)). + 1. Let _unicode_ be ToBoolean(? Get(_regexp_, *"unicode"*)). 1. If _unicode_ is *true*, append the code unit 0x0075 (LATIN SMALL LETTER U) to _codeUnits_. - 1. Let _unicodeSets_ be ToBoolean(? Get(_R_, *"unicodeSets"*)). + 1. Let _unicodeSets_ be ToBoolean(? Get(_regexp_, *"unicodeSets"*)). 1. If _unicodeSets_ is *true*, append the code unit 0x0076 (LATIN SMALL LETTER V) to _codeUnits_. - 1. Let _sticky_ be ToBoolean(? Get(_R_, *"sticky"*)). + 1. Let _sticky_ be ToBoolean(? Get(_regexp_, *"sticky"*)). 1. If _sticky_ is *true*, append the code unit 0x0079 (LATIN SMALL LETTER Y) to _codeUnits_. 1. Return the String value whose code units are the elements of the List _codeUnits_. If _codeUnits_ has no elements, the empty String is returned. @@ -37737,139 +39653,136 @@

            get RegExp.prototype.flags

            RegExpHasFlag ( - _R_: an ECMAScript language value, + _regexp_: an ECMAScript language value, _codeUnit_: a code unit, ): either a normal completion containing either a Boolean or *undefined*, or a throw completion

            - 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. Let _flags_ be _R_.[[OriginalFlags]]. + 1. If _regexp_ is not an Object, throw a *TypeError* exception. + 1. If _regexp_ does not have an [[OriginalFlags]] internal slot, then + 1. If SameValue(_regexp_, %RegExp.prototype%) is *true*, return *undefined*. + 1. Throw a *TypeError* exception. + 1. Let _flags_ be _regexp_.[[OriginalFlags]]. 1. If _flags_ contains _codeUnit_, return *true*. 1. Return *false*.
            - +

            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:

            - 1. Let _R_ be the *this* value. - 1. Let _cu_ be the code unit 0x0067 (LATIN SMALL LETTER G). - 1. Return ? RegExpHasFlag(_R_, _cu_). + 1. Let _regexp_ be the *this* value. + 1. Let _codeUnit_ be the code unit 0x0067 (LATIN SMALL LETTER G). + 1. Return ? RegExpHasFlag(_regexp_, _codeUnit_).
            - +

            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:

            - 1. Let _R_ be the *this* value. - 1. Let _cu_ be the code unit 0x0064 (LATIN SMALL LETTER D). - 1. Return ? RegExpHasFlag(_R_, _cu_). + 1. Let _regexp_ be the *this* value. + 1. Let _codeUnit_ be the code unit 0x0064 (LATIN SMALL LETTER D). + 1. Return ? RegExpHasFlag(_regexp_, _codeUnit_).
            - +

            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:

            - 1. Let _R_ be the *this* value. - 1. Let _cu_ be the code unit 0x0069 (LATIN SMALL LETTER I). - 1. Return ? RegExpHasFlag(_R_, _cu_). + 1. Let _regexp_ be the *this* value. + 1. Let _codeUnit_ be the code unit 0x0069 (LATIN SMALL LETTER I). + 1. Return ? RegExpHasFlag(_regexp_, _codeUnit_).
            - -

            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. Let _regexp_ be the *this* value. + 1. If _regexp_ is not an Object, throw a *TypeError* exception. + 1. Set _string_ to ? ToString(_string_). + 1. Let _flags_ be ? ToString(? Get(_regexp_, *"flags"*)). + 1. If _flags_ does not contain *"g"*, return ? RegExpExec(_regexp_, _string_). + 1. If _flags_ contains *"u"* or _flags_ contains *"v"*, let _fullUnicode_ be *true*; else let _fullUnicode_ be *false*. + 1. Perform ? Set(_regexp_, *"lastIndex"*, *+0*𝔽, *true*). + 1. Let _array_ be ! ArrayCreate(0). + 1. Let _matchCount_ be 0. + 1. Repeat, + 1. Let _result_ be ? RegExpExec(_regexp_, _string_). + 1. If _result_ is *null*, then + 1. If _matchCount_ = 0, return *null*. + 1. Return _array_. + 1. Let _matchString_ be ? ToString(? Get(_result_, *"0"*)). + 1. Perform ! CreateDataPropertyOrThrow(_array_, ! ToString(𝔽(_matchCount_)), _matchString_). + 1. If _matchString_ is the empty String, then + 1. Let _thisIndex_ be ℝ(? ToLength(? Get(_regexp_, *"lastIndex"*))). + 1. Let _nextIndex_ be AdvanceStringIndex(_string_, _thisIndex_, _fullUnicode_). + 1. Perform ? Set(_regexp_, *"lastIndex"*, 𝔽(_nextIndex_), *true*). + 1. Set _matchCount_ to _matchCount_ + 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. - 1. If _R_ is not an Object, throw a *TypeError* exception. - 1. Let _S_ be ? ToString(_string_). - 1. Let _C_ be ? SpeciesConstructor(_R_, %RegExp%). - 1. Let _flags_ be ? ToString(? Get(_R_, *"flags"*)). - 1. Let _matcher_ be ? Construct(_C_, « _R_, _flags_ »). - 1. Let _lastIndex_ be ? ToLength(? Get(_R_, *"lastIndex"*)). + 1. Let _regexp_ be the *this* value. + 1. If _regexp_ is not an Object, throw a *TypeError* exception. + 1. Set _string_ to ? ToString(_string_). + 1. Let _speciesCtor_ be ? SpeciesConstructor(_regexp_, %RegExp%). + 1. Let _flags_ be ? ToString(? Get(_regexp_, *"flags"*)). + 1. Let _matcher_ be ? Construct(_speciesCtor_, « _regexp_, _flags_ »). + 1. Let _lastIndex_ be ? ToLength(? Get(_regexp_, *"lastIndex"*)). 1. Perform ? Set(_matcher_, *"lastIndex"*, _lastIndex_, *true*). 1. If _flags_ contains *"g"*, let _global_ be *true*. 1. Else, let _global_ be *false*. 1. If _flags_ contains *"u"* or _flags_ contains *"v"*, let _fullUnicode_ be *true*. 1. Else, let _fullUnicode_ be *false*. - 1. Return CreateRegExpStringIterator(_matcher_, _S_, _global_, _fullUnicode_). + 1. Return CreateRegExpStringIterator(_matcher_, _string_, _global_, _fullUnicode_).

            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:

            - 1. Let _R_ be the *this* value. - 1. Let _cu_ be the code unit 0x006D (LATIN SMALL LETTER M). - 1. Return ? RegExpHasFlag(_R_, _cu_). + 1. Let _regexp_ be the *this* value. + 1. Let _codeUnit_ be the code unit 0x006D (LATIN SMALL LETTER M). + 1. Return ? RegExpHasFlag(_regexp_, _codeUnit_).
            - -

            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. - 1. If _rx_ is not an Object, throw a *TypeError* exception. - 1. Let _S_ be ? ToString(_string_). - 1. Let _lengthS_ be the length of _S_. + 1. Let _regexp_ be the *this* value. + 1. If _regexp_ is not an Object, throw a *TypeError* exception. + 1. Set _string_ to ? ToString(_string_). + 1. Let _stringLength_ be the length of _string_. 1. Let _functionalReplace_ be IsCallable(_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. Let _flags_ be ? ToString(? Get(_regexp_, *"flags"*)). + 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. Perform ? Set(_regexp_, *"lastIndex"*, *+0*𝔽, *true*). 1. Let _results_ be a new empty List. 1. Let _done_ be *false*. 1. Repeat, while _done_ is *false*, - 1. Let _result_ be ? RegExpExec(_rx_, _S_). + 1. Let _result_ be ? RegExpExec(_regexp_, _string_). 1. If _result_ is *null*, then 1. Set _done_ to *true*. 1. Else, @@ -37877,65 +39790,65 @@

            RegExp.prototype [ @@replace ] ( _string_, _replaceValue_ )

            1. If _global_ is *false*, then 1. Set _done_ to *true*. 1. Else, - 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. Let _nextIndex_ be AdvanceStringIndex(_S_, _thisIndex_, _fullUnicode_). - 1. Perform ? Set(_rx_, *"lastIndex"*, 𝔽(_nextIndex_), *true*). + 1. Let _matchString_ be ? ToString(? Get(_result_, *"0"*)). + 1. If _matchString_ is the empty String, then + 1. Let _thisIndex_ be ℝ(? ToLength(? Get(_regexp_, *"lastIndex"*))). + 1. If _flags_ contains *"u"* or _flags_ contains *"v"*, let _fullUnicode_ be *true*; else let _fullUnicode_ be *false*. + 1. Let _nextIndex_ be AdvanceStringIndex(_string_, _thisIndex_, _fullUnicode_). + 1. Perform ? Set(_regexp_, *"lastIndex"*, 𝔽(_nextIndex_), *true*). 1. Let _accumulatedResult_ be the empty String. 1. Let _nextSourcePosition_ be 0. 1. For each element _result_ of _results_, do 1. Let _resultLength_ be ? LengthOfArrayLike(_result_). - 1. Let _nCaptures_ be max(_resultLength_ - 1, 0). + 1. Let _capturesCount_ be max(_resultLength_ - 1, 0). 1. Let _matched_ be ? ToString(? Get(_result_, *"0"*)). 1. Let _matchLength_ be the length of _matched_. 1. Let _position_ be ? ToIntegerOrInfinity(? Get(_result_, *"index"*)). - 1. Set _position_ to the result of clamping _position_ between 0 and _lengthS_. + 1. Set _position_ to the result of clamping _position_ between 0 and _stringLength_. 1. Let _captures_ be a new empty List. - 1. Let _n_ be 1. - 1. Repeat, while _n_ ≤ _nCaptures_, - 1. Let _capN_ be ? Get(_result_, ! ToString(𝔽(_n_))). - 1. If _capN_ is not *undefined*, then - 1. Set _capN_ to ? ToString(_capN_). - 1. Append _capN_ to _captures_. - 1. NOTE: When _n_ = 1, the preceding step puts the first element into _captures_ (at index 0). More generally, the _n_th capture (the characters captured by the _n_th set of capturing parentheses) is at _captures_[_n_ - 1]. - 1. Set _n_ to _n_ + 1. + 1. Let _captureNumber_ be 1. + 1. Repeat, while _captureNumber_ ≤ _capturesCount_, + 1. Let _capture_ be ? Get(_result_, ! ToString(𝔽(_captureNumber_))). + 1. If _capture_ is not *undefined*, then + 1. Set _capture_ to ? ToString(_capture_). + 1. Append _capture_ to _captures_. + 1. NOTE: When _captureNumber_ = 1, the preceding step puts the first element into _captures_ (at index 0). More generally, the _captureNumber_th capture (the characters captured by the _captureNumber_th set of capturing parentheses) is at _captures_[_captureNumber_ - 1]. + 1. Set _captureNumber_ to _captureNumber_ + 1. 1. Let _namedCaptures_ be ? Get(_result_, *"groups"*). 1. If _functionalReplace_ is *true*, then - 1. Let _replacerArgs_ be the list-concatenation of « _matched_ », _captures_, and « 𝔽(_position_), _S_ ». + 1. Let _replacerArgs_ be the list-concatenation of « _matched_ », _captures_, and « 𝔽(_position_), _string_ ». 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_, _string_, _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. 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 _regexp_. In such cases, the corresponding substitution is ignored. + 1. Set _accumulatedResult_ to the string-concatenation of _accumulatedResult_, the substring of _string_ 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_. + 1. If _nextSourcePosition_ ≥ _stringLength_, return _accumulatedResult_. + 1. Return the string-concatenation of _accumulatedResult_ and the substring of _string_ from _nextSourcePosition_.

            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. - 1. If _rx_ is not an Object, throw a *TypeError* exception. - 1. Let _S_ be ? ToString(_string_). - 1. Let _previousLastIndex_ be ? Get(_rx_, *"lastIndex"*). + 1. Let _regexp_ be the *this* value. + 1. If _regexp_ is not an Object, throw a *TypeError* exception. + 1. Set _string_ to ? ToString(_string_). + 1. Let _previousLastIndex_ be ? Get(_regexp_, *"lastIndex"*). 1. If _previousLastIndex_ is not *+0*𝔽, then - 1. Perform ? Set(_rx_, *"lastIndex"*, *+0*𝔽, *true*). - 1. Let _result_ be ? RegExpExec(_rx_, _S_). - 1. Let _currentLastIndex_ be ? Get(_rx_, *"lastIndex"*). + 1. Perform ? Set(_regexp_, *"lastIndex"*, *+0*𝔽, *true*). + 1. Let _result_ be ? RegExpExec(_regexp_, _string_). + 1. Let _currentLastIndex_ be ? Get(_regexp_, *"lastIndex"*). 1. If SameValue(_currentLastIndex_, _previousLastIndex_) is *false*, then - 1. Perform ? Set(_rx_, *"lastIndex"*, _previousLastIndex_, *true*). + 1. Perform ? Set(_regexp_, *"lastIndex"*, _previousLastIndex_, *true*). 1. If _result_ is *null*, return *-1*𝔽. 1. Return ? Get(_result_, *"index"*). @@ -37945,46 +39858,50 @@

            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:

            - 1. Let _R_ be the *this* value. - 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. Assert: _R_ has an [[OriginalFlags]] internal slot. - 1. Let _src_ be _R_.[[OriginalSource]]. - 1. Let _flags_ be _R_.[[OriginalFlags]]. - 1. Return EscapeRegExpPattern(_src_, _flags_). + 1. Let _regexp_ be the *this* value. + 1. If _regexp_ is not an Object, throw a *TypeError* exception. + 1. If _regexp_ does not have an [[OriginalSource]] internal slot, then + 1. If SameValue(_regexp_, %RegExp.prototype%) is *true*, return *"(?:)"*. + 1. Throw a *TypeError* exception. + 1. Assert: _regexp_ has an [[OriginalFlags]] internal slot. + 1. Let _source_ be _regexp_.[[OriginalSource]]. + 1. Let _flags_ be _regexp_.[[OriginalFlags]]. + 1. Return EscapeRegExpPattern(_source_, _flags_).

            EscapeRegExpPattern ( - _P_: a String, - _F_: a String, + _pattern_: a String, + _flags_: a String, ): a String

            - 1. If _F_ contains *"v"*, then + 1. If _flags_ contains *"v"*, then 1. Let _patternSymbol_ be |Pattern[+UnicodeMode, +UnicodeSetsMode]|. - 1. Else if _F_ contains *"u"*, then + 1. Else if _flags_ contains *"u"*, then 1. Let _patternSymbol_ be |Pattern[+UnicodeMode, ~UnicodeSetsMode]|. 1. Else, 1. Let _patternSymbol_ be |Pattern[~UnicodeMode, ~UnicodeSetsMode]|. - 1. Let _S_ be a String in the form of a _patternSymbol_ equivalent to _P_ interpreted as UTF-16 encoded Unicode code points (), in which certain code points are escaped as described below. _S_ may or may not differ from _P_; however, the Abstract Closure that would result from evaluating _S_ as a _patternSymbol_ must behave identically to the Abstract Closure given by the constructed object's [[RegExpMatcher]] internal slot. Multiple calls to this abstract operation using the same values for _P_ and _F_ must produce identical results. - 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_. + 1. Let _escapedPattern_ be a String in the form of a _patternSymbol_ equivalent to _pattern_ interpreted as UTF-16 encoded Unicode code points (), in which certain code points are escaped as described below. _escapedPattern_ may or may not differ from _pattern_; however, the Abstract Closure that would result from evaluating _escapedPattern_ as a _patternSymbol_ must behave identically to the Abstract Closure given by the constructed object's [[RegExpMatcher]] internal slot. Multiple calls to this abstract operation using the same values for _pattern_ and _flags_ must produce identical results. + 1. The code points `/` or any |LineTerminator| occurring in the pattern shall be escaped in _escapedPattern_ as necessary to ensure that the string-concatenation of *"/"*, _escapedPattern_, *"/"*, and _flags_ can be parsed (in an appropriate lexical context) as a |RegularExpressionLiteral| that behaves identically to the constructed regular expression. For example, if _pattern_ is *"/"*, then _escapedPattern_ could be *"\\/"* or *"\\u002F"*, among other possibilities, but not *"/"*, because `///` followed by _flags_ would be parsed as a |SingleLineComment| rather than a |RegularExpressionLiteral|. If _pattern_ is the empty String, this specification can be met by letting _escapedPattern_ be *"(?:)"*. + 1. Return _escapedPattern_. + + +

            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"]`.)

            @@ -37997,57 +39914,57 @@

            RegExp.prototype [ @@split ] ( _string_, _limit_ )

            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 _C_ be ? SpeciesConstructor(_rx_, %RegExp%). - 1. Let _flags_ be ? ToString(? Get(_rx_, *"flags"*)). + 1. Let _regexp_ be the *this* value. + 1. If _regexp_ is not an Object, throw a *TypeError* exception. + 1. Set _string_ to ? ToString(_string_). + 1. Let _speciesCtor_ be ? SpeciesConstructor(_regexp_, %RegExp%). + 1. Let _flags_ be ? ToString(? Get(_regexp_, *"flags"*)). 1. If _flags_ contains *"u"* or _flags_ contains *"v"*, let _unicodeMatching_ be *true*. 1. Else, let _unicodeMatching_ be *false*. 1. If _flags_ contains *"y"*, let _newFlags_ be _flags_. 1. Else, let _newFlags_ be the string-concatenation of _flags_ and *"y"*. - 1. Let _splitter_ be ? Construct(_C_, « _rx_, _newFlags_ »). - 1. Let _A_ be ! ArrayCreate(0). + 1. Let _splitter_ be ? Construct(_speciesCtor_, « _regexp_, _newFlags_ »). + 1. Let _array_ be ! ArrayCreate(0). 1. Let _lengthA_ be 0. 1. If _limit_ is *undefined*, let _lim_ be 232 - 1; else let _lim_ be ℝ(? ToUint32(_limit_)). - 1. If _lim_ = 0, return _A_. - 1. If _S_ is the empty String, then - 1. Let _z_ be ? RegExpExec(_splitter_, _S_). - 1. If _z_ is not *null*, return _A_. - 1. Perform ! CreateDataPropertyOrThrow(_A_, *"0"*, _S_). - 1. Return _A_. - 1. Let _size_ be the length of _S_. - 1. Let _p_ be 0. - 1. Let _q_ be _p_. - 1. Repeat, while _q_ < _size_, - 1. Perform ? Set(_splitter_, *"lastIndex"*, 𝔽(_q_), *true*). - 1. Let _z_ be ? RegExpExec(_splitter_, _S_). - 1. If _z_ is *null*, then - 1. Set _q_ to AdvanceStringIndex(_S_, _q_, _unicodeMatching_). + 1. If _lim_ = 0, return _array_. + 1. If _string_ is the empty String, then + 1. Let _matchResult_ be ? RegExpExec(_splitter_, _string_). + 1. If _matchResult_ is not *null*, return _array_. + 1. Perform ! CreateDataPropertyOrThrow(_array_, *"0"*, _string_). + 1. Return _array_. + 1. Let _size_ be the length of _string_. + 1. Let _lastMatchEnd_ be 0. + 1. Let _searchIndex_ be _lastMatchEnd_. + 1. Repeat, while _searchIndex_ < _size_, + 1. Perform ? Set(_splitter_, *"lastIndex"*, 𝔽(_searchIndex_), *true*). + 1. Let _matchResult_ be ? RegExpExec(_splitter_, _string_). + 1. If _matchResult_ is *null*, then + 1. Set _searchIndex_ to AdvanceStringIndex(_string_, _searchIndex_, _unicodeMatching_). 1. Else, - 1. Let _e_ be ℝ(? ToLength(? Get(_splitter_, *"lastIndex"*))). - 1. Set _e_ to min(_e_, _size_). - 1. If _e_ = _p_, then - 1. Set _q_ to AdvanceStringIndex(_S_, _q_, _unicodeMatching_). + 1. Let _matchEnd_ be ℝ(? ToLength(? Get(_splitter_, *"lastIndex"*))). + 1. Set _matchEnd_ to min(_matchEnd_, _size_). + 1. If _matchEnd_ = _lastMatchEnd_, then + 1. Set _searchIndex_ to AdvanceStringIndex(_string_, _searchIndex_, _unicodeMatching_). 1. Else, - 1. Let _T_ be the substring of _S_ from _p_ to _q_. - 1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_lengthA_)), _T_). + 1. Let _substring_ be the substring of _string_ from _lastMatchEnd_ to _searchIndex_. + 1. Perform ! CreateDataPropertyOrThrow(_array_, ! ToString(𝔽(_lengthA_)), _substring_). 1. Set _lengthA_ to _lengthA_ + 1. - 1. If _lengthA_ = _lim_, return _A_. - 1. Set _p_ to _e_. - 1. Let _numberOfCaptures_ be ? LengthOfArrayLike(_z_). + 1. If _lengthA_ = _lim_, return _array_. + 1. Set _lastMatchEnd_ to _matchEnd_. + 1. Let _numberOfCaptures_ be ? LengthOfArrayLike(_matchResult_). 1. Set _numberOfCaptures_ to max(_numberOfCaptures_ - 1, 0). - 1. Let _i_ be 1. - 1. Repeat, while _i_ ≤ _numberOfCaptures_, - 1. Let _nextCapture_ be ? Get(_z_, ! ToString(𝔽(_i_))). - 1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_lengthA_)), _nextCapture_). - 1. Set _i_ to _i_ + 1. + 1. Let _captureIndex_ be 1. + 1. Repeat, while _captureIndex_ ≤ _numberOfCaptures_, + 1. Let _nextCapture_ be ? Get(_matchResult_, ! ToString(𝔽(_captureIndex_))). + 1. Perform ! CreateDataPropertyOrThrow(_array_, ! ToString(𝔽(_lengthA_)), _nextCapture_). + 1. Set _captureIndex_ to _captureIndex_ + 1. 1. Set _lengthA_ to _lengthA_ + 1. - 1. If _lengthA_ = _lim_, return _A_. - 1. Set _q_ to _p_. - 1. Let _T_ be the substring of _S_ from _p_ to _size_. - 1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_lengthA_)), _T_). - 1. Return _A_. + 1. If _lengthA_ = _lim_, return _array_. + 1. Set _searchIndex_ to _lastMatchEnd_. + 1. Let _substring_ be the substring of _string_ from _lastMatchEnd_ to _size_. + 1. Perform ! CreateDataPropertyOrThrow(_array_, ! ToString(𝔽(_lengthA_)), _substring_). + 1. Return _array_.

            The value of the *"name"* property of this method is *"[Symbol.split]"*.

            @@ -38055,35 +39972,36 @@

            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:

            - 1. Let _R_ be the *this* value. - 1. Let _cu_ be the code unit 0x0079 (LATIN SMALL LETTER Y). - 1. Return ? RegExpHasFlag(_R_, _cu_). + 1. Let _regexp_ be the *this* value. + 1. Let _codeUnit_ be the code unit 0x0079 (LATIN SMALL LETTER Y). + 1. Return ? RegExpHasFlag(_regexp_, _codeUnit_).
            - -

            RegExp.prototype.test ( _S_ )

            + +

            RegExp.prototype.test ( _string_ )

            This method performs the following steps when called:

            - 1. Let _R_ be the *this* value. - 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. Let _regexp_ be the *this* value. + 1. If _regexp_ is not an Object, throw a *TypeError* exception. + 1. Set _string_ to ? ToString(_string_). + 1. Let _match_ be ? RegExpExec(_regexp_, _string_). + 1. If _match_ is *null*, return *false*. + 1. Return *true*.
            - +

            RegExp.prototype.toString ( )

            - 1. Let _R_ be the *this* value. - 1. If _R_ is not an Object, throw a *TypeError* exception. - 1. Let _pattern_ be ? ToString(? Get(_R_, *"source"*)). - 1. Let _flags_ be ? ToString(? Get(_R_, *"flags"*)). + 1. Let _regexp_ be the *this* value. + 1. If _regexp_ is not an Object, throw a *TypeError* exception. + 1. Let _pattern_ be ? ToString(? Get(_regexp_, *"source"*)). + 1. Let _flags_ be ? ToString(? Get(_regexp_, *"flags"*)). 1. Let _result_ be the string-concatenation of *"/"*, _pattern_, *"/"*, and _flags_. 1. Return _result_. @@ -38092,23 +40010,23 @@

            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:

            - 1. Let _R_ be the *this* value. - 1. Let _cu_ be the code unit 0x0075 (LATIN SMALL LETTER U). - 1. Return ? RegExpHasFlag(_R_, _cu_). + 1. Let _regexp_ be the *this* value. + 1. Let _codeUnit_ be the code unit 0x0075 (LATIN SMALL LETTER U). + 1. Return ? RegExpHasFlag(_regexp_, _codeUnit_).
            - +

            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:

            - 1. Let _R_ be the *this* value. - 1. Let _cu_ be the code unit 0x0076 (LATIN SMALL LETTER V). - 1. Return ? RegExpHasFlag(_R_, _cu_). + 1. Let _regexp_ be the *this* value. + 1. Let _codeUnit_ be the code unit 0x0076 (LATIN SMALL LETTER V). + 1. Return ? RegExpHasFlag(_regexp_, _codeUnit_).
            @@ -38119,20 +40037,20 @@

            Abstract Operations for RegExp Matching

            RegExpExec ( - _R_: an Object, - _S_: a String, + _regexp_: an Object, + _string_: a String, ): either a normal completion containing either an Object or *null*, or a throw completion

            - 1. Let _exec_ be ? Get(_R_, *"exec"*). + 1. Let _exec_ be ? Get(_regexp_, *"exec"*). 1. If IsCallable(_exec_) is *true*, then - 1. Let _result_ be ? Call(_exec_, _R_, « _S_ »). + 1. Let _result_ be ? Call(_exec_, _regexp_, « _string_ »). 1. If _result_ is not an Object and _result_ is not *null*, throw a *TypeError* exception. 1. Return _result_. - 1. Perform ? RequireInternalSlot(_R_, [[RegExpMatcher]]). - 1. Return ? RegExpBuiltinExec(_R_, _S_). + 1. Perform ? RequireInternalSlot(_regexp_, [[RegExpMatcher]]). + 1. Return ? RegExpBuiltinExec(_regexp_, _string_).

            If a callable *"exec"* property is not found this algorithm falls back to attempting to use the built-in RegExp matching algorithm. This provides compatible behaviour for code written for prior editions where most built-in algorithms that use regular expressions did not perform a dynamic property lookup of *"exec"*.

            @@ -38142,148 +40060,157 @@

            RegExpBuiltinExec ( - _R_: an initialized RegExp instance, - _S_: a String, + _regexp_: an initialized RegExp instance, + _string_: a String, ): either a normal completion containing either an Array exotic object or *null*, or a throw completion

            - 1. Let _length_ be the length of _S_. - 1. Let _lastIndex_ be ℝ(? ToLength(? Get(_R_, *"lastIndex"*))). - 1. Let _flags_ be _R_.[[OriginalFlags]]. + 1. Let _length_ be the length of _string_. + 1. Let _lastIndex_ be ℝ(? ToLength(! Get(_regexp_, *"lastIndex"*))). + 1. Let _flags_ be _regexp_.[[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*. 1. If _flags_ contains *"d"*, let _hasIndices_ be *true*; else let _hasIndices_ be *false*. 1. If _global_ is *false* and _sticky_ is *false*, set _lastIndex_ to 0. - 1. Let _matcher_ be _R_.[[RegExpMatcher]]. + 1. Let _matcher_ be _regexp_.[[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(_string_); else let _input_ be a List whose elements are the code units that are the elements of _string_. 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(_regexp_, *"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. Let _inputIndex_ be the index into _input_ of the character that was obtained from element _lastIndex_ of _string_. + 1. Let _result_ be _matcher_(_input_, _inputIndex_). + 1. If _result_ is ~failure~, then 1. If _sticky_ is *true*, then - 1. Perform ? Set(_R_, *"lastIndex"*, *+0*𝔽, *true*). + 1. Perform ? Set(_regexp_, *"lastIndex"*, *+0*𝔽, *true*). 1. Return *null*. - 1. Set _lastIndex_ to AdvanceStringIndex(_S_, _lastIndex_, _fullUnicode_). + 1. Set _lastIndex_ to AdvanceStringIndex(_string_, _lastIndex_, _fullUnicode_). 1. Else, - 1. Assert: _r_ is a MatchState. + 1. Assert: _result_ is a MatchState. 1. Set _matchSucceeded_ to *true*. - 1. Let _e_ be _r_.[[EndIndex]]. - 1. If _fullUnicode_ is *true*, set _e_ to GetStringIndex(_S_, _e_). + 1. Let _endIndex_ be _result_.[[EndIndex]]. + 1. If _fullUnicode_ is *true*, set _endIndex_ to GetStringIndex(_string_, _endIndex_). 1. If _global_ is *true* or _sticky_ is *true*, then - 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. - 1. Let _A_ be ! ArrayCreate(_n_ + 1). - 1. Assert: The mathematical value of _A_'s *"length"* property is _n_ + 1. - 1. Perform ! CreateDataPropertyOrThrow(_A_, *"index"*, 𝔽(_lastIndex_)). - 1. Perform ! CreateDataPropertyOrThrow(_A_, *"input"*, _S_). - 1. Let _match_ be the Match Record { [[StartIndex]]: _lastIndex_, [[EndIndex]]: _e_ }. + 1. Perform ? Set(_regexp_, *"lastIndex"*, 𝔽(_endIndex_), *true*). + 1. Let _capturingGroupsCount_ be the number of elements in _result_.[[Captures]]. + 1. Assert: _capturingGroupsCount_ = _regexp_.[[RegExpRecord]].[[CapturingGroupsCount]]. + 1. Assert: _capturingGroupsCount_ < 232 - 1. + 1. Let _array_ be ! ArrayCreate(_capturingGroupsCount_ + 1). + 1. Assert: The mathematical value of _array_'s *"length"* property is _capturingGroupsCount_ + 1. + 1. Perform ! CreateDataPropertyOrThrow(_array_, *"index"*, 𝔽(_lastIndex_)). + 1. Perform ! CreateDataPropertyOrThrow(_array_, *"input"*, _string_). + 1. Let _match_ be the Match Record { [[StartIndex]]: _lastIndex_, [[EndIndex]]: _endIndex_ }. 1. Let _indices_ be a new empty List. 1. Let _groupNames_ be a new empty List. 1. Append _match_ to _indices_. - 1. Let _matchedSubstr_ be GetMatchString(_S_, _match_). - 1. Perform ! CreateDataPropertyOrThrow(_A_, *"0"*, _matchedSubstr_). - 1. If _R_ contains any |GroupName|, then + 1. Let _matchedSubstring_ be GetMatchString(_string_, _match_). + 1. Perform ! CreateDataPropertyOrThrow(_array_, *"0"*, _matchedSubstring_). + 1. If _regexp_ contains any |GroupName|, then 1. Let _groups_ be OrdinaryObjectCreate(*null*). 1. Let _hasGroups_ be *true*. 1. Else, 1. Let _groups_ be *undefined*. 1. Let _hasGroups_ be *false*. - 1. Perform ! CreateDataPropertyOrThrow(_A_, *"groups"*, _groups_). - 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 + 1. Perform ! CreateDataPropertyOrThrow(_array_, *"groups"*, _groups_). + 1. Let _matchedGroupNames_ be a new empty List. + 1. For each integer _i_ such that 1 ≤ _i_ ≤ _capturingGroupsCount_, in ascending order, do + 1. Let _capture_ be _i_th element of _result_.[[Captures]]. + 1. If _capture_ is *undefined*, then 1. Let _capturedValue_ be *undefined*. 1. Append *undefined* to _indices_. 1. Else, - 1. Let _captureStart_ be _captureI_.[[StartIndex]]. - 1. Let _captureEnd_ be _captureI_.[[EndIndex]]. + 1. Let _captureStart_ be _capture_.[[StartIndex]]. + 1. Let _captureEnd_ be _capture_.[[EndIndex]]. 1. If _fullUnicode_ is *true*, then - 1. Set _captureStart_ to GetStringIndex(_S_, _captureStart_). - 1. Set _captureEnd_ to GetStringIndex(_S_, _captureEnd_). - 1. Let _capture_ be the Match Record { [[StartIndex]]: _captureStart_, [[EndIndex]]: _captureEnd_ }. - 1. Let _capturedValue_ be GetMatchString(_S_, _capture_). - 1. Append _capture_ to _indices_. - 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. Set _captureStart_ to GetStringIndex(_string_, _captureStart_). + 1. Set _captureEnd_ to GetStringIndex(_string_, _captureEnd_). + 1. Let _captureRecord_ be the Match Record { [[StartIndex]]: _captureStart_, [[EndIndex]]: _captureEnd_ }. + 1. Let _capturedValue_ be GetMatchString(_string_, _captureRecord_). + 1. Append _captureRecord_ to _indices_. + 1. Perform ! CreateDataPropertyOrThrow(_array_, ! ToString(𝔽(_i_)), _capturedValue_). + 1. If the _i_th capture of _regexp_ was defined with a |GroupName|, then + 1. Let _groupName_ be the CapturingGroupName of that |GroupName|. + 1. If _matchedGroupNames_ contains _groupName_, then + 1. Assert: _capturedValue_ is *undefined*. + 1. Append *undefined* to _groupNames_. + 1. Else, + 1. If _capturedValue_ is not *undefined*, append _groupName_ to _matchedGroupNames_. + 1. NOTE: If there are multiple groups named _groupName_, _groups_ may already have an _groupName_ 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_, _groupName_, _capturedValue_). + 1. Append _groupName_ to _groupNames_. 1. Else, 1. Append *undefined* to _groupNames_. 1. If _hasIndices_ is *true*, then - 1. Let _indicesArray_ be MakeMatchIndicesIndexPairArray(_S_, _indices_, _groupNames_, _hasGroups_). - 1. Perform ! CreateDataPropertyOrThrow(_A_, *"indices"*, _indicesArray_). - 1. Return _A_. + 1. Let _indicesArray_ be MakeMatchIndicesIndexPairArray(_string_, _indices_, _groupNames_, _hasGroups_). + 1. Perform ! CreateDataPropertyOrThrow(_array_, *"indices"*, _indicesArray_). + 1. Return _array_.

            AdvanceStringIndex ( - _S_: a String, + _string_: a String, _index_: a non-negative integer, _unicode_: a Boolean, - ): an integer + ): a non-negative integer

            1. Assert: _index_ ≤ 253 - 1. 1. If _unicode_ is *false*, return _index_ + 1. - 1. Let _length_ be the length of _S_. + 1. Let _length_ be the length of _string_. 1. If _index_ + 1 ≥ _length_, return _index_ + 1. - 1. Let _cp_ be CodePointAt(_S_, _index_). - 1. Return _index_ + _cp_.[[CodeUnitCount]]. + 1. Let _codePoint_ be CodePointAt(_string_, _index_). + 1. Return _index_ + _codePoint_.[[CodeUnitCount]].

            GetStringIndex ( - _S_: a String, + _string_: a String, _codePointIndex_: a non-negative integer, ): a non-negative integer

            description
            -
            It interprets _S_ as a sequence of UTF-16 encoded code points, as described in , and returns the code unit index corresponding to code point index _codePointIndex_ when such an index exists. Otherwise, it returns the length of _S_.
            +
            It interprets _string_ as a sequence of UTF-16 encoded code points, as described in , and returns the code unit index corresponding to code point index _codePointIndex_ when such an index exists. Otherwise, it returns the length of _string_.
            - 1. If _S_ is the empty String, return 0. - 1. Let _len_ be the length of _S_. + 1. If _string_ is the empty String, return 0. + 1. Let _length_ be the length of _string_. 1. Let _codeUnitCount_ be 0. 1. Let _codePointCount_ be 0. - 1. Repeat, while _codeUnitCount_ < _len_, + 1. Repeat, while _codeUnitCount_ < _length_, 1. If _codePointCount_ = _codePointIndex_, return _codeUnitCount_. - 1. Let _cp_ be CodePointAt(_S_, _codeUnitCount_). - 1. Set _codeUnitCount_ to _codeUnitCount_ + _cp_.[[CodeUnitCount]]. + 1. Let _codePoint_ be CodePointAt(_string_, _codeUnitCount_). + 1. Set _codeUnitCount_ to _codeUnitCount_ + _codePoint_.[[CodeUnitCount]]. 1. Set _codePointCount_ to _codePointCount_ + 1. - 1. Return _len_. + 1. Return _length_.

            Match Records

            -

            A Match Record is a Record value used to encapsulate the start and end indices of a regular expression match or capture.

            +

            A Match Record is a Record used to encapsulate the start and end indices of a regular expression match or capture.

            Match Records have the fields listed in .

            Field NameValueMeaning
            Field NameValueMeaning
            [[IgnoreCase]] a Boolean
            - - - - - + + + + + + + @@ -38301,29 +40228,29 @@

            Match Records

            GetMatchString ( - _S_: a String, + _string_: a String, _match_: a Match Record, ): a String

            - 1. Assert: _match_.[[StartIndex]] ≤ _match_.[[EndIndex]] ≤ the length of _S_. - 1. Return the substring of _S_ from _match_.[[StartIndex]] to _match_.[[EndIndex]]. + 1. Assert: _match_.[[StartIndex]] ≤ _match_.[[EndIndex]] ≤ the length of _string_. + 1. Return the substring of _string_ from _match_.[[StartIndex]] to _match_.[[EndIndex]].

            GetMatchIndexPair ( - _S_: a String, + _string_: a String, _match_: a Match Record, ): an Array

            - 1. Assert: _match_.[[StartIndex]] ≤ _match_.[[EndIndex]] ≤ the length of _S_. + 1. Assert: _match_.[[StartIndex]] ≤ _match_.[[EndIndex]] ≤ the length of _string_. 1. Return CreateArrayFromList(« 𝔽(_match_.[[StartIndex]]), 𝔽(_match_.[[EndIndex]]) »).
            @@ -38331,7 +40258,7 @@

            MakeMatchIndicesIndexPairArray ( - _S_: a String, + _string_: a String, _indices_: a List of either Match Records or *undefined*, _groupNames_: a List of either Strings or *undefined*, _hasGroups_: a Boolean, @@ -38344,23 +40271,26 @@

            1. Assert: _n_ < 232 - 1. 1. Assert: _groupNames_ has _n_ - 1 elements. 1. NOTE: The _groupNames_ List contains elements aligned with the _indices_ List starting at _indices_[1]. - 1. Let _A_ be ! ArrayCreate(_n_). + 1. Let _array_ be ! ArrayCreate(_n_). 1. If _hasGroups_ is *true*, then 1. Let _groups_ be OrdinaryObjectCreate(*null*). 1. Else, 1. Let _groups_ be *undefined*. - 1. Perform ! CreateDataPropertyOrThrow(_A_, *"groups"*, _groups_). + 1. Perform ! CreateDataPropertyOrThrow(_array_, *"groups"*, _groups_). 1. For each integer _i_ such that 0 ≤ _i_ < _n_, in ascending order, do 1. Let _matchIndices_ be _indices_[_i_]. 1. If _matchIndices_ is not *undefined*, then - 1. Let _matchIndexPair_ be GetMatchIndexPair(_S_, _matchIndices_). + 1. Let _matchIndexPair_ be GetMatchIndexPair(_string_, _matchIndices_). 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. Return _A_. + 1. Perform ! CreateDataPropertyOrThrow(_array_, ! ToString(𝔽(_i_)), _matchIndexPair_). + 1. If _i_ > 0, then + 1. Let _name_ be _groupNames_[_i_ - 1]. + 1. If _name_ is not *undefined*, then + 1. Assert: _groups_ is not *undefined*. + 1. NOTE: If there are multiple groups named _name_, _groups_ may already have an _name_ 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_, _name_, _matchIndexPair_). + 1. Return _array_. @@ -38381,34 +40311,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, + _regexp_: an Object, + _string_: 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 _regexp_. + 1. Set _iterator_.[[IteratedString]] to _string_. + 1. Set _iterator_.[[Global]] to _global_. + 1. Set _iterator_.[[Unicode]] to _fullUnicode_. + 1. Set _iterator_.[[Done]] to *false*. + 1. Return _iterator_.
            @@ -38416,25 +40339,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 _iteratorObj_ be the *this* value. + 1. If _iteratorObj_ is not an Object, throw a *TypeError* exception. + 1. If _iteratorObj_ does not have all of the internal slots of a RegExp String Iterator Object Instance (see ), throw a *TypeError* exception. + 1. If _iteratorObj_.[[Done]] is *true*, then + 1. Return CreateIteratorResultObject(*undefined*, *true*). + 1. Let _regexp_ be _iteratorObj_.[[IteratingRegExp]]. + 1. Let _string_ be _iteratorObj_.[[IteratedString]]. + 1. Let _global_ be _iteratorObj_.[[Global]]. + 1. Let _fullUnicode_ be _iteratorObj_.[[Unicode]]. + 1. Let _match_ be ? RegExpExec(_regexp_, _string_). + 1. If _match_ is *null*, then + 1. Set _iteratorObj_.[[Done]] to *true*. + 1. Return CreateIteratorResultObject(*undefined*, *true*). + 1. If _global_ is *false*, then + 1. Set _iteratorObj_.[[Done]] to *true*. + 1. Return CreateIteratorResultObject(_match_, *false*). + 1. Let _matchString_ be ? ToString(? Get(_match_, *"0"*)). + 1. If _matchString_ is the empty String, then + 1. Let _thisIndex_ be ℝ(? ToLength(? Get(_regexp_, *"lastIndex"*))). + 1. Let _nextIndex_ be AdvanceStringIndex(_string_, _thisIndex_, _fullUnicode_). + 1. Perform ? Set(_regexp_, *"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,37 +40441,35 @@

            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. Let _len_ be _values_[0]. + 1. If _numberOfArgs_ = 0, return ! ArrayCreate(0, _proto_). + 1. If _numberOfArgs_ = 1, then + 1. Let _length_ be _values_[0]. 1. Let _array_ be ! ArrayCreate(0, _proto_). - 1. If _len_ is not a Number, then - 1. Perform ! CreateDataPropertyOrThrow(_array_, *"0"*, _len_). - 1. Let _intLen_ be *1*𝔽. + 1. If _length_ is not a Number, then + 1. Perform ! CreateDataPropertyOrThrow(_array_, *"0"*, _length_). + 1. Let _intLength_ be *1*𝔽. 1. Else, - 1. Let _intLen_ be ! ToUint32(_len_). - 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. Let _intLength_ be ! ToUint32(_length_). + 1. If SameValueZero(_intLength_, _length_) is *false*, throw a *RangeError* exception. + 1. Perform ! Set(_array_, *"length"*, _intLength_, *true*). 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 _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _itemK_ be _values_[_k_]. + 1. Perform ! CreateDataPropertyOrThrow(_array_, _propertyKey_, _itemK_). + 1. Set _k_ to _k_ + 1. + 1. Assert: The mathematical value of _array_'s *"length"* property is _numberOfArgs_. + 1. Return _array_.
            @@ -38502,67 +40483,142 @@

            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. Let _ctor_ be the *this* value. + 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_). + 1. If IsConstructor(_ctor_) is *true*, then + 1. Let _array_ be ? Construct(_ctor_). 1. Else, - 1. Let _A_ be ! ArrayCreate(0). + 1. Let _array_ be ! ArrayCreate(0). 1. Let _iteratorRecord_ be ? GetIteratorFromMethod(_items_, _usingIterator_). 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 ? IteratorClose(_iteratorRecord_, _error_). - 1. Let _Pk_ be ! ToString(𝔽(_k_)). + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_). 1. If _next_ is ~done~, then - 1. Perform ? Set(_A_, *"length"*, 𝔽(_k_), *true*). - 1. Return _A_. + 1. Perform ? Set(_array_, *"length"*, 𝔽(_k_), *true*). + 1. Return _array_. 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. Let _defineStatus_ be Completion(CreateDataPropertyOrThrow(_array_, _propertyKey_, _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 - 1. Let _A_ be ? Construct(_C_, « 𝔽(_len_) »). + 1. Let _length_ be ? LengthOfArrayLike(_arrayLike_). + 1. If IsConstructor(_ctor_) is *true*, then + 1. Let _array_ be ? Construct(_ctor_, « 𝔽(_length_) »). 1. Else, - 1. Let _A_ be ? ArrayCreate(_len_). + 1. Let _array_ be ? ArrayCreate(_length_). 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Let _kValue_ be ? Get(_arrayLike_, _Pk_). + 1. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kValue_ be ? Get(_arrayLike_, _propertyKey_). 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_). + 1. Perform ? CreateDataPropertyOrThrow(_array_, _propertyKey_, _mappedValue_). 1. Set _k_ to _k_ + 1. - 1. Perform ? Set(_A_, *"length"*, 𝔽(_len_), *true*). - 1. Return _A_. + 1. Perform ? Set(_array_, *"length"*, 𝔽(_length_), *true*). + 1. Return _array_.

            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.fromAsync ( _items_ [ , _mapper_ [ , _thisArg_ ] ] )

            + +

            This async function performs the following steps when called:

            + + 1. Let _ctor_ 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(_ctor_) is *true*, then + 1. Let _array_ be ? Construct(_ctor_). + 1. Else, + 1. Let _array_ 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 _propertyKey_ 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(_array_, *"length"*, 𝔽(_k_), *true*). + 1. Return _array_. + 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(_array_, _propertyKey_, _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 _length_ be ? LengthOfArrayLike(_arrayLike_). + 1. If IsConstructor(_ctor_) is *true*, then + 1. Let _array_ be ? Construct(_ctor_, « 𝔽(_length_) »). + 1. Else, + 1. Let _array_ be ? ArrayCreate(_length_). + 1. Let _k_ be 0. + 1. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kValue_ be ? Get(_arrayLike_, _propertyKey_). + 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(_array_, _propertyKey_, _mappedValue_). + 1. Set _k_ to _k_ + 1. + 1. Perform ? Set(_array_, *"length"*, 𝔽(_length_), *true*). + 1. Return _array_. + + +

            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,25 +40626,25 @@

            Array.isArray ( _arg_ )

            - +

            Array.of ( ..._items_ )

            This method performs the following steps when called:

            - 1. Let _len_ be the number of elements in _items_. - 1. Let _lenNumber_ be 𝔽(_len_). - 1. Let _C_ be the *this* value. - 1. If IsConstructor(_C_) is *true*, then - 1. Let _A_ be ? Construct(_C_, « _lenNumber_ »). + 1. Let _length_ be the number of elements in _items_. + 1. Let _lengthNumber_ be 𝔽(_length_). + 1. Let _ctor_ be the *this* value. + 1. If IsConstructor(_ctor_) is *true*, then + 1. Let _array_ be ? Construct(_ctor_, « _lengthNumber_ »). 1. Else, - 1. Let _A_ be ? ArrayCreate(_len_). + 1. Let _array_ be ? ArrayCreate(_length_). 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, + 1. Repeat, while _k_ < _length_, 1. Let _kValue_ be _items_[_k_]. - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Perform ? CreateDataPropertyOrThrow(_A_, _Pk_, _kValue_). + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Perform ? CreateDataPropertyOrThrow(_array_, _propertyKey_, _kValue_). 1. Set _k_ to _k_ + 1. - 1. Perform ? Set(_A_, *"length"*, _lenNumber_, *true*). - 1. Return _A_. + 1. Perform ? Set(_array_, *"length"*, _lengthNumber_, *true*). + 1. Return _array_.

            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 other constructors that may be called with a single numeric argument.

            @@ -38601,15 +40657,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,55 +40683,55 @@

            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). - 1. Let _len_ be ? LengthOfArrayLike(_O_). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). 1. Let _relativeIndex_ be ? ToIntegerOrInfinity(_index_). 1. If _relativeIndex_ ≥ 0, then 1. Let _k_ be _relativeIndex_. 1. Else, - 1. Let _k_ be _len_ + _relativeIndex_. - 1. If _k_ < 0 or _k_ ≥ _len_, return *undefined*. - 1. Return ? Get(_O_, ! ToString(𝔽(_k_))). + 1. Let _k_ be _length_ + _relativeIndex_. + 1. If _k_ < 0 or _k_ ≥ _length_, return *undefined*. + 1. Return ? Get(_obj_, ! ToString(𝔽(_k_))).
            - +

            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:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _A_ be ? ArraySpeciesCreate(_O_, 0). - 1. Let _n_ be 0. - 1. Prepend _O_ to _items_. - 1. For each element _E_ of _items_, do - 1. Let _spreadable_ be ? IsConcatSpreadable(_E_). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _array_ be ? ArraySpeciesCreate(_obj_, 0). + 1. Let _nextIndex_ be 0. + 1. Prepend _obj_ to _items_. + 1. For each element _item_ of _items_, do + 1. Let _spreadable_ be ? IsConcatSpreadable(_item_). 1. If _spreadable_ is *true*, then - 1. Let _len_ be ? LengthOfArrayLike(_E_). - 1. If _n_ + _len_ > 253 - 1, throw a *TypeError* exception. - 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Let _exists_ be ? HasProperty(_E_, _Pk_). + 1. Let _length_ be ? LengthOfArrayLike(_item_). + 1. If _nextIndex_ + _length_ > 253 - 1, throw a *TypeError* exception. + 1. Let _sourceIndex_ be 0. + 1. Repeat, while _sourceIndex_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_sourceIndex_)). + 1. Let _exists_ be ? HasProperty(_item_, _propertyKey_). 1. If _exists_ is *true*, then - 1. Let _subElement_ be ? Get(_E_, _Pk_). - 1. Perform ? CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_n_)), _subElement_). - 1. Set _n_ to _n_ + 1. - 1. Set _k_ to _k_ + 1. + 1. Let _subElement_ be ? Get(_item_, _propertyKey_). + 1. Perform ? CreateDataPropertyOrThrow(_array_, ! ToString(𝔽(_nextIndex_)), _subElement_). + 1. Set _nextIndex_ to _nextIndex_ + 1. + 1. Set _sourceIndex_ to _sourceIndex_ + 1. 1. Else, - 1. NOTE: _E_ is added as a single item rather than spread. - 1. If _n_ ≥ 253 - 1, throw a *TypeError* exception. - 1. Perform ? CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_n_)), _E_). - 1. Set _n_ to _n_ + 1. - 1. [id="step-array-proto-concat-set-length"] Perform ? Set(_A_, *"length"*, 𝔽(_n_), *true*). - 1. Return _A_. + 1. NOTE: _item_ is added as a single item rather than spread. + 1. If _nextIndex_ ≥ 253 - 1, throw a *TypeError* exception. + 1. Perform ? CreateDataPropertyOrThrow(_array_, ! ToString(𝔽(_nextIndex_)), _item_). + 1. Set _nextIndex_ to _nextIndex_ + 1. + 1. [id="step-array-proto-concat-set-length"] Perform ? Set(_array_, *"length"*, 𝔽(_nextIndex_), *true*). + 1. Return _array_.

            The *"length"* property of this method is *1*𝔽.

            -

            The explicit setting of the *"length"* property in step is intended to ensure the length is correct when the final non-empty element of _items_ has trailing holes or when _A_ is not a built-in Array.

            +

            The explicit setting of the *"length"* property in step is intended to ensure the length is correct when the final non-empty element of _items_ has trailing holes or when _array_ is not a built-in Array.

            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.

            @@ -38684,16 +40740,16 @@

            Array.prototype.concat ( ..._items_ )

            IsConcatSpreadable ( - _O_: an ECMAScript language value, + _obj_: an ECMAScript language value, ): either a normal completion containing a Boolean or a throw completion

            - 1. If _O_ is not an Object, return *false*. - 1. Let _spreadable_ be ? Get(_O_, @@isConcatSpreadable). + 1. If _obj_ is not an Object, return *false*. + 1. Let _spreadable_ be ? Get(_obj_, %Symbol.isConcatSpreadable%). 1. If _spreadable_ is not *undefined*, return ToBoolean(_spreadable_). - 1. Return ? IsArray(_O_). + 1. Return ? IsArray(_obj_).
            @@ -38703,7 +40759,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.

            @@ -38713,21 +40769,21 @@

            Array.prototype.copyWithin ( _target_, _start_ [ , _end_ ] )

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). 1. Let _relativeTarget_ be ? ToIntegerOrInfinity(_target_). 1. If _relativeTarget_ = -∞, let _to_ be 0. - 1. Else if _relativeTarget_ < 0, let _to_ be max(_len_ + _relativeTarget_, 0). - 1. Else, let _to_ be min(_relativeTarget_, _len_). + 1. Else if _relativeTarget_ < 0, let _to_ be max(_length_ + _relativeTarget_, 0). + 1. Else, let _to_ be min(_relativeTarget_, _length_). 1. Let _relativeStart_ be ? ToIntegerOrInfinity(_start_). 1. If _relativeStart_ = -∞, let _from_ be 0. - 1. Else if _relativeStart_ < 0, let _from_ be max(_len_ + _relativeStart_, 0). - 1. Else, let _from_ be min(_relativeStart_, _len_). - 1. If _end_ is *undefined*, let _relativeEnd_ be _len_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). + 1. Else if _relativeStart_ < 0, let _from_ be max(_length_ + _relativeStart_, 0). + 1. Else, let _from_ be min(_relativeStart_, _length_). + 1. If _end_ is *undefined*, let _relativeEnd_ be _length_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). 1. If _relativeEnd_ = -∞, let _final_ be 0. - 1. Else if _relativeEnd_ < 0, let _final_ be max(_len_ + _relativeEnd_, 0). - 1. Else, let _final_ be min(_relativeEnd_, _len_). - 1. Let _count_ be min(_final_ - _from_, _len_ - _to_). + 1. Else if _relativeEnd_ < 0, let _final_ be max(_length_ + _relativeEnd_, 0). + 1. Else, let _final_ be min(_relativeEnd_, _length_). + 1. Let _count_ be min(_final_ - _from_, _length_ - _to_). 1. If _from_ < _to_ and _to_ < _from_ + _count_, then 1. Let _direction_ be -1. 1. Set _from_ to _from_ + _count_ - 1. @@ -38737,53 +40793,53 @@

            Array.prototype.copyWithin ( _target_, _start_ [ , _end_ ] )

            1. Repeat, while _count_ > 0, 1. Let _fromKey_ be ! ToString(𝔽(_from_)). 1. Let _toKey_ be ! ToString(𝔽(_to_)). - 1. Let _fromPresent_ be ? HasProperty(_O_, _fromKey_). + 1. Let _fromPresent_ be ? HasProperty(_obj_, _fromKey_). 1. If _fromPresent_ is *true*, then - 1. Let _fromValue_ be ? Get(_O_, _fromKey_). - 1. Perform ? Set(_O_, _toKey_, _fromValue_, *true*). + 1. Let _fromValue_ be ? Get(_obj_, _fromKey_). + 1. Perform ? Set(_obj_, _toKey_, _fromValue_, *true*). 1. Else, 1. Assert: _fromPresent_ is *false*. - 1. Perform ? DeletePropertyOrThrow(_O_, _toKey_). + 1. Perform ? DeletePropertyOrThrow(_obj_, _toKey_). 1. Set _from_ to _from_ + _direction_. 1. Set _to_ to _to_ + _direction_. 1. Set _count_ to _count_ - 1. - 1. Return _O_. + 1. Return _obj_.

            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.entries ( )

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Return CreateArrayIterator(_O_, ~key+value~). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Return CreateArrayIterator(_obj_, ~key+value~).
            - -

            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. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 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. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kPresent_ be ? HasProperty(_obj_, _propertyKey_). 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 _kValue_ be ? Get(_obj_, _propertyKey_). + 1. Let _testResult_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _obj_ »)). 1. If _testResult_ is *false*, return *false*. 1. Set _k_ to _k_ + 1. 1. Return *true*. @@ -38793,7 +40849,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.

            @@ -38804,62 +40860,62 @@

            Array.prototype.fill ( _value_ [ , _start_ [ , _end_ ] ] )

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). 1. Let _relativeStart_ be ? ToIntegerOrInfinity(_start_). 1. If _relativeStart_ = -∞, let _k_ be 0. - 1. Else if _relativeStart_ < 0, let _k_ be max(_len_ + _relativeStart_, 0). - 1. Else, let _k_ be min(_relativeStart_, _len_). - 1. If _end_ is *undefined*, let _relativeEnd_ be _len_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). + 1. Else if _relativeStart_ < 0, let _k_ be max(_length_ + _relativeStart_, 0). + 1. Else, let _k_ be min(_relativeStart_, _length_). + 1. If _end_ is *undefined*, let _relativeEnd_ be _length_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). 1. If _relativeEnd_ = -∞, let _final_ be 0. - 1. Else if _relativeEnd_ < 0, let _final_ be max(_len_ + _relativeEnd_, 0). - 1. Else, let _final_ be min(_relativeEnd_, _len_). + 1. Else if _relativeEnd_ < 0, let _final_ be max(_length_ + _relativeEnd_, 0). + 1. Else, let _final_ be min(_relativeEnd_, _length_). 1. Repeat, while _k_ < _final_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Perform ? Set(_O_, _Pk_, _value_, *true*). + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Perform ? Set(_obj_, _propertyKey_, _value_, *true*). 1. Set _k_ to _k_ + 1. - 1. Return _O_. + 1. Return _obj_.

            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.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. Let _A_ be ? ArraySpeciesCreate(_O_, 0). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. + 1. Let _array_ be ? ArraySpeciesCreate(_obj_, 0). 1. Let _k_ be 0. 1. Let _to_ be 0. - 1. Repeat, while _k_ < _len_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). + 1. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kPresent_ be ? HasProperty(_obj_, _propertyKey_). 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 _kValue_ be ? Get(_obj_, _propertyKey_). + 1. Let _selected_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _obj_ »)). 1. If _selected_ is *true*, then - 1. Perform ? CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_to_)), _kValue_). + 1. Perform ? CreateDataPropertyOrThrow(_array_, ! ToString(𝔽(_to_)), _kValue_). 1. Set _to_ to _to_ + 1. 1. Set _k_ to _k_ + 1. - 1. Return _A_. + 1. Return _array_.

            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.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*.

            @@ -38867,17 +40923,17 @@

            Array.prototype.find ( _predicate_ [ , _thisArg_ ] )

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. Let _findRec_ be ? FindViaPredicate(_O_, _len_, ~ascending~, _predicate_, _thisArg_). - 1. Return _findRec_.[[Value]]. + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 1. Let _findRecord_ be ? FindViaPredicate(_obj_, _length_, ~ascending~, _predicate_, _thisArg_). + 1. Return _findRecord_.[[Value]].

            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.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.

            @@ -38885,17 +40941,17 @@

            Array.prototype.findIndex ( _predicate_ [ , _thisArg_ ] )

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. Let _findRec_ be ? FindViaPredicate(_O_, _len_, ~ascending~, _predicate_, _thisArg_). - 1. Return _findRec_.[[Index]]. + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 1. Let _findRecord_ be ? FindViaPredicate(_obj_, _length_, ~ascending~, _predicate_, _thisArg_). + 1. Return _findRecord_.[[Index]].

            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.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*.

            @@ -38903,17 +40959,17 @@

            Array.prototype.findLast ( _predicate_ [ , _thisArg_ ] )

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. Let _findRec_ be ? FindViaPredicate(_O_, _len_, ~descending~, _predicate_, _thisArg_). - 1. Return _findRec_.[[Value]]. + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 1. Let _findRecord_ be ? FindViaPredicate(_obj_, _length_, ~descending~, _predicate_, _thisArg_). + 1. Return _findRecord_.[[Value]].

            This method is intentionally generic; it does not require that its *this* value be an Array object. Therefore it can be transferred to other kinds of objects for use as a method.

            - +

            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.

            @@ -38921,10 +40977,10 @@

            Array.prototype.findLastIndex ( _predicate_ [ , _thisArg_ ] )

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. Let _findRec_ be ? FindViaPredicate(_O_, _len_, ~descending~, _predicate_, _thisArg_). - 1. Return _findRec_.[[Index]]. + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 1. Let _findRecord_ be ? FindViaPredicate(_obj_, _length_, ~descending~, _predicate_, _thisArg_). + 1. Return _findRecord_.[[Index]].

            This method is intentionally generic; it does not require that its *this* value be an Array object. Therefore it can be transferred to other kinds of objects for use as a method.

            @@ -38933,8 +40989,8 @@

            Array.prototype.findLastIndex ( _predicate_ [ , _thisArg_ ] )

            FindViaPredicate ( - _O_: an Object, - _len_: a non-negative integer, + _obj_: an Object, + _length_: a non-negative integer, _direction_: ~ascending~ or ~descending~, _predicate_: an ECMAScript language value, _thisArg_: an ECMAScript language value, @@ -38943,7 +40999,7 @@

            description
            -

            _O_ should be an array-like object or a TypedArray. This operation calls _predicate_ once for each element of _O_, in either ascending index order or descending index order (as indicated by _direction_), until it finds one where _predicate_ returns a value that coerces to *true*. At that point, this operation returns a Record that gives the index and value of the element found. If no such element is found, this operation returns a Record that specifies *-1*𝔽 for the index and *undefined* for the value.

            +

            _obj_ should be an array-like object or a TypedArray. This operation calls _predicate_ once for each element of _obj_, in either ascending index order or descending index order (as indicated by _direction_), until it finds one where _predicate_ returns a value that coerces to *true*. At that point, this operation returns a Record that gives the index and value of the element found. If no such element is found, this operation returns a Record that specifies *-1*𝔽 for the index and *undefined* for the value.

            _predicate_ should be a function. When called for an element of the array, it is passed three arguments: the value of the element, the index of the element, and the object being traversed. Its return value will be coerced to a Boolean value.

            _thisArg_ will be used as the *this* value for each invocation of _predicate_.

            This operation does not directly mutate the object on which it is called, but the object may be mutated by the calls to _predicate_.

            @@ -38953,33 +41009,33 @@

            1. If IsCallable(_predicate_) is *false*, throw a *TypeError* exception. 1. If _direction_ is ~ascending~, then - 1. Let _indices_ be a List of the integers in the interval from 0 (inclusive) to _len_ (exclusive), in ascending order. + 1. Let _indices_ be a List of the integers in the interval from 0 (inclusive) to _length_ (exclusive), in ascending order. 1. Else, - 1. Let _indices_ be a List of the integers in the interval from 0 (inclusive) to _len_ (exclusive), in descending order. + 1. Let _indices_ be a List of the integers in the interval from 0 (inclusive) to _length_ (exclusive), in descending order. 1. For each integer _k_ of _indices_, do - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. NOTE: If _O_ is a TypedArray, the following invocation of Get will return a normal completion. - 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Let _testResult_ be ? Call(_predicate_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. NOTE: If _obj_ is a TypedArray, the following invocation of Get will return a normal completion. + 1. Let _kValue_ be ? Get(_obj_, _propertyKey_). + 1. Let _testResult_ be ? Call(_predicate_, _thisArg_, « _kValue_, 𝔽(_k_), _obj_ »). 1. If ToBoolean(_testResult_) is *true*, return the Record { [[Index]]: 𝔽(_k_), [[Value]]: _kValue_ }. 1. Return the Record { [[Index]]: *-1*𝔽, [[Value]]: *undefined* }. - +

            Array.prototype.flat ( [ _depth_ ] )

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _sourceLen_ be ? LengthOfArrayLike(_O_). - 1. Let _depthNum_ be 1. + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _sourceLength_ be ? LengthOfArrayLike(_obj_). + 1. Let _depthNumber_ be 1. 1. If _depth_ is not *undefined*, then - 1. Set _depthNum_ to ? ToIntegerOrInfinity(_depth_). - 1. If _depthNum_ < 0, set _depthNum_ to 0. - 1. Let _A_ be ? ArraySpeciesCreate(_O_, 0). - 1. Perform ? FlattenIntoArray(_A_, _O_, _sourceLen_, 0, _depthNum_). - 1. Return _A_. + 1. Set _depthNumber_ to ? ToIntegerOrInfinity(_depth_). + 1. If _depthNumber_ < 0, set _depthNumber_ to 0. + 1. Let _array_ be ? ArraySpeciesCreate(_obj_, 0). + 1. Perform ? FlattenIntoArray(_array_, _obj_, _sourceLength_, 0, _depthNumber_). + 1. Return _array_. @@ -38987,34 +41043,34 @@

            FlattenIntoArray ( _target_: an Object, _source_: an Object, - _sourceLen_: a non-negative integer, + _sourceLength_: a non-negative integer, _start_: a non-negative integer, _depth_: a non-negative integer or +∞, - optional _mapperFunction_: a function object, + optional _mapperFunc_: a function object, optional _thisArg_: an ECMAScript language value, ): either a normal completion containing a non-negative integer or a throw completion

            - 1. Assert: If _mapperFunction_ is present, then IsCallable(_mapperFunction_) is *true*, _thisArg_ is present, and _depth_ is 1. + 1. Assert: If _mapperFunc_ is present, then IsCallable(_mapperFunc_) is *true*, _thisArg_ is present, and _depth_ is 1. 1. Let _targetIndex_ be _start_. 1. Let _sourceIndex_ be *+0*𝔽. - 1. Repeat, while ℝ(_sourceIndex_) < _sourceLen_, - 1. Let _P_ be ! ToString(_sourceIndex_). - 1. Let _exists_ be ? HasProperty(_source_, _P_). + 1. Repeat, while ℝ(_sourceIndex_) < _sourceLength_, + 1. Let _propertyKey_ be ! ToString(_sourceIndex_). + 1. Let _exists_ be ? HasProperty(_source_, _propertyKey_). 1. If _exists_ is *true*, then - 1. Let _element_ be ? Get(_source_, _P_). - 1. If _mapperFunction_ is present, then - 1. Set _element_ to ? Call(_mapperFunction_, _thisArg_, « _element_, _sourceIndex_, _source_ »). + 1. Let _element_ be ? Get(_source_, _propertyKey_). + 1. If _mapperFunc_ is present, then + 1. Set _element_ to ? Call(_mapperFunc_, _thisArg_, « _element_, _sourceIndex_, _source_ »). 1. Let _shouldFlatten_ be *false*. 1. If _depth_ > 0, then 1. Set _shouldFlatten_ to ? IsArray(_element_). 1. If _shouldFlatten_ is *true*, then 1. If _depth_ = +∞, let _newDepth_ be +∞. 1. Else, let _newDepth_ be _depth_ - 1. - 1. Let _elementLen_ be ? LengthOfArrayLike(_element_). - 1. Set _targetIndex_ to ? FlattenIntoArray(_target_, _element_, _elementLen_, _targetIndex_, _newDepth_). + 1. Let _elementLength_ be ? LengthOfArrayLike(_element_). + 1. Set _targetIndex_ to ? FlattenIntoArray(_target_, _element_, _elementLength_, _targetIndex_, _newDepth_). 1. Else, 1. If _targetIndex_ ≥ 253 - 1, throw a *TypeError* exception. 1. Perform ? CreateDataPropertyOrThrow(_target_, ! ToString(𝔽(_targetIndex_)), _element_). @@ -39025,40 +41081,40 @@

            - -

            Array.prototype.flatMap ( _mapperFunction_ [ , _thisArg_ ] )

            + +

            Array.prototype.flatMap ( _mapperFunc_ [ , _thisArg_ ] )

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _sourceLen_ be ? LengthOfArrayLike(_O_). - 1. If IsCallable(_mapperFunction_) is *false*, throw a *TypeError* exception. - 1. Let _A_ be ? ArraySpeciesCreate(_O_, 0). - 1. Perform ? FlattenIntoArray(_A_, _O_, _sourceLen_, 0, 1, _mapperFunction_, _thisArg_). - 1. Return _A_. + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _sourceLength_ be ? LengthOfArrayLike(_obj_). + 1. If IsCallable(_mapperFunc_) is *false*, throw a *TypeError* exception. + 1. Let _array_ be ? ArraySpeciesCreate(_obj_, 0). + 1. Perform ? FlattenIntoArray(_array_, _obj_, _sourceLength_, 0, 1, _mapperFunc_, _thisArg_). + 1. Return _array_.
            - -

            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. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 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. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kPresent_ be ? HasProperty(_obj_, _propertyKey_). 1. If _kPresent_ is *true*, then - 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Perform ? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). + 1. Let _kValue_ be ? Get(_obj_, _propertyKey_). + 1. Perform ? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _obj_ »). 1. Set _k_ to _k_ + 1. 1. Return *undefined*. @@ -39067,7 +41123,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*.

            @@ -39075,20 +41131,20 @@

            Array.prototype.includes ( _searchElement_ [ , _fromIndex_ ] )

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If _len_ = 0, return *false*. - 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_ ≥ 0, then - 1. Let _k_ be _n_. + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 1. If _length_ = 0, return *false*. + 1. Let _startIndex_ be ? ToIntegerOrInfinity(_fromIndex_). + 1. Assert: If _fromIndex_ is *undefined*, then _startIndex_ is 0. + 1. If _startIndex_ = +∞, return *false*. + 1. If _startIndex_ = -∞, set _startIndex_ to 0. + 1. If _startIndex_ ≥ 0, then + 1. Let _k_ be _startIndex_. 1. Else, - 1. Let _k_ be _len_ + _n_. + 1. Let _k_ be _length_ + _startIndex_. 1. If _k_ < 0, set _k_ to 0. - 1. Repeat, while _k_ < _len_, - 1. Let _elementK_ be ? Get(_O_, ! ToString(𝔽(_k_))). + 1. Repeat, while _k_ < _length_, + 1. Let _elementK_ be ? Get(_obj_, ! ToString(𝔽(_k_))). 1. If SameValueZero(_searchElement_, _elementK_) is *true*, return *true*. 1. Set _k_ to _k_ + 1. 1. Return *false*. @@ -39101,31 +41157,31 @@

            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*𝔽.

            -

            The optional second argument _fromIndex_ defaults to *+0*𝔽 (i.e. the whole array is searched). If it is greater than or equal to the length of the array, *-1*𝔽 is returned, i.e. the array will not be searched. If it is less than *-0*𝔽, it is used as the offset from the end of the array to compute _fromIndex_. If the computed index is less than or equal to *+0*𝔽, the whole array will be searched.

            +

            The optional second argument _fromIndex_ defaults to *+0*𝔽 (i.e. the whole array is searched). If it is greater than or equal to the length of the array, *-1*𝔽 is returned, i.e. the array will not be searched. If it is less than *-0*𝔽, it is used to compute an offset from the end of the array. If the computed index is less than or equal to *+0*𝔽, the whole array will be searched.

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If _len_ = 0, return *-1*𝔽. - 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_ ≥ 0, then - 1. Let _k_ be _n_. + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 1. If _length_ = 0, return *-1*𝔽. + 1. Let _startIndex_ be ? ToIntegerOrInfinity(_fromIndex_). + 1. Assert: If _fromIndex_ is *undefined*, then _startIndex_ is 0. + 1. If _startIndex_ = +∞, return *-1*𝔽. + 1. If _startIndex_ = -∞, set _startIndex_ to 0. + 1. If _startIndex_ ≥ 0, then + 1. Let _k_ be _startIndex_. 1. Else, - 1. Let _k_ be _len_ + _n_. + 1. Let _k_ be _length_ + _startIndex_. 1. If _k_ < 0, set _k_ to 0. - 1. Repeat, while _k_ < _len_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). + 1. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kPresent_ be ? HasProperty(_obj_, _propertyKey_). 1. If _kPresent_ is *true*, then - 1. Let _elementK_ be ? Get(_O_, _Pk_). + 1. Let _elementK_ be ? Get(_obj_, _propertyKey_). 1. If IsStrictlyEqual(_searchElement_, _elementK_) is *true*, return 𝔽(_k_). 1. Set _k_ to _k_ + 1. 1. Return *-1*𝔽. @@ -39135,62 +41191,62 @@

            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:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). 1. If _separator_ is *undefined*, let _sep_ be *","*. 1. Else, let _sep_ be ? ToString(_separator_). - 1. Let _R_ be the empty String. + 1. Let _result_ be the empty String. 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. If _k_ > 0, set _R_ to the string-concatenation of _R_ and _sep_. - 1. Let _element_ be ? Get(_O_, ! ToString(𝔽(_k_))). + 1. Repeat, while _k_ < _length_, + 1. If _k_ > 0, set _result_ to the string-concatenation of _result_ and _sep_. + 1. Let _element_ be ? Get(_obj_, ! ToString(𝔽(_k_))). 1. If _element_ is neither *undefined* nor *null*, then - 1. Let _S_ be ? ToString(_element_). - 1. Set _R_ to the string-concatenation of _R_ and _S_. + 1. Let _elementString_ be ? ToString(_element_). + 1. Set _result_ to the string-concatenation of _result_ and _elementString_. 1. Set _k_ to _k_ + 1. - 1. Return _R_. + 1. Return _result_.

            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.keys ( )

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Return CreateArrayIterator(_O_, ~key~). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Return CreateArrayIterator(_obj_, ~key~).
            - +

            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*𝔽.

            -

            The optional second argument _fromIndex_ defaults to the array's length minus one (i.e. the whole array is searched). If it is greater than or equal to the length of the array, the whole array will be searched. If it is less than *-0*𝔽, it is used as the offset from the end of the array to compute _fromIndex_. If the computed index is less than or equal to *+0*𝔽, *-1*𝔽 is returned.

            +

            The optional second argument _fromIndex_ defaults to the array's length minus one (i.e. the whole array is searched). If it is greater than or equal to the length of the array, the whole array will be searched. If it is less than *-0*𝔽, it is used to compute an offset from the end of the array. If the computed index is less than *-0*𝔽, *-1*𝔽 is returned.

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If _len_ = 0, return *-1*𝔽. - 1. If _fromIndex_ is present, let _n_ be ? ToIntegerOrInfinity(_fromIndex_); else let _n_ be _len_ - 1. - 1. If _n_ = -∞, return *-1*𝔽. - 1. If _n_ ≥ 0, then - 1. Let _k_ be min(_n_, _len_ - 1). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 1. If _length_ = 0, return *-1*𝔽. + 1. If _fromIndex_ is present, let _startIndex_ be ? ToIntegerOrInfinity(_fromIndex_); else let _startIndex_ be _length_ - 1. + 1. If _startIndex_ = -∞, return *-1*𝔽. + 1. If _startIndex_ ≥ 0, then + 1. Let _k_ be min(_startIndex_, _length_ - 1). 1. Else, - 1. Let _k_ be _len_ + _n_. + 1. Let _k_ be _length_ + _startIndex_. 1. Repeat, while _k_ ≥ 0, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kPresent_ be ? HasProperty(_obj_, _propertyKey_). 1. If _kPresent_ is *true*, then - 1. Let _elementK_ be ? Get(_O_, _Pk_). + 1. Let _elementK_ be ? Get(_obj_, _propertyKey_). 1. If IsStrictlyEqual(_searchElement_, _elementK_) is *true*, return 𝔽(_k_). 1. Set _k_ to _k_ - 1. 1. Return *-1*𝔽. @@ -39200,79 +41256,78 @@

            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. Let _A_ be ? ArraySpeciesCreate(_O_, _len_). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. + 1. Let _array_ be ? ArraySpeciesCreate(_obj_, _length_). 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). + 1. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kPresent_ be ? HasProperty(_obj_, _propertyKey_). 1. If _kPresent_ is *true*, then - 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Let _mappedValue_ be ? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). - 1. Perform ? CreateDataPropertyOrThrow(_A_, _Pk_, _mappedValue_). + 1. Let _kValue_ be ? Get(_obj_, _propertyKey_). + 1. Let _mappedValue_ be ? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _obj_ »). + 1. Perform ? CreateDataPropertyOrThrow(_array_, _propertyKey_, _mappedValue_). 1. Set _k_ to _k_ + 1. - 1. Return _A_. + 1. Return _array_.

            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.pop ( )

            This method removes the last element of the array and returns it.

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If _len_ = 0, then - 1. Perform ? Set(_O_, *"length"*, *+0*𝔽, *true*). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 1. If _length_ = 0, then + 1. Perform ? Set(_obj_, *"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: _length_ > 0. + 1. Let _newLength_ be 𝔽(_length_ - 1). + 1. Let _index_ be ! ToString(_newLength_). + 1. Let _element_ be ? Get(_obj_, _index_). + 1. Perform ? DeletePropertyOrThrow(_obj_, _index_). + 1. Perform ? Set(_obj_, *"length"*, _newLength_, *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.

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). 1. Let _argCount_ be the number of elements in _items_. - 1. If _len_ + _argCount_ > 253 - 1, throw a *TypeError* exception. - 1. For each element _E_ of _items_, do - 1. Perform ? Set(_O_, ! ToString(𝔽(_len_)), _E_, *true*). - 1. Set _len_ to _len_ + 1. - 1. Perform ? Set(_O_, *"length"*, 𝔽(_len_), *true*). - 1. Return 𝔽(_len_). + 1. If _length_ + _argCount_ > 253 - 1, throw a *TypeError* exception. + 1. For each element _item_ of _items_, do + 1. Perform ? Set(_obj_, ! ToString(𝔽(_length_)), _item_, *true*). + 1. Set _length_ to _length_ + 1. + 1. Perform ? Set(_obj_, *"length"*, 𝔽(_length_), *true*). + 1. Return 𝔽(_length_).

            The *"length"* property of this method is *1*𝔽.

            @@ -39280,39 +41335,39 @@

            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 _callback_ once for each element present in the array, in ascending order, skipping the first element unless _initialValue_ is provided.

            +

            _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 _len_ = 0 and _initialValue_ is not present, throw a *TypeError* exception. + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. + 1. If _length_ = 0 and _initialValue_ is not present, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Let _accumulator_ be *undefined*. 1. If _initialValue_ is present, then 1. Set _accumulator_ to _initialValue_. 1. Else, 1. Let _kPresent_ be *false*. - 1. Repeat, while _kPresent_ is *false* and _k_ < _len_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Set _kPresent_ to ? HasProperty(_O_, _Pk_). + 1. Repeat, while _kPresent_ is *false* and _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Set _kPresent_ to ? HasProperty(_obj_, _propertyKey_). 1. If _kPresent_ is *true*, then - 1. Set _accumulator_ to ? Get(_O_, _Pk_). + 1. Set _accumulator_ to ? Get(_obj_, _propertyKey_). 1. Set _k_ to _k_ + 1. 1. If _kPresent_ is *false*, throw a *TypeError* exception. - 1. Repeat, while _k_ < _len_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). + 1. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kPresent_ be ? HasProperty(_obj_, _propertyKey_). 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. Let _kValue_ be ? Get(_obj_, _propertyKey_). + 1. Set _accumulator_ to ? Call(_callback_, *undefined*, « _accumulator_, _kValue_, 𝔽(_k_), _obj_ »). 1. Set _k_ to _k_ + 1. 1. Return _accumulator_. @@ -39321,39 +41376,39 @@

            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 _callback_ once for each element present in the array, in descending order, skipping the first call unless _initialValue_ is provided.

            +

            _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 _len_ = 0 and _initialValue_ is not present, throw a *TypeError* exception. - 1. Let _k_ be _len_ - 1. + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. + 1. If _length_ = 0 and _initialValue_ is not present, throw a *TypeError* exception. + 1. Let _k_ be _length_ - 1. 1. Let _accumulator_ be *undefined*. 1. If _initialValue_ is present, then 1. Set _accumulator_ to _initialValue_. 1. Else, 1. Let _kPresent_ be *false*. 1. Repeat, while _kPresent_ is *false* and _k_ ≥ 0, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Set _kPresent_ to ? HasProperty(_O_, _Pk_). + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Set _kPresent_ to ? HasProperty(_obj_, _propertyKey_). 1. If _kPresent_ is *true*, then - 1. Set _accumulator_ to ? Get(_O_, _Pk_). + 1. Set _accumulator_ to ? Get(_obj_, _propertyKey_). 1. Set _k_ to _k_ - 1. 1. If _kPresent_ is *false*, throw a *TypeError* exception. 1. Repeat, while _k_ ≥ 0, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kPresent_ be ? HasProperty(_obj_, _propertyKey_). 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. Let _kValue_ be ? Get(_obj_, _propertyKey_). + 1. Set _accumulator_ to ? Call(_callback_, *undefined*, « _accumulator_, _kValue_, 𝔽(_k_), _obj_ »). 1. Set _k_ to _k_ - 1. 1. Return _accumulator_. @@ -39362,72 +41417,72 @@

            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:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. Let _middle_ be floor(_len_ / 2). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 1. Let _middle_ be floor(_length_ / 2). 1. Let _lower_ be 0. 1. Repeat, while _lower_ ≠ _middle_, - 1. Let _upper_ be _len_ - _lower_ - 1. + 1. Let _upper_ be _length_ - _lower_ - 1. 1. Let _upperP_ be ! ToString(𝔽(_upper_)). 1. Let _lowerP_ be ! ToString(𝔽(_lower_)). - 1. Let _lowerExists_ be ? HasProperty(_O_, _lowerP_). + 1. Let _lowerExists_ be ? HasProperty(_obj_, _lowerP_). 1. If _lowerExists_ is *true*, then - 1. Let _lowerValue_ be ? Get(_O_, _lowerP_). - 1. Let _upperExists_ be ? HasProperty(_O_, _upperP_). + 1. Let _lowerValue_ be ? Get(_obj_, _lowerP_). + 1. Let _upperExists_ be ? HasProperty(_obj_, _upperP_). 1. If _upperExists_ is *true*, then - 1. Let _upperValue_ be ? Get(_O_, _upperP_). + 1. Let _upperValue_ be ? Get(_obj_, _upperP_). 1. If _lowerExists_ is *true* and _upperExists_ is *true*, then - 1. Perform ? Set(_O_, _lowerP_, _upperValue_, *true*). - 1. Perform ? Set(_O_, _upperP_, _lowerValue_, *true*). + 1. Perform ? Set(_obj_, _lowerP_, _upperValue_, *true*). + 1. Perform ? Set(_obj_, _upperP_, _lowerValue_, *true*). 1. Else if _lowerExists_ is *false* and _upperExists_ is *true*, then - 1. Perform ? Set(_O_, _lowerP_, _upperValue_, *true*). - 1. Perform ? DeletePropertyOrThrow(_O_, _upperP_). + 1. Perform ? Set(_obj_, _lowerP_, _upperValue_, *true*). + 1. Perform ? DeletePropertyOrThrow(_obj_, _upperP_). 1. Else if _lowerExists_ is *true* and _upperExists_ is *false*, then - 1. Perform ? DeletePropertyOrThrow(_O_, _lowerP_). - 1. Perform ? Set(_O_, _upperP_, _lowerValue_, *true*). + 1. Perform ? DeletePropertyOrThrow(_obj_, _lowerP_). + 1. Perform ? Set(_obj_, _upperP_, _lowerValue_, *true*). 1. Else, 1. Assert: _lowerExists_ and _upperExists_ are both *false*. 1. NOTE: No action is required. 1. Set _lower_ to _lower_ + 1. - 1. Return _O_. + 1. Return _obj_.

            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.shift ( )

            This method removes the first element of the array and returns it.

            It performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If _len_ = 0, then - 1. Perform ? Set(_O_, *"length"*, *+0*𝔽, *true*). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 1. If _length_ = 0, then + 1. Perform ? Set(_obj_, *"length"*, *+0*𝔽, *true*). 1. Return *undefined*. - 1. Let _first_ be ? Get(_O_, *"0"*). + 1. Let _first_ be ? Get(_obj_, *"0"*). 1. Let _k_ be 1. - 1. Repeat, while _k_ < _len_, + 1. Repeat, while _k_ < _length_, 1. Let _from_ be ! ToString(𝔽(_k_)). 1. Let _to_ be ! ToString(𝔽(_k_ - 1)). - 1. Let _fromPresent_ be ? HasProperty(_O_, _from_). + 1. Let _fromPresent_ be ? HasProperty(_obj_, _from_). 1. If _fromPresent_ is *true*, then - 1. Let _fromValue_ be ? Get(_O_, _from_). - 1. Perform ? Set(_O_, _to_, _fromValue_, *true*). + 1. Let _fromValue_ be ? Get(_obj_, _from_). + 1. Perform ? Set(_obj_, _to_, _fromValue_, *true*). 1. Else, 1. Assert: _fromPresent_ is *false*. - 1. Perform ? DeletePropertyOrThrow(_O_, _to_). + 1. Perform ? DeletePropertyOrThrow(_obj_, _to_). 1. Set _k_ to _k_ + 1. - 1. Perform ? DeletePropertyOrThrow(_O_, ! ToString(𝔽(_len_ - 1))). - 1. Perform ? Set(_O_, *"length"*, 𝔽(_len_ - 1), *true*). + 1. Perform ? DeletePropertyOrThrow(_obj_, ! ToString(𝔽(_length_ - 1))). + 1. Perform ? Set(_obj_, *"length"*, 𝔽(_length_ - 1), *true*). 1. Return _first_. @@ -39435,64 +41490,64 @@

            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:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). 1. Let _relativeStart_ be ? ToIntegerOrInfinity(_start_). 1. If _relativeStart_ = -∞, let _k_ be 0. - 1. Else if _relativeStart_ < 0, let _k_ be max(_len_ + _relativeStart_, 0). - 1. Else, let _k_ be min(_relativeStart_, _len_). - 1. If _end_ is *undefined*, let _relativeEnd_ be _len_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). + 1. Else if _relativeStart_ < 0, let _k_ be max(_length_ + _relativeStart_, 0). + 1. Else, let _k_ be min(_relativeStart_, _length_). + 1. If _end_ is *undefined*, let _relativeEnd_ be _length_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). 1. If _relativeEnd_ = -∞, let _final_ be 0. - 1. Else if _relativeEnd_ < 0, let _final_ be max(_len_ + _relativeEnd_, 0). - 1. Else, let _final_ be min(_relativeEnd_, _len_). + 1. Else if _relativeEnd_ < 0, let _final_ be max(_length_ + _relativeEnd_, 0). + 1. Else, let _final_ be min(_relativeEnd_, _length_). 1. Let _count_ be max(_final_ - _k_, 0). - 1. Let _A_ be ? ArraySpeciesCreate(_O_, _count_). - 1. Let _n_ be 0. + 1. Let _array_ be ? ArraySpeciesCreate(_obj_, _count_). + 1. Let _resultIndex_ be 0. 1. Repeat, while _k_ < _final_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kPresent_ be ? HasProperty(_obj_, _propertyKey_). 1. If _kPresent_ is *true*, then - 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Perform ? CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_n_)), _kValue_). + 1. Let _kValue_ be ? Get(_obj_, _propertyKey_). + 1. Perform ? CreateDataPropertyOrThrow(_array_, ! ToString(𝔽(_resultIndex_)), _kValue_). 1. Set _k_ to _k_ + 1. - 1. Set _n_ to _n_ + 1. - 1. [id="step-array-proto-slice-set-length"] Perform ? Set(_A_, *"length"*, 𝔽(_n_), *true*). - 1. Return _A_. + 1. Set _resultIndex_ to _resultIndex_ + 1. + 1. [id="step-array-proto-slice-set-length"] Perform ? Set(_array_, *"length"*, 𝔽(_resultIndex_), *true*). + 1. Return _array_. -

            The explicit setting of the *"length"* property in step is intended to ensure the length is correct even when _A_ is not a built-in Array.

            +

            The explicit setting of the *"length"* property in step is intended to ensure the length is correct even when _array_ is not a built-in Array.

            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.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. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 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. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kPresent_ be ? HasProperty(_obj_, _propertyKey_). 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 _kValue_ be ? Get(_obj_, _propertyKey_). + 1. Let _testResult_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _obj_ »)). 1. If _testResult_ is *true*, return *true*. 1. Set _k_ to _k_ + 1. 1. Return *false*. @@ -39502,24 +41557,24 @@

            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. [id="step-array-sortindexedproperties"] Let _sortedList_ be ? SortIndexedProperties(_obj_, _len_, _SortCompare_, ~skip-holes~). + 1. [id="step-array-sort-len"] Let _length_ be ? LengthOfArrayLike(_obj_). + 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_, _length_, _sortCompare_, ~skip-holes~). 1. Let _itemCount_ be the number of elements in _sortedList_. 1. Let _j_ be 0. 1. Repeat, while _j_ < _itemCount_, 1. Perform ? Set(_obj_, ! ToString(𝔽(_j_)), _sortedList_[_j_], *true*). 1. Set _j_ to _j_ + 1. 1. NOTE: The call to SortIndexedProperties in step uses ~skip-holes~. The remaining indices are deleted to preserve the number of holes that were detected and excluded from the sort. - 1. Repeat, while _j_ < _len_, + 1. Repeat, while _j_ < _length_, 1. Perform ? DeletePropertyOrThrow(_obj_, ! ToString(𝔽(_j_))). 1. Set _j_ to _j_ + 1. 1. Return _obj_. @@ -39528,7 +41583,7 @@

            Array.prototype.sort ( _comparefn_ )

            Because non-existent property values always compare greater than *undefined* property values, and *undefined* always compares greater than any other value (see CompareArrayElements), *undefined* property values always sort to the end of the result, followed by non-existent property values.

            -

            Method calls performed by the ToString abstract operations in steps and have the potential to cause _SortCompare_ to not behave as a consistent comparator.

            +

            Method calls performed by the ToString abstract operations in steps and have the potential to cause _sortCompare_ to not behave as a consistent comparator.

            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.

            @@ -39538,8 +41593,8 @@

            Array.prototype.sort ( _comparefn_ )

            SortIndexedProperties ( _obj_: an Object, - _len_: a non-negative integer, - _SortCompare_: an Abstract Closure with two parameters, + _length_: a non-negative integer, + _sortCompare_: an Abstract Closure with two parameters, _holes_: ~skip-holes~ or ~read-through-holes~, ): either a normal completion containing a List of ECMAScript language values or a throw completion

            @@ -39548,32 +41603,35 @@

            1. Let _items_ be a new empty List. 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). + 1. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). 1. If _holes_ is ~skip-holes~, then - 1. Let _kRead_ be ? HasProperty(_obj_, _Pk_). + 1. Let _kRead_ be ? HasProperty(_obj_, _propertyKey_). 1. Else, 1. Assert: _holes_ is ~read-through-holes~. 1. Let _kRead_ be *true*. 1. If _kRead_ is *true*, then - 1. Let _kValue_ be ? Get(_obj_, _Pk_). + 1. Let _kValue_ be ? Get(_obj_, _propertyKey_). 1. Append _kValue_ to _items_. 1. Set _k_ to _k_ + 1. - 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. [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:

            • There must be some mathematical permutation π of the non-negative integers less than _itemCount_, such that for every non-negative integer _j_ less than _itemCount_, the element old[_j_] is exactly the same as new[π(_j_)].
            • - Then for all non-negative integers _j_ and _k_, each less than _itemCount_, if ℝ(_SortCompare_(old[_j_], old[_k_])) < 0, then π(_j_) < π(_k_). + 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 _values_ if all of the requirements below are met for all values _a_, _b_, and _c_ (possibly the same value) in the set _values_: 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_. @@ -39598,7 +41656,7 @@

            -

            The above conditions are necessary and sufficient to ensure that _comparator_ divides the set _S_ into equivalence classes and that these equivalence classes are totally ordered.

            +

            The above conditions are necessary and sufficient to ensure that _comparator_ divides the set _values_ into equivalence classes and that these equivalence classes are totally ordered.

            @@ -39607,19 +41665,19 @@

            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

            - 1. If _x_ and _y_ are both *undefined*, return *+0*𝔽. + 1. If _x_ is *undefined* and _y_ is *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 _v_ is *NaN*, return *+0*𝔽. - 1. Return _v_. + 1. If _comparator_ is not *undefined*, then + 1. Let _result_ be ? ToNumber(? Call(_comparator_, *undefined*, « _x_, _y_ »)). + 1. If _result_ is *NaN*, return *+0*𝔽. + 1. Return _result_. 1. [id="step-sortcompare-tostring-x"] Let _xString_ be ? ToString(_x_). 1. [id="step-sortcompare-tostring-y"] Let _yString_ be ? ToString(_y_). 1. Let _xSmaller_ be ! IsLessThan(_xString_, _yString_, *true*). @@ -39631,69 +41689,69 @@

            - +

            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).

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). 1. Let _relativeStart_ be ? ToIntegerOrInfinity(_start_). 1. If _relativeStart_ = -∞, let _actualStart_ be 0. - 1. Else if _relativeStart_ < 0, let _actualStart_ be max(_len_ + _relativeStart_, 0). - 1. Else, let _actualStart_ be min(_relativeStart_, _len_). + 1. Else if _relativeStart_ < 0, let _actualStart_ be max(_length_ + _relativeStart_, 0). + 1. Else, let _actualStart_ be min(_relativeStart_, _length_). 1. Let _itemCount_ be the number of elements in _items_. 1. If _start_ is not present, then 1. Let _actualDeleteCount_ be 0. 1. Else if _deleteCount_ is not present, then - 1. Let _actualDeleteCount_ be _len_ - _actualStart_. + 1. Let _actualDeleteCount_ be _length_ - _actualStart_. 1. Else, 1. Let _dc_ be ? ToIntegerOrInfinity(_deleteCount_). - 1. Let _actualDeleteCount_ be the result of clamping _dc_ between 0 and _len_ - _actualStart_. - 1. If _len_ + _itemCount_ - _actualDeleteCount_ > 253 - 1, throw a *TypeError* exception. - 1. Let _A_ be ? ArraySpeciesCreate(_O_, _actualDeleteCount_). + 1. Let _actualDeleteCount_ be the result of clamping _dc_ between 0 and _length_ - _actualStart_. + 1. If _length_ + _itemCount_ - _actualDeleteCount_ > 253 - 1, throw a *TypeError* exception. + 1. Let _deletedArray_ be ? ArraySpeciesCreate(_obj_, _actualDeleteCount_). 1. Let _k_ be 0. 1. Repeat, while _k_ < _actualDeleteCount_, 1. Let _from_ be ! ToString(𝔽(_actualStart_ + _k_)). - 1. If ? HasProperty(_O_, _from_) is *true*, then - 1. Let _fromValue_ be ? Get(_O_, _from_). - 1. Perform ? CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_k_)), _fromValue_). + 1. If ? HasProperty(_obj_, _from_) is *true*, then + 1. Let _fromValue_ be ? Get(_obj_, _from_). + 1. Perform ? CreateDataPropertyOrThrow(_deletedArray_, ! ToString(𝔽(_k_)), _fromValue_). 1. Set _k_ to _k_ + 1. - 1. [id="step-array-proto-splice-set-length"] Perform ? Set(_A_, *"length"*, 𝔽(_actualDeleteCount_), *true*). + 1. [id="step-array-proto-splice-set-length"] Perform ? Set(_deletedArray_, *"length"*, 𝔽(_actualDeleteCount_), *true*). 1. If _itemCount_ < _actualDeleteCount_, then 1. Set _k_ to _actualStart_. - 1. Repeat, while _k_ < (_len_ - _actualDeleteCount_), + 1. Repeat, while _k_ < (_length_ - _actualDeleteCount_), 1. Let _from_ be ! ToString(𝔽(_k_ + _actualDeleteCount_)). 1. Let _to_ be ! ToString(𝔽(_k_ + _itemCount_)). - 1. If ? HasProperty(_O_, _from_) is *true*, then - 1. Let _fromValue_ be ? Get(_O_, _from_). - 1. Perform ? Set(_O_, _to_, _fromValue_, *true*). + 1. If ? HasProperty(_obj_, _from_) is *true*, then + 1. Let _fromValue_ be ? Get(_obj_, _from_). + 1. Perform ? Set(_obj_, _to_, _fromValue_, *true*). 1. Else, - 1. Perform ? DeletePropertyOrThrow(_O_, _to_). + 1. Perform ? DeletePropertyOrThrow(_obj_, _to_). 1. Set _k_ to _k_ + 1. - 1. Set _k_ to _len_. - 1. Repeat, while _k_ > (_len_ - _actualDeleteCount_ + _itemCount_), - 1. Perform ? DeletePropertyOrThrow(_O_, ! ToString(𝔽(_k_ - 1))). + 1. Set _k_ to _length_. + 1. Repeat, while _k_ > (_length_ - _actualDeleteCount_ + _itemCount_), + 1. Perform ? DeletePropertyOrThrow(_obj_, ! ToString(𝔽(_k_ - 1))). 1. Set _k_ to _k_ - 1. 1. Else if _itemCount_ > _actualDeleteCount_, then - 1. Set _k_ to (_len_ - _actualDeleteCount_). + 1. Set _k_ to (_length_ - _actualDeleteCount_). 1. Repeat, while _k_ > _actualStart_, 1. Let _from_ be ! ToString(𝔽(_k_ + _actualDeleteCount_ - 1)). 1. Let _to_ be ! ToString(𝔽(_k_ + _itemCount_ - 1)). - 1. If ? HasProperty(_O_, _from_) is *true*, then - 1. Let _fromValue_ be ? Get(_O_, _from_). - 1. Perform ? Set(_O_, _to_, _fromValue_, *true*). + 1. If ? HasProperty(_obj_, _from_) is *true*, then + 1. Let _fromValue_ be ? Get(_obj_, _from_). + 1. Perform ? Set(_obj_, _to_, _fromValue_, *true*). 1. Else, - 1. Perform ? DeletePropertyOrThrow(_O_, _to_). + 1. Perform ? DeletePropertyOrThrow(_obj_, _to_). 1. Set _k_ to _k_ - 1. 1. Set _k_ to _actualStart_. - 1. For each element _E_ of _items_, do - 1. Perform ? Set(_O_, ! ToString(𝔽(_k_)), _E_, *true*). + 1. For each element _item_ of _items_, do + 1. Perform ? Set(_obj_, ! ToString(𝔽(_k_)), _item_, *true*). 1. Set _k_ to _k_ + 1. - 1. [id="step-array-proto-splice-set-length-2"] Perform ? Set(_O_, *"length"*, 𝔽(_len_ - _actualDeleteCount_ + _itemCount_), *true*). - 1. Return _A_. + 1. [id="step-array-proto-splice-set-length-2"] Perform ? Set(_obj_, *"length"*, 𝔽(_length_ - _actualDeleteCount_ + _itemCount_), *true*). + 1. Return _deletedArray_.

            The explicit setting of the *"length"* property in steps and is intended to ensure the lengths are correct even when the objects are not built-in Arrays.

            @@ -39703,7 +41761,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.

            @@ -39713,18 +41771,18 @@

            Array.prototype.toLocaleString ( [ _reserved1_ [ , _reserved2_ ] ] )

            This method performs the following steps when called:

            1. Let _array_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_array_). + 1. Let _length_ be ? LengthOfArrayLike(_array_). 1. Let _separator_ be the implementation-defined list-separator String value appropriate for the host environment's current locale (such as *", "*). - 1. Let _R_ be the empty String. + 1. Let _result_ be the empty String. 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. If _k_ > 0, set _R_ to the string-concatenation of _R_ and _separator_. + 1. Repeat, while _k_ < _length_, + 1. If _k_ > 0, set _result_ to the string-concatenation of _result_ and _separator_. 1. Let _element_ be ? Get(_array_, ! ToString(𝔽(_k_))). 1. If _element_ is neither *undefined* nor *null*, then - 1. Let _S_ be ? ToString(? Invoke(_element_, *"toLocaleString"*)). - 1. Set _R_ to the string-concatenation of _R_ and _S_. + 1. Let _elementString_ be ? ToString(? Invoke(_element_, *"toLocaleString"*)). + 1. Set _result_ to the string-concatenation of _result_ and _elementString_. 1. Set _k_ to _k_ + 1. - 1. Return _R_. + 1. Return _result_.

            This method converts the elements of the array to Strings using their `toLocaleString` methods, and then concatenates these Strings, separated by occurrences of an implementation-defined locale-sensitive separator String. This method is analogous to `toString` except that it is intended to yield a locale-sensitive result corresponding with conventions of the host environment's current locale.

            @@ -39734,87 +41792,87 @@

            Array.prototype.toLocaleString ( [ _reserved1_ [ , _reserved2_ ] ] )

            - +

            Array.prototype.toReversed ( )

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. Let _A_ be ? ArrayCreate(_len_). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 1. Let _array_ be ? ArrayCreate(_length_). 1. Let _k_ be 0. - 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 ! CreateDataPropertyOrThrow(_A_, _Pk_, _fromValue_). + 1. Repeat, while _k_ < _length_, + 1. Let _from_ be ! ToString(𝔽(_length_ - _k_ - 1)). + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _fromValue_ be ? Get(_obj_, _from_). + 1. Perform ! CreateDataPropertyOrThrow(_array_, _propertyKey_, _fromValue_). 1. Set _k_ to _k_ + 1. - 1. Return _A_. + 1. Return _array_.
            - -

            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. 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 _sortedList_ be ? SortIndexedProperties(_O_, _len_, _SortCompare_, ~read-through-holes~). + 1. If _comparator_ is not *undefined* and IsCallable(_comparator_) is *false*, throw a *TypeError* exception. + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). + 1. Let _array_ be ? ArrayCreate(_length_). + 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(_obj_, _length_, _sortCompare_, ~read-through-holes~). 1. Let _j_ be 0. - 1. Repeat, while _j_ < _len_, - 1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_j_)), _sortedList_[_j_]). + 1. Repeat, while _j_ < _length_, + 1. Perform ! CreateDataPropertyOrThrow(_array_, ! ToString(𝔽(_j_)), _sortedList_[_j_]). 1. Set _j_ to _j_ + 1. - 1. Return _A_. + 1. Return _array_.
            - +

            Array.prototype.toSpliced ( _start_, _skipCount_, ..._items_ )

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). 1. Let _relativeStart_ be ? ToIntegerOrInfinity(_start_). 1. If _relativeStart_ = -∞, let _actualStart_ be 0. - 1. Else if _relativeStart_ < 0, let _actualStart_ be max(_len_ + _relativeStart_, 0). - 1. Else, let _actualStart_ be min(_relativeStart_, _len_). + 1. Else if _relativeStart_ < 0, let _actualStart_ be max(_length_ + _relativeStart_, 0). + 1. Else, let _actualStart_ be min(_relativeStart_, _length_). 1. Let _insertCount_ be the number of elements in _items_. 1. If _start_ is not present, then 1. Let _actualSkipCount_ be 0. 1. Else if _skipCount_ is not present, then - 1. Let _actualSkipCount_ be _len_ - _actualStart_. + 1. Let _actualSkipCount_ be _length_ - _actualStart_. 1. Else, 1. Let _sc_ be ? ToIntegerOrInfinity(_skipCount_). - 1. Let _actualSkipCount_ be the result of clamping _sc_ between 0 and _len_ - _actualStart_. - 1. Let _newLen_ be _len_ + _insertCount_ - _actualSkipCount_. - 1. If _newLen_ > 253 - 1, throw a *TypeError* exception. - 1. Let _A_ be ? ArrayCreate(_newLen_). - 1. Let _i_ be 0. - 1. Let _r_ be _actualStart_ + _actualSkipCount_. - 1. Repeat, while _i_ < _actualStart_, - 1. Let _Pi_ be ! ToString(𝔽(_i_)). - 1. Let _iValue_ be ? Get(_O_, _Pi_). - 1. Perform ! CreateDataPropertyOrThrow(_A_, _Pi_, _iValue_). - 1. Set _i_ to _i_ + 1. - 1. For each element _E_ of _items_, do - 1. Let _Pi_ be ! ToString(𝔽(_i_)). - 1. Perform ! CreateDataPropertyOrThrow(_A_, _Pi_, _E_). - 1. Set _i_ to _i_ + 1. - 1. Repeat, while _i_ < _newLen_, - 1. Let _Pi_ be ! ToString(𝔽(_i_)). - 1. Let _from_ be ! ToString(𝔽(_r_)). - 1. Let _fromValue_ be ? Get(_O_, _from_). - 1. Perform ! CreateDataPropertyOrThrow(_A_, _Pi_, _fromValue_). - 1. Set _i_ to _i_ + 1. - 1. Set _r_ to _r_ + 1. - 1. Return _A_. - -
            - - + 1. Let _actualSkipCount_ be the result of clamping _sc_ between 0 and _length_ - _actualStart_. + 1. Let _newLength_ be _length_ + _insertCount_ - _actualSkipCount_. + 1. If _newLength_ > 253 - 1, throw a *TypeError* exception. + 1. Let _newArray_ be ? ArrayCreate(_newLength_). + 1. Let _writeIndex_ be 0. + 1. Let _readIndex_ be _actualStart_ + _actualSkipCount_. + 1. Repeat, while _writeIndex_ < _actualStart_, + 1. Let _propertyKey_ be ! ToString(𝔽(_writeIndex_)). + 1. Let _iValue_ be ? Get(_obj_, _propertyKey_). + 1. Perform ! CreateDataPropertyOrThrow(_newArray_, _propertyKey_, _iValue_). + 1. Set _writeIndex_ to _writeIndex_ + 1. + 1. For each element _item_ of _items_, do + 1. Let _propertyKey_ be ! ToString(𝔽(_writeIndex_)). + 1. Perform ! CreateDataPropertyOrThrow(_newArray_, _propertyKey_, _item_). + 1. Set _writeIndex_ to _writeIndex_ + 1. + 1. Repeat, while _writeIndex_ < _newLength_, + 1. Let _propertyKey_ be ! ToString(𝔽(_writeIndex_)). + 1. Let _from_ be ! ToString(𝔽(_readIndex_)). + 1. Let _fromValue_ be ? Get(_obj_, _from_). + 1. Perform ! CreateDataPropertyOrThrow(_newArray_, _propertyKey_, _fromValue_). + 1. Set _writeIndex_ to _writeIndex_ + 1. + 1. Set _readIndex_ to _readIndex_ + 1. + 1. Return _newArray_. + + + +

            Array.prototype.toString ( )

            This method performs the following steps when called:

            @@ -39828,34 +41886,34 @@

            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:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). 1. Let _argCount_ be the number of elements in _items_. 1. If _argCount_ > 0, then - 1. If _len_ + _argCount_ > 253 - 1, throw a *TypeError* exception. - 1. Let _k_ be _len_. + 1. If _length_ + _argCount_ > 253 - 1, throw a *TypeError* exception. + 1. Let _k_ be _length_. 1. Repeat, while _k_ > 0, 1. Let _from_ be ! ToString(𝔽(_k_ - 1)). 1. Let _to_ be ! ToString(𝔽(_k_ + _argCount_ - 1)). - 1. Let _fromPresent_ be ? HasProperty(_O_, _from_). + 1. Let _fromPresent_ be ? HasProperty(_obj_, _from_). 1. If _fromPresent_ is *true*, then - 1. Let _fromValue_ be ? Get(_O_, _from_). - 1. Perform ? Set(_O_, _to_, _fromValue_, *true*). + 1. Let _fromValue_ be ? Get(_obj_, _from_). + 1. Perform ? Set(_obj_, _to_, _fromValue_, *true*). 1. Else, 1. Assert: _fromPresent_ is *false*. - 1. Perform ? DeletePropertyOrThrow(_O_, _to_). + 1. Perform ? DeletePropertyOrThrow(_obj_, _to_). 1. Set _k_ to _k_ - 1. 1. Let _j_ be *+0*𝔽. - 1. For each element _E_ of _items_, do - 1. Perform ? Set(_O_, ! ToString(_j_), _E_, *true*). + 1. For each element _item_ of _items_, do + 1. Perform ? Set(_obj_, ! ToString(_j_), _item_, *true*). 1. Set _j_ to _j_ + *1*𝔽. - 1. Perform ? Set(_O_, *"length"*, 𝔽(_len_ + _argCount_), *true*). - 1. Return 𝔽(_len_ + _argCount_). + 1. Perform ? Set(_obj_, *"length"*, 𝔽(_length_ + _argCount_), *true*). + 1. Return 𝔽(_length_ + _argCount_).

            The *"length"* property of this method is *1*𝔽.

            @@ -39863,45 +41921,45 @@

            Array.prototype.unshift ( ..._items_ )

            - +

            Array.prototype.values ( )

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Return CreateArrayIterator(_O_, ~value~). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Return CreateArrayIterator(_obj_, ~value~).
            - +

            Array.prototype.with ( _index_, _value_ )

            This method performs the following steps when called:

            - 1. Let _O_ be ? ToObject(*this* value). - 1. Let _len_ be ? LengthOfArrayLike(_O_). + 1. Let _obj_ be ? ToObject(*this* value). + 1. Let _length_ be ? LengthOfArrayLike(_obj_). 1. Let _relativeIndex_ be ? ToIntegerOrInfinity(_index_). 1. If _relativeIndex_ ≥ 0, let _actualIndex_ be _relativeIndex_. - 1. Else, let _actualIndex_ be _len_ + _relativeIndex_. - 1. If _actualIndex_ ≥ _len_ or _actualIndex_ < 0, throw a *RangeError* exception. - 1. Let _A_ be ? ArrayCreate(_len_). + 1. Else, let _actualIndex_ be _length_ + _relativeIndex_. + 1. If _actualIndex_ ≥ _length_ or _actualIndex_ < 0, throw a *RangeError* exception. + 1. Let _array_ be ? ArrayCreate(_length_). 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). + 1. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). 1. If _k_ = _actualIndex_, let _fromValue_ be _value_. - 1. Else, let _fromValue_ be ? Get(_O_, _Pk_). - 1. Perform ! CreateDataPropertyOrThrow(_A_, _Pk_, _fromValue_). + 1. Else, let _fromValue_ be ? Get(_obj_, _propertyKey_). + 1. Perform ! CreateDataPropertyOrThrow(_array_, _propertyKey_, _fromValue_). 1. Set _k_ to _k_ + 1. - 1. Return _A_. + 1. Return _array_.
            - -

            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 +42005,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 +42031,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 _iteratorObj_ be the *this* value. + 1. If _iteratorObj_ is not an Object, throw a *TypeError* exception. + 1. If _iteratorObj_ does not have all of the internal slots of an Array Iterator Instance (), throw a *TypeError* exception. + 1. Let _array_ be _iteratorObj_.[[IteratedArrayLike]]. + 1. If _array_ is *undefined*, return CreateIteratorResultObject(*undefined*, *true*). + 1. Let _index_ be _iteratorObj_.[[ArrayLikeNextIndex]]. + 1. Let _kind_ be _iteratorObj_.[[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 _length_ be TypedArrayLength(_taRecord_). + 1. Else, + 1. Let _length_ be ? LengthOfArrayLike(_array_). + 1. If _index_ ≥ _length_, then + 1. Set _iteratorObj_.[[IteratedArrayLike]] to *undefined*. + 1. Return CreateIteratorResultObject(*undefined*, *true*). + 1. Set _iteratorObj_.[[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 +42139,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 +42320,23 @@

            TypedArray Objects

            64-bit unsigned integer
            + Float16Array
            + %Float16Array% +
            + ~float16~ + + 2 + + + 16-bit IEEE floating point +
            Float32Array
            @@ -40247,7 +42386,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,66 +42405,66 @@

            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. Let _ctor_ be the *this* value. + 1. If IsConstructor(_ctor_) is *false*, throw a *TypeError* exception. + 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_. - 1. Let _targetObj_ be ? TypedArrayCreateFromConstructor(_C_, « 𝔽(_len_) »). + 1. Let _length_ be the number of elements in _values_. + 1. Let _targetObj_ be ? TypedArrayCreateFromConstructor(_ctor_, « 𝔽(_length_) »). 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). + 1. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). 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. Perform ? Set(_targetObj_, _propertyKey_, _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_) »). + 1. Let _length_ be ? LengthOfArrayLike(_arrayLike_). + 1. Let _targetObj_ be ? TypedArrayCreateFromConstructor(_ctor_, « 𝔽(_length_) »). 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Let _kValue_ be ? Get(_arrayLike_, _Pk_). + 1. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kValue_ be ? Get(_arrayLike_, _propertyKey_). 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. Perform ? Set(_targetObj_, _propertyKey_, _mappedValue_, *true*). 1. Set _k_ to _k_ + 1. 1. Return _targetObj_.
            - +

            %TypedArray%.of ( ..._items_ )

            This method performs the following steps when called:

            - 1. Let _len_ be the number of elements in _items_. - 1. Let _C_ be the *this* value. - 1. If IsConstructor(_C_) is *false*, throw a *TypeError* exception. - 1. Let _newObj_ be ? TypedArrayCreateFromConstructor(_C_, « 𝔽(_len_) »). + 1. Let _length_ be the number of elements in _items_. + 1. Let _ctor_ be the *this* value. + 1. If IsConstructor(_ctor_) is *false*, throw a *TypeError* exception. + 1. Let _newObj_ be ? TypedArrayCreateFromConstructor(_ctor_, « 𝔽(_length_) »). 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, + 1. Repeat, while _k_ < _length_, 1. Let _kValue_ be _items_[_k_]. - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Perform ? Set(_newObj_, _Pk_, _kValue_, *true*). + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Perform ? Set(_newObj_, _propertyKey_, _kValue_, *true*). 1. Set _k_ to _k_ + 1. 1. Return _newObj_. @@ -40337,15 +42476,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,57 +42499,58 @@

            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. - 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). - 1. Let _len_ be TypedArrayLength(_taRecord_). + 1. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). 1. Let _relativeIndex_ be ? ToIntegerOrInfinity(_index_). 1. If _relativeIndex_ ≥ 0, then 1. Let _k_ be _relativeIndex_. 1. Else, - 1. Let _k_ be _len_ + _relativeIndex_. - 1. If _k_ < 0 or _k_ ≥ _len_, return *undefined*. - 1. Return ! Get(_O_, ! ToString(𝔽(_k_))). + 1. Let _k_ be _length_ + _relativeIndex_. + 1. If _k_ < 0 or _k_ ≥ _length_, return *undefined*. + 1. Return ! Get(_obj_, ! ToString(𝔽(_k_))).
            - +

            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:

            - 1. Let _O_ be the *this* value. - 1. Perform ? RequireInternalSlot(_O_, [[TypedArrayName]]). - 1. Assert: _O_ has a [[ViewedArrayBuffer]] internal slot. - 1. Let _buffer_ be _O_.[[ViewedArrayBuffer]]. + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[TypedArrayName]]). + 1. Assert: _obj_ has a [[ViewedArrayBuffer]] internal slot. + 1. Let _buffer_ be _obj_.[[ViewedArrayBuffer]]. 1. Return _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:

            - 1. Let _O_ be the *this* value. - 1. Perform ? RequireInternalSlot(_O_, [[TypedArrayName]]). - 1. Assert: _O_ has a [[ViewedArrayBuffer]] internal slot. - 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~). + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[TypedArrayName]]). + 1. Assert: _obj_ has a [[ViewedArrayBuffer]] internal slot. + 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_obj_, ~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:

            - 1. Let _O_ be the *this* value. - 1. Perform ? RequireInternalSlot(_O_, [[TypedArrayName]]). - 1. Assert: _O_ has a [[ViewedArrayBuffer]] internal slot. - 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~). + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[TypedArrayName]]). + 1. Assert: _obj_ has a [[ViewedArrayBuffer]] internal slot. + 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_obj_, ~seq-cst~). 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, return *+0*𝔽. - 1. Let _offset_ be _O_.[[ByteOffset]]. + 1. Let _offset_ be _obj_.[[ByteOffset]]. 1. Return 𝔽(_offset_).
            @@ -40420,36 +42560,37 @@

            %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:

            - 1. Let _O_ be the *this* value. - 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). - 1. Let _len_ be TypedArrayLength(_taRecord_). + 1. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). 1. Let _relativeTarget_ be ? ToIntegerOrInfinity(_target_). 1. If _relativeTarget_ = -∞, let _targetIndex_ be 0. - 1. Else if _relativeTarget_ < 0, let _targetIndex_ be max(_len_ + _relativeTarget_, 0). - 1. Else, let _targetIndex_ be min(_relativeTarget_, _len_). + 1. Else if _relativeTarget_ < 0, let _targetIndex_ be max(_length_ + _relativeTarget_, 0). + 1. Else, let _targetIndex_ be min(_relativeTarget_, _length_). 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). - 1. Else, let _startIndex_ be min(_relativeStart_, _len_). - 1. If _end_ is *undefined*, let _relativeEnd_ be _len_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). + 1. Else if _relativeStart_ < 0, let _startIndex_ be max(_length_ + _relativeStart_, 0). + 1. Else, let _startIndex_ be min(_relativeStart_, _length_). + 1. If _end_ is *undefined*, let _relativeEnd_ be _length_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). 1. If _relativeEnd_ = -∞, let _endIndex_ be 0. - 1. Else if _relativeEnd_ < 0, let _endIndex_ be max(_len_ + _relativeEnd_, 0). - 1. Else, let _endIndex_ be min(_relativeEnd_, _len_). - 1. Let _count_ be min(_endIndex_ - _startIndex_, _len_ - _targetIndex_). + 1. Else if _relativeEnd_ < 0, let _endIndex_ be max(_length_ + _relativeEnd_, 0). + 1. Else, let _endIndex_ be min(_relativeEnd_, _length_). + 1. Let _count_ be min(_endIndex_ - _startIndex_, _length_ - _targetIndex_). 1. If _count_ > 0, then 1. NOTE: The copying must be performed in a manner that preserves the bit-level encoding of the source data. - 1. Let _buffer_ be _O_.[[ViewedArrayBuffer]]. - 1. Set _taRecord_ to MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~). + 1. Let _buffer_ be _obj_.[[ViewedArrayBuffer]]. + 1. Set _taRecord_ to MakeTypedArrayWithBufferWitnessRecord(_obj_, ~seq-cst~). 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception. - 1. Set _len_ to TypedArrayLength(_taRecord_). - 1. Let _elementSize_ be TypedArrayElementSize(_O_). - 1. Let _byteOffset_ be _O_.[[ByteOffset]]. - 1. Let _bufferByteLimit_ be (_len_ × _elementSize_) + _byteOffset_. + 1. Set _length_ to TypedArrayLength(_taRecord_). + 1. NOTE: Side-effects of the above steps may have reduced the size of _obj_, in which case copying should proceed with the longest still-applicable prefix. + 1. Set _count_ to min(_count_, _length_ - _startIndex_, _length_ - _targetIndex_). + 1. Let _elementSize_ be TypedArrayElementSize(_obj_). + 1. Let _byteOffset_ be _obj_.[[ByteOffset]]. 1. Let _toByteIndex_ be (_targetIndex_ × _elementSize_) + _byteOffset_. 1. Let _fromByteIndex_ be (_startIndex_ × _elementSize_) + _byteOffset_. 1. Let _countBytes_ be _count_ × _elementSize_. @@ -40460,42 +42601,39 @@

            %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. Return _O_. + 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 _obj_.
            - +

            %TypedArray%.prototype.entries ( )

            This method performs the following steps when called:

            - 1. Let _O_ be the *this* value. - 1. Perform ? ValidateTypedArray(_O_, ~seq-cst~). - 1. Return CreateArrayIterator(_O_, ~key+value~). + 1. Let _obj_ be the *this* value. + 1. Perform ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Return CreateArrayIterator(_obj_, ~key+value~).
            - -

            %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. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). + 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. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kValue_ be ! Get(_obj_, _propertyKey_). + 1. Let _testResult_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _obj_ »)). 1. If _testResult_ is *false*, return *false*. 1. Set _k_ to _k_ + 1. 1. Return *true*. @@ -40503,163 +42641,163 @@

            %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:

            - 1. Let _O_ be the *this* value. - 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. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). + 1. If _obj_.[[ContentType]] is ~bigint~, set _value_ to ? ToBigInt(_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). - 1. Else, let _startIndex_ be min(_relativeStart_, _len_). - 1. If _end_ is *undefined*, let _relativeEnd_ be _len_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). + 1. Else if _relativeStart_ < 0, let _startIndex_ be max(_length_ + _relativeStart_, 0). + 1. Else, let _startIndex_ be min(_relativeStart_, _length_). + 1. If _end_ is *undefined*, let _relativeEnd_ be _length_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). 1. If _relativeEnd_ = -∞, let _endIndex_ be 0. - 1. Else if _relativeEnd_ < 0, let _endIndex_ be max(_len_ + _relativeEnd_, 0). - 1. Else, let _endIndex_ be min(_relativeEnd_, _len_). - 1. Set _taRecord_ to MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~). + 1. Else if _relativeEnd_ < 0, let _endIndex_ be max(_length_ + _relativeEnd_, 0). + 1. Else, let _endIndex_ be min(_relativeEnd_, _length_). + 1. Set _taRecord_ to MakeTypedArrayWithBufferWitnessRecord(_obj_, ~seq-cst~). 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception. - 1. Set _len_ to TypedArrayLength(_taRecord_). - 1. Set _endIndex_ to min(_endIndex_, _len_). + 1. Set _length_ to TypedArrayLength(_taRecord_). + 1. Set _endIndex_ to min(_endIndex_, _length_). 1. Let _k_ be _startIndex_. 1. Repeat, while _k_ < _endIndex_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Perform ! Set(_O_, _Pk_, _value_, *true*). + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Perform ! Set(_obj_, _propertyKey_, _value_, *true*). 1. Set _k_ to _k_ + 1. - 1. Return _O_. + 1. Return _obj_.
            - -

            %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. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). + 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. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kValue_ be ! Get(_obj_, _propertyKey_). + 1. Let _selected_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _obj_ »)). 1. If _selected_ is *true*, then 1. Append _kValue_ to _kept_. 1. Set _captured_ to _captured_ + 1. 1. Set _k_ to _k_ + 1. - 1. Let _A_ be ? TypedArraySpeciesCreate(_O_, « 𝔽(_captured_) »). + 1. Let _result_ be ? TypedArraySpeciesCreate(_obj_, « 𝔽(_captured_) »). 1. Let _n_ be 0. - 1. For each element _e_ of _kept_, do - 1. Perform ! Set(_A_, ! ToString(𝔽(_n_)), _e_, *true*). + 1. For each element _element_ of _kept_, do + 1. Perform ! Set(_result_, ! ToString(𝔽(_n_)), _element_, *true*). 1. Set _n_ to _n_ + 1. - 1. Return _A_. + 1. Return _result_.

            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:

            - 1. Let _O_ be the *this* value. - 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). - 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. Let _findRec_ be ? FindViaPredicate(_O_, _len_, ~ascending~, _predicate_, _thisArg_). - 1. Return _findRec_.[[Value]]. + 1. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). + 1. Let _findRecord_ be ? FindViaPredicate(_obj_, _length_, ~ascending~, _predicate_, _thisArg_). + 1. Return _findRecord_.[[Value]].

            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:

            - 1. Let _O_ be the *this* value. - 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). - 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. Let _findRec_ be ? FindViaPredicate(_O_, _len_, ~ascending~, _predicate_, _thisArg_). - 1. Return _findRec_.[[Index]]. + 1. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). + 1. Let _findRecord_ be ? FindViaPredicate(_obj_, _length_, ~ascending~, _predicate_, _thisArg_). + 1. Return _findRecord_.[[Index]].

            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:

            - 1. Let _O_ be the *this* value. - 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). - 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. Let _findRec_ be ? FindViaPredicate(_O_, _len_, ~descending~, _predicate_, _thisArg_). - 1. Return _findRec_.[[Value]]. + 1. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). + 1. Let _findRecord_ be ? FindViaPredicate(_obj_, _length_, ~descending~, _predicate_, _thisArg_). + 1. Return _findRecord_.[[Value]].

            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:

            - 1. Let _O_ be the *this* value. - 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). - 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. Let _findRec_ be ? FindViaPredicate(_O_, _len_, ~descending~, _predicate_, _thisArg_). - 1. Return _findRec_.[[Index]]. + 1. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). + 1. Let _findRecord_ be ? FindViaPredicate(_obj_, _length_, ~descending~, _predicate_, _thisArg_). + 1. Return _findRecord_.[[Index]].

            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. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). + 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. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kValue_ be ! Get(_obj_, _propertyKey_). + 1. Perform ? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _obj_ »). 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:

            - 1. Let _O_ be the *this* value. - 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). - 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. If _len_ = 0, return *false*. + 1. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). + 1. If _length_ = 0, return *false*. 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, - 1. Let _k_ be _len_ + _n_. + 1. Let _k_ be _length_ + _n_. 1. If _k_ < 0, set _k_ to 0. - 1. Repeat, while _k_ < _len_, - 1. Let _elementK_ be ! Get(_O_, ! ToString(𝔽(_k_))). + 1. Repeat, while _k_ < _length_, + 1. Let _elementK_ be ! Get(_obj_, ! ToString(𝔽(_k_))). 1. If SameValueZero(_searchElement_, _elementK_) is *true*, return *true*. 1. Set _k_ to _k_ + 1. 1. Return *false*. @@ -40667,28 +42805,29 @@

            %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:

            - 1. Let _O_ be the *this* value. - 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). - 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. If _len_ = 0, return *-1*𝔽. + 1. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). + 1. If _length_ = 0, return *-1*𝔽. 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. Let _k_ be _length_ + _n_. 1. If _k_ < 0, set _k_ to 0. - 1. Repeat, while _k_ < _len_, - 1. Let _kPresent_ be ! HasProperty(_O_, ! ToString(𝔽(_k_))). + 1. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kPresent_ be ! HasProperty(_obj_, _propertyKey_). 1. If _kPresent_ is *true*, then - 1. Let _elementK_ be ! Get(_O_, ! ToString(𝔽(_k_))). + 1. Let _elementK_ be ! Get(_obj_, _propertyKey_). 1. If IsStrictlyEqual(_searchElement_, _elementK_) is *true*, return 𝔽(_k_). 1. Set _k_ to _k_ + 1. 1. Return *-1*𝔽. @@ -40696,59 +42835,60 @@

            %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:

            - 1. Let _O_ be the *this* value. - 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). - 1. Let _len_ be TypedArrayLength(_taRecord_). + 1. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). 1. If _separator_ is *undefined*, let _sep_ be *","*. 1. Else, let _sep_ be ? ToString(_separator_). - 1. Let _R_ be the empty String. + 1. Let _result_ be the empty String. 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. If _k_ > 0, set _R_ to the string-concatenation of _R_ and _sep_. - 1. Let _element_ be ! Get(_O_, ! ToString(𝔽(_k_))). + 1. Repeat, while _k_ < _length_, + 1. If _k_ > 0, set _result_ to the string-concatenation of _result_ and _sep_. + 1. Let _element_ be ! Get(_obj_, ! ToString(𝔽(_k_))). 1. If _element_ is not *undefined*, then - 1. Let _S_ be ! ToString(_element_). - 1. Set _R_ to the string-concatenation of _R_ and _S_. + 1. Let _elementString_ be ! ToString(_element_). + 1. Set _result_ to the string-concatenation of _result_ and _elementString_. 1. Set _k_ to _k_ + 1. - 1. Return _R_. + 1. Return _result_.

            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:

            - 1. Let _O_ be the *this* value. - 1. Perform ? ValidateTypedArray(_O_, ~seq-cst~). - 1. Return CreateArrayIterator(_O_, ~key~). + 1. Let _obj_ be the *this* value. + 1. Perform ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Return CreateArrayIterator(_obj_, ~key~).
            - +

            %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:

            - 1. Let _O_ be the *this* value. - 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). - 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. If _len_ = 0, return *-1*𝔽. - 1. If _fromIndex_ is present, let _n_ be ? ToIntegerOrInfinity(_fromIndex_); else let _n_ be _len_ - 1. + 1. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). + 1. If _length_ = 0, return *-1*𝔽. + 1. If _fromIndex_ is present, let _n_ be ? ToIntegerOrInfinity(_fromIndex_); else let _n_ be _length_ - 1. 1. If _n_ = -∞, return *-1*𝔽. 1. If _n_ ≥ 0, then - 1. Let _k_ be min(_n_, _len_ - 1). + 1. Let _k_ be min(_n_, _length_ - 1). 1. Else, - 1. Let _k_ be _len_ + _n_. + 1. Let _k_ be _length_ + _n_. 1. Repeat, while _k_ ≥ 0, - 1. Let _kPresent_ be ! HasProperty(_O_, ! ToString(𝔽(_k_))). + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kPresent_ be ! HasProperty(_obj_, _propertyKey_). 1. If _kPresent_ is *true*, then - 1. Let _elementK_ be ! Get(_O_, ! ToString(𝔽(_k_))). + 1. Let _elementK_ be ! Get(_obj_, _propertyKey_). 1. If IsStrictlyEqual(_searchElement_, _elementK_) is *true*, return 𝔽(_k_). 1. Set _k_ to _k_ - 1. 1. Return *-1*𝔽. @@ -40756,14 +42896,14 @@

            %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:

            - 1. Let _O_ be the *this* value. - 1. Perform ? RequireInternalSlot(_O_, [[TypedArrayName]]). - 1. Assert: _O_ has [[ViewedArrayBuffer]] and [[ArrayLength]] internal slots. - 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~). + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[TypedArrayName]]). + 1. Assert: _obj_ has [[ViewedArrayBuffer]] and [[ArrayLength]] internal slots. + 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_obj_, ~seq-cst~). 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, return *+0*𝔽. 1. Let _length_ be TypedArrayLength(_taRecord_). 1. Return 𝔽(_length_). @@ -40771,109 +42911,109 @@

            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. Let _A_ be ? TypedArraySpeciesCreate(_O_, « 𝔽(_len_) »). + 1. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. + 1. Let _result_ be ? TypedArraySpeciesCreate(_obj_, « 𝔽(_length_) »). 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. Perform ? Set(_A_, _Pk_, _mappedValue_, *true*). + 1. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kValue_ be ! Get(_obj_, _propertyKey_). + 1. Let _mappedValue_ be ? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _obj_ »). + 1. Perform ? Set(_result_, _propertyKey_, _mappedValue_, *true*). 1. Set _k_ to _k_ + 1. - 1. Return _A_. + 1. Return _result_.

            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 _len_ = 0 and _initialValue_ is not present, throw a *TypeError* exception. + 1. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. + 1. If _length_ = 0 and _initialValue_ is not present, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Let _accumulator_ be *undefined*. 1. If _initialValue_ is present, then 1. Set _accumulator_ to _initialValue_. 1. Else, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Set _accumulator_ to ! Get(_O_, _Pk_). + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Set _accumulator_ to ! Get(_obj_, _propertyKey_). 1. Set _k_ to _k_ + 1. - 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. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kValue_ be ! Get(_obj_, _propertyKey_). + 1. Set _accumulator_ to ? Call(_callback_, *undefined*, « _accumulator_, _kValue_, 𝔽(_k_), _obj_ »). 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 _len_ = 0 and _initialValue_ is not present, throw a *TypeError* exception. - 1. Let _k_ be _len_ - 1. + 1. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. + 1. If _length_ = 0 and _initialValue_ is not present, throw a *TypeError* exception. + 1. Let _k_ be _length_ - 1. 1. Let _accumulator_ be *undefined*. 1. If _initialValue_ is present, then 1. Set _accumulator_ to _initialValue_. 1. Else, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Set _accumulator_ to ! Get(_O_, _Pk_). + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Set _accumulator_ to ! Get(_obj_, _propertyKey_). 1. Set _k_ to _k_ - 1. 1. Repeat, while _k_ ≥ 0, - 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. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kValue_ be ! Get(_obj_, _propertyKey_). + 1. Set _accumulator_ to ? Call(_callback_, *undefined*, « _accumulator_, _kValue_, 𝔽(_k_), _obj_ »). 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.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:

            - 1. Let _O_ be the *this* value. - 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). - 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. Let _middle_ be floor(_len_ / 2). + 1. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). + 1. Let _middle_ be floor(_length_ / 2). 1. Let _lower_ be 0. 1. Repeat, while _lower_ ≠ _middle_, - 1. Let _upper_ be _len_ - _lower_ - 1. + 1. Let _upper_ be _length_ - _lower_ - 1. 1. Let _upperP_ be ! ToString(𝔽(_upper_)). 1. Let _lowerP_ be ! ToString(𝔽(_lower_)). - 1. Let _lowerValue_ be ! Get(_O_, _lowerP_). - 1. Let _upperValue_ be ! Get(_O_, _upperP_). - 1. Perform ! Set(_O_, _lowerP_, _upperValue_, *true*). - 1. Perform ! Set(_O_, _upperP_, _lowerValue_, *true*). + 1. Let _lowerValue_ be ! Get(_obj_, _lowerP_). + 1. Let _upperValue_ be ! Get(_obj_, _upperP_). + 1. Perform ! Set(_obj_, _lowerP_, _upperValue_, *true*). + 1. Perform ! Set(_obj_, _upperP_, _lowerValue_, *true*). 1. Set _lower_ to _lower_ + 1. - 1. Return _O_. + 1. Return _obj_.

            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,12 +43031,12 @@

            %TypedArray%.prototype.set ( _source_ [ , _offset_ ] )

            This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

            - +

            - SetTypedArrayFromTypedArray ( + SetTypedArrayFromArrayLike ( _target_: a TypedArray, _targetOffset_: a non-negative integer or +∞, - _source_: a TypedArray, + _source_: an ECMAScript language value, but not a TypedArray, ): either a normal completion containing ~unused~ or a throw completion

            @@ -40904,55 +43044,30 @@

            It sets multiple values in _target_, starting at index _targetOffset_, reading the values from _source_.

            - 1. Let _targetBuffer_ be _target_.[[ViewedArrayBuffer]]. 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 _srcBuffer_ be _source_.[[ViewedArrayBuffer]]. - 1. Let _srcRecord_ be MakeTypedArrayWithBufferWitnessRecord(_source_, ~seq-cst~). - 1. If IsTypedArrayOutOfBounds(_srcRecord_) is *true*, throw a *TypeError* exception. - 1. Let _srcLength_ be TypedArrayLength(_srcRecord_). - 1. Let _targetType_ be TypedArrayElementType(_target_). - 1. Let _targetElementSize_ be TypedArrayElementSize(_target_). - 1. Let _targetByteOffset_ be _target_.[[ByteOffset]]. - 1. Let _srcType_ be TypedArrayElementType(_source_). - 1. Let _srcElementSize_ be TypedArrayElementSize(_source_). - 1. Let _srcByteOffset_ be _source_.[[ByteOffset]]. + 1. Set _source_ to ? ToObject(_source_). + 1. Let _sourceLength_ be ? LengthOfArrayLike(_source_). 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 SameValue(_srcBuffer_, _targetBuffer_) is *true* or _sameSharedArrayBuffer_ is *true*, then - 1. Let _srcByteLength_ be TypedArrayByteLength(_srcRecord_). - 1. Set _srcBuffer_ to ? CloneArrayBuffer(_srcBuffer_, _srcByteOffset_, _srcByteLength_). - 1. Let _srcByteIndex_ be 0. - 1. Else, - 1. Let _srcByteIndex_ be _srcByteOffset_. - 1. Let _targetByteIndex_ be (_targetOffset_ × _targetElementSize_) + _targetByteOffset_. - 1. Let _limit_ be _targetByteIndex_ + (_targetElementSize_ × _srcLength_). - 1. If _srcType_ is _targetType_, then - 1. NOTE: The transfer must be performed in a manner that preserves the bit-level encoding of the source data. - 1. Repeat, while _targetByteIndex_ < _limit_, - 1. Let _value_ be GetValueFromBuffer(_srcBuffer_, _srcByteIndex_, ~uint8~, *true*, ~unordered~). - 1. Perform SetValueInBuffer(_targetBuffer_, _targetByteIndex_, ~uint8~, _value_, *true*, ~unordered~). - 1. Set _srcByteIndex_ to _srcByteIndex_ + 1. - 1. Set _targetByteIndex_ to _targetByteIndex_ + 1. - 1. Else, - 1. Repeat, while _targetByteIndex_ < _limit_, - 1. Let _value_ be GetValueFromBuffer(_srcBuffer_, _srcByteIndex_, _srcType_, *true*, ~unordered~). - 1. Perform SetValueInBuffer(_targetBuffer_, _targetByteIndex_, _targetType_, _value_, *true*, ~unordered~). - 1. Set _srcByteIndex_ to _srcByteIndex_ + _srcElementSize_. - 1. Set _targetByteIndex_ to _targetByteIndex_ + _targetElementSize_. + 1. If _sourceLength_ + _targetOffset_ > _targetLength_, throw a *RangeError* exception. + 1. Let _k_ be 0. + 1. Repeat, while _k_ < _sourceLength_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _value_ be ? Get(_source_, _propertyKey_). + 1. Let _targetIndex_ be 𝔽(_targetOffset_ + _k_). + 1. Perform ? TypedArraySetElement(_target_, _targetIndex_, _value_). + 1. Set _k_ to _k_ + 1. 1. Return ~unused~.
            - +

            - SetTypedArrayFromArrayLike ( + SetTypedArrayFromTypedArray ( _target_: a TypedArray, _targetOffset_: a non-negative integer or +∞, - _source_: an ECMAScript language value, but not a TypedArray, + _source_: a TypedArray, ): either a normal completion containing ~unused~ or a throw completion

            @@ -40960,92 +43075,117 @@

            It sets multiple values in _target_, starting at index _targetOffset_, reading the values from _source_.

            + 1. Let _targetBuffer_ be _target_.[[ViewedArrayBuffer]]. 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. Let _sourceBuffer_ be _source_.[[ViewedArrayBuffer]]. + 1. Let _sourceRecord_ be MakeTypedArrayWithBufferWitnessRecord(_source_, ~seq-cst~). + 1. If IsTypedArrayOutOfBounds(_sourceRecord_) is *true*, throw a *TypeError* exception. + 1. Let _sourceLength_ be TypedArrayLength(_sourceRecord_). + 1. Let _targetType_ be TypedArrayElementType(_target_). + 1. Let _targetElementSize_ be TypedArrayElementSize(_target_). + 1. Let _targetByteOffset_ be _target_.[[ByteOffset]]. + 1. Let _sourceType_ be TypedArrayElementType(_source_). + 1. Let _sourceElementSize_ be TypedArrayElementSize(_source_). + 1. Let _sourceByteOffset_ be _source_.[[ByteOffset]]. 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. If _sourceLength_ + _targetOffset_ > _targetLength_, throw a *RangeError* exception. + 1. If _target_.[[ContentType]] is not _source_.[[ContentType]], throw a *TypeError* exception. + 1. If IsSharedArrayBuffer(_sourceBuffer_) is *true*, IsSharedArrayBuffer(_targetBuffer_) is *true*, and _sourceBuffer_.[[ArrayBufferData]] is _targetBuffer_.[[ArrayBufferData]], let _sameSharedArrayBuffer_ be *true*; else let _sameSharedArrayBuffer_ be *false*. + 1. If SameValue(_sourceBuffer_, _targetBuffer_) is *true* or _sameSharedArrayBuffer_ is *true*, then + 1. Let _sourceByteLength_ be TypedArrayByteLength(_sourceRecord_). + 1. Set _sourceBuffer_ to ? CloneArrayBuffer(_sourceBuffer_, _sourceByteOffset_, _sourceByteLength_). + 1. Let _sourceByteIndex_ be 0. + 1. Else, + 1. Let _sourceByteIndex_ be _sourceByteOffset_. + 1. Let _targetByteIndex_ be (_targetOffset_ × _targetElementSize_) + _targetByteOffset_. + 1. Let _limit_ be _targetByteIndex_ + (_targetElementSize_ × _sourceLength_). + 1. If _sourceType_ is _targetType_, then + 1. NOTE: The transfer must be performed in a manner that preserves the bit-level encoding of the source data. + 1. Repeat, while _targetByteIndex_ < _limit_, + 1. Let _value_ be GetValueFromBuffer(_sourceBuffer_, _sourceByteIndex_, ~uint8~, *true*, ~unordered~). + 1. Perform SetValueInBuffer(_targetBuffer_, _targetByteIndex_, ~uint8~, _value_, *true*, ~unordered~). + 1. Set _sourceByteIndex_ to _sourceByteIndex_ + 1. + 1. Set _targetByteIndex_ to _targetByteIndex_ + 1. + 1. Else, + 1. Repeat, while _targetByteIndex_ < _limit_, + 1. Let _value_ be GetValueFromBuffer(_sourceBuffer_, _sourceByteIndex_, _sourceType_, *true*, ~unordered~). + 1. Perform SetValueInBuffer(_targetBuffer_, _targetByteIndex_, _targetType_, _value_, *true*, ~unordered~). + 1. Set _sourceByteIndex_ to _sourceByteIndex_ + _sourceElementSize_. + 1. Set _targetByteIndex_ to _targetByteIndex_ + _targetElementSize_. 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:

            - 1. Let _O_ be the *this* value. - 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). - 1. Let _srcArrayLength_ be TypedArrayLength(_taRecord_). + 1. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _sourceArrayLength_ be TypedArrayLength(_taRecord_). 1. Let _relativeStart_ be ? ToIntegerOrInfinity(_start_). 1. If _relativeStart_ = -∞, let _startIndex_ be 0. - 1. Else if _relativeStart_ < 0, let _startIndex_ be max(_srcArrayLength_ + _relativeStart_, 0). - 1. Else, let _startIndex_ be min(_relativeStart_, _srcArrayLength_). - 1. If _end_ is *undefined*, let _relativeEnd_ be _srcArrayLength_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). + 1. Else if _relativeStart_ < 0, let _startIndex_ be max(_sourceArrayLength_ + _relativeStart_, 0). + 1. Else, let _startIndex_ be min(_relativeStart_, _sourceArrayLength_). + 1. If _end_ is *undefined*, let _relativeEnd_ be _sourceArrayLength_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). 1. If _relativeEnd_ = -∞, let _endIndex_ be 0. - 1. Else if _relativeEnd_ < 0, let _endIndex_ be max(_srcArrayLength_ + _relativeEnd_, 0). - 1. Else, let _endIndex_ be min(_relativeEnd_, _srcArrayLength_). + 1. Else if _relativeEnd_ < 0, let _endIndex_ be max(_sourceArrayLength_ + _relativeEnd_, 0). + 1. Else, let _endIndex_ be min(_relativeEnd_, _sourceArrayLength_). 1. Let _countBytes_ be max(_endIndex_ - _startIndex_, 0). - 1. Let _A_ be ? TypedArraySpeciesCreate(_O_, « 𝔽(_countBytes_) »). + 1. Let _resultArray_ be ? TypedArraySpeciesCreate(_obj_, « 𝔽(_countBytes_) »). 1. If _countBytes_ > 0, then - 1. Set _taRecord_ to MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~). + 1. Set _taRecord_ to MakeTypedArrayWithBufferWitnessRecord(_obj_, ~seq-cst~). 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception. 1. Set _endIndex_ to min(_endIndex_, TypedArrayLength(_taRecord_)). 1. Set _countBytes_ to max(_endIndex_ - _startIndex_, 0). - 1. Let _srcType_ be TypedArrayElementType(_O_). - 1. Let _targetType_ be TypedArrayElementType(_A_). - 1. If _srcType_ is _targetType_, then + 1. Let _sourceType_ be TypedArrayElementType(_obj_). + 1. Let _targetType_ be TypedArrayElementType(_resultArray_). + 1. If _sourceType_ is _targetType_, then 1. NOTE: The transfer must be performed in a manner that preserves the bit-level encoding of the source data. - 1. Let _srcBuffer_ be _O_.[[ViewedArrayBuffer]]. - 1. Let _targetBuffer_ be _A_.[[ViewedArrayBuffer]]. - 1. Let _elementSize_ be TypedArrayElementSize(_O_). - 1. Let _srcByteOffset_ be _O_.[[ByteOffset]]. - 1. Let _srcByteIndex_ be (_startIndex_ × _elementSize_) + _srcByteOffset_. - 1. Let _targetByteIndex_ be _A_.[[ByteOffset]]. + 1. Let _sourceBuffer_ be _obj_.[[ViewedArrayBuffer]]. + 1. Let _targetBuffer_ be _resultArray_.[[ViewedArrayBuffer]]. + 1. Let _elementSize_ be TypedArrayElementSize(_obj_). + 1. Let _sourceByteOffset_ be _obj_.[[ByteOffset]]. + 1. Let _sourceByteIndex_ be (_startIndex_ × _elementSize_) + _sourceByteOffset_. + 1. Let _targetByteIndex_ be _resultArray_.[[ByteOffset]]. 1. Let _endByteIndex_ be _targetByteIndex_ + (_countBytes_ × _elementSize_). 1. Repeat, while _targetByteIndex_ < _endByteIndex_, - 1. Let _value_ be GetValueFromBuffer(_srcBuffer_, _srcByteIndex_, ~uint8~, *true*, ~unordered~). + 1. Let _value_ be GetValueFromBuffer(_sourceBuffer_, _sourceByteIndex_, ~uint8~, *true*, ~unordered~). 1. Perform SetValueInBuffer(_targetBuffer_, _targetByteIndex_, ~uint8~, _value_, *true*, ~unordered~). - 1. Set _srcByteIndex_ to _srcByteIndex_ + 1. + 1. Set _sourceByteIndex_ to _sourceByteIndex_ + 1. 1. Set _targetByteIndex_ to _targetByteIndex_ + 1. 1. Else, 1. Let _n_ be 0. 1. Let _k_ be _startIndex_. 1. Repeat, while _k_ < _endIndex_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Let _kValue_ be ! Get(_O_, _Pk_). - 1. Perform ! Set(_A_, ! ToString(𝔽(_n_)), _kValue_, *true*). + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kValue_ be ! Get(_obj_, _propertyKey_). + 1. Perform ! Set(_resultArray_, ! ToString(𝔽(_n_)), _kValue_, *true*). 1. Set _k_ to _k_ + 1. 1. Set _n_ to _n_ + 1. - 1. Return _A_. + 1. Return _resultArray_.

            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. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). + 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. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kValue_ be ! Get(_obj_, _propertyKey_). + 1. Let _testResult_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _obj_ »)). 1. If _testResult_ is *true*, return *true*. 1. Set _k_ to _k_ + 1. 1. Return *false*. @@ -41053,67 +43193,67 @@

            %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. Let _length_ 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 _sortedList_ be ? SortIndexedProperties(_obj_, _len_, _SortCompare_, ~read-through-holes~). + 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_, _length_, _sortCompare_, ~read-through-holes~). 1. Let _j_ be 0. - 1. Repeat, while _j_ < _len_, + 1. Repeat, while _j_ < _length_, 1. Perform ! Set(_obj_, ! ToString(𝔽(_j_)), _sortedList_[_j_], *true*). 1. Set _j_ to _j_ + 1. 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:

            - 1. Let _O_ be the *this* value. - 1. Perform ? RequireInternalSlot(_O_, [[TypedArrayName]]). - 1. Assert: _O_ has a [[ViewedArrayBuffer]] internal slot. - 1. Let _buffer_ be _O_.[[ViewedArrayBuffer]]. - 1. Let _srcRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~). - 1. If IsTypedArrayOutOfBounds(_srcRecord_) is *true*, then - 1. Let _srcLength_ be 0. + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[TypedArrayName]]). + 1. Assert: _obj_ has a [[ViewedArrayBuffer]] internal slot. + 1. Let _buffer_ be _obj_.[[ViewedArrayBuffer]]. + 1. Let _sourceRecord_ be MakeTypedArrayWithBufferWitnessRecord(_obj_, ~seq-cst~). + 1. If IsTypedArrayOutOfBounds(_sourceRecord_) is *true*, then + 1. Let _sourceLength_ be 0. 1. Else, - 1. Let _srcLength_ be TypedArrayLength(_srcRecord_). + 1. Let _sourceLength_ be TypedArrayLength(_sourceRecord_). 1. Let _relativeStart_ be ? ToIntegerOrInfinity(_start_). 1. If _relativeStart_ = -∞, let _startIndex_ be 0. - 1. Else if _relativeStart_ < 0, let _startIndex_ be max(_srcLength_ + _relativeStart_, 0). - 1. Else, let _startIndex_ be min(_relativeStart_, _srcLength_). - 1. Let _elementSize_ be TypedArrayElementSize(_O_). - 1. Let _srcByteOffset_ be _O_.[[ByteOffset]]. - 1. Let _beginByteOffset_ be _srcByteOffset_ + (_startIndex_ × _elementSize_). - 1. If _O_.[[ArrayLength]] is ~auto~ and _end_ is *undefined*, then - 1. Let _argumentsList_ be « _buffer_, 𝔽(_beginByteOffset_) ». + 1. Else if _relativeStart_ < 0, let _startIndex_ be max(_sourceLength_ + _relativeStart_, 0). + 1. Else, let _startIndex_ be min(_relativeStart_, _sourceLength_). + 1. Let _elementSize_ be TypedArrayElementSize(_obj_). + 1. Let _sourceByteOffset_ be _obj_.[[ByteOffset]]. + 1. Let _beginByteOffset_ be _sourceByteOffset_ + (_startIndex_ × _elementSize_). + 1. If _obj_.[[ArrayLength]] is ~auto~ and _end_ is *undefined*, then + 1. Let _argList_ be « _buffer_, 𝔽(_beginByteOffset_) ». 1. Else, - 1. If _end_ is *undefined*, let _relativeEnd_ be _srcLength_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). + 1. If _end_ is *undefined*, let _relativeEnd_ be _sourceLength_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). 1. If _relativeEnd_ = -∞, let _endIndex_ be 0. - 1. Else if _relativeEnd_ < 0, let _endIndex_ be max(_srcLength_ + _relativeEnd_, 0). - 1. Else, let _endIndex_ be min(_relativeEnd_, _srcLength_). + 1. Else if _relativeEnd_ < 0, let _endIndex_ be max(_sourceLength_ + _relativeEnd_, 0). + 1. Else, let _endIndex_ be min(_relativeEnd_, _sourceLength_). 1. Let _newLength_ be max(_endIndex_ - _startIndex_, 0). - 1. Let _argumentsList_ be « _buffer_, 𝔽(_beginByteOffset_), 𝔽(_newLength_) ». - 1. Return ? TypedArraySpeciesCreate(_O_, _argumentsList_). + 1. Let _argList_ be « _buffer_, 𝔽(_beginByteOffset_), 𝔽(_newLength_) ». + 1. Return ? TypedArraySpeciesCreate(_obj_, _argList_).

            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,99 +43262,99 @@

            %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 _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). 1. Let _length_ be TypedArrayLength(_taRecord_). - 1. Let _A_ be ? TypedArrayCreateSameType(_O_, « 𝔽(_length_) »). + 1. Let _resultArray_ be ? TypedArrayCreateSameType(_obj_, _length_). 1. Let _k_ be 0. 1. Repeat, while _k_ < _length_, 1. Let _from_ be ! ToString(𝔽(_length_ - _k_ - 1)). - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Let _fromValue_ be ! Get(_O_, _from_). - 1. Perform ! Set(_A_, _Pk_, _fromValue_, *true*). + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _fromValue_ be ! Get(_obj_, _from_). + 1. Perform ! Set(_resultArray_, _propertyKey_, _fromValue_, *true*). 1. Set _k_ to _k_ + 1. - 1. Return _A_. + 1. Return _resultArray_.
            - -

            %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. 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. 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 _length_ be TypedArrayLength(_taRecord_). + 1. Let _resultArray_ be ? TypedArrayCreateSameType(_obj_, _length_). 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 _sortedList_ be ? SortIndexedProperties(_O_, _len_, _SortCompare_, ~read-through-holes~). + 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_, _length_, _sortCompare_, ~read-through-holes~). 1. Let _j_ be 0. - 1. Repeat, while _j_ < _len_, - 1. Perform ! Set(_A_, ! ToString(𝔽(_j_)), _sortedList_[_j_], *true*). + 1. Repeat, while _j_ < _length_, + 1. Perform ! Set(_resultArray_, ! ToString(𝔽(_j_)), _sortedList_[_j_], *true*). 1. Set _j_ to _j_ + 1. - 1. Return _A_. + 1. Return _resultArray_.
            - +

            %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:

            - 1. Let _O_ be the *this* value. - 1. Perform ? ValidateTypedArray(_O_, ~seq-cst~). - 1. Return CreateArrayIterator(_O_, ~value~). + 1. Let _obj_ be the *this* value. + 1. Perform ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Return CreateArrayIterator(_obj_, ~value~).
            - +

            %TypedArray%.prototype.with ( _index_, _value_ )

            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. Let _obj_ be the *this* value. + 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). + 1. Let _length_ be TypedArrayLength(_taRecord_). 1. Let _relativeIndex_ be ? ToIntegerOrInfinity(_index_). 1. If _relativeIndex_ ≥ 0, let _actualIndex_ be _relativeIndex_. - 1. Else, let _actualIndex_ be _len_ + _relativeIndex_. - 1. If _O_.[[ContentType]] is ~bigint~, let _numericValue_ be ? ToBigInt(_value_). + 1. Else, let _actualIndex_ be _length_ + _relativeIndex_. + 1. If _obj_.[[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. If IsValidIntegerIndex(_obj_, 𝔽(_actualIndex_)) is *false*, throw a *RangeError* exception. + 1. Let _resultArray_ be ? TypedArrayCreateSameType(_obj_, _length_). 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). + 1. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). 1. If _k_ = _actualIndex_, let _fromValue_ be _numericValue_. - 1. Else, let _fromValue_ be ! Get(_O_, _Pk_). - 1. Perform ! Set(_A_, _Pk_, _fromValue_, *true*). + 1. Else, let _fromValue_ be ! Get(_obj_, _propertyKey_). + 1. Perform ! Set(_resultArray_, _propertyKey_, _fromValue_, *true*). 1. Set _k_ to _k_ + 1. - 1. Return _A_. + 1. Return _resultArray_.
            - -

            %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*. - 1. If _O_ does not have a [[TypedArrayName]] internal slot, return *undefined*. - 1. Let _name_ be _O_.[[TypedArrayName]]. + 1. Let _obj_ be the *this* value. + 1. If _obj_ is not an Object, return *undefined*. + 1. If _obj_ does not have a [[TypedArrayName]] internal slot, return *undefined*. + 1. Let _name_ be _obj_.[[TypedArrayName]]. 1. Assert: _name_ is a String. 1. Return _name_. @@ -41226,65 +43366,65 @@

            get %TypedArray%.prototype [ @@toStringTag ]

            Abstract Operations for TypedArray Objects

            - +

            - TypedArraySpeciesCreate ( - _exemplar_: a TypedArray, - _argumentList_: a List of ECMAScript language values, + TypedArrayCreateFromConstructor ( + _ctor_: a constructor, + _argList_: 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.
            +
            It is used to specify the creation of a new TypedArray using a constructor function.
            - 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_. + 1. Let _ta_ be ? Construct(_ctor_, _argList_). + 1. Let _taRecord_ be ? ValidateTypedArray(_ta_, ~seq-cst~). + 1. Assert: _ta_ has all the internal slots mentioned in . + 1. If the number of elements in _argList_ is 1 and _argList_[0] is a Number, then + 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception. + 1. Let _length_ be TypedArrayLength(_taRecord_). + 1. If _length_ < ℝ(_argList_[0]), throw a *TypeError* exception. + 1. Return _ta_.
            - +

            - TypedArrayCreateFromConstructor ( - _constructor_: a constructor, - _argumentList_: a List of ECMAScript language values, + TypedArrayCreateSameType ( + _exemplar_: a TypedArray, + _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.
            +
            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 _newTypedArray_ be ? Construct(_constructor_, _argumentList_). - 1. Let _taRecord_ be ? ValidateTypedArray(_newTypedArray_, ~seq-cst~). - 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_). - 1. If _length_ < ℝ(_argumentList_[0]), throw a *TypeError* exception. - 1. Return _newTypedArray_. + 1. Let _ctor_ be the intrinsic object associated with the constructor name _exemplar_.[[TypedArrayName]] in . + 1. Let _result_ be ? TypedArrayCreateFromConstructor(_ctor_, « 𝔽(_length_) »). + 1. Assert: _result_ has [[TypedArrayName]] and [[ContentType]] internal slots. + 1. Assert: _result_.[[ContentType]] is _exemplar_.[[ContentType]]. + 1. Return _result_.
            - +

            - TypedArrayCreateSameType ( + TypedArraySpeciesCreate ( _exemplar_: a TypedArray, - _argumentList_: a List of ECMAScript language values, + _argList_: 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 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 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 _constructor_ be the intrinsic object associated with the constructor name _exemplar_.[[TypedArrayName]] in . - 1. Let _result_ be ? TypedArrayCreateFromConstructor(_constructor_, _argumentList_). - 1. Assert: _result_ has [[TypedArrayName]] and [[ContentType]] internal slots. - 1. Assert: _result_.[[ContentType]] is _exemplar_.[[ContentType]]. + 1. Let _defaultCtor_ be the intrinsic object associated with the constructor name _exemplar_.[[TypedArrayName]] in . + 1. Let _ctor_ be ? SpeciesConstructor(_exemplar_, _defaultCtor_). + 1. Let _result_ be ? TypedArrayCreateFromConstructor(_ctor_, _argList_). + 1. If _result_.[[ContentType]] is not _exemplar_.[[ContentType]], throw a *TypeError* exception. 1. Return _result_.
            @@ -41292,16 +43432,16 @@

            ValidateTypedArray ( - _O_: an ECMAScript language value, + _obj_: an ECMAScript language value, _order_: ~seq-cst~ or ~unordered~, ): either a normal completion containing a TypedArray With Buffer Witness Record or a throw completion

            - 1. Perform ? RequireInternalSlot(_O_, [[TypedArrayName]]). - 1. Assert: _O_ has a [[ViewedArrayBuffer]] internal slot. - 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, _order_). + 1. Perform ? RequireInternalSlot(_obj_, [[TypedArrayName]]). + 1. Assert: _obj_ has a [[ViewedArrayBuffer]] internal slot. + 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_obj_, _order_). 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception. 1. Return _taRecord_. @@ -41310,26 +43450,26 @@

            TypedArrayElementSize ( - _O_: a TypedArray, + _obj_: a TypedArray, ): a non-negative integer

            - 1. Return the Element Size value specified in for _O_.[[TypedArrayName]]. + 1. Return the Element Size value specified in for _obj_.[[TypedArrayName]].

            TypedArrayElementType ( - _O_: a TypedArray, + _obj_: a TypedArray, ): a TypedArray element type

            - 1. Return the Element Type value specified in for _O_.[[TypedArrayName]]. + 1. Return the Element Type value specified in for _obj_.[[TypedArrayName]].
            @@ -41338,18 +43478,18 @@

            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 _v_ is *NaN*, return *+0*𝔽. - 1. Return _v_. - 1. If _x_ and _y_ are both *NaN*, return *+0*𝔽. + 1. If _comparator_ is not *undefined*, then + 1. Let _result_ be ? ToNumber(? Call(_comparator_, *undefined*, « _x_, _y_ »)). + 1. If _result_ is *NaN*, return *+0*𝔽. + 1. Return _result_. + 1. If _x_ is *NaN* and _y_ is *NaN*, return *+0*𝔽. 1. If _x_ is *NaN*, return *1*𝔽. 1. If _y_ is *NaN*, return *-1*𝔽. 1. If _x_ < _y_, return *-1*𝔽. @@ -41368,52 +43508,49 @@

            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.
            • +
            • 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 built-in methods of %TypedArray%`.prototype`.
            - +

            _TypedArray_ ( ..._args_ )

            Each _TypedArray_ constructor performs the following steps when called:

            1. If NewTarget is *undefined*, throw a *TypeError* exception. - 1. Let _constructorName_ be the String value of the Constructor Name value specified in for this TypedArray constructor. + 1. Let _ctorName_ 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(_ctorName_, NewTarget, _proto_, 0). + 1. Let _firstArg_ be _args_[0]. + 1. If _firstArg_ is an Object, then + 1. Let _obj_ be ? AllocateTypedArray(_ctorName_, NewTarget, _proto_). + 1. If _firstArg_ has a [[TypedArrayName]] internal slot, then + 1. Perform ? InitializeTypedArrayFromTypedArray(_obj_, _firstArg_). + 1. Else if _firstArg_ 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(_obj_, _firstArg_, _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: _firstArg_ is an Object and _firstArg_ does not have either a [[TypedArrayName]] or an [[ArrayBufferData]] internal slot. + 1. Let _usingIterator_ be ? GetMethod(_firstArg_, %Symbol.iterator%). + 1. If _usingIterator_ is not *undefined*, then + 1. Let _values_ be ? IteratorToList(? GetIteratorFromMethod(_firstArg_, _usingIterator_)). + 1. Perform ? InitializeTypedArrayFromList(_obj_, _values_). + 1. Else, + 1. NOTE: _firstArg_ is not an iterable object, so assume it is already an array-like object. + 1. Perform ? InitializeTypedArrayFromArrayLike(_obj_, _firstArg_). + 1. Return _obj_. + 1. Assert: _firstArg_ is not an Object. + 1. Let _elementLength_ be ? ToIndex(_firstArg_). + 1. Return ? AllocateTypedArray(_ctorName_, NewTarget, _proto_, _elementLength_).

            AllocateTypedArray ( - _constructorName_: a String which is the name of a TypedArray constructor in , + _ctorName_: a String which is the name of a TypedArray constructor in , _newTarget_: a constructor, _defaultProto_: a String, optional _length_: a non-negative integer, @@ -41427,9 +43564,9 @@

            1. Let _proto_ be ? GetPrototypeFromConstructor(_newTarget_, _defaultProto_). 1. Let _obj_ be TypedArrayCreate(_proto_). 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. Set _obj_.[[TypedArrayName]] to _ctorName_. + 1. If _ctorName_ is either *"BigInt64Array"* or *"BigUint64Array"*, set _obj_.[[ContentType]] to ~bigint~. + 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. @@ -41443,41 +43580,41 @@

            InitializeTypedArrayFromTypedArray ( - _O_: a TypedArray, - _srcArray_: a TypedArray, + _obj_: a TypedArray, + _sourceArray_: a TypedArray, ): either a normal completion containing ~unused~ or a throw completion

            - 1. Let _srcData_ be _srcArray_.[[ViewedArrayBuffer]]. - 1. Let _elementType_ be TypedArrayElementType(_O_). - 1. Let _elementSize_ be TypedArrayElementSize(_O_). - 1. Let _srcType_ be TypedArrayElementType(_srcArray_). - 1. Let _srcElementSize_ be TypedArrayElementSize(_srcArray_). - 1. Let _srcByteOffset_ be _srcArray_.[[ByteOffset]]. - 1. Let _srcRecord_ be MakeTypedArrayWithBufferWitnessRecord(_srcArray_, ~seq-cst~). - 1. If IsTypedArrayOutOfBounds(_srcRecord_) is *true*, throw a *TypeError* exception. - 1. Let _elementLength_ be TypedArrayLength(_srcRecord_). + 1. Let _sourceData_ be _sourceArray_.[[ViewedArrayBuffer]]. + 1. Let _elementType_ be TypedArrayElementType(_obj_). + 1. Let _elementSize_ be TypedArrayElementSize(_obj_). + 1. Let _sourceType_ be TypedArrayElementType(_sourceArray_). + 1. Let _sourceElementSize_ be TypedArrayElementSize(_sourceArray_). + 1. Let _sourceByteOffset_ be _sourceArray_.[[ByteOffset]]. + 1. Let _sourceRecord_ be MakeTypedArrayWithBufferWitnessRecord(_sourceArray_, ~seq-cst~). + 1. If IsTypedArrayOutOfBounds(_sourceRecord_) is *true*, throw a *TypeError* exception. + 1. Let _elementLength_ be TypedArrayLength(_sourceRecord_). 1. Let _byteLength_ be _elementSize_ × _elementLength_. - 1. If _elementType_ is _srcType_, then - 1. Let _data_ be ? CloneArrayBuffer(_srcData_, _srcByteOffset_, _byteLength_). + 1. If _elementType_ is _sourceType_, then + 1. Let _data_ be ? CloneArrayBuffer(_sourceData_, _sourceByteOffset_, _byteLength_). 1. Else, 1. Let _data_ be ? AllocateArrayBuffer(%ArrayBuffer%, _byteLength_). - 1. If _srcArray_.[[ContentType]] is not _O_.[[ContentType]], throw a *TypeError* exception. - 1. Let _srcByteIndex_ be _srcByteOffset_. + 1. If _sourceArray_.[[ContentType]] is not _obj_.[[ContentType]], throw a *TypeError* exception. + 1. Let _sourceByteIndex_ be _sourceByteOffset_. 1. Let _targetByteIndex_ be 0. 1. Let _count_ be _elementLength_. 1. Repeat, while _count_ > 0, - 1. Let _value_ be GetValueFromBuffer(_srcData_, _srcByteIndex_, _srcType_, *true*, ~unordered~). + 1. Let _value_ be GetValueFromBuffer(_sourceData_, _sourceByteIndex_, _sourceType_, *true*, ~unordered~). 1. Perform SetValueInBuffer(_data_, _targetByteIndex_, _elementType_, _value_, *true*, ~unordered~). - 1. Set _srcByteIndex_ to _srcByteIndex_ + _srcElementSize_. + 1. Set _sourceByteIndex_ to _sourceByteIndex_ + _sourceElementSize_. 1. Set _targetByteIndex_ to _targetByteIndex_ + _elementSize_. 1. Set _count_ to _count_ - 1. - 1. Set _O_.[[ViewedArrayBuffer]] to _data_. - 1. Set _O_.[[ByteLength]] to _byteLength_. - 1. Set _O_.[[ByteOffset]] to 0. - 1. Set _O_.[[ArrayLength]] to _elementLength_. + 1. Set _obj_.[[ViewedArrayBuffer]] to _data_. + 1. Set _obj_.[[ByteLength]] to _byteLength_. + 1. Set _obj_.[[ByteOffset]] to 0. + 1. Set _obj_.[[ArrayLength]] to _elementLength_. 1. Return ~unused~.
            @@ -41485,7 +43622,7 @@

            InitializeTypedArrayFromArrayBuffer ( - _O_: a TypedArray, + _obj_: a TypedArray, _buffer_: an ArrayBuffer or a SharedArrayBuffer, _byteOffset_: an ECMAScript language value, _length_: an ECMAScript language value, @@ -41494,7 +43631,7 @@

            - 1. Let _elementSize_ be TypedArrayElementSize(_O_). + 1. Let _elementSize_ be TypedArrayElementSize(_obj_). 1. Let _offset_ be ? ToIndex(_byteOffset_). 1. If _offset_ modulo _elementSize_ ≠ 0, throw a *RangeError* exception. 1. Let _bufferIsFixedLength_ be IsFixedLengthArrayBuffer(_buffer_). @@ -41504,8 +43641,8 @@

            1. Let _bufferByteLength_ be ArrayBufferByteLength(_buffer_, ~seq-cst~). 1. If _length_ is *undefined* and _bufferIsFixedLength_ is *false*, then 1. If _offset_ > _bufferByteLength_, throw a *RangeError* exception. - 1. Set _O_.[[ByteLength]] to ~auto~. - 1. Set _O_.[[ArrayLength]] to ~auto~. + 1. Set _obj_.[[ByteLength]] to ~auto~. + 1. Set _obj_.[[ArrayLength]] to ~auto~. 1. Else, 1. If _length_ is *undefined*, then 1. If _bufferByteLength_ modulo _elementSize_ ≠ 0, throw a *RangeError* exception. @@ -41514,10 +43651,10 @@

            1. Else, 1. Let _newByteLength_ be _newLength_ × _elementSize_. 1. If _offset_ + _newByteLength_ > _bufferByteLength_, throw a *RangeError* exception. - 1. Set _O_.[[ByteLength]] to _newByteLength_. - 1. Set _O_.[[ArrayLength]] to _newByteLength_ / _elementSize_. - 1. Set _O_.[[ViewedArrayBuffer]] to _buffer_. - 1. Set _O_.[[ByteOffset]] to _offset_. + 1. Set _obj_.[[ByteLength]] to _newByteLength_. + 1. Set _obj_.[[ArrayLength]] to _newByteLength_ / _elementSize_. + 1. Set _obj_.[[ViewedArrayBuffer]] to _buffer_. + 1. Set _obj_.[[ByteOffset]] to _offset_. 1. Return ~unused~. @@ -41525,21 +43662,21 @@

            InitializeTypedArrayFromList ( - _O_: a TypedArray, + _obj_: a TypedArray, _values_: a List of ECMAScript language values, ): either a normal completion containing ~unused~ or a throw completion

            - 1. Let _len_ be the number of elements in _values_. - 1. Perform ? AllocateTypedArrayBuffer(_O_, _len_). + 1. Let _length_ be the number of elements in _values_. + 1. Perform ? AllocateTypedArrayBuffer(_obj_, _length_). 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). + 1. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be the first element of _values_. 1. Remove the first element from _values_. - 1. Perform ? Set(_O_, _Pk_, _kValue_, *true*). + 1. Perform ? Set(_obj_, _propertyKey_, _kValue_, *true*). 1. Set _k_ to _k_ + 1. 1. Assert: _values_ is now an empty List. 1. Return ~unused~. @@ -41549,20 +43686,20 @@

            InitializeTypedArrayFromArrayLike ( - _O_: a TypedArray, + _obj_: a TypedArray, _arrayLike_: an Object, but not a TypedArray or an ArrayBuffer, ): either a normal completion containing ~unused~ or a throw completion

            - 1. Let _len_ be ? LengthOfArrayLike(_arrayLike_). - 1. Perform ? AllocateTypedArrayBuffer(_O_, _len_). + 1. Let _length_ be ? LengthOfArrayLike(_arrayLike_). + 1. Perform ? AllocateTypedArrayBuffer(_obj_, _length_). 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. Let _Pk_ be ! ToString(𝔽(_k_)). - 1. Let _kValue_ be ? Get(_arrayLike_, _Pk_). - 1. Perform ? Set(_O_, _Pk_, _kValue_, *true*). + 1. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _kValue_ be ? Get(_arrayLike_, _propertyKey_). + 1. Perform ? Set(_obj_, _propertyKey_, _kValue_, *true*). 1. Set _k_ to _k_ + 1. 1. Return ~unused~. @@ -41571,23 +43708,23 @@

            AllocateTypedArrayBuffer ( - _O_: a TypedArray, + _obj_: a TypedArray, _length_: a non-negative integer, ): either a normal completion containing ~unused~ or a throw completion

            description
            -
            It allocates and associates an ArrayBuffer with _O_.
            +
            It allocates and associates an ArrayBuffer with _obj_.
            - 1. Assert: _O_.[[ViewedArrayBuffer]] is *undefined*. - 1. Let _elementSize_ be TypedArrayElementSize(_O_). + 1. Assert: _obj_.[[ViewedArrayBuffer]] is *undefined*. + 1. Let _elementSize_ be TypedArrayElementSize(_obj_). 1. Let _byteLength_ be _elementSize_ × _length_. 1. Let _data_ be ? AllocateArrayBuffer(%ArrayBuffer%, _byteLength_). - 1. Set _O_.[[ViewedArrayBuffer]] to _data_. - 1. Set _O_.[[ByteLength]] to _byteLength_. - 1. Set _O_.[[ByteOffset]] to 0. - 1. Set _O_.[[ArrayLength]] to _length_. + 1. Set _obj_.[[ViewedArrayBuffer]] to _data_. + 1. Set _obj_.[[ByteLength]] to _byteLength_. + 1. Set _obj_.[[ByteOffset]] to 0. + 1. Set _obj_.[[ArrayLength]] to _length_. 1. Return ~unused~.
            @@ -41640,7 +43777,391 @@

            _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. Throw _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. Throw _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. Throw _result_.[[Error]]. + 1. Let _resultObj_ be OrdinaryObjectCreate(%Object.prototype%). + 1. Perform ! CreateDataPropertyOrThrow(_resultObj_, *"read"*, 𝔽(_result_.[[Read]])). + 1. Perform ! CreateDataPropertyOrThrow(_resultObj_, *"written"*, 𝔽(_written_)). + 1. Return _resultObj_. + +
            + + +

            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. Throw _result_.[[Error]]. + 1. Let _resultObj_ be OrdinaryObjectCreate(%Object.prototype%). + 1. Perform ! CreateDataPropertyOrThrow(_resultObj_, *"read"*, 𝔽(_result_.[[Read]])). + 1. Perform ! CreateDataPropertyOrThrow(_resultObj_, *"written"*, 𝔽(_written_)). + 1. Return _resultObj_. + +
            + + +

            Uint8Array.prototype.toBase64 ( [ _options_ ] )

            + + 1. Let _obj_ be the *this* value. + 1. Perform ? ValidateUint8Array(_obj_). + 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(_obj_). + 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 _obj_ be the *this* value. + 1. Perform ? ValidateUint8Array(_obj_). + 1. Let _toEncode_ be ? GetUint8ArrayBytes(_obj_). + 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 _length_ 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_ < _length_, + 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 _length_ be the number of elements in _bytes_. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _length_, + 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. Assert: The number of elements in _bytes_ is evenly divisible by 3. + 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 +44171,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.

            @@ -41661,10 +44182,10 @@

            The Map Constructor

          • is the initial value of the *"Map"* property of the global object.
          • creates and initializes a new Map when called as a constructor.
          • 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 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.
          • +
          • 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 built-in methods of `Map.prototype`.
          • - +

            Map ( [ _iterable_ ] )

            This function performs the following steps when called:

            @@ -41677,7 +44198,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.

            @@ -41687,7 +44208,7 @@

            _target_: an Object, _iterable_: an ECMAScript language value, but not *undefined* or *null*, _adder_: a function object, - ): either a normal completion containing an ECMAScript language value or a throw completion + ): either a normal completion containing an Object or a throw completion

            description
            @@ -41701,15 +44222,15 @@

            1. If _next_ is not an Object, then 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). 1. Return ? IteratorClose(_iteratorRecord_, _error_). - 1. Let _k_ be Completion(Get(_next_, *"0"*)). - 1. IfAbruptCloseIterator(_k_, _iteratorRecord_). - 1. Let _v_ be Completion(Get(_next_, *"1"*)). - 1. IfAbruptCloseIterator(_v_, _iteratorRecord_). - 1. Let _status_ be Completion(Call(_adder_, _target_, « _k_, _v_ »)). + 1. Let _key_ be Completion(Get(_next_, *"0"*)). + 1. IfAbruptCloseIterator(_key_, _iteratorRecord_). + 1. Let _value_ be Completion(Get(_next_, *"1"*)). + 1. IfAbruptCloseIterator(_value_, _iteratorRecord_). + 1. Let _status_ be Completion(Call(_adder_, _target_, « _key_, _value_ »)). 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,20 +44243,20 @@

            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]]). - 1. Let _entry_ be the Record { [[Key]]: _g_.[[Key]], [[Value]]: _elements_ }. + 1. For each Record { [[Key]], [[Elements]] } _group_ of _groups_, do + 1. Let _elements_ be CreateArrayFromList(_group_.[[Elements]]). + 1. Let _entry_ be the Record { [[Key]]: _group_.[[Key]], [[Value]]: _elements_ }. 1. Append _entry_ to _map_.[[MapData]]. 1. Return _map_. @@ -41747,15 +44268,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,15 +44291,15 @@

            Properties of the Map Prototype Object

          • does not have a [[MapData]] internal slot.
          • - +

            Map.prototype.clear ( )

            This method performs the following steps when called:

            - 1. Let _M_ be the *this* value. - 1. Perform ? RequireInternalSlot(_M_, [[MapData]]). - 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do - 1. Set _p_.[[Key]] to ~empty~. - 1. Set _p_.[[Value]] to ~empty~. + 1. Let _map_ be the *this* value. + 1. Perform ? RequireInternalSlot(_map_, [[MapData]]). + 1. For each Record { [[Key]], [[Value]] } _entry_ of _map_.[[MapData]], do + 1. Set _entry_.[[Key]] to ~empty~. + 1. Set _entry_.[[Value]] to ~empty~. 1. Return *undefined*. @@ -41791,16 +44312,17 @@

            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. 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. Set _p_.[[Key]] to ~empty~. - 1. Set _p_.[[Value]] to ~empty~. + 1. Let _map_ be the *this* value. + 1. Perform ? RequireInternalSlot(_map_, [[MapData]]). + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). + 1. For each Record { [[Key]], [[Value]] } _entry_ of _map_.[[MapData]], do + 1. If _entry_.[[Key]] is not ~empty~ and SameValue(_entry_.[[Key]], _key_) is *true*, then + 1. Set _entry_.[[Key]] to ~empty~. + 1. Set _entry_.[[Value]] to ~empty~. 1. Return *true*. 1. Return *false*. @@ -41809,134 +44331,173 @@

            Map.prototype.delete ( _key_ )

            - +

            Map.prototype.entries ( )

            This method performs the following steps when called:

            - 1. Let _M_ be the *this* value. - 1. Return ? CreateMapIterator(_M_, ~key+value~). + 1. Let _map_ be the *this* value. + 1. Return ? CreateMapIterator(_map_, ~key+value~).
            - -

            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. Let _entries_ be _M_.[[MapData]]. - 1. Let _numEntries_ be the number of elements in _entries_. + 1. Let _map_ be the *this* value. + 1. Perform ? RequireInternalSlot(_map_, [[MapData]]). + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. + 1. Let _entries_ be _map_.[[MapData]]. + 1. Let _entriesCount_ be the number of elements in _entries_. 1. Let _index_ be 0. - 1. Repeat, while _index_ < _numEntries_, - 1. Let _e_ be _entries_[_index_]. + 1. Repeat, while _index_ < _entriesCount_, + 1. Let _entry_ 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. Set _numEntries_ to the number of elements in _entries_. + 1. If _entry_.[[Key]] is not ~empty~, then + 1. Perform ? Call(_callback_, _thisArg_, « _entry_.[[Value]], _entry_.[[Key]], _map_ »). + 1. NOTE: The number of elements in _entries_ may have increased during execution of _callback_. + 1. Set _entriesCount_ 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. 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. Let _map_ be the *this* value. + 1. Perform ? RequireInternalSlot(_map_, [[MapData]]). + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). + 1. For each Record { [[Key]], [[Value]] } _entry_ of _map_.[[MapData]], do + 1. If _entry_.[[Key]] is not ~empty~ and SameValue(_entry_.[[Key]], _key_) is *true*, return _entry_.[[Value]]. 1. Return *undefined*.
            - + +

            Map.prototype.getOrInsert ( _key_, _value_ )

            +

            This method performs the following steps when called:

            + + 1. Let _map_ be the *this* value. + 1. Perform ? RequireInternalSlot(_map_, [[MapData]]). + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). + 1. For each Record { [[Key]], [[Value]] } _entry_ of _map_.[[MapData]], do + 1. If _entry_.[[Key]] is not ~empty~ and SameValue(_entry_.[[Key]], _key_) is *true*, return _entry_.[[Value]]. + 1. Let _entry_ be the Record { [[Key]]: _key_, [[Value]]: _value_ }. + 1. Append _entry_ to _map_.[[MapData]]. + 1. Return _value_. + +
            + + +

            Map.prototype.getOrInsertComputed ( _key_, _callback_ )

            +

            This method performs the following steps when called:

            + + 1. Let _map_ be the *this* value. + 1. Perform ? RequireInternalSlot(_map_, [[MapData]]). + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). + 1. For each Record { [[Key]], [[Value]] } _entry_ of _map_.[[MapData]], do + 1. If _entry_.[[Key]] is not ~empty~ and SameValue(_entry_.[[Key]], _key_) is *true*, return _entry_.[[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]] } _entry_ of _map_.[[MapData]], do + 1. If _entry_.[[Key]] is not ~empty~ and SameValue(_entry_.[[Key]], _key_) is *true*, then + 1. Set _entry_.[[Value]] to _value_. + 1. Return _value_. + 1. Let _entry_ be the Record { [[Key]]: _key_, [[Value]]: _value_ }. + 1. Append _entry_ to _map_.[[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. 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. Let _map_ be the *this* value. + 1. Perform ? RequireInternalSlot(_map_, [[MapData]]). + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). + 1. For each Record { [[Key]], [[Value]] } _entry_ of _map_.[[MapData]], do + 1. If _entry_.[[Key]] is not ~empty~ and SameValue(_entry_.[[Key]], _key_) is *true*, return *true*. 1. Return *false*.
            - +

            Map.prototype.keys ( )

            This method performs the following steps when called:

            - 1. Let _M_ be the *this* value. - 1. Return ? CreateMapIterator(_M_, ~key~). + 1. Let _map_ be the *this* value. + 1. Return ? CreateMapIterator(_map_, ~key~).
            - +

            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. 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. 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_. + 1. Let _map_ be the *this* value. + 1. Perform ? RequireInternalSlot(_map_, [[MapData]]). + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). + 1. For each Record { [[Key]], [[Value]] } _entry_ of _map_.[[MapData]], do + 1. If _entry_.[[Key]] is not ~empty~ and SameValue(_entry_.[[Key]], _key_) is *true*, then + 1. Set _entry_.[[Value]] to _value_. + 1. Return _map_. + 1. Let _entry_ be the Record { [[Key]]: _key_, [[Value]]: _value_ }. + 1. Append _entry_ to _map_.[[MapData]]. + 1. Return _map_.
            - +

            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:

            - 1. Let _M_ be the *this* value. - 1. Perform ? RequireInternalSlot(_M_, [[MapData]]). + 1. Let _map_ be the *this* value. + 1. Perform ? RequireInternalSlot(_map_, [[MapData]]). 1. Let _count_ be 0. - 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do - 1. If _p_.[[Key]] is not ~empty~, set _count_ to _count_ + 1. + 1. For each Record { [[Key]], [[Value]] } _entry_ of _map_.[[MapData]], do + 1. If _entry_.[[Key]] is not ~empty~, set _count_ to _count_ + 1. 1. Return 𝔽(_count_).
            - +

            Map.prototype.values ( )

            This method performs the following steps when called:

            - 1. Let _M_ be the *this* value. - 1. Return ? CreateMapIterator(_M_, ~value~). + 1. Let _map_ be the *this* value. + 1. Return ? CreateMapIterator(_map_, ~value~).
            - -

            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.

            @@ -41954,22 +44515,22 @@

            1. Let _closure_ be a new Abstract Closure with no parameters that captures _map_ and _kind_ and performs the following steps when called: 1. Let _entries_ be _map_.[[MapData]]. 1. Let _index_ be 0. - 1. Let _numEntries_ be the number of elements in _entries_. - 1. Repeat, while _index_ < _numEntries_, - 1. Let _e_ be _entries_[_index_]. + 1. Let _entriesCount_ be the number of elements in _entries_. + 1. Repeat, while _index_ < _entriesCount_, + 1. Let _entry_ be _entries_[_index_]. 1. Set _index_ to _index_ + 1. - 1. If _e_.[[Key]] is not ~empty~, then + 1. If _entry_.[[Key]] is not ~empty~, then 1. If _kind_ is ~key~, then - 1. Let _result_ be _e_.[[Key]]. + 1. Let _result_ be _entry_.[[Key]]. 1. Else if _kind_ is ~value~, then - 1. Let _result_ be _e_.[[Value]]. + 1. Let _result_ be _entry_.[[Value]]. 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. Set _numEntries_ to the number of elements in _entries_. - 1. Return *undefined*. + 1. Let _result_ be CreateArrayFromList(« _entry_.[[Key]], _entry_.[[Value]] »). + 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 _entriesCount_ to the number of elements in _entries_. + 1. Return NormalCompletion(~unused~). 1. Return CreateIteratorFromClosure(_closure_, *"%MapIteratorPrototype%"*, %MapIteratorPrototype%). @@ -41978,22 +44539,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 +44563,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 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 _numberSize_ be ? ToNumber(_rawSize_). + 1. NOTE: If _rawSize_ is *undefined*, then _numberSize_ will be *NaN*. + 1. If _numberSize_ is *NaN*, throw a *TypeError* exception. + 1. Let _intSize_ be ! ToIntegerOrInfinity(_numberSize_). + 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 _element_ be _setData_[_index_]. + 1. If _element_ is not ~empty~ and _element_ 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 _element_ of _setData_, do + 1. If _element_ is not ~empty~, set _count_ to _count_ + 1. + 1. Return _count_. + +
            +
            +

            The Set Constructor

            The Set constructor:

            @@ -42013,10 +44720,10 @@

            The Set Constructor

          • is the initial value of the *"Set"* property of the global object.
          • creates and initializes a new Set object when called as a constructor.
          • 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 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.
          • +
          • 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 built-in methods of `Set.prototype`.
          • - +

            Set ( [ _iterable_ ] )

            This function performs the following steps when called:

            @@ -42050,15 +44757,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,29 +44780,29 @@

            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. For each element _e_ of _S_.[[SetData]], do - 1. If _e_ is not ~empty~ and SameValueZero(_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_. + 1. Let _set_ be the *this* value. + 1. Perform ? RequireInternalSlot(_set_, [[SetData]]). + 1. Set _value_ to CanonicalizeKeyedCollectionKey(_value_). + 1. For each element _entry_ of _set_.[[SetData]], do + 1. If _entry_ is not ~empty~ and SameValue(_entry_, _value_) is *true*, then + 1. Return _set_. + 1. Append _value_ to _set_.[[SetData]]. + 1. Return _set_.
            - +

            Set.prototype.clear ( )

            This method performs the following steps when called:

            - 1. Let _S_ be the *this* value. - 1. Perform ? RequireInternalSlot(_S_, [[SetData]]). - 1. For each element _e_ of _S_.[[SetData]], do - 1. Replace the element of _S_.[[SetData]] whose value is _e_ with an element whose value is ~empty~. + 1. Let _set_ be the *this* value. + 1. Perform ? RequireInternalSlot(_set_, [[SetData]]). + 1. For each element _entry_ of _set_.[[SetData]], do + 1. Replace the element of _set_.[[SetData]] whose value is _entry_ with an element whose value is ~empty~. 1. Return *undefined*. @@ -42108,15 +44815,16 @@

            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. For each element _e_ of _S_.[[SetData]], do - 1. If _e_ is not ~empty~ and SameValueZero(_e_, _value_) is *true*, then - 1. Replace the element of _S_.[[SetData]] whose value is _e_ with an element whose value is ~empty~. + 1. Let _set_ be the *this* value. + 1. Perform ? RequireInternalSlot(_set_, [[SetData]]). + 1. Set _value_ to CanonicalizeKeyedCollectionKey(_value_). + 1. For each element _entry_ of _set_.[[SetData]], do + 1. If _entry_ is not ~empty~ and SameValue(_entry_, _value_) is *true*, then + 1. Replace the element of _set_.[[SetData]] whose value is _entry_ with an element whose value is ~empty~. 1. Return *true*. 1. Return *false*. @@ -42125,60 +44833,208 @@

            Set.prototype.delete ( _value_ )

            - + +

            Set.prototype.difference ( _other_ )

            +

            This method performs the following steps when called:

            + + 1. Let _set_ be the *this* value. + 1. Perform ? RequireInternalSlot(_set_, [[SetData]]). + 1. Let _otherRecord_ be ? GetSetRecord(_other_). + 1. Let _resultSetData_ be a copy of _set_.[[SetData]]. + 1. If SetDataSize(_set_.[[SetData]]) ≤ _otherRecord_.[[Size]], then + 1. Let _thisSize_ be the number of elements in _set_.[[SetData]]. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _thisSize_, + 1. Let _entry_ be _resultSetData_[_index_]. + 1. If _entry_ is not ~empty~, then + 1. Let _inOther_ be ToBoolean(? Call(_otherRecord_.[[Has]], _otherRecord_.[[SetObject]], « _entry_ »)). + 1. If _inOther_ is *true*, then + 1. Set _resultSetData_[_index_] to ~empty~. + 1. Set _index_ to _index_ + 1. + 1. Else, + 1. Let _keysIterator_ be ? GetIteratorFromMethod(_otherRecord_.[[SetObject]], _otherRecord_.[[Keys]]). + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIterator_). + 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:

            - 1. Let _S_ be the *this* value. - 1. Return ? CreateSetIterator(_S_, ~key+value~). + 1. Let _set_ be the *this* value. + 1. Return ? CreateSetIterator(_set_, ~key+value~).

            For iteration purposes, a Set appears similar to a Map where each entry has the same value for its key and value.

            - -

            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. Let _entries_ be _S_.[[SetData]]. - 1. Let _numEntries_ be the number of elements in _entries_. + 1. Let _set_ be the *this* value. + 1. Perform ? RequireInternalSlot(_set_, [[SetData]]). + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. + 1. Let _entries_ be _set_.[[SetData]]. + 1. Let _entriesCount_ be the number of elements in _entries_. 1. Let _index_ be 0. - 1. Repeat, while _index_ < _numEntries_, - 1. Let _e_ be _entries_[_index_]. + 1. Repeat, while _index_ < _entriesCount_, + 1. Let _entry_ 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. Set _numEntries_ to the number of elements in _entries_. + 1. If _entry_ is not ~empty~, then + 1. Perform ? Call(_callback_, _thisArg_, « _entry_, _entry_, _set_ »). + 1. NOTE: The number of elements in _entries_ may have increased during execution of _callback_. + 1. Set _entriesCount_ 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. For each element _e_ of _S_.[[SetData]], do - 1. If _e_ is not ~empty~ and SameValueZero(_e_, _value_) is *true*, return *true*. + 1. Let _set_ be the *this* value. + 1. Perform ? RequireInternalSlot(_set_, [[SetData]]). + 1. Set _value_ to CanonicalizeKeyedCollectionKey(_value_). + 1. For each element _entry_ of _set_.[[SetData]], do + 1. If _entry_ is not ~empty~ and SameValue(_entry_, _value_) is *true*, return *true*. 1. Return *false*.
            - + +

            Set.prototype.intersection ( _other_ )

            +

            This method performs the following steps when called:

            + + 1. Let _set_ be the *this* value. + 1. Perform ? RequireInternalSlot(_set_, [[SetData]]). + 1. Let _otherRecord_ be ? GetSetRecord(_other_). + 1. Let _resultSetData_ be a new empty List. + 1. If SetDataSize(_set_.[[SetData]]) ≤ _otherRecord_.[[Size]], then + 1. Let _thisSize_ be the number of elements in _set_.[[SetData]]. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _thisSize_, + 1. Let _entry_ be _set_.[[SetData]][_index_]. + 1. Set _index_ to _index_ + 1. + 1. If _entry_ is not ~empty~, then + 1. Let _inOther_ be ToBoolean(? Call(_otherRecord_.[[Has]], _otherRecord_.[[SetObject]], « _entry_ »)). + 1. If _inOther_ is *true*, then + 1. NOTE: It is possible for earlier calls to _otherRecord_.[[Has]] to remove and re-add an element of _set_.[[SetData]], which can cause the same element to be visited twice during this iteration. + 1. If SetDataHas(_resultSetData_, _entry_) is *false*, then + 1. Append _entry_ to _resultSetData_. + 1. NOTE: The number of elements in _set_.[[SetData]] may have increased during execution of _otherRecord_.[[Has]]. + 1. Set _thisSize_ to the number of elements in _set_.[[SetData]]. + 1. Else, + 1. Let _keysIterator_ be ? GetIteratorFromMethod(_otherRecord_.[[SetObject]], _otherRecord_.[[Keys]]). + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIterator_). + 1. If _next_ is not ~done~, then + 1. Set _next_ to CanonicalizeKeyedCollectionKey(_next_). + 1. Let _inThis_ be SetDataHas(_set_.[[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 _set_ be the *this* value. + 1. Perform ? RequireInternalSlot(_set_, [[SetData]]). + 1. Let _otherRecord_ be ? GetSetRecord(_other_). + 1. If SetDataSize(_set_.[[SetData]]) ≤ _otherRecord_.[[Size]], then + 1. Let _thisSize_ be the number of elements in _set_.[[SetData]]. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _thisSize_, + 1. Let _entry_ be _set_.[[SetData]][_index_]. + 1. Set _index_ to _index_ + 1. + 1. If _entry_ is not ~empty~, then + 1. Let _inOther_ be ToBoolean(? Call(_otherRecord_.[[Has]], _otherRecord_.[[SetObject]], « _entry_ »)). + 1. If _inOther_ is *true*, return *false*. + 1. NOTE: The number of elements in _set_.[[SetData]] may have increased during execution of _otherRecord_.[[Has]]. + 1. Set _thisSize_ to the number of elements in _set_.[[SetData]]. + 1. Else, + 1. Let _keysIterator_ be ? GetIteratorFromMethod(_otherRecord_.[[SetObject]], _otherRecord_.[[Keys]]). + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIterator_). + 1. If _next_ is not ~done~, then + 1. If SetDataHas(_set_.[[SetData]], _next_) is *true*, then + 1. Perform ? IteratorClose(_keysIterator_, NormalCompletion(~unused~)). + 1. Return *false*. + 1. Return *true*. + +
            + + +

            Set.prototype.isSubsetOf ( _other_ )

            +

            This method performs the following steps when called:

            + + 1. Let _set_ be the *this* value. + 1. Perform ? RequireInternalSlot(_set_, [[SetData]]). + 1. Let _otherRecord_ be ? GetSetRecord(_other_). + 1. If SetDataSize(_set_.[[SetData]]) > _otherRecord_.[[Size]], return *false*. + 1. Let _thisSize_ be the number of elements in _set_.[[SetData]]. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _thisSize_, + 1. Let _entry_ be _set_.[[SetData]][_index_]. + 1. Set _index_ to _index_ + 1. + 1. If _entry_ is not ~empty~, then + 1. Let _inOther_ be ToBoolean(? Call(_otherRecord_.[[Has]], _otherRecord_.[[SetObject]], « _entry_ »)). + 1. If _inOther_ is *false*, return *false*. + 1. NOTE: The number of elements in _set_.[[SetData]] may have increased during execution of _otherRecord_.[[Has]]. + 1. Set _thisSize_ to the number of elements in _set_.[[SetData]]. + 1. Return *true*. + +
            + + +

            Set.prototype.isSupersetOf ( _other_ )

            +

            This method performs the following steps when called:

            + + 1. Let _set_ be the *this* value. + 1. Perform ? RequireInternalSlot(_set_, [[SetData]]). + 1. Let _otherRecord_ be ? GetSetRecord(_other_). + 1. If SetDataSize(_set_.[[SetData]]) < _otherRecord_.[[Size]], return *false*. + 1. Let _keysIterator_ be ? GetIteratorFromMethod(_otherRecord_.[[SetObject]], _otherRecord_.[[Keys]]). + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIterator_). + 1. If _next_ is not ~done~, then + 1. If SetDataHas(_set_.[[SetData]], _next_) is *false*, then + 1. Perform ? IteratorClose(_keysIterator_, 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,48 +45042,94 @@

            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 _set_ be the *this* value. + 1. Perform ? RequireInternalSlot(_set_, [[SetData]]). + 1. Let _size_ be SetDataSize(_set_.[[SetData]]). + 1. Return 𝔽(_size_). + +
            + + +

            Set.prototype.symmetricDifference ( _other_ )

            +

            This method performs the following steps when called:

            + + 1. Let _set_ be the *this* value. + 1. Perform ? RequireInternalSlot(_set_, [[SetData]]). + 1. Let _otherRecord_ be ? GetSetRecord(_other_). + 1. Let _keysIterator_ be ? GetIteratorFromMethod(_otherRecord_.[[SetObject]], _otherRecord_.[[Keys]]). + 1. Let _resultSetData_ be a copy of _set_.[[SetData]]. + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIterator_). + 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(_set_.[[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 _set_ be the *this* value. + 1. Perform ? RequireInternalSlot(_set_, [[SetData]]). + 1. Let _otherRecord_ be ? GetSetRecord(_other_). + 1. Let _keysIterator_ be ? GetIteratorFromMethod(_otherRecord_.[[SetObject]], _otherRecord_.[[Keys]]). + 1. Let _resultSetData_ be a copy of _set_.[[SetData]]. + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIterator_). + 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:

            - 1. Let _S_ be the *this* value. - 1. Return ? CreateSetIterator(_S_, ~value~). + 1. Let _set_ be the *this* value. + 1. Return ? CreateSetIterator(_set_, ~value~).
            - -

            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.

            @@ -42245,20 +45147,20 @@

            1. Let _closure_ be a new Abstract Closure with no parameters that captures _set_ and _kind_ and performs the following steps when called: 1. Let _index_ be 0. 1. Let _entries_ be _set_.[[SetData]]. - 1. Let _numEntries_ be the number of elements in _entries_. - 1. Repeat, while _index_ < _numEntries_, - 1. Let _e_ be _entries_[_index_]. + 1. Let _entriesCount_ be the number of elements in _entries_. + 1. Repeat, while _index_ < _entriesCount_, + 1. Let _entry_ be _entries_[_index_]. 1. Set _index_ to _index_ + 1. - 1. If _e_ is not ~empty~, then + 1. If _entry_ 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. Let _result_ be CreateArrayFromList(« _entry_, _entry_ »). + 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. Set _numEntries_ to the number of elements in _entries_. - 1. Return *undefined*. + 1. Perform ? GeneratorYield(CreateIteratorResultObject(_entry_, *false*)). + 1. NOTE: The number of elements in _entries_ may have increased while execution of this abstract operation was paused by GeneratorYield. + 1. Set _entriesCount_ to the number of elements in _entries_. + 1. Return NormalCompletion(~unused~). 1. Return CreateIteratorFromClosure(_closure_, *"%SetIteratorPrototype%"*, %SetIteratorPrototype%). @@ -42267,22 +45169,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* }.

            @@ -42308,10 +45210,10 @@

            The WeakMap Constructor

          • is the initial value of the *"WeakMap"* property of the global object.
          • creates and initializes a new WeakMap when called as a constructor.
          • 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 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.
          • +
          • 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 built-in methods of `WeakMap.prototype`.
          • - +

            WeakMap ( [ _iterable_ ] )

            This function performs the following steps when called:

            @@ -42324,7 +45226,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,17 +45261,17 @@

            WeakMap.prototype.constructor

            The initial value of `WeakMap.prototype.constructor` is %WeakMap%.

            - +

            WeakMap.prototype.delete ( _key_ )

            This method performs the following steps when called:

            - 1. Let _M_ be the *this* value. - 1. Perform ? RequireInternalSlot(_M_, [[WeakMapData]]). + 1. Let _weakMap_ be the *this* value. + 1. Perform ? RequireInternalSlot(_weakMap_, [[WeakMapData]]). 1. If CanBeHeldWeakly(_key_) is *false*, return *false*. - 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_.[[Key]] to ~empty~. - 1. Set _p_.[[Value]] to ~empty~. + 1. For each Record { [[Key]], [[Value]] } _entry_ of _weakMap_.[[WeakMapData]], do + 1. If _entry_.[[Key]] is not ~empty~ and SameValue(_entry_.[[Key]], _key_) is *true*, then + 1. Set _entry_.[[Key]] to ~empty~. + 1. Set _entry_.[[Value]] to ~empty~. 1. Return *true*. 1. Return *false*. @@ -42378,59 +45280,96 @@

            WeakMap.prototype.delete ( _key_ )

            - +

            WeakMap.prototype.get ( _key_ )

            This method performs the following steps when called:

            - 1. Let _M_ be the *this* value. - 1. Perform ? RequireInternalSlot(_M_, [[WeakMapData]]). + 1. Let _weakMap_ be the *this* value. + 1. Perform ? RequireInternalSlot(_weakMap_, [[WeakMapData]]). 1. If CanBeHeldWeakly(_key_) is *false*, return *undefined*. - 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. For each Record { [[Key]], [[Value]] } _entry_ of _weakMap_.[[WeakMapData]], do + 1. If _entry_.[[Key]] is not ~empty~ and SameValue(_entry_.[[Key]], _key_) is *true*, return _entry_.[[Value]]. 1. Return *undefined*.
            - + +

            WeakMap.prototype.getOrInsert ( _key_, _value_ )

            +

            This method performs the following steps when called:

            + + 1. Let _weakMap_ be the *this* value. + 1. Perform ? RequireInternalSlot(_weakMap_, [[WeakMapData]]). + 1. If CanBeHeldWeakly(_key_) is *false*, throw a *TypeError* exception. + 1. For each Record { [[Key]], [[Value]] } _entry_ of _weakMap_.[[WeakMapData]], do + 1. If _entry_.[[Key]] is not ~empty~ and SameValue(_entry_.[[Key]], _key_) is *true*, return _entry_.[[Value]]. + 1. Let _entry_ be the Record { [[Key]]: _key_, [[Value]]: _value_ }. + 1. Append _entry_ to _weakMap_.[[WeakMapData]]. + 1. Return _value_. + +
            + + +

            WeakMap.prototype.getOrInsertComputed ( _key_, _callback_ )

            +

            This method performs the following steps when called:

            + + 1. Let _weakMap_ be the *this* value. + 1. Perform ? RequireInternalSlot(_weakMap_, [[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]] } _entry_ of _weakMap_.[[WeakMapData]], do + 1. If _entry_.[[Key]] is not ~empty~ and SameValue(_entry_.[[Key]], _key_) is *true*, return _entry_.[[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]] } _entry_ of _weakMap_.[[WeakMapData]], do + 1. If _entry_.[[Key]] is not ~empty~ and SameValue(_entry_.[[Key]], _key_) is *true*, then + 1. Set _entry_.[[Value]] to _value_. + 1. Return _value_. + 1. Let _entry_ be the Record { [[Key]]: _key_, [[Value]]: _value_ }. + 1. Append _entry_ to _weakMap_.[[WeakMapData]]. + 1. Return _value_. + +
            + +

            WeakMap.prototype.has ( _key_ )

            This method performs the following steps when called:

            - 1. Let _M_ be the *this* value. - 1. Perform ? RequireInternalSlot(_M_, [[WeakMapData]]). + 1. Let _weakMap_ be the *this* value. + 1. Perform ? RequireInternalSlot(_weakMap_, [[WeakMapData]]). 1. If CanBeHeldWeakly(_key_) is *false*, return *false*. - 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 *true*. + 1. For each Record { [[Key]], [[Value]] } _entry_ of _weakMap_.[[WeakMapData]], do + 1. If _entry_.[[Key]] is not ~empty~ and SameValue(_entry_.[[Key]], _key_) is *true*, return *true*. 1. Return *false*.
            - +

            WeakMap.prototype.set ( _key_, _value_ )

            This method performs the following steps when called:

            - 1. Let _M_ be the *this* value. - 1. Perform ? RequireInternalSlot(_M_, [[WeakMapData]]). + 1. Let _weakMap_ be the *this* value. + 1. Perform ? RequireInternalSlot(_weakMap_, [[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*, then - 1. Set _p_.[[Value]] to _value_. - 1. Return _M_. - 1. Let _p_ be the Record { [[Key]]: _key_, [[Value]]: _value_ }. - 1. Append _p_ to _M_.[[WeakMapData]]. - 1. Return _M_. + 1. For each Record { [[Key]], [[Value]] } _entry_ of _weakMap_.[[WeakMapData]], do + 1. If _entry_.[[Key]] is not ~empty~ and SameValue(_entry_.[[Key]], _key_) is *true*, then + 1. Set _entry_.[[Value]] to _value_. + 1. Return _weakMap_. + 1. Let _entry_ be the Record { [[Key]]: _key_, [[Value]]: _value_ }. + 1. Append _entry_ to _weakMap_.[[WeakMapData]]. + 1. Return _weakMap_.
            - -

            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.

            @@ -42451,10 +45390,10 @@

            The WeakSet Constructor

          • is the initial value of the *"WeakSet"* property of the global object.
          • creates and initializes a new WeakSet when called as a constructor.
          • 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 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.
          • +
          • 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 built-in methods of `WeakSet.prototype`.
          • - +

            WeakSet ( [ _iterable_ ] )

            This function performs the following steps when called:

            @@ -42499,18 +45438,18 @@

            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:

            - 1. Let _S_ be the *this* value. - 1. Perform ? RequireInternalSlot(_S_, [[WeakSetData]]). + 1. Let _weakSet_ be the *this* value. + 1. Perform ? RequireInternalSlot(_weakSet_, [[WeakSetData]]). 1. If CanBeHeldWeakly(_value_) is *false*, throw a *TypeError* exception. - 1. For each element _e_ of _S_.[[WeakSetData]], do - 1. If _e_ is not ~empty~ and SameValue(_e_, _value_) is *true*, then - 1. Return _S_. - 1. Append _value_ to _S_.[[WeakSetData]]. - 1. Return _S_. + 1. For each element _entry_ of _weakSet_.[[WeakSetData]], do + 1. If _entry_ is not ~empty~ and SameValue(_entry_, _value_) is *true*, then + 1. Return _weakSet_. + 1. Append _value_ to _weakSet_.[[WeakSetData]]. + 1. Return _weakSet_.
            @@ -42519,16 +45458,16 @@

            WeakSet.prototype.constructor

            The initial value of `WeakSet.prototype.constructor` is %WeakSet%.

            - +

            WeakSet.prototype.delete ( _value_ )

            This method performs the following steps when called:

            - 1. Let _S_ be the *this* value. - 1. Perform ? RequireInternalSlot(_S_, [[WeakSetData]]). + 1. Let _weakSet_ be the *this* value. + 1. Perform ? RequireInternalSlot(_weakSet_, [[WeakSetData]]). 1. If CanBeHeldWeakly(_value_) is *false*, return *false*. - 1. For each element _e_ of _S_.[[WeakSetData]], do - 1. If _e_ is not ~empty~ and SameValue(_e_, _value_) is *true*, then - 1. Replace the element of _S_.[[WeakSetData]] whose value is _e_ with an element whose value is ~empty~. + 1. For each element _entry_ of _weakSet_.[[WeakSetData]], do + 1. If _entry_ is not ~empty~ and SameValue(_entry_, _value_) is *true*, then + 1. Replace the element of _weakSet_.[[WeakSetData]] whose value is _entry_ with an element whose value is ~empty~. 1. Return *true*. 1. Return *false*. @@ -42537,29 +45476,47 @@

            WeakSet.prototype.delete ( _value_ )

            - +

            WeakSet.prototype.has ( _value_ )

            This method performs the following steps when called:

            - 1. Let _S_ be the *this* value. - 1. Perform ? RequireInternalSlot(_S_, [[WeakSetData]]). + 1. Let _weakSet_ be the *this* value. + 1. Perform ? RequireInternalSlot(_weakSet_, [[WeakSetData]]). 1. If CanBeHeldWeakly(_value_) is *false*, return *false*. - 1. For each element _e_ of _S_.[[WeakSetData]], do - 1. If _e_ is not ~empty~ and SameValue(_e_, _value_) is *true*, return *true*. + 1. For each element _entry_ of _weakSet_.[[WeakSetData]], do + 1. If _entry_ is not ~empty~ and SameValue(_entry_, _value_) is *true*, return *true*. 1. Return *false*.
            - -

            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 +45530,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 +45538,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.
              @@ -42600,7 +45558,7 @@

              Abstract Operations For ArrayBuffer Objects

              AllocateArrayBuffer ( - _constructor_: a constructor, + _ctor_: a constructor, _byteLength_: a non-negative integer, optional _maxByteLength_: a non-negative integer or ~empty~, ): either a normal completion containing an ArrayBuffer or a throw completion @@ -42611,11 +45569,11 @@

            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_. - 1. Let _obj_ be ? OrdinaryCreateFromConstructor(_constructor_, *"%ArrayBuffer.prototype%"*, _slots_). + 1. Let _obj_ be ? OrdinaryCreateFromConstructor(_ctor_, *"%ArrayBuffer.prototype%"*, _slots_). 1. Let _block_ be ? CreateByteDataBlock(_byteLength_). 1. Set _obj_.[[ArrayBufferData]] to _block_. 1. Set _obj_.[[ArrayBufferByteLength]] to _byteLength_. @@ -42637,10 +45595,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 _agentRecord_ be the Agent Record of the surrounding agent. + 1. Let _isLittleEndian_ be _agentRecord_.[[LittleEndian]]. 1. Return ℝ(RawBytesToNumeric(~biguint64~, _rawLength_, _isLittleEndian_)). 1. Assert: IsDetachedBuffer(_arrayBuffer_) is *false*. 1. Return _arrayBuffer_.[[ArrayBufferByteLength]]. @@ -42722,21 +45681,21 @@

            CloneArrayBuffer ( - _srcBuffer_: an ArrayBuffer or a SharedArrayBuffer, - _srcByteOffset_: a non-negative integer, - _srcLength_: a non-negative integer, + _sourceBuffer_: an ArrayBuffer or a SharedArrayBuffer, + _sourceByteOffset_: a non-negative integer, + _sourceLength_: a non-negative integer, ): either a normal completion containing an ArrayBuffer or a throw completion

            description
            -
            It creates a new ArrayBuffer whose data is a copy of _srcBuffer_'s data over the range starting at _srcByteOffset_ and continuing for _srcLength_ bytes.
            +
            It creates a new ArrayBuffer whose data is a copy of _sourceBuffer_'s data over the range starting at _sourceByteOffset_ and continuing for _sourceLength_ bytes.
            - 1. Assert: IsDetachedBuffer(_srcBuffer_) is *false*. - 1. Let _targetBuffer_ be ? AllocateArrayBuffer(%ArrayBuffer%, _srcLength_). - 1. Let _srcBlock_ be _srcBuffer_.[[ArrayBufferData]]. + 1. Assert: IsDetachedBuffer(_sourceBuffer_) is *false*. + 1. Let _targetBuffer_ be ? AllocateArrayBuffer(%ArrayBuffer%, _sourceLength_). + 1. Let _sourceBlock_ be _sourceBuffer_.[[ArrayBufferData]]. 1. Let _targetBlock_ be _targetBuffer_.[[ArrayBufferData]]. - 1. Perform CopyDataBlockBytes(_targetBlock_, 0, _srcBlock_, _srcByteOffset_, _srcLength_). + 1. Perform CopyDataBlockBytes(_targetBlock_, 0, _sourceBlock_, _sourceByteOffset_, _sourceLength_). 1. Return _targetBuffer_.
            @@ -42869,20 +45828,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 +45863,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 _agentRecord_ be the Agent Record of the surrounding agent. + 1. Let _execution_ be _agentRecord_.[[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 +45900,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 _agentRecord_ be the Agent Record of the surrounding agent. + 1. Set _isLittleEndian_ to _agentRecord_.[[LittleEndian]]. 1. Return RawBytesToNumeric(_type_, _rawValue_, _isLittleEndian_). @@ -42952,14 +45918,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 +45954,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 _agentRecord_ be the Agent Record of the surrounding agent. + 1. If _isLittleEndian_ is not present, then + 1. Set _isLittleEndian_ to _agentRecord_.[[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 _agentRecord_.[[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 +45987,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 _agentRecord_ be the Agent Record of the surrounding agent. + 1. Let _isLittleEndian_ be _agentRecord_.[[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 _agentRecord_.[[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. @@ -43047,10 +46018,10 @@

            The ArrayBuffer Constructor

          • is the initial value of the *"ArrayBuffer"* property of the global object.
          • creates and initializes a new ArrayBuffer when called as a constructor.
          • 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 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.
          • +
          • 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 built-in methods of `ArrayBuffer.prototype`.
          • - +

            ArrayBuffer ( _length_ [ , _options_ ] )

            This function performs the following steps when called:

            @@ -43070,7 +46041,7 @@

            Properties of the ArrayBuffer Constructor

          • has the following properties:
          • - +

            ArrayBuffer.isView ( _arg_ )

            This function performs the following steps when called:

            @@ -43086,15 +46057,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,15 +46080,15 @@

            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:

            - 1. Let _O_ be the *this* value. - 1. Perform ? RequireInternalSlot(_O_, [[ArrayBufferData]]). - 1. If IsSharedArrayBuffer(_O_) is *true*, throw a *TypeError* exception. - 1. If IsDetachedBuffer(_O_) is *true*, return *+0*𝔽. - 1. Let _length_ be _O_.[[ArrayBufferByteLength]]. + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[ArrayBufferData]]). + 1. If IsSharedArrayBuffer(_obj_) is *true*, throw a *TypeError* exception. + 1. If IsDetachedBuffer(_obj_) is *true*, return *+0*𝔽. + 1. Let _length_ be _obj_.[[ArrayBufferByteLength]]. 1. Return 𝔽(_length_).
            @@ -43127,125 +46098,126 @@

            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:

            - 1. Let _O_ be the *this* value. - 1. Perform ? RequireInternalSlot(_O_, [[ArrayBufferData]]). - 1. If IsSharedArrayBuffer(_O_) is *true*, throw a *TypeError* exception. - 1. Return IsDetachedBuffer(_O_). + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[ArrayBufferData]]). + 1. If IsSharedArrayBuffer(_obj_) is *true*, throw a *TypeError* exception. + 1. Return IsDetachedBuffer(_obj_).
            - +

            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:

            - 1. Let _O_ be the *this* value. - 1. Perform ? RequireInternalSlot(_O_, [[ArrayBufferData]]). - 1. If IsSharedArrayBuffer(_O_) is *true*, throw a *TypeError* exception. - 1. If IsDetachedBuffer(_O_) is *true*, return *+0*𝔽. - 1. If IsFixedLengthArrayBuffer(_O_) is *true*, then - 1. Let _length_ be _O_.[[ArrayBufferByteLength]]. + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[ArrayBufferData]]). + 1. If IsSharedArrayBuffer(_obj_) is *true*, throw a *TypeError* exception. + 1. If IsDetachedBuffer(_obj_) is *true*, return *+0*𝔽. + 1. If IsFixedLengthArrayBuffer(_obj_) is *true*, then + 1. Let _length_ be _obj_.[[ArrayBufferByteLength]]. 1. Else, - 1. Let _length_ be _O_.[[ArrayBufferMaxByteLength]]. + 1. Let _length_ be _obj_.[[ArrayBufferMaxByteLength]]. 1. Return 𝔽(_length_).
            - +

            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. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[ArrayBufferData]]). + 1. If IsSharedArrayBuffer(_obj_) is *true*, throw a *TypeError* exception. + 1. If IsFixedLengthArrayBuffer(_obj_) is *false*, return *true*. + 1. Return *false*.
            - +

            ArrayBuffer.prototype.resize ( _newLength_ )

            This method performs the following steps when called:

            - 1. Let _O_ be the *this* value. - 1. Perform ? RequireInternalSlot(_O_, [[ArrayBufferMaxByteLength]]). - 1. If IsSharedArrayBuffer(_O_) is *true*, throw a *TypeError* exception. + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[ArrayBufferMaxByteLength]]). + 1. If IsSharedArrayBuffer(_obj_) is *true*, throw a *TypeError* exception. 1. Let _newByteLength_ be ? ToIndex(_newLength_). - 1. If IsDetachedBuffer(_O_) is *true*, throw a *TypeError* exception. - 1. If _newByteLength_ > _O_.[[ArrayBufferMaxByteLength]], throw a *RangeError* exception. - 1. Let _hostHandled_ be ? HostResizeArrayBuffer(_O_, _newByteLength_). + 1. If IsDetachedBuffer(_obj_) is *true*, throw a *TypeError* exception. + 1. If _newByteLength_ > _obj_.[[ArrayBufferMaxByteLength]], throw a *RangeError* exception. + 1. Let _hostHandled_ be ? HostResizeArrayBuffer(_obj_, _newByteLength_). 1. If _hostHandled_ is ~handled~, return *undefined*. - 1. Let _oldBlock_ be _O_.[[ArrayBufferData]]. + 1. Let _oldBlock_ be _obj_.[[ArrayBufferData]]. 1. Let _newBlock_ be ? CreateByteDataBlock(_newByteLength_). - 1. Let _copyLength_ be min(_newByteLength_, _O_.[[ArrayBufferByteLength]]). + 1. Let _copyLength_ be min(_newByteLength_, _obj_.[[ArrayBufferByteLength]]). 1. Perform CopyDataBlockBytes(_newBlock_, 0, _oldBlock_, 0, _copyLength_). 1. NOTE: Neither creation of the new Data Block nor copying from the old Data Block are observable. Implementations may implement this method as in-place growth or shrinkage. - 1. Set _O_.[[ArrayBufferData]] to _newBlock_. - 1. Set _O_.[[ArrayBufferByteLength]] to _newByteLength_. + 1. Set _obj_.[[ArrayBufferData]] to _newBlock_. + 1. Set _obj_.[[ArrayBufferByteLength]] to _newByteLength_. 1. Return *undefined*.
            - +

            ArrayBuffer.prototype.slice ( _start_, _end_ )

            This method 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 IsDetachedBuffer(_O_) is *true*, throw a *TypeError* exception. - 1. Let _len_ be _O_.[[ArrayBufferByteLength]]. + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[ArrayBufferData]]). + 1. If IsSharedArrayBuffer(_obj_) is *true*, throw a *TypeError* exception. + 1. If IsDetachedBuffer(_obj_) is *true*, throw a *TypeError* exception. + 1. Let _length_ be _obj_.[[ArrayBufferByteLength]]. 1. Let _relativeStart_ be ? ToIntegerOrInfinity(_start_). 1. If _relativeStart_ = -∞, let _first_ be 0. - 1. Else if _relativeStart_ < 0, let _first_ be max(_len_ + _relativeStart_, 0). - 1. Else, let _first_ be min(_relativeStart_, _len_). - 1. If _end_ is *undefined*, let _relativeEnd_ be _len_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). + 1. Else if _relativeStart_ < 0, let _first_ be max(_length_ + _relativeStart_, 0). + 1. Else, let _first_ be min(_relativeStart_, _length_). + 1. If _end_ is *undefined*, let _relativeEnd_ be _length_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). 1. If _relativeEnd_ = -∞, let _final_ be 0. - 1. Else if _relativeEnd_ < 0, let _final_ be max(_len_ + _relativeEnd_, 0). - 1. Else, let _final_ be min(_relativeEnd_, _len_). - 1. Let _newLen_ be max(_final_ - _first_, 0). - 1. Let _ctor_ be ? SpeciesConstructor(_O_, %ArrayBuffer%). - 1. Let _new_ be ? Construct(_ctor_, « 𝔽(_newLen_) »). + 1. Else if _relativeEnd_ < 0, let _final_ be max(_length_ + _relativeEnd_, 0). + 1. Else, let _final_ be min(_relativeEnd_, _length_). + 1. Let _newLength_ be max(_final_ - _first_, 0). + 1. Let _ctor_ be ? SpeciesConstructor(_obj_, %ArrayBuffer%). + 1. Let _new_ be ? Construct(_ctor_, « 𝔽(_newLength_) »). 1. Perform ? RequireInternalSlot(_new_, [[ArrayBufferData]]). 1. If IsSharedArrayBuffer(_new_) is *true*, throw a *TypeError* exception. 1. If IsDetachedBuffer(_new_) is *true*, throw a *TypeError* exception. - 1. If SameValue(_new_, _O_) is *true*, throw a *TypeError* exception. - 1. If _new_.[[ArrayBufferByteLength]] < _newLen_, throw a *TypeError* exception. - 1. NOTE: Side-effects of the above steps may have detached or resized _O_. - 1. If IsDetachedBuffer(_O_) is *true*, throw a *TypeError* exception. - 1. Let _fromBuf_ be _O_.[[ArrayBufferData]]. + 1. If SameValue(_new_, _obj_) is *true*, throw a *TypeError* exception. + 1. If _new_.[[ArrayBufferByteLength]] < _newLength_, throw a *TypeError* exception. + 1. NOTE: Side-effects of the above steps may have detached or resized _obj_. + 1. If IsDetachedBuffer(_obj_) is *true*, throw a *TypeError* exception. + 1. Let _fromBuf_ be _obj_.[[ArrayBufferData]]. 1. Let _toBuf_ be _new_.[[ArrayBufferData]]. - 1. Let _currentLen_ be _O_.[[ArrayBufferByteLength]]. - 1. If _first_ < _currentLen_, then - 1. Let _count_ be min(_newLen_, _currentLen_ - _first_). + 1. Let _currentLength_ be _obj_.[[ArrayBufferByteLength]]. + 1. If _first_ < _currentLength_, then + 1. Let _count_ be min(_newLength_, _currentLength_ - _first_). 1. Perform CopyDataBlockBytes(_toBuf_, 0, _fromBuf_, _first_, _count_). 1. Return _new_.
            - +

            ArrayBuffer.prototype.transfer ( [ _newLength_ ] )

            This method performs the following steps when called:

            - 1. Let _O_ be the *this* value. - 1. Return ? ArrayBufferCopyAndDetach(_O_, _newLength_, ~preserve-resizability~). + 1. Let _obj_ be the *this* value. + 1. Return ? ArrayBufferCopyAndDetach(_obj_, _newLength_, ~preserve-resizability~).
            - +

            ArrayBuffer.prototype.transferToFixedLength ( [ _newLength_ ] )

            This method performs the following steps when called:

            - 1. Let _O_ be the *this* value. - 1. Return ? ArrayBufferCopyAndDetach(_O_, _newLength_, ~fixed-length~). + 1. Let _obj_ be the *this* value. + 1. Return ? ArrayBufferCopyAndDetach(_obj_, _newLength_, ~fixed-length~).
            - -

            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* }.

            @@ -43254,7 +46226,7 @@

            ArrayBuffer.prototype [ @@toStringTag ]

            Properties of ArrayBuffer Instances

            ArrayBuffer instances inherit properties from the ArrayBuffer prototype object. ArrayBuffer instances each have an [[ArrayBufferData]] internal slot, an [[ArrayBufferByteLength]] internal slot, and an [[ArrayBufferDetachKey]] internal slot. ArrayBuffer instances which are resizable each have an [[ArrayBufferMaxByteLength]] internal slot.

            ArrayBuffer instances whose [[ArrayBufferData]] is *null* are considered to be detached and all operators to access or modify data contained in the ArrayBuffer instance will fail.

            -

            ArrayBuffer instances whose [[ArrayBufferDetachKey]] is set to a value other than *undefined* need to have all DetachArrayBuffer calls passing that same "detach key" as an argument, otherwise a TypeError will result. This internal slot is only ever set by certain embedding environments, not by algorithms in this specification.

            +

            ArrayBuffer instances whose [[ArrayBufferDetachKey]] is set to a value other than *undefined* need to have all DetachArrayBuffer calls passing that same “detach key” as an argument, otherwise a TypeError will result. This internal slot is only ever set by certain embedding environments, not by algorithms in this specification.

            @@ -43270,7 +46242,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.

            @@ -43291,7 +46263,7 @@

            Abstract Operations for SharedArrayBuffer Objects

            AllocateSharedArrayBuffer ( - _constructor_: a constructor, + _ctor_: a constructor, _byteLength_: a non-negative integer, optional _maxByteLength_: a non-negative integer or ~empty~, ): either a normal completion containing a SharedArrayBuffer or a throw completion @@ -43302,14 +46274,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. Let _obj_ be ? OrdinaryCreateFromConstructor(_ctor_, *"%SharedArrayBuffer.prototype%"*, _slots_). + 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 +46304,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 +46342,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 _agentRecord_ be the Agent Record of the surrounding agent. Let _isLittleEndian_ be _agentRecord_.[[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~).

            @@ -43377,7 +46362,7 @@

            The SharedArrayBuffer Constructor

          • is the initial value of the *"SharedArrayBuffer"* property of the global object, if that property is present (see below).
          • creates and initializes a new SharedArrayBuffer when called as a constructor.
          • 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 SharedArrayBuffer behaviour must include a `super` call to the SharedArrayBuffer constructor to create and initialize subclass instances with the internal state necessary to support the `SharedArrayBuffer.prototype` built-in methods.
          • +
          • may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified SharedArrayBuffer behaviour must include a `super` call to the SharedArrayBuffer constructor to create and initialize subclass instances with the internal state necessary to support the built-in methods of `SharedArrayBuffer.prototype`.
          • Whenever a host does not provide concurrent access to SharedArrayBuffers it may omit the *"SharedArrayBuffer"* property of the global object.

            @@ -43386,7 +46371,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 +46397,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,14 +46417,14 @@

            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:

            - 1. Let _O_ be the *this* value. - 1. Perform ? RequireInternalSlot(_O_, [[ArrayBufferData]]). - 1. If IsSharedArrayBuffer(_O_) is *false*, throw a *TypeError* exception. - 1. Let _length_ be ArrayBufferByteLength(_O_, ~seq-cst~). + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[ArrayBufferData]]). + 1. If IsSharedArrayBuffer(_obj_) is *false*, throw a *TypeError* exception. + 1. Let _length_ be ArrayBufferByteLength(_obj_, ~seq-cst~). 1. Return 𝔽(_length_).
            @@ -43449,25 +46434,26 @@

            SharedArrayBuffer.prototype.constructor

            The initial value of `SharedArrayBuffer.prototype.constructor` is %SharedArrayBuffer%.

            - +

            SharedArrayBuffer.prototype.grow ( _newLength_ )

            This method performs the following steps when called:

            - 1. Let _O_ be the *this* value. - 1. Perform ? RequireInternalSlot(_O_, [[ArrayBufferMaxByteLength]]). - 1. If IsSharedArrayBuffer(_O_) is *false*, throw a *TypeError* exception. + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[ArrayBufferMaxByteLength]]). + 1. If IsSharedArrayBuffer(_obj_) is *false*, throw a *TypeError* exception. 1. Let _newByteLength_ be ? ToIndex(_newLength_). - 1. Let _hostHandled_ be ? HostGrowSharedArrayBuffer(_O_, _newByteLength_). + 1. Let _hostHandled_ be ? HostGrowSharedArrayBuffer(_obj_, _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 _byteLengthBlock_ be _O_.[[ArrayBufferByteLengthData]]. + 1. Let _agentRecord_ be the Agent Record of the surrounding agent. + 1. Let _isLittleEndian_ be _agentRecord_.[[LittleEndian]]. + 1. Let _byteLengthBlock_ be _obj_.[[ArrayBufferByteLengthData]]. 1. Let _currentByteLengthRawBytes_ be GetRawBytesFromSharedBlock(_byteLengthBlock_, 0, ~biguint64~, *true*, ~seq-cst~). 1. Let _newByteLengthRawBytes_ be NumericToRawBytes(~biguint64~, ℤ(_newByteLength_), _isLittleEndian_). 1. Repeat, 1. NOTE: This is a compare-and-exchange loop to ensure that parallel, racing grows of the same buffer are totally ordered, are not lost, and do not silently do nothing. The loop exits if it was able to attempt to grow uncontended. 1. Let _currentByteLength_ be ℝ(RawBytesToNumeric(~biguint64~, _currentByteLengthRawBytes_, _isLittleEndian_)). 1. If _newByteLength_ = _currentByteLength_, return *undefined*. - 1. If _newByteLength_ < _currentByteLength_ or _newByteLength_ > _O_.[[ArrayBufferMaxByteLength]], throw a *RangeError* exception. + 1. If _newByteLength_ < _currentByteLength_ or _newByteLength_ > _obj_.[[ArrayBufferMaxByteLength]], throw a *RangeError* exception. 1. Let _byteLengthDelta_ be _newByteLength_ - _currentByteLength_. 1. If it is impossible to create a new Shared Data Block value consisting of _byteLengthDelta_ bytes, throw a *RangeError* exception. 1. NOTE: No new Shared Data Block is constructed and used here. The observable behaviour of growable SharedArrayBuffers is specified by allocating a max-sized Shared Data Block at construction time, and this step captures the requirement that implementations that run out of memory must throw a *RangeError*. @@ -43481,65 +46467,66 @@

            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. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[ArrayBufferData]]). + 1. If IsSharedArrayBuffer(_obj_) is *false*, throw a *TypeError* exception. + 1. If IsFixedLengthArrayBuffer(_obj_) 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:

            - 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 *true*, then - 1. Let _length_ be _O_.[[ArrayBufferByteLength]]. + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[ArrayBufferData]]). + 1. If IsSharedArrayBuffer(_obj_) is *false*, throw a *TypeError* exception. + 1. If IsFixedLengthArrayBuffer(_obj_) is *true*, then + 1. Let _length_ be _obj_.[[ArrayBufferByteLength]]. 1. Else, - 1. Let _length_ be _O_.[[ArrayBufferMaxByteLength]]. + 1. Let _length_ be _obj_.[[ArrayBufferMaxByteLength]]. 1. Return 𝔽(_length_).
            - +

            SharedArrayBuffer.prototype.slice ( _start_, _end_ )

            This method 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. Let _len_ be ArrayBufferByteLength(_O_, ~seq-cst~). + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[ArrayBufferData]]). + 1. If IsSharedArrayBuffer(_obj_) is *false*, throw a *TypeError* exception. + 1. Let _length_ be ArrayBufferByteLength(_obj_, ~seq-cst~). 1. Let _relativeStart_ be ? ToIntegerOrInfinity(_start_). 1. If _relativeStart_ = -∞, let _first_ be 0. - 1. Else if _relativeStart_ < 0, let _first_ be max(_len_ + _relativeStart_, 0). - 1. Else, let _first_ be min(_relativeStart_, _len_). - 1. If _end_ is *undefined*, let _relativeEnd_ be _len_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). + 1. Else if _relativeStart_ < 0, let _first_ be max(_length_ + _relativeStart_, 0). + 1. Else, let _first_ be min(_relativeStart_, _length_). + 1. If _end_ is *undefined*, let _relativeEnd_ be _length_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_). 1. If _relativeEnd_ = -∞, let _final_ be 0. - 1. Else if _relativeEnd_ < 0, let _final_ be max(_len_ + _relativeEnd_, 0). - 1. Else, let _final_ be min(_relativeEnd_, _len_). - 1. Let _newLen_ be max(_final_ - _first_, 0). - 1. Let _ctor_ be ? SpeciesConstructor(_O_, %SharedArrayBuffer%). - 1. Let _new_ be ? Construct(_ctor_, « 𝔽(_newLen_) »). + 1. Else if _relativeEnd_ < 0, let _final_ be max(_length_ + _relativeEnd_, 0). + 1. Else, let _final_ be min(_relativeEnd_, _length_). + 1. Let _newLength_ be max(_final_ - _first_, 0). + 1. Let _ctor_ be ? SpeciesConstructor(_obj_, %SharedArrayBuffer%). + 1. Let _new_ be ? Construct(_ctor_, « 𝔽(_newLength_) »). 1. Perform ? RequireInternalSlot(_new_, [[ArrayBufferData]]). 1. If IsSharedArrayBuffer(_new_) is *false*, throw a *TypeError* exception. - 1. If _new_.[[ArrayBufferData]] is _O_.[[ArrayBufferData]], throw a *TypeError* exception. - 1. If ArrayBufferByteLength(_new_, ~seq-cst~) < _newLen_, throw a *TypeError* exception. - 1. Let _fromBuf_ be _O_.[[ArrayBufferData]]. + 1. If _new_.[[ArrayBufferData]] is _obj_.[[ArrayBufferData]], throw a *TypeError* exception. + 1. If ArrayBufferByteLength(_new_, ~seq-cst~) < _newLength_, throw a *TypeError* exception. + 1. Let _fromBuf_ be _obj_.[[ArrayBufferData]]. 1. Let _toBuf_ be _new_.[[ArrayBufferData]]. - 1. Perform CopyDataBlockBytes(_toBuf_, 0, _fromBuf_, _first_, _newLen_). + 1. Perform CopyDataBlockBytes(_toBuf_, 0, _fromBuf_, _first_, _newLength_). 1. Return _new_.
            - -

            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* }.

            @@ -43566,7 +46553,7 @@

            Growable SharedArrayBuffer Guidelines

            The following are guidelines for ECMAScript implementers implementing growable SharedArrayBuffer.

            We recommend growable SharedArrayBuffer be implemented as in-place growth via reserving virtual memory up front.

            -

            Because grow operations can happen in parallel with memory accesses on a growable SharedArrayBuffer, the constraints of the memory model require that even unordered accesses do not "tear" (bits of their values will not be mixed). In practice, this means the underlying data block of a growable SharedArrayBuffer cannot be grown by being copied without stopping the world. We do not recommend stopping the world as an implementation strategy because it introduces a serialization point and is slow.

            +

            Because grow operations can happen in parallel with memory accesses on a growable SharedArrayBuffer, the constraints of the memory model require that even unordered accesses do not “tear” (bits of their values will not be mixed). In practice, this means the underlying data block of a growable SharedArrayBuffer cannot be grown by being copied without stopping the world. We do not recommend stopping the world as an implementation strategy because it introduces a serialization point and is slow.

            Grown memory must appear zeroed from the moment of its creation, including to any racy accesses in parallel. This can be accomplished via zero-filled-on-demand virtual memory pages, or careful synchronization if manually zeroing memory.

            Integer-indexed property access on TypedArray views of growable SharedArrayBuffers is intended to be optimizable similarly to access on TypedArray views of non-growable SharedArrayBuffers, because integer-indexed property loads on are not synchronizing on the underlying buffer's length (see programmer guidelines above). For example, bounds checks for property accesses may still be hoisted out of loops.

            In practice it is difficult to implement growable SharedArrayBuffer by copying on hosts that do not have virtual memory, such as those running on embedded devices without an MMU. Memory usage behaviour of growable SharedArrayBuffers on such hosts may significantly differ from that of hosts with virtual memory. Such hosts should clearly communicate memory usage expectations to users.

            @@ -43582,21 +46569,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 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 +46662,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*. @@ -43734,8 +46725,8 @@

            1. Perform ? RequireInternalSlot(_view_, [[DataView]]). 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. If IsBigIntElementType(_type_) is *true*, let _number_ be ? ToBigInt(_value_). + 1. Else, let _number_ be ? ToNumber(_value_). 1. Set _isLittleEndian_ to ToBoolean(_isLittleEndian_). 1. Let _viewOffset_ be _view_.[[ByteOffset]]. 1. Let _viewRecord_ be MakeDataViewWithBufferWitnessRecord(_view_, ~unordered~). @@ -43745,7 +46736,7 @@

            1. Let _elementSize_ be the Element Size value specified in for Element Type _type_. 1. If _getIndex_ + _elementSize_ > _viewSize_, throw a *RangeError* exception. 1. Let _bufferIndex_ be _getIndex_ + _viewOffset_. - 1. Perform SetValueInBuffer(_view_.[[ViewedArrayBuffer]], _bufferIndex_, _type_, _numberValue_, *false*, ~unordered~, _isLittleEndian_). + 1. Perform SetValueInBuffer(_view_.[[ViewedArrayBuffer]], _bufferIndex_, _type_, _number_, *false*, ~unordered~, _isLittleEndian_). 1. Return *undefined*. @@ -43759,10 +46750,10 @@

            The DataView Constructor

          • is the initial value of the *"DataView"* property of the global object.
          • creates and initializes a new DataView when called as a constructor.
          • 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 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.
          • +
          • 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 built-in methods of `DataView.prototype`.
          • - +

            DataView ( _buffer_ [ , _byteOffset_ [ , _byteLength_ ] ] )

            This function performs the following steps when called:

            @@ -43781,16 +46772,16 @@

            DataView ( _buffer_ [ , _byteOffset_ [ , _byteLength_ ] ] )

            1. Else, 1. Let _viewByteLength_ be ? ToIndex(_byteLength_). 1. If _offset_ + _viewByteLength_ > _bufferByteLength_, throw a *RangeError* exception. - 1. Let _O_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%DataView.prototype%"*, « [[DataView]], [[ViewedArrayBuffer]], [[ByteLength]], [[ByteOffset]] »). + 1. Let _obj_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%DataView.prototype%"*, « [[DataView]], [[ViewedArrayBuffer]], [[ByteLength]], [[ByteOffset]] »). 1. If IsDetachedBuffer(_buffer_) is *true*, throw a *TypeError* exception. 1. Set _bufferByteLength_ to ArrayBufferByteLength(_buffer_, ~seq-cst~). 1. If _offset_ > _bufferByteLength_, throw a *RangeError* exception. 1. If _byteLength_ is not *undefined*, then 1. If _offset_ + _viewByteLength_ > _bufferByteLength_, throw a *RangeError* exception. - 1. Set _O_.[[ViewedArrayBuffer]] to _buffer_. - 1. Set _O_.[[ByteLength]] to _viewByteLength_. - 1. Set _O_.[[ByteOffset]] to _offset_. - 1. Return _O_. + 1. Set _obj_.[[ViewedArrayBuffer]] to _buffer_. + 1. Set _obj_.[[ByteLength]] to _viewByteLength_. + 1. Set _obj_.[[ByteOffset]] to _offset_. + 1. Return _obj_.
            @@ -43820,42 +46811,42 @@

            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:

            - 1. Let _O_ be the *this* value. - 1. Perform ? RequireInternalSlot(_O_, [[DataView]]). - 1. Assert: _O_ has a [[ViewedArrayBuffer]] internal slot. - 1. Let _buffer_ be _O_.[[ViewedArrayBuffer]]. + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[DataView]]). + 1. Assert: _obj_ has a [[ViewedArrayBuffer]] internal slot. + 1. Let _buffer_ be _obj_.[[ViewedArrayBuffer]]. 1. Return _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:

            - 1. Let _O_ be the *this* value. - 1. Perform ? RequireInternalSlot(_O_, [[DataView]]). - 1. Assert: _O_ has a [[ViewedArrayBuffer]] internal slot. - 1. Let _viewRecord_ be MakeDataViewWithBufferWitnessRecord(_O_, ~seq-cst~). + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[DataView]]). + 1. Assert: _obj_ has a [[ViewedArrayBuffer]] internal slot. + 1. Let _viewRecord_ be MakeDataViewWithBufferWitnessRecord(_obj_, ~seq-cst~). 1. If IsViewOutOfBounds(_viewRecord_) is *true*, throw a *TypeError* exception. 1. Let _size_ be GetViewByteLength(_viewRecord_). 1. Return 𝔽(_size_).
            - +

            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:

            - 1. Let _O_ be the *this* value. - 1. Perform ? RequireInternalSlot(_O_, [[DataView]]). - 1. Assert: _O_ has a [[ViewedArrayBuffer]] internal slot. - 1. Let _viewRecord_ be MakeDataViewWithBufferWitnessRecord(_O_, ~seq-cst~). + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[DataView]]). + 1. Assert: _obj_ has a [[ViewedArrayBuffer]] internal slot. + 1. Let _viewRecord_ be MakeDataViewWithBufferWitnessRecord(_obj_, ~seq-cst~). 1. If IsViewOutOfBounds(_viewRecord_) is *true*, throw a *TypeError* exception. - 1. Let _offset_ be _O_.[[ByteOffset]]. + 1. Let _offset_ be _obj_.[[ByteOffset]]. 1. Return 𝔽(_offset_).
            @@ -43865,201 +46856,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* }.

            @@ -44091,21 +47102,23 @@

            The Atomics Object

            Waiter Record

            -

            A Waiter Record is a Record value used to denote a particular call to `Atomics.wait` or `Atomics.waitAsync`.

            +

            A Waiter Record is a Record used to denote a particular call to `Atomics.wait` or `Atomics.waitAsync`.

            A Waiter Record has fields listed in .

            - - - - - + + + + + + +
            - Field Name - - Value - - Meaning -
            + Field Name + + Value + + Meaning +
            [[AgentSignifier]] @@ -44160,17 +47173,19 @@

            WaiterList Records

            A WaiterList Record has fields listed in .

            - - - - - + + + + + + +
            - Field Name - - Value - - Meaning -
            + Field Name + + Value + + Meaning +
            [[Waiters]] @@ -44206,19 +47221,19 @@

            Abstract Operations for Atomics

            ValidateIntegerTypedArray ( - _typedArray_: an ECMAScript language value, + _ta_: an ECMAScript language value, _waitable_: a Boolean, ): either a normal completion containing a TypedArray With Buffer Witness Record, or a throw completion

            - 1. Let _taRecord_ be ? ValidateTypedArray(_typedArray_, ~unordered~). - 1. NOTE: Bounds checking is not a synchronizing operation when _typedArray_'s backing buffer is a growable SharedArrayBuffer. + 1. Let _taRecord_ be ? ValidateTypedArray(_ta_, ~unordered~). + 1. NOTE: Bounds checking is not a synchronizing operation when _ta_'s backing buffer is a growable SharedArrayBuffer. 1. If _waitable_ is *true*, then - 1. If _typedArray_.[[TypedArrayName]] is neither *"Int32Array"* nor *"BigInt64Array"*, throw a *TypeError* exception. + 1. If _ta_.[[TypedArrayName]] is neither *"Int32Array"* nor *"BigInt64Array"*, throw a *TypeError* exception. 1. Else, - 1. Let _type_ be TypedArrayElementType(_typedArray_). + 1. Let _type_ be TypedArrayElementType(_ta_). 1. If IsUnclampedIntegerElementType(_type_) is *false* and IsBigIntElementType(_type_) is *false*, throw a *TypeError* exception. 1. Return _taRecord_. @@ -44229,7 +47244,7 @@

            ValidateAtomicAccess ( _taRecord_: a TypedArray With Buffer Witness Record, _requestIndex_: an ECMAScript language value, - ): either a normal completion containing an integer or a throw completion + ): either a normal completion containing a non-negative integer or a throw completion

            @@ -44238,9 +47253,9 @@

            1. Let _accessIndex_ be ? ToIndex(_requestIndex_). 1. Assert: _accessIndex_ ≥ 0. 1. If _accessIndex_ ≥ _length_, throw a *RangeError* exception. - 1. Let _typedArray_ be _taRecord_.[[Object]]. - 1. Let _elementSize_ be TypedArrayElementSize(_typedArray_). - 1. Let _offset_ be _typedArray_.[[ByteOffset]]. + 1. Let _ta_ be _taRecord_.[[Object]]. + 1. Let _elementSize_ be TypedArrayElementSize(_ta_). + 1. Let _offset_ be _ta_.[[ByteOffset]]. 1. Return (_accessIndex_ × _elementSize_) + _offset_. @@ -44248,16 +47263,14 @@

            ValidateAtomicAccessOnIntegerTypedArray ( - _typedArray_: an ECMAScript language value, + _ta_: an ECMAScript language value, _requestIndex_: an ECMAScript language value, - optional _waitable_: a Boolean, - ): either a normal completion containing an integer or a throw completion + ): either a normal completion containing a non-negative 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(_ta_, *false*). 1. Return ? ValidateAtomicAccess(_taRecord_, _requestIndex_).
            @@ -44265,19 +47278,19 @@

            RevalidateAtomicAccess ( - _typedArray_: a TypedArray, - _byteIndexInBuffer_: an integer, + _ta_: a TypedArray, + _byteIndexInBuffer_: a non-negative integer, ): either a normal completion containing ~unused~ or a throw completion

            description
            -
            This operation revalidates the index within the backing buffer for atomic operations after all argument coercions are performed in Atomics methods, as argument coercions can have arbitrary side effects, which could cause the buffer to become out of bounds. This operation does not throw when _typedArray_'s backing buffer is a SharedArrayBuffer.
            +
            This operation revalidates the index within the backing buffer for atomic operations after all argument coercions are performed in Atomics methods, as argument coercions can have arbitrary side effects, which could cause the buffer to become out of bounds. This operation does not throw when _ta_'s backing buffer is a SharedArrayBuffer.
            - 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_typedArray_, ~unordered~). - 1. NOTE: Bounds checking is not a synchronizing operation when _typedArray_'s backing buffer is a growable SharedArrayBuffer. + 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_ta_, ~unordered~). + 1. NOTE: Bounds checking is not a synchronizing operation when _ta_'s backing buffer is a growable SharedArrayBuffer. 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception. - 1. Assert: _byteIndexInBuffer_ ≥ _typedArray_.[[ByteOffset]]. + 1. Assert: _byteIndexInBuffer_ ≥ _ta_.[[ByteOffset]]. 1. If _byteIndexInBuffer_ ≥ _taRecord_.[[CachedBufferByteLength]], throw a *RangeError* exception. 1. Return ~unused~. @@ -44301,21 +47314,22 @@

            EnterCriticalSection ( - _WL_: a WaiterList Record, + _waiterList_: a WaiterList Record, ): ~unused~

            1. Assert: The surrounding agent is not in the critical section for any WaiterList Record. - 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. Wait until no agent is in the critical section for _waiterList_, then enter the critical section for _waiterList_ (without allowing any other agent to enter). + 1. If _waiterList_.[[MostRecentLeaveEvent]] is not ~empty~, then + 1. NOTE: A _waiterList_ whose critical section has been entered at least once has a Synchronize event set by LeaveCriticalSection. + 1. Let _agentRecord_ be the Agent Record of the surrounding agent. + 1. Let _execution_ be _agentRecord_.[[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]]. - 1. Append (_WL_.[[MostRecentLeaveEvent]], _enterEvent_) to _eventsRecord_.[[AgentSynchronizesWith]]. + 1. Append (_waiterList_.[[MostRecentLeaveEvent]], _enterEvent_) to _eventsRecord_.[[AgentSynchronizesWith]]. 1. Return ~unused~.

            EnterCriticalSection has contention when an agent attempting to enter the critical section must wait for another agent to leave it. When there is no contention, FIFO order of EnterCriticalSection calls is observable. When there is contention, an implementation may choose an arbitrary order but may not cause an agent to wait indefinitely.

            @@ -44324,19 +47338,20 @@

            LeaveCriticalSection ( - _WL_: a WaiterList Record, + _waiterList_: a WaiterList Record, ): ~unused~

            - 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. Assert: The surrounding agent is in the critical section for _waiterList_. + 1. Let _agentRecord_ be the Agent Record of the surrounding agent. + 1. Let _execution_ be _agentRecord_.[[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]]. - 1. Set _WL_.[[MostRecentLeaveEvent]] to _leaveEvent_. - 1. Leave the critical section for _WL_. + 1. Set _waiterList_.[[MostRecentLeaveEvent]] to _leaveEvent_. + 1. Leave the critical section for _waiterList_. 1. Return ~unused~.
            @@ -44344,16 +47359,16 @@

            AddWaiter ( - _WL_: a WaiterList Record, + _waiterList_: a WaiterList Record, _waiterRecord_: a Waiter Record, ): ~unused~

            - 1. Assert: The surrounding agent is in the critical section for _WL_. - 1. Assert: There is no Waiter Record in _WL_.[[Waiters]] whose [[PromiseCapability]] field is _waiterRecord_.[[PromiseCapability]] and whose [[AgentSignifier]] field is _waiterRecord_.[[AgentSignifier]]. - 1. Append _waiterRecord_ to _WL_.[[Waiters]]. + 1. Assert: The surrounding agent is in the critical section for _waiterList_. + 1. Assert: There is no Waiter Record in _waiterList_.[[Waiters]] whose [[PromiseCapability]] field is _waiterRecord_.[[PromiseCapability]] and whose [[AgentSignifier]] field is _waiterRecord_.[[AgentSignifier]]. + 1. Append _waiterRecord_ to _waiterList_.[[Waiters]]. 1. Return ~unused~.
            @@ -44361,16 +47376,16 @@

            RemoveWaiter ( - _WL_: a WaiterList Record, + _waiterList_: a WaiterList Record, _waiterRecord_: a Waiter Record, ): ~unused~

            - 1. Assert: The surrounding agent is in the critical section for _WL_. - 1. Assert: _WL_.[[Waiters]] contains _waiterRecord_. - 1. Remove _waiterRecord_ from _WL_.[[Waiters]]. + 1. Assert: The surrounding agent is in the critical section for _waiterList_. + 1. Assert: _waiterList_.[[Waiters]] contains _waiterRecord_. + 1. Remove _waiterRecord_ from _waiterList_.[[Waiters]]. 1. Return ~unused~.
            @@ -44378,40 +47393,40 @@

            RemoveWaiters ( - _WL_: a WaiterList Record, - _c_: a non-negative integer or +∞, + _waiterList_: a WaiterList Record, + _count_: a non-negative integer or +∞, ): a List of Waiter Records

            - 1. Assert: The surrounding agent is in the critical section for _WL_. - 1. Let _len_ be the number of elements in _WL_.[[Waiters]]. - 1. Let _n_ be min(_c_, _len_). - 1. Let _L_ be a List whose elements are the first _n_ elements of _WL_.[[Waiters]]. - 1. Remove the first _n_ elements of _WL_.[[Waiters]]. - 1. Return _L_. + 1. Assert: The surrounding agent is in the critical section for _waiterList_. + 1. Let _length_ be the number of elements in _waiterList_.[[Waiters]]. + 1. Set _count_ to min(_count_, _length_). + 1. Let _waiters_ be a List whose elements are the first _count_ elements of _waiterList_.[[Waiters]]. + 1. Remove the first _count_ elements of _waiterList_.[[Waiters]]. + 1. Return _waiters_.

            SuspendThisAgent ( - _WL_: a WaiterList Record, + _waiterList_: a WaiterList Record, _waiterRecord_: a Waiter Record, ): ~unused~

            - 1. Assert: The surrounding agent is in the critical section for _WL_. - 1. Assert: _WL_.[[Waiters]] contains _waiterRecord_. + 1. Assert: The surrounding agent is in the critical section for _waiterList_. + 1. Assert: _waiterList_.[[Waiters]] contains _waiterRecord_. 1. Let _thisAgent_ be AgentSignifier(). 1. Assert: _waiterRecord_.[[AgentSignifier]] is _thisAgent_. 1. Assert: _waiterRecord_.[[PromiseCapability]] is ~blocking~. 1. Assert: AgentCanSuspend() is *true*. - 1. Perform LeaveCriticalSection(_WL_) and suspend the surrounding agent until the time is _waiterRecord_.[[TimeoutTime]], performing the combined operation in such a way that a notification that arrives after the critical section is exited but before the suspension takes effect is not lost. The surrounding agent can only wake from suspension due to a timeout or due to another agent calling NotifyWaiter with arguments _WL_ and _thisAgent_ (i.e. via a call to `Atomics.notify`). - 1. Perform EnterCriticalSection(_WL_). + 1. Perform LeaveCriticalSection(_waiterList_) and suspend the surrounding agent until the time is _waiterRecord_.[[TimeoutTime]], performing the combined operation in such a way that a notification that arrives after the critical section is exited but before the suspension takes effect is not lost. The surrounding agent can only wake from suspension due to a timeout or due to another agent calling NotifyWaiter with arguments _waiterList_ and _thisAgent_ (i.e. via a call to `Atomics.notify`). + 1. Perform EnterCriticalSection(_waiterList_). 1. Return ~unused~.
            @@ -44419,14 +47434,14 @@

            NotifyWaiter ( - _WL_: a WaiterList Record, + _waiterList_: a WaiterList Record, _waiterRecord_: a Waiter Record, ): ~unused~

            - 1. Assert: The surrounding agent is in the critical section for _WL_. + 1. Assert: The surrounding agent is in the critical section for _waiterList_. 1. If _waiterRecord_.[[PromiseCapability]] is ~blocking~, then 1. Wake the agent whose signifier is _waiterRecord_.[[AgentSignifier]] from suspension. 1. NOTE: This causes the agent to resume execution in SuspendThisAgent. @@ -44447,7 +47462,7 @@

            EnqueueResolveInAgentJob ( _agentSignifier_: an agent signifier, _promiseCapability_: a PromiseCapability Record, - _resolution_: an ECMAScript language value, + _resolution_: *"ok"* or *"timed-out"*, ): ~unused~

            @@ -44468,7 +47483,7 @@

            DoWait ( _mode_: ~sync~ or ~async~, - _typedArray_: an ECMAScript language value, + _ta_: an ECMAScript language value, _index_: an ECMAScript language value, _value_: an ECMAScript language value, _timeout_: an ECMAScript language value, @@ -44477,57 +47492,57 @@

            - 1. Let _taRecord_ be ? ValidateIntegerTypedArray(_typedArray_, *true*). + 1. Let _taRecord_ be ? ValidateIntegerTypedArray(_ta_, *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 _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. Let _byteIndexInBuffer_ be ? ValidateAtomicAccess(_taRecord_, _index_). + 1. Let _arrayTypeName_ be _ta_.[[TypedArrayName]]. + 1. If _arrayTypeName_ is *"BigInt64Array"*, let _expected_ be ? ToBigInt64(_value_). + 1. Else, let _expected_ be ? ToInt32(_value_). + 1. Let _timeoutNumber_ be ? ToNumber(_timeout_). + 1. If _timeoutNumber_ is either *NaN* or *+∞*𝔽, let _realTimeout_ be +∞. + 1. Else if _timeoutNumber_ is *-∞*𝔽, let _realTimeout_ be 0. + 1. Else, let _realTimeout_ be max(ℝ(_timeoutNumber_), 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. Let _waiterList_ be GetWaiterList(_block_, _byteIndexInBuffer_). 1. If _mode_ is ~sync~, then 1. Let _promiseCapability_ be ~blocking~. - 1. Let _resultObject_ be *undefined*. + 1. Let _resultObj_ be *undefined*. 1. Else, 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). - 1. Let _resultObject_ be OrdinaryObjectCreate(%Object.prototype%). - 1. Perform EnterCriticalSection(_WL_). - 1. Let _elementType_ be TypedArrayElementType(_typedArray_). - 1. Let _w_ be GetValueFromBuffer(_buffer_, _byteIndexInBuffer_, _elementType_, *true*, ~seq-cst~). - 1. If _v_ ≠ _w_, then - 1. Perform LeaveCriticalSection(_WL_). + 1. Let _resultObj_ be OrdinaryObjectCreate(%Object.prototype%). + 1. Perform EnterCriticalSection(_waiterList_). + 1. Let _elementType_ be TypedArrayElementType(_ta_). + 1. Let _witness_ be GetValueFromBuffer(_buffer_, _byteIndexInBuffer_, _elementType_, *true*, ~seq-cst~). + 1. If _expected_ ≠ _witness_, then + 1. Perform LeaveCriticalSection(_waiterList_). 1. If _mode_ is ~sync~, return *"not-equal"*. - 1. Perform ! CreateDataPropertyOrThrow(_resultObject_, *"async"*, *false*). - 1. Perform ! CreateDataPropertyOrThrow(_resultObject_, *"value"*, *"not-equal"*). - 1. Return _resultObject_. - 1. If _t_ = 0 and _mode_ is ~async~, then + 1. Perform ! CreateDataPropertyOrThrow(_resultObj_, *"async"*, *false*). + 1. Perform ! CreateDataPropertyOrThrow(_resultObj_, *"value"*, *"not-equal"*). + 1. Return _resultObj_. + 1. If _realTimeout_ = 0 and _mode_ is ~async~, then 1. NOTE: There is no special handling of synchronous immediate timeouts. Asynchronous immediate timeouts have special handling in order to fail fast and avoid unnecessary Promise jobs. - 1. Perform LeaveCriticalSection(_WL_). - 1. Perform ! CreateDataPropertyOrThrow(_resultObject_, *"async"*, *false*). - 1. Perform ! CreateDataPropertyOrThrow(_resultObject_, *"value"*, *"timed-out"*). - 1. Return _resultObject_. + 1. Perform LeaveCriticalSection(_waiterList_). + 1. Perform ! CreateDataPropertyOrThrow(_resultObj_, *"async"*, *false*). + 1. Perform ! CreateDataPropertyOrThrow(_resultObj_, *"value"*, *"timed-out"*). + 1. Return _resultObj_. 1. Let _thisAgent_ be AgentSignifier(). 1. Let _now_ be the time value (UTC) identifying the current time. 1. Let _additionalTimeout_ be an implementation-defined non-negative mathematical value. - 1. Let _timeoutTime_ be ℝ(_now_) + _t_ + _additionalTimeout_. - 1. NOTE: When _t_ is +∞, _timeoutTime_ is also +∞. + 1. Let _timeoutTime_ be ℝ(_now_) + _realTimeout_ + _additionalTimeout_. + 1. NOTE: When _realTimeout_ is +∞, _timeoutTime_ is also +∞. 1. Let _waiterRecord_ be a new Waiter Record { [[AgentSignifier]]: _thisAgent_, [[PromiseCapability]]: _promiseCapability_, [[TimeoutTime]]: _timeoutTime_, [[Result]]: *"ok"* }. - 1. Perform AddWaiter(_WL_, _waiterRecord_). + 1. Perform AddWaiter(_waiterList_, _waiterRecord_). 1. If _mode_ is ~sync~, then - 1. Perform SuspendThisAgent(_WL_, _waiterRecord_). + 1. Perform SuspendThisAgent(_waiterList_, _waiterRecord_). 1. Else if _timeoutTime_ is finite, then - 1. Perform EnqueueAtomicsWaitAsyncTimeoutJob(_WL_, _waiterRecord_). - 1. Perform LeaveCriticalSection(_WL_). + 1. Perform EnqueueAtomicsWaitAsyncTimeoutJob(_waiterList_, _waiterRecord_). + 1. Perform LeaveCriticalSection(_waiterList_). 1. If _mode_ is ~sync~, return _waiterRecord_.[[Result]]. - 1. Perform ! CreateDataPropertyOrThrow(_resultObject_, *"async"*, *true*). - 1. Perform ! CreateDataPropertyOrThrow(_resultObject_, *"value"*, _promiseCapability_.[[Promise]]). - 1. Return _resultObject_. + 1. Perform ! CreateDataPropertyOrThrow(_resultObj_, *"async"*, *true*). + 1. Perform ! CreateDataPropertyOrThrow(_resultObj_, *"value"*, _promiseCapability_.[[Promise]]). + 1. Return _resultObj_.

            _additionalTimeout_ allows implementations to pad timeouts as necessary, such as for reducing power consumption or coarsening timer resolution to mitigate timing attacks. This value may differ from call to call of DoWait.

            @@ -44537,22 +47552,22 @@

            EnqueueAtomicsWaitAsyncTimeoutJob ( - _WL_: a WaiterList Record, + _waiterList_: a WaiterList Record, _waiterRecord_: a Waiter Record, ): ~unused~

            - 1. Let _timeoutJob_ be a new Job Abstract Closure with no parameters that captures _WL_ and _waiterRecord_ and performs the following steps when called: - 1. Perform EnterCriticalSection(_WL_). - 1. If _WL_.[[Waiters]] contains _waiterRecord_, then + 1. Let _timeoutJob_ be a new Job Abstract Closure with no parameters that captures _waiterList_ and _waiterRecord_ and performs the following steps when called: + 1. Perform EnterCriticalSection(_waiterList_). + 1. If _waiterList_.[[Waiters]] contains _waiterRecord_, then 1. Let _timeOfJobExecution_ be the time value (UTC) identifying the current time. 1. Assert: ℝ(_timeOfJobExecution_) ≥ _waiterRecord_.[[TimeoutTime]] (ignoring potential non-monotonicity of time values). 1. Set _waiterRecord_.[[Result]] to *"timed-out"*. - 1. Perform RemoveWaiter(_WL_, _waiterRecord_). - 1. Perform NotifyWaiter(_WL_, _waiterRecord_). - 1. Perform LeaveCriticalSection(_WL_). + 1. Perform RemoveWaiter(_waiterList_, _waiterRecord_). + 1. Perform NotifyWaiter(_waiterList_, _waiterRecord_). + 1. Perform LeaveCriticalSection(_waiterList_). 1. Return ~unused~. 1. Let _now_ be the time value (UTC) identifying the current time. 1. Let _currentRealm_ be the current Realm Record. @@ -44574,7 +47589,8 @@

            - 1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record. + 1. Let _agentRecord_ be the Agent Record of the surrounding agent. + 1. Let _execution_ be _agentRecord_.[[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. @@ -44594,7 +47610,7 @@

            AtomicReadModifyWrite ( - _typedArray_: an ECMAScript language value, + _ta_: an ECMAScript language value, _index_: an ECMAScript language value, _value_: an ECMAScript language value, _op_: a read-modify-write modification function, @@ -44602,16 +47618,16 @@

            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. Perform ? RevalidateAtomicAccess(_typedArray_, _byteIndexInBuffer_). - 1. Let _buffer_ be _typedArray_.[[ViewedArrayBuffer]]. - 1. Let _elementType_ be TypedArrayElementType(_typedArray_). - 1. Return GetModifySetValueInBuffer(_buffer_, _byteIndexInBuffer_, _elementType_, _v_, _op_). + 1. Let _byteIndexInBuffer_ be ? ValidateAtomicAccessOnIntegerTypedArray(_ta_, _index_). + 1. If _ta_.[[ContentType]] is ~bigint~, let _coerced_ be ? ToBigInt(_value_). + 1. Else, let _coerced_ be 𝔽(? ToIntegerOrInfinity(_value_)). + 1. Perform ? RevalidateAtomicAccess(_ta_, _byteIndexInBuffer_). + 1. Let _buffer_ be _ta_.[[ViewedArrayBuffer]]. + 1. Let _elementType_ be TypedArrayElementType(_ta_). + 1. Return GetModifySetValueInBuffer(_buffer_, _byteIndexInBuffer_, _elementType_, _coerced_, _op_).
            @@ -44667,13 +47683,14 @@

            - -

            Atomics.add ( _typedArray_, _index_, _value_ )

            + +

            Atomics.add ( _ta_, _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 _ta_ and performs the following steps atomically when called: + 1. Let _type_ be TypedArrayElementType(_ta_). + 1. Let _agentRecord_ be the Agent Record of the surrounding agent. + 1. Let _isLittleEndian_ be _agentRecord_.[[LittleEndian]]. 1. Let _x_ be RawBytesToNumeric(_type_, _xBytes_, _isLittleEndian_). 1. Let _y_ be RawBytesToNumeric(_type_, _yBytes_, _isLittleEndian_). 1. If _x_ is a Number, then @@ -44684,37 +47701,38 @@

            Atomics.add ( _typedArray_, _index_, _value_ )

            1. Let _sumBytes_ be NumericToRawBytes(_type_, _sum_, _isLittleEndian_). 1. Assert: _sumBytes_, _xBytes_, and _yBytes_ have the same number of elements. 1. Return _sumBytes_. - 1. Return ? AtomicReadModifyWrite(_typedArray_, _index_, _value_, _add_). + 1. Return ? AtomicReadModifyWrite(_ta_, _index_, _value_, _add_).
            - -

            Atomics.and ( _typedArray_, _index_, _value_ )

            + +

            Atomics.and ( _ta_, _index_, _value_ )

            This function performs the following steps when called:

            1. Let _and_ be a new read-modify-write modification function with parameters (_xBytes_, _yBytes_) that captures nothing and performs the following steps atomically when called: 1. Return ByteListBitwiseOp(`&`, _xBytes_, _yBytes_). - 1. Return ? AtomicReadModifyWrite(_typedArray_, _index_, _value_, _and_). + 1. Return ? AtomicReadModifyWrite(_ta_, _index_, _value_, _and_).
            - -

            Atomics.compareExchange ( _typedArray_, _index_, _expectedValue_, _replacementValue_ )

            + +

            Atomics.compareExchange ( _ta_, _index_, _expectedValue_, _replacementValue_ )

            This function performs the following steps when called:

            - 1. Let _byteIndexInBuffer_ be ? ValidateAtomicAccessOnIntegerTypedArray(_typedArray_, _index_). - 1. Let _buffer_ be _typedArray_.[[ViewedArrayBuffer]]. + 1. Let _byteIndexInBuffer_ be ? ValidateAtomicAccessOnIntegerTypedArray(_ta_, _index_). + 1. Let _buffer_ be _ta_.[[ViewedArrayBuffer]]. 1. Let _block_ be _buffer_.[[ArrayBufferData]]. - 1. If _typedArray_.[[ContentType]] is ~bigint~, then + 1. If _ta_.[[ContentType]] is ~bigint~, then 1. Let _expected_ be ? ToBigInt(_expectedValue_). 1. Let _replacement_ be ? ToBigInt(_replacementValue_). 1. Else, 1. Let _expected_ be 𝔽(? ToIntegerOrInfinity(_expectedValue_)). 1. Let _replacement_ be 𝔽(? ToIntegerOrInfinity(_replacementValue_)). - 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. Perform ? RevalidateAtomicAccess(_ta_, _byteIndexInBuffer_). + 1. Let _elementType_ be TypedArrayElementType(_ta_). + 1. Let _elementSize_ be TypedArrayElementSize(_ta_). + 1. Let _agentRecord_ be the Agent Record of the surrounding agent. + 1. Let _isLittleEndian_ be _agentRecord_.[[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,79 +47745,124 @@

            Atomics.compareExchange ( _typedArray_, _index_, _expectedValue_, _replaceme - -

            Atomics.exchange ( _typedArray_, _index_, _value_ )

            + +

            Atomics.exchange ( _ta_, _index_, _value_ )

            This function performs the following steps when called:

            1. Let _second_ be a new read-modify-write modification function with parameters (_oldBytes_, _newBytes_) that captures nothing and performs the following steps atomically when called: 1. Return _newBytes_. - 1. Return ? AtomicReadModifyWrite(_typedArray_, _index_, _value_, _second_). + 1. Return ? AtomicReadModifyWrite(_ta_, _index_, _value_, _second_).
            - +

            Atomics.isLockFree ( _size_ )

            This function performs the following steps when called:

            1. Let _n_ be ? ToIntegerOrInfinity(_size_). - 1. Let _AR_ be the Agent Record of the surrounding agent. - 1. If _n_ = 1, return _AR_.[[IsLockFree1]]. - 1. If _n_ = 2, return _AR_.[[IsLockFree2]]. + 1. Let _agentRecord_ be the Agent Record of the surrounding agent. + 1. If _n_ = 1, return _agentRecord_.[[IsLockFree1]]. + 1. If _n_ = 2, return _agentRecord_.[[IsLockFree2]]. 1. If _n_ = 4, return *true*. - 1. If _n_ = 8, return _AR_.[[IsLockFree8]]. + 1. If _n_ = 8, return _agentRecord_.[[IsLockFree8]]. 1. Return *false*.

            This function is an optimization primitive. The intuition is that if the atomic step of an atomic primitive (`compareExchange`, `load`, `store`, `add`, `sub`, `and`, `or`, `xor`, or `exchange`) on a datum of size _n_ bytes will be performed without the surrounding agent acquiring a lock outside the _n_ bytes comprising the datum, then `Atomics.isLockFree`(_n_) will return *true*. High-performance algorithms will use this function to determine whether to use locks or atomic operations in critical sections. If an atomic primitive is not lock-free then it is often more efficient for an algorithm to provide its own locking.

            `Atomics.isLockFree`(4) always returns *true* as that can be supported on all known relevant hardware. Being able to assume this will generally simplify programs.

            -

            Regardless of the value returned by this function, all atomic operations are guaranteed to be atomic. For example, they will never have a visible operation take place in the middle of the operation (e.g., "tearing").

            +

            Regardless of the value returned by this function, all atomic operations are guaranteed to be atomic. For example, they will never have a visible operation take place in the middle of the operation (e.g., “tearing”).

            - -

            Atomics.load ( _typedArray_, _index_ )

            + +

            Atomics.load ( _ta_, _index_ )

            This function performs the following steps when called:

            - 1. Let _byteIndexInBuffer_ be ? ValidateAtomicAccessOnIntegerTypedArray(_typedArray_, _index_). - 1. Perform ? RevalidateAtomicAccess(_typedArray_, _byteIndexInBuffer_). - 1. Let _buffer_ be _typedArray_.[[ViewedArrayBuffer]]. - 1. Let _elementType_ be TypedArrayElementType(_typedArray_). + 1. Let _byteIndexInBuffer_ be ? ValidateAtomicAccessOnIntegerTypedArray(_ta_, _index_). + 1. Perform ? RevalidateAtomicAccess(_ta_, _byteIndexInBuffer_). + 1. Let _buffer_ be _ta_.[[ViewedArrayBuffer]]. + 1. Let _elementType_ be TypedArrayElementType(_ta_). 1. Return GetValueFromBuffer(_buffer_, _byteIndexInBuffer_, _elementType_, *true*, ~seq-cst~).
            - -

            Atomics.or ( _typedArray_, _index_, _value_ )

            + +

            Atomics.notify ( _ta_, _index_, _count_ )

            +

            This function notifies some agents that are sleeping in the wait queue.

            +

            It performs the following steps when called:

            + + 1. Let _taRecord_ be ? ValidateIntegerTypedArray(_ta_, *true*). + 1. Let _byteIndexInBuffer_ be ? ValidateAtomicAccess(_taRecord_, _index_). + 1. If _count_ is *undefined*, then + 1. Set _count_ to +∞. + 1. Else, + 1. Let _intCount_ be ? ToIntegerOrInfinity(_count_). + 1. Set _count_ to max(_intCount_, 0). + 1. Let _buffer_ be _ta_.[[ViewedArrayBuffer]]. + 1. Let _block_ be _buffer_.[[ArrayBufferData]]. + 1. If IsSharedArrayBuffer(_buffer_) is *false*, return *+0*𝔽. + 1. Let _waiterList_ be GetWaiterList(_block_, _byteIndexInBuffer_). + 1. Perform EnterCriticalSection(_waiterList_). + 1. Let _waiters_ be RemoveWaiters(_waiterList_, _count_). + 1. For each element _waiterRecord_ of _waiters_, do + 1. Perform NotifyWaiter(_waiterList_, _waiterRecord_). + 1. Perform LeaveCriticalSection(_waiterList_). + 1. Let _waitersCount_ be the number of elements in _waiters_. + 1. Return 𝔽(_waitersCount_). + +
            + + +

            Atomics.or ( _ta_, _index_, _value_ )

            This function performs the following steps when called:

            1. Let _or_ be a new read-modify-write modification function with parameters (_xBytes_, _yBytes_) that captures nothing and performs the following steps atomically when called: 1. Return ByteListBitwiseOp(`|`, _xBytes_, _yBytes_). - 1. Return ? AtomicReadModifyWrite(_typedArray_, _index_, _value_, _or_). + 1. Return ? AtomicReadModifyWrite(_ta_, _index_, _value_, _or_).
            - -

            Atomics.store ( _typedArray_, _index_, _value_ )

            + +

            Atomics.pause ( )

            +

            This function provides a hint to the CPU that the program is spin looping while waiting on a value.

            +

            It performs the following steps when called:

            + + 1. If the execution environment of the ECMAScript implementation supports signaling to the operating system or CPU that the current executing code is in a spin-wait loop, send that signal. + 1. Return *undefined*. + + +

            This method is designed for programs implementing spin-wait loops, such as spinlock fast paths inside of mutexes, to provide a hint to the CPU that it is spinning while waiting on a value. It has no observable behaviour other than timing.

            +

            Implementations are expected to implement a pause or yield instruction if the best practices of the underlying architecture recommends such instructions in spin loops. For example, the Intel Optimization Manual recommends the pause instruction.

            +

            Implementations are encouraged to have an internal upper bound on the maximum amount of time paused on the order of tens to hundreds of nanoseconds.

            +
            + +

            Due to the overhead of function calls, it is reasonable that an inlined call to this method in an optimizing compiler waits a different amount of time than a non-inlined call.

            +
            +
            + + +

            Atomics.store ( _ta_, _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. Perform ? RevalidateAtomicAccess(_typedArray_, _byteIndexInBuffer_). - 1. Let _buffer_ be _typedArray_.[[ViewedArrayBuffer]]. - 1. Let _elementType_ be TypedArrayElementType(_typedArray_). - 1. Perform SetValueInBuffer(_buffer_, _byteIndexInBuffer_, _elementType_, _v_, *true*, ~seq-cst~). - 1. Return _v_. + 1. Let _byteIndexInBuffer_ be ? ValidateAtomicAccessOnIntegerTypedArray(_ta_, _index_). + 1. If _ta_.[[ContentType]] is ~bigint~, let _coerced_ be ? ToBigInt(_value_). + 1. Else, let _coerced_ be 𝔽(? ToIntegerOrInfinity(_value_)). + 1. Perform ? RevalidateAtomicAccess(_ta_, _byteIndexInBuffer_). + 1. Let _buffer_ be _ta_.[[ViewedArrayBuffer]]. + 1. Let _elementType_ be TypedArrayElementType(_ta_). + 1. Perform SetValueInBuffer(_buffer_, _byteIndexInBuffer_, _elementType_, _coerced_, *true*, ~seq-cst~). + 1. Return _coerced_.
            - -

            Atomics.sub ( _typedArray_, _index_, _value_ )

            + +

            Atomics.sub ( _ta_, _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 _ta_ and performs the following steps atomically when called: + 1. Let _type_ be TypedArrayElementType(_ta_). + 1. Let _agentRecord_ be the Agent Record of the surrounding agent. + 1. Let _isLittleEndian_ be _agentRecord_.[[LittleEndian]]. 1. Let _x_ be RawBytesToNumeric(_type_, _xBytes_, _isLittleEndian_). 1. Let _y_ be RawBytesToNumeric(_type_, _yBytes_, _isLittleEndian_). 1. If _x_ is a Number, then @@ -44810,66 +47873,41 @@

            Atomics.sub ( _typedArray_, _index_, _value_ )

            1. Let _differenceBytes_ be NumericToRawBytes(_type_, _difference_, _isLittleEndian_). 1. Assert: _differenceBytes_, _xBytes_, and _yBytes_ have the same number of elements. 1. Return _differenceBytes_. - 1. Return ? AtomicReadModifyWrite(_typedArray_, _index_, _value_, _subtract_). + 1. Return ? AtomicReadModifyWrite(_ta_, _index_, _value_, _subtract_).
            - -

            Atomics.wait ( _typedArray_, _index_, _value_, _timeout_ )

            + +

            Atomics.wait ( _ta_, _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:

            - 1. Return ? DoWait(~sync~, _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.

            -

            It performs the following steps when called:

            - - 1. Return ? DoWait(~async~, _typedArray_, _index_, _value_, _timeout_). + 1. Return ? DoWait(~sync~, _ta_, _index_, _value_, _timeout_).
            - -

            Atomics.notify ( _typedArray_, _index_, _count_ )

            -

            This function notifies some agents that are sleeping in the wait queue.

            + +

            Atomics.waitAsync ( _ta_, _index_, _value_, _timeout_ )

            +

            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. Let _byteIndexInBuffer_ be ? ValidateAtomicAccessOnIntegerTypedArray(_typedArray_, _index_, *true*). - 1. If _count_ is *undefined*, then - 1. Let _c_ be +∞. - 1. Else, - 1. Let _intCount_ be ? ToIntegerOrInfinity(_count_). - 1. Let _c_ be max(_intCount_, 0). - 1. Let _buffer_ be _typedArray_.[[ViewedArrayBuffer]]. - 1. Let _block_ be _buffer_.[[ArrayBufferData]]. - 1. If IsSharedArrayBuffer(_buffer_) is *false*, return *+0*𝔽. - 1. Let _WL_ be GetWaiterList(_block_, _byteIndexInBuffer_). - 1. Perform EnterCriticalSection(_WL_). - 1. Let _S_ be RemoveWaiters(_WL_, _c_). - 1. For each element _W_ of _S_, do - 1. Perform NotifyWaiter(_WL_, _W_). - 1. Perform LeaveCriticalSection(_WL_). - 1. Let _n_ be the number of elements in _S_. - 1. Return 𝔽(_n_). + 1. Return ? DoWait(~async~, _ta_, _index_, _value_, _timeout_).
            - -

            Atomics.xor ( _typedArray_, _index_, _value_ )

            + +

            Atomics.xor ( _ta_, _index_, _value_ )

            This function performs the following steps when called:

            1. Let _xor_ be a new read-modify-write modification function with parameters (_xBytes_, _yBytes_) that captures nothing and performs the following steps atomically when called: 1. Return ByteListBitwiseOp(`^`, _xBytes_, _yBytes_). - 1. Return ? AtomicReadModifyWrite(_typedArray_, _index_, _value_, _xor_). + 1. Return ? AtomicReadModifyWrite(_ta_, _index_, _value_, _xor_).
            - -

            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 +47926,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 ( _obj_ )

            +

            This function performs the following steps when called:

            + + 1. If _obj_ is an Object and _obj_ 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 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, + _value_: an ECMAScript language value, + ): a JSON Parse Record +

            +
            +
            description
            +
            It recursively combines a _parseNode_ parsed from JSON text and the _value_ produced by its evaluation.
            +
            + + 1. Let _typedValueNode_ be ShallowestContainedJSONValue(_parseNode_). + 1. Assert: _typedValueNode_ is not ~empty~. + 1. Let _elements_ be a new empty List. + 1. Let _entries_ be a new empty List. + 1. If _value_ is an Object, then + 1. Let _isArray_ be ! IsArray(_value_). + 1. If _isArray_ is *true*, then + 1. Assert: _typedValueNode_ is an |ArrayLiteral| Parse Node. + 1. Let _contentNodes_ be the JSONArrayLiteralContentNodes of _typedValueNode_. + 1. Let _length_ be the number of elements in _contentNodes_. + 1. Let _valueLength_ be ! LengthOfArrayLike(_value_). + 1. Assert: _valueLength_ is _length_. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _length_, + 1. Let _propertyName_ be ! ToString(𝔽(_index_)). + 1. Let _elementParseRecord_ be CreateJSONParseRecord(_contentNodes_[_index_], _propertyName_, ! Get(_value_, _propertyName_)). + 1. Append _elementParseRecord_ to _elements_. + 1. Set _index_ to _index_ + 1. + 1. Else, + 1. Assert: _typedValueNode_ is an |ObjectLiteral| Parse Node. + 1. Let _propertyNodes_ be the PropertyDefinitionNodes of _typedValueNode_. + 1. NOTE: Because _value_ 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(_value_, ~key~). + 1. For each String _propertyKey_ 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 _propertyName_ be the PropName of _propertyNode_. + 1. If _propertyName_ is _propertyKey_, 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_, _propertyKey_, ! Get(_value_, _propertyKey_)). + 1. Append _entryParseRecord_ to _entries_. + 1. Else, + 1. Assert: _typedValueNode_ is neither an |ArrayLiteral| Parse Node nor an |ObjectLiteral| Parse Node. + 1. Return the JSON Parse Record { [[ParseNode]]: _typedValueNode_, [[Key]]: _key_, [[Value]]: _value_, [[Elements]]: _elements_, [[Entries]]: _entries_ }. + +

            @@ -44923,6 +48079,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

            @@ -44932,67 +48089,174 @@

            It performs the following steps when called:

            - 1. Let _val_ be ? Get(_holder_, _name_). - 1. If _val_ is an Object, then - 1. Let _isArray_ be ? IsArray(_val_). + 1. Let _value_ be ? Get(_holder_, _name_). + 1. Let _context_ be OrdinaryObjectCreate(%Object.prototype%). + 1. If _parseRecord_ is a JSON Parse Record and SameValue(_parseRecord_.[[Value]], _value_) is *true*, then + 1. If _value_ 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 _value_ is an Object, then + 1. Let _isArray_ be ? IsArray(_value_). 1. If _isArray_ is *true*, then - 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 _elementRecordsLength_ be the number of elements in _elementRecords_. + 1. Let _length_ be ? LengthOfArrayLike(_value_). + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_index_)). + 1. If _index_ < _elementRecordsLength_, let _elementRecord_ be _elementRecords_[_index_]; else let _elementRecord_ be ~empty~. + 1. Let _newElement_ be ? InternalizeJSONProperty(_value_, _propertyKey_, _reviver_, _elementRecord_). 1. If _newElement_ is *undefined*, then - 1. Perform ? _val_.[[Delete]](_prop_). + 1. Perform ? _value_.[[Delete]](_propertyKey_). 1. Else, - 1. Perform ? CreateDataProperty(_val_, _prop_, _newElement_). - 1. Set _I_ to _I_ + 1. + 1. Perform ? CreateDataProperty(_value_, _propertyKey_, _newElement_). + 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. Let _keys_ be ? EnumerableOwnProperties(_value_, ~key~). + 1. For each String _propertyKey_ of _keys_, do + 1. If there exists an element _entry_ of _entryRecords_ such that _entry_.[[Key]] is _propertyKey_, let _entryRecord_ be _entry_; else let _entryRecord_ be ~empty~. + 1. Let _newElement_ be ? InternalizeJSONProperty(_value_, _propertyKey_, _reviver_, _entryRecord_). 1. If _newElement_ is *undefined*, then - 1. Perform ? _val_.[[Delete]](_P_). + 1. Perform ? _value_.[[Delete]](_propertyKey_). 1. Else, - 1. Perform ? CreateDataProperty(_val_, _P_, _newElement_). - 1. Return ? Call(_reviver_, _holder_, « _name_, _val_ »). + 1. Perform ? CreateDataProperty(_value_, _propertyKey_, _newElement_). + 1. Return ? Call(_reviver_, _holder_, « _name_, _value_, _context_ »). -

            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.

            -
            + + +

            + 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 _activeFunc_ be the active function object. + 1. Assert: _activeFunc_ is a `JSON.parse` built-in function object (see JSON.parse). + 1. Let _types_ be « |NullLiteral|, |BooleanLiteral|, |NumericLiteral|, |StringLiteral|, |ArrayLiteral|, |ObjectLiteral|, |UnaryExpression| ». + 1. Let _unaryExpr_ 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 _unaryExpr_ to _candidate_. + 1. Else if _type_ is |NumericLiteral|, then + 1. Assert: _candidate_ is contained within _unaryExpr_. + 1. Return _unaryExpr_. + 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 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. + +
            + + + +

            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:

            1. Let _stack_ be a new empty List. 1. Let _indent_ be the empty String. - 1. Let _PropertyList_ be *undefined*. - 1. Let _ReplacerFunction_ be *undefined*. + 1. Let _propertyList_ be *undefined*. + 1. Let _replacerFunc_ be *undefined*. 1. If _replacer_ is an Object, then 1. If IsCallable(_replacer_) is *true*, then - 1. Set _ReplacerFunction_ to _replacer_. + 1. Set _replacerFunc_ to _replacer_. 1. Else, 1. Let _isArray_ be ? IsArray(_replacer_). 1. If _isArray_ is *true*, then - 1. Set _PropertyList_ to a new empty List. - 1. Let _len_ be ? LengthOfArrayLike(_replacer_). + 1. Set _propertyList_ to a new empty List. + 1. Let _length_ be ? LengthOfArrayLike(_replacer_). 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. Let _prop_ be ! ToString(𝔽(_k_)). - 1. Let _v_ be ? Get(_replacer_, _prop_). + 1. Repeat, while _k_ < _length_, + 1. Let _propertyKey_ be ! ToString(𝔽(_k_)). + 1. Let _propertyValue_ be ? Get(_replacer_, _propertyKey_). 1. Let _item_ be *undefined*. - 1. If _v_ is a String, then - 1. Set _item_ to _v_. - 1. Else if _v_ is a Number, then - 1. Set _item_ to ! ToString(_v_). - 1. Else if _v_ is an Object, then - 1. If _v_ has a [[StringData]] or [[NumberData]] internal slot, set _item_ to ? ToString(_v_). - 1. If _item_ is not *undefined* and _PropertyList_ does not contain _item_, then - 1. Append _item_ to _PropertyList_. + 1. If _propertyValue_ is a String, then + 1. Set _item_ to _propertyValue_. + 1. Else if _propertyValue_ is a Number, then + 1. Set _item_ to ! ToString(_propertyValue_). + 1. Else if _propertyValue_ is an Object, then + 1. If _propertyValue_ has a [[StringData]] or [[NumberData]] internal slot, set _item_ to ? ToString(_propertyValue_). + 1. If _item_ is not *undefined* and _propertyList_ does not contain _item_, then + 1. Append _item_ to _propertyList_. 1. Set _k_ to _k_ + 1. 1. If _space_ is an Object, then 1. If _space_ has a [[NumberData]] internal slot, then @@ -45002,14 +48266,14 @@

            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%). 1. Perform ! CreateDataPropertyOrThrow(_wrapper_, the empty String, _value_). - 1. Let _state_ be the JSON Serialization Record { [[ReplacerFunction]]: _ReplacerFunction_, [[Stack]]: _stack_, [[Indent]]: _indent_, [[Gap]]: _gap_, [[PropertyList]]: _PropertyList_ }. + 1. Let _state_ be the JSON Serialization Record { [[ReplacerFunction]]: _replacerFunc_, [[Stack]]: _stack_, [[Indent]]: _indent_, [[Gap]]: _gap_, [[PropertyList]]: _propertyList_ }. 1. Return ? SerializeJSONProperty(_state_, the empty String, _wrapper_).

            The *"length"* property of this function is *3*𝔽.

            @@ -45053,15 +48317,17 @@

            JSON.stringify ( _value_ [ , _replacer_ [ , _space_ ] ] )

            JSON Serialization Record

            -

            A JSON Serialization Record is a Record value used to enable serialization to the JSON format.

            +

            A JSON Serialization Record is a Record used to enable serialization to the JSON format.

            JSON Serialization Records have the fields listed in .

            - - - - - + + + + + + + @@ -45110,6 +48376,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 @@ -45128,7 +48398,8 @@

            1. If _value_ is a BigInt, throw a *TypeError* exception. 1. If _value_ is an Object and IsCallable(_value_) is *false*, then 1. Let _isArray_ be ? IsArray(_value_). - 1. If _isArray_ is *true*, return ? SerializeJSONArray(_state_, _value_). + 1. If _isArray_ is *true*, then + 1. Return ? SerializeJSONArray(_state_, _value_). 1. Return ? SerializeJSONObject(_state_, _value_). 1. Return *undefined*. @@ -45146,30 +48417,32 @@

            1. Let _product_ be the String value consisting solely of the code unit 0x0022 (QUOTATION MARK). - 1. For each code point _C_ of StringToCodePoints(_value_), do - 1. If _C_ is listed in the “Code Point” column of , then - 1. Set _product_ to the string-concatenation of _product_ and the escape sequence for _C_ as specified in the “Escape Sequence” column of the corresponding row. - 1. Else if _C_ has a numeric value less than 0x0020 (SPACE) or _C_ has the same numeric value as a leading surrogate or trailing surrogate, then - 1. Let _unit_ be the code unit whose numeric value is the numeric value of _C_. + 1. For each code point _codePoint_ of StringToCodePoints(_value_), do + 1. If _codePoint_ is listed in the “Code Point” column of , then + 1. Set _product_ to the string-concatenation of _product_ and the escape sequence for _codePoint_ as specified in the “Escape Sequence” column of the corresponding row. + 1. Else if _codePoint_ has a numeric value less than 0x0020 (SPACE) or _codePoint_ has the same numeric value as a leading surrogate or trailing surrogate, then + 1. Let _unit_ be the code unit whose numeric value is the numeric value of _codePoint_. 1. Set _product_ to the string-concatenation of _product_ and UnicodeEscape(_unit_). 1. Else, - 1. Set _product_ to the string-concatenation of _product_ and UTF16EncodeCodePoint(_C_). + 1. Set _product_ to the string-concatenation of _product_ and UTF16EncodeCodePoint(_codePoint_). 1. Set _product_ to the string-concatenation of _product_ and the code unit 0x0022 (QUOTATION MARK). 1. Return _product_.

            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 @@ -45254,15 +48527,15 @@

            UnicodeEscape ( - _C_: a code unit, + _codeUnit_: a code unit, ): a String

            description
            -
            It represents _C_ as a Unicode escape sequence.
            +
            It represents _codeUnit_ as a Unicode escape sequence.
            - 1. Let _n_ be the numeric value of _C_. + 1. Let _n_ be the numeric value of _codeUnit_. 1. Assert: _n_ ≤ 0xFFFF. 1. Let _hex_ be the String representation of _n_, formatted as a lowercase hexadecimal number. 1. Return the string-concatenation of the code unit 0x005C (REVERSE SOLIDUS), *"u"*, and StringPad(_hex_, 4, *"0"*, ~start~). @@ -45283,21 +48556,21 @@

            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]]. + 1. Let _keys_ be _state_.[[PropertyList]]. 1. Else, - 1. Let _K_ be ? EnumerableOwnProperties(_value_, ~key~). + 1. Let _keys_ be ? EnumerableOwnProperties(_value_, ~key~). 1. Let _partial_ be a new empty List. - 1. For each element _P_ of _K_, do - 1. Let _strP_ be ? SerializeJSONProperty(_state_, _P_, _value_). - 1. If _strP_ is not *undefined*, then - 1. Let _member_ be QuoteJSONString(_P_). + 1. For each element _propertyKey_ of _keys_, do + 1. Let _stringP_ be ? SerializeJSONProperty(_state_, _propertyKey_, _value_). + 1. If _stringP_ is not *undefined*, then + 1. Let _member_ be QuoteJSONString(_propertyKey_). 1. Set _member_ to the string-concatenation of _member_ and *":"*. 1. If _state_.[[Gap]] is not the empty String, then 1. Set _member_ to the string-concatenation of _member_ and the code unit 0x0020 (SPACE). - 1. Set _member_ to the string-concatenation of _member_ and _strP_. + 1. Set _member_ to the string-concatenation of _member_ and _stringP_. 1. Append _member_ to _partial_. 1. If _partial_ is empty, then 1. Let _final_ be *"{}"*. @@ -45308,9 +48581,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_. @@ -45319,7 +48592,7 @@

            SerializeJSONArray ( _state_: a JSON Serialization Record, - _value_: an ECMAScript language value, + _value_: an Object, ): either a normal completion containing a String or a throw completion

            @@ -45329,17 +48602,17 @@

            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_). + 1. Let _length_ be ? LengthOfArrayLike(_value_). 1. Let _index_ be 0. - 1. Repeat, while _index_ < _len_, - 1. Let _strP_ be ? SerializeJSONProperty(_state_, ! ToString(𝔽(_index_)), _value_). - 1. If _strP_ is *undefined*, then + 1. Repeat, while _index_ < _length_, + 1. Let _stringP_ be ? SerializeJSONProperty(_state_, ! ToString(𝔽(_index_)), _value_). + 1. If _stringP_ is *undefined*, then 1. Append *"null"* to _partial_. 1. Else, - 1. Append _strP_ to _partial_. + 1. Append _stringP_ to _partial_. 1. Set _index_ to _index_ + 1. 1. If _partial_ is empty, then 1. Let _final_ be *"[]"*. @@ -45350,9 +48623,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 +48634,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* }.

            @@ -45391,11 +48664,11 @@

            The WeakRef Constructor

            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 in an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified `WeakRef` behaviour must include a `super` call to the `WeakRef` constructor to create and initialize the subclass instance with the internal state necessary to support the `WeakRef.prototype` built-in methods. + may be used as the value in an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified `WeakRef` behaviour must include a `super` call to the `WeakRef` constructor to create and initialize the subclass instance with the internal state necessary to support the built-in methods of `WeakRef.prototype`.
          • - +

            WeakRef ( _target_ )

            This function performs the following steps when called:

            @@ -45428,7 +48701,7 @@

            WeakRef.prototype

            Properties of the WeakRef Prototype Object

            -

            The WeakRef prototype object:

            +

            The WeakRef prototype object:

            • is %WeakRef.prototype%.
            • @@ -45442,11 +48715,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 +48744,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 +48777,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.

              @@ -45529,19 +48800,19 @@

              The FinalizationRegistry Constructor

              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 in an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified `FinalizationRegistry` behaviour must include a `super` call to the `FinalizationRegistry` constructor to create and initialize the subclass instance with the internal state necessary to support the `FinalizationRegistry.prototype` built-in methods. + may be used as the value in an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified `FinalizationRegistry` behaviour must include a `super` call to the `FinalizationRegistry` constructor to create and initialize the subclass instance with the internal state necessary to support the built-in methods of `FinalizationRegistry.prototype`.
            - +

            FinalizationRegistry ( _cleanupCallback_ )

            This function performs the following steps when called:

            1. If NewTarget is *undefined*, throw a *TypeError* exception. 1. If IsCallable(_cleanupCallback_) is *false*, throw a *TypeError* exception. 1. Let _finalizationRegistry_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%FinalizationRegistry.prototype%"*, « [[Realm]], [[CleanupCallback]], [[Cells]] »). - 1. Let _fn_ be the active function object. - 1. Set _finalizationRegistry_.[[Realm]] to _fn_.[[Realm]]. + 1. Let _activeFunc_ be the active function object. + 1. Set _finalizationRegistry_.[[Realm]] to _activeFunc_.[[Realm]]. 1. Set _finalizationRegistry_.[[CleanupCallback]] to HostMakeJobCallback(_cleanupCallback_). 1. Set _finalizationRegistry_.[[Cells]] to a new empty List. 1. Return _finalizationRegistry_. @@ -45568,7 +48839,7 @@

            FinalizationRegistry.prototype

            Properties of the FinalizationRegistry Prototype Object

            -

            The FinalizationRegistry prototype object:

            +

            The FinalizationRegistry prototype object:

            • is %FinalizationRegistry.prototype%.
            • @@ -45585,7 +48856,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 +48877,7 @@

              FinalizationRegistry.prototype.register ( _target_, _heldValue_ [ , _unregis - +

              FinalizationRegistry.prototype.unregister ( _unregisterToken_ )

              This method performs the following steps when called:

              @@ -45622,16 +48893,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 +48918,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 properties 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 +48951,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 +49015,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 +49110,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 +49154,711 @@

              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 _obj_ be *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[UnderlyingIterators]]). + 1. Assert: _obj_ has a [[GeneratorState]] internal slot. + 1. If _obj_.[[GeneratorState]] is ~suspended-start~, then + 1. Set _obj_.[[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 _obj_ can be discarded at this point. + 1. Perform ? IteratorCloseAll(_obj_.[[UnderlyingIterators]], NormalCompletion(~unused~)). + 1. Return CreateIteratorResultObject(*undefined*, *true*). + 1. Let _completion_ be ReturnCompletion(*undefined*). + 1. Return ? GeneratorResumeAbrupt(_obj_, _completion_, *"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 _iterator_ be ? Call(_iterable_.[[OpenMethod]], _iterable_.[[Iterable]]). + 1. If _iterator_ is not an Object, throw a *TypeError* exception. + 1. Let _iteratorRecord_ be ? GetIteratorDirect(_iterator_). + 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 ( _obj_ )

              + + 1. Let _iteratorRecord_ be ? GetIteratorFlattenable(_obj_, ~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 _obj_ be *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[Iterated]]). + 1. Let _iteratorRecord_ be _obj_.[[Iterated]]. + 1. Return ? Call(_iteratorRecord_.[[NextMethod]], _iteratorRecord_.[[Iterator]]). + +
              + + +

              %WrapForValidIteratorPrototype%.return ( )

              + + 1. Let _obj_ be *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[Iterated]]). + 1. Let _iterator_ be _obj_.[[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* }.

              +
              + + +

              Iterator.zip ( _iterables_ [ , _options_ ] )

              +

              This function performs the following steps when called:

              + + 1. If _iterables_ is not an Object, throw a *TypeError* exception. + 1. Set _options_ to ? GetOptionsObject(_options_). + 1. Let _mode_ be ? Get(_options_, *"mode"*). + 1. If _mode_ is *undefined*, set _mode_ to *"shortest"*. + 1. If _mode_ is not one of *"shortest"*, *"longest"*, or *"strict"*, throw a *TypeError* exception. + 1. Let _paddingOption_ be *undefined*. + 1. If _mode_ is *"longest"*, then + 1. Set _paddingOption_ to ? Get(_options_, *"padding"*). + 1. If _paddingOption_ is not *undefined* and _paddingOption_ is not an Object, throw a *TypeError* exception. + 1. Let _iters_ be a new empty List. + 1. Let _padding_ be a new empty List. + 1. Let _inputIter_ be ? GetIterator(_iterables_, ~sync~). + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to Completion(IteratorStepValue(_inputIter_)). + 1. IfAbruptCloseIterators(_next_, _iters_). + 1. If _next_ is not ~done~, then + 1. Let _iter_ be Completion(GetIteratorFlattenable(_next_, ~reject-primitives~)). + 1. Let _needClosing_ be the list-concatenation of « _inputIter_ » and _iters_. + 1. IfAbruptCloseIterators(_iter_, _needClosing_). + 1. Append _iter_ to _iters_. + 1. Let _iterCount_ be the number of elements in _iters_. + 1. If _mode_ is *"longest"*, then + 1. If _paddingOption_ is *undefined*, then + 1. Repeat _iterCount_ times: + 1. Append *undefined* to _padding_. + 1. Else, + 1. Let _paddingIter_ be Completion(GetIterator(_paddingOption_, ~sync~)). + 1. IfAbruptCloseIterators(_paddingIter_, _iters_). + 1. Let _usingIterator_ be *true*. + 1. Repeat _iterCount_ times: + 1. If _usingIterator_ is *true*, then + 1. Set _next_ to Completion(IteratorStepValue(_paddingIter_)). + 1. IfAbruptCloseIterators(_next_, _iters_). + 1. If _next_ is ~done~, then + 1. Set _usingIterator_ to *false*. + 1. Else, + 1. Append _next_ to _padding_. + 1. If _usingIterator_ is *false*, append *undefined* to _padding_. + 1. If _usingIterator_ is *true*, then + 1. Let _completion_ be Completion(IteratorClose(_paddingIter_, NormalCompletion(~unused~))). + 1. IfAbruptCloseIterators(_completion_, _iters_). + 1. Let _finishResults_ be a new Abstract Closure with parameters (_results_) that captures nothing and performs the following steps when called: + 1. Return CreateArrayFromList(_results_). + 1. Return IteratorZip(_iters_, _mode_, _padding_, _finishResults_). + +
              + + +

              Iterator.zipKeyed ( _iterables_ [ , _options_ ] )

              +

              This function performs the following steps when called:

              + + 1. If _iterables_ is not an Object, throw a *TypeError* exception. + 1. Set _options_ to ? GetOptionsObject(_options_). + 1. Let _mode_ be ? Get(_options_, *"mode"*). + 1. If _mode_ is *undefined*, set _mode_ to *"shortest"*. + 1. If _mode_ is not one of *"shortest"*, *"longest"*, or *"strict"*, throw a *TypeError* exception. + 1. Let _paddingOption_ be *undefined*. + 1. If _mode_ is *"longest"*, then + 1. Set _paddingOption_ to ? Get(_options_, *"padding"*). + 1. If _paddingOption_ is not *undefined* and _paddingOption_ is not an Object, throw a *TypeError* exception. + 1. Let _iters_ be a new empty List. + 1. Let _padding_ be a new empty List. + 1. Let _allKeys_ be ? _iterables_.[[OwnPropertyKeys]](). + 1. Let _keys_ be a new empty List. + 1. For each element _key_ of _allKeys_, do + 1. Let _propertyDesc_ be Completion(_iterables_.[[GetOwnProperty]](_key_)). + 1. IfAbruptCloseIterators(_propertyDesc_, _iters_). + 1. If _propertyDesc_ is not *undefined* and _propertyDesc_.[[Enumerable]] is *true*, then + 1. Let _value_ be Completion(Get(_iterables_, _key_)). + 1. IfAbruptCloseIterators(_value_, _iters_). + 1. If _value_ is not *undefined*, then + 1. Append _key_ to _keys_. + 1. Let _iter_ be Completion(GetIteratorFlattenable(_value_, ~reject-primitives~)). + 1. IfAbruptCloseIterators(_iter_, _iters_). + 1. Append _iter_ to _iters_. + 1. Let _iterCount_ be the number of elements in _iters_. + 1. If _mode_ is *"longest"*, then + 1. If _paddingOption_ is *undefined*, then + 1. Repeat _iterCount_ times: + 1. Append *undefined* to _padding_. + 1. Else, + 1. For each element _key_ of _keys_, do + 1. Let _value_ be Completion(Get(_paddingOption_, _key_)). + 1. IfAbruptCloseIterators(_value_, _iters_). + 1. Append _value_ to _padding_. + 1. Let _finishResults_ be a new Abstract Closure with parameters (_results_) that captures _keys_ and _iterCount_ and performs the following steps when called: + 1. Let _obj_ be OrdinaryObjectCreate(*null*). + 1. For each integer _i_ such that 0 ≤ _i_ < _iterCount_, in ascending order, do + 1. Perform ! CreateDataPropertyOrThrow(_obj_, _keys_[_i_], _results_[_i_]). + 1. Return _obj_. + 1. Return IteratorZip(_iters_, _mode_, _padding_, _finishResults_). + +
              +
              + + +

              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 [[Getter]] and [[Setter]] attributes are defined as follows:

              + + +

              get Iterator.prototype.constructor

              +

              The value of the [[Getter]] 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 [[Setter]] 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 _obj_ be the *this* value. + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _obj_, [[NextMethod]]: *undefined*, [[Done]]: *false* }. + 1. Let _numberLimit_ be Completion(ToNumber(_limit_)). + 1. IfAbruptCloseIterator(_numberLimit_, _iterated_). + 1. If _numberLimit_ is *NaN*, then + 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Let _intLimit_ be ! ToIntegerOrInfinity(_numberLimit_). + 1. If _intLimit_ < 0, then + 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Set _iterated_ to ? GetIteratorDirect(_obj_). + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _intLimit_ and performs the following steps when called: + 1. Let _remaining_ be _intLimit_. + 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 _obj_ be the *this* value. + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _obj_, [[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(_obj_). + 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 _obj_ be the *this* value. + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _obj_, [[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(_obj_). + 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 _obj_ be the *this* value. + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _obj_, [[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(_obj_). + 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 _obj_ be the *this* value. + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _obj_, [[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(_obj_). + 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 _obj_ be the *this* value. + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _obj_, [[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(_obj_). + 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 _obj_ be the *this* value. + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _obj_, [[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(_obj_). + 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 _obj_ be the *this* value. + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _obj_, [[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(_obj_). + 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 _obj_ be the *this* value. + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _obj_, [[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(_obj_). + 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 _obj_ be the *this* value. + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _obj_, [[NextMethod]]: *undefined*, [[Done]]: *false* }. + 1. Let _numberLimit_ be Completion(ToNumber(_limit_)). + 1. IfAbruptCloseIterator(_numberLimit_, _iterated_). + 1. If _numberLimit_ is *NaN*, then + 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Let _intLimit_ be ! ToIntegerOrInfinity(_numberLimit_). + 1. If _intLimit_ < 0, then + 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Set _iterated_ to ? GetIteratorDirect(_obj_). + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _intLimit_ and performs the following steps when called: + 1. Let _remaining_ be _intLimit_. + 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 _obj_ be the *this* value. + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. Let _iterated_ be ? GetIteratorDirect(_obj_). + 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.dispose% ] ( )

              +

              This method performs the following steps when called:

              + + 1. Let _obj_ be the *this* value. + 1. Let _return_ be ? GetMethod(_obj_, *"return"*). + 1. If _return_ is not *undefined*, then + 1. Perform ? Call(_return_, _obj_). + 1. Return *undefined*. + +

              The value of the *"name"* property of this method is *"[Symbol.dispose]"*.

              +
              + + +

              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 [[Getter]] and [[Setter]] attributes are defined as follows:

              + + +

              get Iterator.prototype [ %Symbol.toStringTag% ]

              +

              The value of the [[Getter]] 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 [[Setter]] 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.

              +
              +
              +
              + + +

              Abstract Operations for Iterators

              + + +

              + IteratorZip ( + _iters_: a List of Iterator Records, + _mode_: *"shortest"*, *"longest"*, or *"strict"*, + _padding_: a List of ECMAScript language values, + _finishResults_: an Abstract Closure that takes a List of ECMAScript language values and returns an ECMAScript language value, + ): a Generator +

              +
              +
              + + 1. Let _iterCount_ be the number of elements in _iters_. + 1. Let _openIters_ be a copy of _iters_. + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iters_, _iterCount_, _openIters_, _mode_, _padding_, and _finishResults_ and performs the following steps when called: + 1. If _iterCount_ = 0, return ReturnCompletion(*undefined*). + 1. Repeat, + 1. Let _results_ be a new empty List. + 1. Assert: _openIters_ is not empty. + 1. For each integer _i_ such that 0 ≤ _i_ < _iterCount_, in ascending order, do + 1. Let _iter_ be _iters_[_i_]. + 1. If _iter_ is *null*, then + 1. Assert: _mode_ is *"longest"*. + 1. Let _result_ be _padding_[_i_]. + 1. Else, + 1. Let _result_ be Completion(IteratorStepValue(_iter_)). + 1. If _result_ is an abrupt completion, then + 1. Remove _iter_ from _openIters_. + 1. Return ? IteratorCloseAll(_openIters_, _result_). + 1. Set _result_ to ! _result_. + 1. If _result_ is ~done~, then + 1. Remove _iter_ from _openIters_. + 1. If _mode_ is *"shortest"*, then + 1. Return ? IteratorCloseAll(_openIters_, ReturnCompletion(*undefined*)). + 1. Else if _mode_ is *"strict"*, then + 1. If _i_ ≠ 0, then + 1. Return ? IteratorCloseAll(_openIters_, ThrowCompletion(a newly created *TypeError* object)). + 1. For each integer _k_ such that 1 ≤ _k_ < _iterCount_, in ascending order, do + 1. Assert: _iters_[_k_] is not *null*. + 1. Let _open_ be Completion(IteratorStep(_iters_[_k_])). + 1. If _open_ is an abrupt completion, then + 1. Remove _iters_[_k_] from _openIters_. + 1. Return ? IteratorCloseAll(_openIters_, _open_). + 1. Set _open_ to ! _open_. + 1. If _open_ is ~done~, then + 1. Remove _iters_[_k_] from _openIters_. + 1. Else, + 1. Return ? IteratorCloseAll(_openIters_, ThrowCompletion(a newly created *TypeError* object)). + 1. Return ReturnCompletion(*undefined*). + 1. Else, + 1. Assert: _mode_ is *"longest"*. + 1. If _openIters_ is empty, return ReturnCompletion(*undefined*). + 1. Set _iters_[_i_] to *null*. + 1. Set _result_ to _padding_[_i_]. + 1. Append _result_ to _results_. + 1. Set _results_ to _finishResults_(_results_). + 1. Let _completion_ be Completion(Yield(_results_)). + 1. IfAbruptCloseIterators(_completion_, _openIters_). + 1. Let _gen_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterators]] »). + 1. Set _gen_.[[UnderlyingIterators]] to _openIters_. + 1. Return _gen_. + +
              @@ -45900,11 +49870,35 @@

              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.asyncDispose% ] ( )

              +

              This method performs the following steps when called:

              + + 1. Let _obj_ be the *this* value. + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _return_ be Completion(GetMethod(_obj_, *"return"*)). + 1. IfAbruptRejectPromise(_return_, _promiseCapability_). + 1. If _return_ is *undefined*, then + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « *undefined* »). + 1. Else, + 1. Let _result_ be Completion(Call(_return_, _obj_, « »)). + 1. IfAbruptRejectPromise(_result_, _promiseCapability_). + 1. Let _resultWrapper_ be Completion(PromiseResolve(%Promise%, _result_)). + 1. IfAbruptRejectPromise(_resultWrapper_, _promiseCapability_). + 1. Let _unwrap_ be a new Abstract Closure with no parameters that captures nothing and performs the following steps when called: + 1. Return *undefined*. + 1. Let _onFulfilled_ be CreateBuiltinFunction(_unwrap_, 1, *""*, « »). + 1. Perform PerformPromiseThen(_resultWrapper_, _onFulfilled_, *undefined*, _promiseCapability_). + 1. Return _promiseCapability_.[[Promise]]. + +

              The value of the *"name"* property of this method is *"[Symbol.asyncDispose]"*.

              +
              + + +

              %AsyncIteratorPrototype% [ %Symbol.asyncIterator% ] ( )

              This function performs the following steps when called:

              1. Return the *this* value. @@ -45915,7 +49909,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,42 +49934,43 @@

              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. - 1. Assert: _O_ is an Object that has a [[SyncIteratorRecord]] internal slot. + 1. Let _obj_ be the *this* value. + 1. Assert: _obj_ is an Object that has a [[SyncIteratorRecord]] internal slot. 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). - 1. Let _syncIteratorRecord_ be _O_.[[SyncIteratorRecord]]. + 1. Let _syncIteratorRecord_ be _obj_.[[SyncIteratorRecord]]. 1. If _value_ is present, then 1. Let _result_ be Completion(IteratorNext(_syncIteratorRecord_, _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 _obj_ be the *this* value. + 1. Assert: _obj_ 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 _obj_.[[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,23 +49980,30 @@

              %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 . - 1. Let _O_ be the *this* value. - 1. Assert: _O_ is an Object that has a [[SyncIteratorRecord]] internal slot. + 1. Let _obj_ be the *this* value. + 1. Assert: _obj_ 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 _obj_.[[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 +50013,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 +50056,8 @@

              AsyncFromSyncIteratorContinuation ( _result_: an Object, _promiseCapability_: a PromiseCapability Record for an intrinsic %Promise%, + _syncIteratorRecord_: an Iterator Record, + _closeOnRejection_: a Boolean, ): a Promise

              @@ -46066,18 +50070,489 @@

              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. 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. If _done_ is *true* or _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]]. + +

              Resource Management

              + + +

              Common Resource Management Interfaces

              + + +

              The Disposable Interface

              +

              The Disposable interface includes the properties described in :

              + +

              - Property - - Value - - Requirements -
              + Property + + Value + + Requirements +
              *"done"* @@ -45850,7 +49135,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*.
              + + + + + + + + + + +
              + Property + + Value + + Requirements +
              + `%Symbol.dispose%` + + a function object + +

              Invoking this method notifies the Disposable object that the caller does not intend to continue to use this object. This method should perform any necessary logic to perform explicit clean-up of the resource including, but not limited to, file system handles, streams, host objects, etc. When an exception is thrown from this method, it typically means that the resource could not be explicitly freed.

              +

              Invoking this method more than once on the same object should avoid repeating clean-up logic against the already-disposed resource and should not throw an exception, even if an exception was thrown on the first invocation. However, this requirement is not enforced.

              +

              When using a Disposable object with a `using` or `await using` declaration, the resource will be automatically disposed when the |Block| or |Module| immediately containing the declaration has been evaluated.

              +
              +
              +
              + + +

              The AsyncDisposable Interface

              +

              The AsyncDisposable interface includes the properties described in :

              + + + + + + + + + + + + +
              + Property + + Value + + Requirements +
              + `%Symbol.asyncDispose%` + + a function object that returns a promise + +

              Invoking this method notifies the AsyncDisposable object that the caller does not intend to continue to use this object. This method should perform any necessary logic to perform explicit clean-up of the resource including, but not limited to, file system handles, streams, host objects, etc. When the promise returned by this method is rejected, it typically means that the resource could not be explicitly freed. An AsyncDisposable object is not considered "disposed" until the resulting Promise has been fulfilled.

              +

              Invoking this method more than once on the same object should avoid repeating clean-up logic against the already-disposed resource and should not throw an exception or return a rejected promise, even if an exception was thrown or a rejected promise was returned on the first invocation. However, this requirement is not enforced.

              +

              When using an AsyncDisposable object with an `await using` declaration, the resource will be automatically disposed when the |Block| or |Module| immediately containing the declaration has been evaluated.

              +
              +
              +
              +
              +
              + + +

              DisposableStack Objects

              +

              A DisposableStack is an object that can be used to contain one or more resources that should be disposed together.

              +

              Any DisposableStack object is in one of two mutually exclusive states: disposed or pending. A disposable stack `d` is pending if and only if neither `d.dispose()` nor `d.move()` has been invoked for `d`.

              + + +

              The DisposableStack Constructor

              +

              The DisposableStack constructor:

              +
                +
              • is %DisposableStack%.
              • +
              • is the initial value of the *"DisposableStack"* property of the global object.
              • +
              • creates and initializes a new DisposableStack when called as a constructor.
              • +
              • 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 in an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified DisposableStack behaviour must include a `super` call to the DisposableStack constructor to create and initialize the subclass instance with the internal state necessary to support the built-in methods of `DisposableStack.prototype`.
              • +
              + + +

              DisposableStack ( )

              +

              This function performs the following steps when called:

              + + 1. If NewTarget is *undefined*, throw a *TypeError* exception. + 1. Let _disposableStack_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%DisposableStack.prototype%"*, « [[DisposableState]], [[DisposableResourceStack]] »). + 1. Set _disposableStack_.[[DisposableState]] to ~pending~. + 1. Set _disposableStack_.[[DisposableResourceStack]] to a new empty List. + 1. Return _disposableStack_. + +
              +
              + + +

              Properties of the DisposableStack Constructor

              +

              The DisposableStack constructor:

              +
                +
              • has a [[Prototype]] internal slot whose value is %Function.prototype%.
              • +
              • has the following properties:
              • +
              + + +

              DisposableStack.prototype

              +

              The initial value of `DisposableStack.prototype` is the DisposableStack prototype object.

              +

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

              +
              +
              + + +

              Properties of the DisposableStack Prototype Object

              +

              The DisposableStack prototype object:

              +
                +
              • is %DisposableStack.prototype%.
              • +
              • has a [[Prototype]] internal slot whose value is %Object.prototype%.
              • +
              • is an ordinary object.
              • +
              • does not have a [[DisposableState]] internal slot or any of the other internal slots of DisposableStack instances.
              • +
              + + +

              DisposableStack.prototype.adopt ( _value_, _onDispose_ )

              +

              This method performs the following steps when called:

              + + 1. Let _disposableStack_ be the *this* value. + 1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]). + 1. If _disposableStack_.[[DisposableState]] is ~disposed~, throw a *ReferenceError* exception. + 1. If IsCallable(_onDispose_) is *false*, throw a *TypeError* exception. + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _value_ and _onDispose_ and performs the following steps when called: + 1. Return ? Call(_onDispose_, *undefined*, « _value_ »). + 1. Let _func_ be CreateBuiltinFunction(_closure_, 0, *""*, « »). + 1. Perform ? AddDisposableResource(_disposableStack_.[[DisposableResourceStack]], *undefined*, ~sync-dispose~, _func_). + 1. Return _value_. + +
              + + +

              DisposableStack.prototype.constructor

              +

              The initial value of `DisposableStack.prototype.constructor` is %DisposableStack%.

              +
              + + +

              DisposableStack.prototype.defer ( _onDispose_ )

              +

              This method performs the following steps when called:

              + + 1. Let _disposableStack_ be the *this* value. + 1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]). + 1. If _disposableStack_.[[DisposableState]] is ~disposed~, throw a *ReferenceError* exception. + 1. If IsCallable(_onDispose_) is *false*, throw a *TypeError* exception. + 1. Perform ? AddDisposableResource(_disposableStack_.[[DisposableResourceStack]], *undefined*, ~sync-dispose~, _onDispose_). + 1. Return *undefined*. + +
              + + +

              DisposableStack.prototype.dispose ( )

              +

              This method performs the following steps when called:

              + + 1. Let _disposableStack_ be the *this* value. + 1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]). + 1. If _disposableStack_.[[DisposableState]] is ~disposed~, return *undefined*. + 1. Set _disposableStack_.[[DisposableState]] to ~disposed~. + 1. Return ? DisposeResources(_disposableStack_.[[DisposableResourceStack]], NormalCompletion(*undefined*)). + +
              + + +

              get DisposableStack.prototype.disposed

              +

              `DisposableStack.prototype.disposed` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

              + + 1. Let _disposableStack_ be the *this* value. + 1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]). + 1. If _disposableStack_.[[DisposableState]] is ~disposed~, return *true*. + 1. Return *false*. + +
              + + +

              DisposableStack.prototype.move ( )

              +

              This method performs the following steps when called:

              + + 1. Let _disposableStack_ be the *this* value. + 1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]). + 1. If _disposableStack_.[[DisposableState]] is ~disposed~, throw a *ReferenceError* exception. + 1. Let _newDisposableStack_ be ? OrdinaryCreateFromConstructor(%DisposableStack%, *"%DisposableStack.prototype%"*, « [[DisposableState]], [[DisposableResourceStack]] »). + 1. Set _newDisposableStack_.[[DisposableState]] to ~pending~. + 1. Set _newDisposableStack_.[[DisposableResourceStack]] to _disposableStack_.[[DisposableResourceStack]]. + 1. Set _disposableStack_.[[DisposableResourceStack]] to a new empty List. + 1. Set _disposableStack_.[[DisposableState]] to ~disposed~. + 1. Return _newDisposableStack_. + +
              + + +

              DisposableStack.prototype.use ( _value_ )

              +

              This method performs the following steps when called:

              + + 1. Let _disposableStack_ be the *this* value. + 1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]). + 1. If _disposableStack_.[[DisposableState]] is ~disposed~, throw a *ReferenceError* exception. + 1. Perform ? AddDisposableResource(_disposableStack_.[[DisposableResourceStack]], _value_, ~sync-dispose~). + 1. Return _value_. + +
              + + +

              DisposableStack.prototype [ %Symbol.dispose% ] ( )

              +

              The initial value of the `%Symbol.dispose%` property is %DisposableStack.prototype.dispose%, defined in .

              +
              + + +

              DisposableStack.prototype [ %Symbol.toStringTag% ]

              +

              The initial value of the `%Symbol.toStringTag%` property is the String value *"DisposableStack"*.

              +

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              +
              +
              + + +

              Properties of DisposableStack Instances

              +

              DisposableStack instances are ordinary objects that inherit properties from the DisposableStack prototype object (the intrinsic %DisposableStack.prototype%). DisposableStack instances are initially created with internal slots described in .

              + + + + + + + + + + + + + + + + + +
              + Internal Slot + + Type + + Description +
              + [[DisposableState]] + + ~pending~ or ~disposed~ + + Governs how a disposable stack will react to incoming calls to its `%Symbol.dispose%` method. +
              + [[DisposableResourceStack]] + + a List of DisposableResource Records + + Resources to be disposed when the disposable stack is disposed. Resources are added in the order they are initialized, and are disposed in reverse order. +
              +
              +
              +
              + + +

              AsyncDisposableStack Objects

              +

              An AsyncDisposableStack is an object that can be used to contain one or more resources that should be asynchronously disposed together.

              +

              Any AsyncDisposableStack object is in one of two mutually exclusive states: disposed or pending. An async-disposable stack `d` is pending if and only if neither `d.disposeAsync()` nor `d.move()` has been invoked for `d`.

              + + +

              The AsyncDisposableStack Constructor

              +

              The AsyncDisposableStack constructor:

              +
                +
              • is %AsyncDisposableStack%.
              • +
              • is the initial value of the *"AsyncDisposableStack"* property of the global object.
              • +
              • creates and initializes a new AsyncDisposableStack when called as a constructor.
              • +
              • 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 in an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified AsyncDisposableStack behaviour must include a `super` call to the AsyncDisposableStack constructor to create and initialize the subclass instance with the internal state necessary to support the built-in methods of `AsyncDisposableStack.prototype`.
              • +
              + + +

              AsyncDisposableStack ( )

              +

              This function performs the following steps when called:

              + + 1. If NewTarget is *undefined*, throw a *TypeError* exception. + 1. Let _asyncDisposableStack_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%AsyncDisposableStack.prototype%"*, « [[AsyncDisposableState]], [[DisposableResourceStack]] »). + 1. Set _asyncDisposableStack_.[[AsyncDisposableState]] to ~pending~. + 1. Set _asyncDisposableStack_.[[DisposableResourceStack]] to a new empty List. + 1. Return _asyncDisposableStack_. + +
              +
              + + +

              Properties of the AsyncDisposableStack Constructor

              +

              The AsyncDisposableStack constructor:

              +
                +
              • has a [[Prototype]] internal slot whose value is %Function.prototype%.
              • +
              • has the following properties:
              • +
              + + +

              AsyncDisposableStack.prototype

              +

              The initial value of `AsyncDisposableStack.prototype` is the AsyncDisposableStack prototype object.

              +

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

              +
              +
              + + +

              Properties of the AsyncDisposableStack Prototype Object

              +

              The AsyncDisposableStack prototype object:

              +
                +
              • is %AsyncDisposableStack.prototype%.
              • +
              • has a [[Prototype]] internal slot whose value is %Object.prototype%.
              • +
              • is an ordinary object.
              • +
              • does not have an [[AsyncDisposableState]] internal slot or any of the other internal slots of AsyncDisposableStack instances.
              • +
              + + +

              AsyncDisposableStack.prototype.adopt ( _value_, _onDisposeAsync_ )

              +

              This method performs the following steps when called:

              + + 1. Let _asyncDisposableStack_ be the *this* value. + 1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]). + 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception. + 1. If IsCallable(_onDisposeAsync_) is *false*, throw a *TypeError* exception. + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _value_ and _onDisposeAsync_ and performs the following steps when called: + 1. Return ? Call(_onDisposeAsync_, *undefined*, « _value_ »). + 1. Let _func_ be CreateBuiltinFunction(_closure_, 0, *""*, « »). + 1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposableResourceStack]], *undefined*, ~async-dispose~, _func_). + 1. Return _value_. + +
              + + +

              AsyncDisposableStack.prototype.constructor

              +

              The initial value of `AsyncDisposableStack.prototype.constructor` is %AsyncDisposableStack%.

              +
              + + +

              AsyncDisposableStack.prototype.defer ( _onDisposeAsync_ )

              +

              This method performs the following steps when called:

              + + 1. Let _asyncDisposableStack_ be the *this* value. + 1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]). + 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception. + 1. If IsCallable(_onDisposeAsync_) is *false*, throw a *TypeError* exception. + 1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposableResourceStack]], *undefined*, ~async-dispose~, _onDisposeAsync_). + 1. Return *undefined*. + +
              + + +

              AsyncDisposableStack.prototype.disposeAsync ( )

              +

              This async method performs the following steps when called:

              + + 1. Let _asyncDisposableStack_ be the *this* value. + 1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]). + 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, return *undefined*. + 1. Set _asyncDisposableStack_.[[AsyncDisposableState]] to ~disposed~. + 1. Return ? DisposeResources(_asyncDisposableStack_.[[DisposableResourceStack]], NormalCompletion(*undefined*)). + +
              + + +

              get AsyncDisposableStack.prototype.disposed

              +

              `AsyncDisposableStack.prototype.disposed` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

              + + 1. Let _asyncDisposableStack_ be the *this* value. + 1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]). + 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, return *true*. + 1. Return *false*. + +
              + + +

              AsyncDisposableStack.prototype.move ( )

              +

              This method performs the following steps when called:

              + + 1. Let _asyncDisposableStack_ be the *this* value. + 1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]). + 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception. + 1. Let _newAsyncDisposableStack_ be ? OrdinaryCreateFromConstructor(%AsyncDisposableStack%, *"%AsyncDisposableStack.prototype%"*, « [[AsyncDisposableState]], [[DisposableResourceStack]] »). + 1. Set _newAsyncDisposableStack_.[[AsyncDisposableState]] to ~pending~. + 1. Set _newAsyncDisposableStack_.[[DisposableResourceStack]] to _asyncDisposableStack_.[[DisposableResourceStack]]. + 1. Set _asyncDisposableStack_.[[DisposableResourceStack]] to a new empty List. + 1. Set _asyncDisposableStack_.[[AsyncDisposableState]] to ~disposed~. + 1. Return _newAsyncDisposableStack_. + +
              + + +

              AsyncDisposableStack.prototype.use ( _value_ )

              +

              This method performs the following steps when called:

              + + 1. Let _asyncDisposableStack_ be the *this* value. + 1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]). + 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception. + 1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposableResourceStack]], _value_, ~async-dispose~). + 1. Return _value_. + +
              + + +

              AsyncDisposableStack.prototype [ %Symbol.asyncDispose% ] ( )

              +

              The initial value of the `%Symbol.asyncDispose%` property is %AsyncDisposableStack.prototype.disposeAsync%, defined in .

              +
              + + +

              AsyncDisposableStack.prototype [ %Symbol.toStringTag% ]

              +

              The initial value of the `%Symbol.toStringTag%` property is the String value *"AsyncDisposableStack"*.

              +

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              +
              +
              + + +

              Properties of AsyncDisposableStack Instances

              +

              AsyncDisposableStack instances are ordinary objects that inherit properties from the AsyncDisposableStack prototype object (the intrinsic %AsyncDisposableStack.prototype%). AsyncDisposableStack instances are initially created with internal slots described in .

              + + + + + + + + + + + + + + + + + +
              + Internal Slot + + Type + + Description +
              + [[AsyncDisposableState]] + + ~pending~ or ~disposed~ + + Governs how a disposable stack will react to incoming calls to its `%Symbol.asyncDispose%` method. +
              + [[DisposableResourceStack]] + + a List of DisposableResource Records + + Resources to be disposed when the disposable stack is disposed. Resources are added in the order they are initialized, and are disposed in reverse order. +
              +
              +
              +
              +

              Promise Objects

              A Promise is an object that is used as a placeholder for the eventual results of a deferred (and possibly asynchronous) computation.

              @@ -46101,21 +50576,23 @@

              Promise Abstract Operations

              PromiseCapability Records

              -

              A PromiseCapability Record is a Record value used to encapsulate a Promise or promise-like object along with the functions that are capable of resolving or rejecting that promise. PromiseCapability Records are produced by the NewPromiseCapability abstract operation.

              +

              A PromiseCapability Record is a Record used to encapsulate a Promise or promise-like object along with the functions that are capable of resolving or rejecting that promise. PromiseCapability Records are produced by the NewPromiseCapability abstract operation.

              PromiseCapability Records have the fields listed in .

              - - - - - + + + + + + +
              - Field Name - - Value - - Meaning -
              + Field Name + + Value + + Meaning +
              [[Promise]] @@ -46164,29 +50641,30 @@

              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_.

              PromiseReaction Records

              -

              A PromiseReaction Record is a Record value used to store information about how a promise should react when it becomes resolved or rejected with a given value. PromiseReaction Records are created by the PerformPromiseThen abstract operation, and are used by the Abstract Closure returned by NewPromiseReactionJob.

              +

              A PromiseReaction Record is a Record used to store information about how a promise should react when it becomes resolved or rejected with a given value. PromiseReaction Records are created by the PerformPromiseThen abstract operation, and are used by the Abstract Closure returned by NewPromiseReactionJob.

              PromiseReaction Records have the fields listed in .

              - - - - - + + + + + + +
              - Field Name - - Value - - Meaning -
              + Field Name + + Value + + Meaning +
              [[Capability]] @@ -46224,57 +50702,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 +50735,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 +50757,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*. @@ -46323,28 +50771,28 @@

              NewPromiseCapability ( - _C_: an ECMAScript language value, + _ctor_: an ECMAScript language value, ): either a normal completion containing a PromiseCapability Record or a throw completion

              description
              -
              It attempts to use _C_ as a constructor in the fashion of the built-in Promise constructor to create a promise and extract its `resolve` and `reject` functions. The promise plus the `resolve` and `reject` functions are used to initialize a new PromiseCapability Record.
              -
              - - 1. If IsConstructor(_C_) is *false*, throw a *TypeError* exception. - 1. NOTE: _C_ is assumed to be a constructor function that supports the parameter conventions of the Promise constructor (see ). - 1. Let _resolvingFunctions_ be the Record { [[Resolve]]: *undefined*, [[Reject]]: *undefined* }. - 1. Let _executorClosure_ be a new Abstract Closure with parameters (_resolve_, _reject_) that captures _resolvingFunctions_ and performs the following steps when called: - 1. If _resolvingFunctions_.[[Resolve]] is not *undefined*, throw a *TypeError* exception. - 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*. +
              It attempts to use _ctor_ as a constructor in the fashion of the built-in Promise constructor to create a promise and extract its `resolve` and `reject` functions. The promise plus the `resolve` and `reject` functions are used to initialize a new PromiseCapability Record.
              + + + 1. If IsConstructor(_ctor_) is *false*, throw a *TypeError* exception. + 1. NOTE: _ctor_ is assumed to be a constructor function that supports the parameter conventions of the Promise constructor (see ). + 1. Let _resolvingFuncs_ be the Record { [[Resolve]]: *undefined*, [[Reject]]: *undefined* }. + 1. Let _executorClosure_ be a new Abstract Closure with parameters (_resolve_, _reject_) that captures _resolvingFuncs_ and performs the following steps when called: + 1. If _resolvingFuncs_.[[Resolve]] is not *undefined*, throw a *TypeError* exception. + 1. If _resolvingFuncs_.[[Reject]] is not *undefined*, throw a *TypeError* exception. + 1. Set _resolvingFuncs_.[[Resolve]] to _resolve_. + 1. Set _resolvingFuncs_.[[Reject]] to _reject_. + 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. - 1. If IsCallable(_resolvingFunctions_.[[Reject]]) is *false*, throw a *TypeError* exception. - 1. Return the PromiseCapability Record { [[Promise]]: _promise_, [[Resolve]]: _resolvingFunctions_.[[Resolve]], [[Reject]]: _resolvingFunctions_.[[Reject]] }. + 1. Let _promise_ be ? Construct(_ctor_, « _executor_ »). + 1. If IsCallable(_resolvingFuncs_.[[Resolve]]) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_resolvingFuncs_.[[Reject]]) is *false*, throw a *TypeError* exception. + 1. Return the PromiseCapability Record { [[Promise]]: _promise_, [[Resolve]]: _resolvingFuncs_.[[Resolve]], [[Reject]]: _resolvingFuncs_.[[Reject]] }.

              This abstract operation supports Promise subclassing, as it is generic on any constructor that calls a passed executor function argument in the same way as the Promise constructor. It is used to generalize static methods of the Promise constructor to any subclass.

              @@ -46354,7 +50802,7 @@

              IsPromise ( - _x_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): a Boolean

              @@ -46362,8 +50810,8 @@

              It checks for the promise brand on an object.

              - 1. If _x_ is not an Object, return *false*. - 1. If _x_ does not have a [[PromiseState]] internal slot, return *false*. + 1. If _arg_ is not an Object, return *false*. + 1. If _arg_ does not have a [[PromiseState]] internal slot, return *false*. 1. Return *true*.
              @@ -46378,7 +50826,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*. @@ -46394,7 +50842,7 @@

              TriggerPromiseReactions ( _reactions_: a List of PromiseReaction Records, - _argument_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): ~unused~

              @@ -46403,7 +50851,7 @@

              1. For each element _reaction_ of _reactions_, do - 1. Let _job_ be NewPromiseReactionJob(_reaction_, _argument_). + 1. Let _job_ be NewPromiseReactionJob(_reaction_, _arg_). 1. Perform HostEnqueuePromiseJob(_job_.[[Job]], _job_.[[Realm]]). 1. Return ~unused~. @@ -46446,7 +50894,7 @@

              Promise Jobs

              NewPromiseReactionJob ( _reaction_: a PromiseReaction Record, - _argument_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): a Record with fields [[Job]] (a Job Abstract Closure) and [[Realm]] (a Realm Record or *null*)

              @@ -46454,26 +50902,25 @@

              It returns a new Job Abstract Closure that applies the appropriate handler to the incoming value, and uses the handler's return value to resolve or reject the derived promise associated with that handler.

              - 1. Let _job_ be a new Job Abstract Closure with no parameters that captures _reaction_ and _argument_ and performs the following steps when called: + 1. Let _job_ be a new Job Abstract Closure with no parameters that captures _reaction_ and _arg_ and performs the following steps when called: 1. Let _promiseCapability_ be _reaction_.[[Capability]]. 1. Let _type_ be _reaction_.[[Type]]. 1. Let _handler_ be _reaction_.[[Handler]]. 1. If _handler_ is ~empty~, then 1. If _type_ is ~fulfill~, then - 1. Let _handlerResult_ be NormalCompletion(_argument_). + 1. Let _handlerResult_ be NormalCompletion(_arg_). 1. Else, 1. Assert: _type_ is ~reject~. - 1. Let _handlerResult_ be ThrowCompletion(_argument_). + 1. Let _handlerResult_ be ThrowCompletion(_arg_). 1. Else, - 1. Let _handlerResult_ be Completion(HostCallJobCallback(_handler_, *undefined*, « _argument_ »)). + 1. Let _handlerResult_ be Completion(HostCallJobCallback(_handler_, *undefined*, « _arg_ »)). 1. If _promiseCapability_ is *undefined*, then 1. Assert: _handlerResult_ is not an abrupt completion. 1. Return ~empty~. 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]])). @@ -46496,11 +50943,11 @@

              1. Let _job_ be a new Job Abstract Closure with no parameters that captures _promiseToResolve_, _thenable_, and _then_ and performs the following steps when called: - 1. Let _resolvingFunctions_ be CreateResolvingFunctions(_promiseToResolve_). - 1. Let _thenCallResult_ be Completion(HostCallJobCallback(_then_, _thenable_, « _resolvingFunctions_.[[Resolve]], _resolvingFunctions_.[[Reject]] »)). + 1. Let _resolvingFuncs_ be CreateResolvingFunctions(_promiseToResolve_). + 1. Let _thenCallResult_ be Completion(HostCallJobCallback(_then_, _thenable_, « _resolvingFuncs_.[[Resolve]], _resolvingFuncs_.[[Reject]] »)). 1. If _thenCallResult_ is an abrupt completion, then - 1. Return ? Call(_resolvingFunctions_.[[Reject]], *undefined*, « _thenCallResult_.[[Value]] »). - 1. Return ? _thenCallResult_. + 1. Return ? Call(_resolvingFuncs_.[[Reject]], *undefined*, « _thenCallResult_.[[Value]] »). + 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. @@ -46521,10 +50968,10 @@

              The Promise Constructor

            • is the initial value of the *"Promise"* property of the global object.
            • creates and initializes a new Promise when called as a constructor.
            • 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 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.
            • +
            • 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 built-in methods of `Promise` and `Promise.prototype`.
            • - +

              Promise ( _executor_ )

              This function performs the following steps when called:

              @@ -46532,13 +50979,14 @@

              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*. - 1. Let _resolvingFunctions_ be CreateResolvingFunctions(_promise_). - 1. Let _completion_ be Completion(Call(_executor_, *undefined*, « _resolvingFunctions_.[[Resolve]], _resolvingFunctions_.[[Reject]] »)). + 1. Let _resolvingFuncs_ be CreateResolvingFunctions(_promise_). + 1. Let _completion_ be Completion(Call(_executor_, *undefined*, « _resolvingFuncs_.[[Resolve]], _resolvingFuncs_.[[Reject]] »)). 1. If _completion_ is an abrupt completion, then - 1. Perform ? Call(_resolvingFunctions_.[[Reject]], *undefined*, « _completion_.[[Value]] »). + 1. Perform ? Call(_resolvingFuncs_.[[Reject]], *undefined*, « _completion_.[[Value]] »). 1. Return _promise_.
              @@ -46558,21 +51006,21 @@

              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.

              - 1. Let _C_ be the *this* value. - 1. Let _promiseCapability_ be ? NewPromiseCapability(_C_). - 1. Let _promiseResolve_ be Completion(GetPromiseResolve(_C_)). + 1. Let _ctor_ be the *this* value. + 1. Let _promiseCapability_ be ? NewPromiseCapability(_ctor_). + 1. Let _promiseResolve_ be Completion(GetPromiseResolve(_ctor_)). 1. IfAbruptRejectPromise(_promiseResolve_, _promiseCapability_). 1. Let _iteratorRecord_ be Completion(GetIterator(_iterable_, ~sync~)). 1. IfAbruptRejectPromise(_iteratorRecord_, _promiseCapability_). - 1. Let _result_ be Completion(PerformPromiseAll(_iteratorRecord_, _C_, _promiseCapability_, _promiseResolve_)). + 1. Let _result_ be Completion(PerformPromiseAll(_iteratorRecord_, _ctor_, _promiseCapability_, _promiseResolve_)). 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.

              @@ -46581,31 +51029,32 @@

              Promise.all ( _iterable_ )

              GetPromiseResolve ( - _promiseConstructor_: a constructor, + _promiseCtor_: a constructor, ): either a normal completion containing a function object or a throw completion

              - 1. Let _promiseResolve_ be ? Get(_promiseConstructor_, *"resolve"*). + 1. Let _promiseResolve_ be ? Get(_promiseCtor_, *"resolve"*). 1. If IsCallable(_promiseResolve_) is *false*, throw a *TypeError* exception. 1. Return _promiseResolve_.
              - +

              PerformPromiseAll ( _iteratorRecord_: an Iterator Record, - _constructor_: a constructor, + _ctor_: a constructor, _resultCapability_: a PromiseCapability Record, _promiseResolve_: a function object, - ): either a normal completion containing an ECMAScript language value or a throw completion + ): either a normal completion containing an Object or a throw completion

              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, @@ -46617,77 +51066,62 @@

              1. Perform ? Call(_resultCapability_.[[Resolve]], *undefined*, « _valuesArray_ »). 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 _nextPromise_ be ? Call(_promiseResolve_, _ctor_, « _next_ »). + 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 _activeFunc_ be the active function object. + 1. If _activeFunc_.[[AlreadyCalled]] is *true*, return *undefined*. + 1. Set _activeFunc_.[[AlreadyCalled]] to *true*. + 1. Let _thisIndex_ be _activeFunc_.[[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.

              - 1. Let _C_ be the *this* value. - 1. Let _promiseCapability_ be ? NewPromiseCapability(_C_). - 1. Let _promiseResolve_ be Completion(GetPromiseResolve(_C_)). + 1. Let _ctor_ be the *this* value. + 1. Let _promiseCapability_ be ? NewPromiseCapability(_ctor_). + 1. Let _promiseResolve_ be Completion(GetPromiseResolve(_ctor_)). 1. IfAbruptRejectPromise(_promiseResolve_, _promiseCapability_). 1. Let _iteratorRecord_ be Completion(GetIterator(_iterable_, ~sync~)). 1. IfAbruptRejectPromise(_iteratorRecord_, _promiseCapability_). - 1. Let _result_ be Completion(PerformPromiseAllSettled(_iteratorRecord_, _C_, _promiseCapability_, _promiseResolve_)). + 1. Let _result_ be Completion(PerformPromiseAllSettled(_iteratorRecord_, _ctor_, _promiseCapability_, _promiseResolve_)). 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, - _constructor_: a constructor, + _ctor_: a constructor, _resultCapability_: a PromiseCapability Record, _promiseResolve_: a function object, - ): either a normal completion containing an ECMAScript language value or a throw completion + ): either a normal completion containing an Object or a throw completion

              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, @@ -46699,116 +51133,83 @@

              1. Perform ? Call(_resultCapability_.[[Resolve]], *undefined*, « _valuesArray_ »). 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 _nextPromise_ be ? Call(_promiseResolve_, _ctor_, « _next_ »). 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 _activeFunc_ be the active function object. + 1. If _activeFunc_.[[AlreadyCalled]].[[Value]] is *true*, return *undefined*. + 1. Set _activeFunc_.[[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 _activeFunc_.[[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 _activeFunc_ be the active function object. + 1. If _activeFunc_.[[AlreadyCalled]].[[Value]] is *true*, return *undefined*. + 1. Set _activeFunc_.[[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 _activeFunc_.[[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.

              - 1. Let _C_ be the *this* value. - 1. Let _promiseCapability_ be ? NewPromiseCapability(_C_). - 1. Let _promiseResolve_ be Completion(GetPromiseResolve(_C_)). + 1. Let _ctor_ be the *this* value. + 1. Let _promiseCapability_ be ? NewPromiseCapability(_ctor_). + 1. Let _promiseResolve_ be Completion(GetPromiseResolve(_ctor_)). 1. IfAbruptRejectPromise(_promiseResolve_, _promiseCapability_). 1. Let _iteratorRecord_ be Completion(GetIterator(_iterable_, ~sync~)). 1. IfAbruptRejectPromise(_iteratorRecord_, _promiseCapability_). - 1. Let _result_ be Completion(PerformPromiseAny(_iteratorRecord_, _C_, _promiseCapability_, _promiseResolve_)). + 1. Let _result_ be Completion(PerformPromiseAny(_iteratorRecord_, _ctor_, _promiseCapability_, _promiseResolve_)). 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, - _constructor_: a constructor, + _ctor_: a constructor, _resultCapability_: a PromiseCapability Record, _promiseResolve_: a function object, - ): either a normal completion containing an ECMAScript language value or a throw completion + ): either a normal completion containing an Object or a throw completion

              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 +51217,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 _nextPromise_ be ? Call(_promiseResolve_, _ctor_, « _next_ »). + 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 _activeFunc_ be the active function object. + 1. If _activeFunc_.[[AlreadyCalled]] is *true*, return *undefined*. + 1. Set _activeFunc_.[[AlreadyCalled]] to *true*. + 1. Let _thisIndex_ be _activeFunc_.[[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,21 +51251,21 @@

              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.

              - 1. Let _C_ be the *this* value. - 1. Let _promiseCapability_ be ? NewPromiseCapability(_C_). - 1. Let _promiseResolve_ be Completion(GetPromiseResolve(_C_)). + 1. Let _ctor_ be the *this* value. + 1. Let _promiseCapability_ be ? NewPromiseCapability(_ctor_). + 1. Let _promiseResolve_ be Completion(GetPromiseResolve(_ctor_)). 1. IfAbruptRejectPromise(_promiseResolve_, _promiseCapability_). 1. Let _iteratorRecord_ be Completion(GetIterator(_iterable_, ~sync~)). 1. IfAbruptRejectPromise(_iteratorRecord_, _promiseCapability_). - 1. Let _result_ be Completion(PerformPromiseRace(_iteratorRecord_, _C_, _promiseCapability_, _promiseResolve_)). + 1. Let _result_ be Completion(PerformPromiseRace(_iteratorRecord_, _ctor_, _promiseCapability_, _promiseResolve_)). 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.

              @@ -46893,10 +51278,10 @@

              Promise.race ( _iterable_ )

              PerformPromiseRace ( _iteratorRecord_: an Iterator Record, - _constructor_: a constructor, + _ctor_: a constructor, _resultCapability_: a PromiseCapability Record, _promiseResolve_: a function object, - ): either a normal completion containing an ECMAScript language value or a throw completion + ): either a normal completion containing an Object or a throw completion

              @@ -46905,19 +51290,19 @@

              1. Let _next_ be ? IteratorStepValue(_iteratorRecord_). 1. If _next_ is ~done~, then 1. Return _resultCapability_.[[Promise]]. - 1. Let _nextPromise_ be ? Call(_promiseResolve_, _constructor_, « _next_ »). + 1. Let _nextPromise_ be ? Call(_promiseResolve_, _ctor_, « _next_ »). 1. Perform ? Invoke(_nextPromise_, *"then"*, « _resultCapability_.[[Resolve]], _resultCapability_.[[Reject]] »). - -

              Promise.reject ( _r_ )

              + +

              Promise.reject ( _reason_ )

              This function returns a new promise rejected with the passed argument.

              - 1. Let _C_ be the *this* value. - 1. Let _promiseCapability_ be ? NewPromiseCapability(_C_). - 1. Perform ? Call(_promiseCapability_.[[Reject]], *undefined*, « _r_ »). + 1. Let _ctor_ be the *this* value. + 1. Let _promiseCapability_ be ? NewPromiseCapability(_ctor_). + 1. Perform ? Call(_promiseCapability_.[[Reject]], *undefined*, « _reason_ »). 1. Return _promiseCapability_.[[Promise]]. @@ -46925,13 +51310,13 @@

              Promise.reject ( _r_ )

              - -

              Promise.resolve ( _x_ )

              + +

              Promise.resolve ( _resolution_ )

              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.

              - 1. Let _C_ be the *this* value. - 1. If _C_ is not an Object, throw a *TypeError* exception. - 1. Return ? PromiseResolve(_C_, _x_). + 1. Let _ctor_ be the *this* value. + 1. If _ctor_ is not an Object, throw a *TypeError* exception. + 1. Return ? PromiseResolve(_ctor_, _resolution_).

              This function expects its *this* value to be a constructor function that supports the parameter conventions of the Promise constructor.

              @@ -46940,31 +51325,50 @@

              Promise.resolve ( _x_ )

              PromiseResolve ( - _C_: a constructor, - _x_: an ECMAScript language value, - ): either a normal completion containing an ECMAScript language value or a throw completion + _ctor_: an Object, + _resolution_: an ECMAScript language value, + ): either a normal completion containing an Object or a throw completion

              description
              -
              It returns a new promise resolved with _x_.
              +
              It returns a new promise resolved with _resolution_.
              - 1. If IsPromise(_x_) is *true*, then - 1. Let _xConstructor_ be ? Get(_x_, *"constructor"*). - 1. If SameValue(_xConstructor_, _C_) is *true*, return _x_. - 1. Let _promiseCapability_ be ? NewPromiseCapability(_C_). - 1. Perform ? Call(_promiseCapability_.[[Resolve]], *undefined*, « _x_ »). + 1. If IsPromise(_resolution_) is *true*, then + 1. Let _resolutionCtor_ be ? Get(_resolution_, *"constructor"*). + 1. If SameValue(_resolutionCtor_, _ctor_) is *true*, return _resolution_. + 1. Let _promiseCapability_ be ? NewPromiseCapability(_ctor_). + 1. Perform ? Call(_promiseCapability_.[[Resolve]], *undefined*, « _resolution_ »). 1. Return _promiseCapability_.[[Promise]].
              - + +

              Promise.try ( _callback_, ..._args_ )

              +

              This function performs the following steps when called:

              + + 1. Let _ctor_ be the *this* value. + 1. If _ctor_ is not an Object, throw a *TypeError* exception. + 1. Let _promiseCapability_ be ? NewPromiseCapability(_ctor_). + 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.

              - 1. Let _C_ be the *this* value. - 1. Let _promiseCapability_ be ? NewPromiseCapability(_C_). + 1. Let _ctor_ be the *this* value. + 1. Let _promiseCapability_ be ? NewPromiseCapability(_ctor_). 1. Let _obj_ be OrdinaryObjectCreate(%Object.prototype%). 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"promise"*, _promiseCapability_.[[Promise]]). 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"resolve"*, _promiseCapability_.[[Resolve]]). @@ -46973,15 +51377,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 +51400,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,31 +51414,31 @@

              Promise.prototype.constructor

              The initial value of `Promise.prototype.constructor` is %Promise%.

              - +

              Promise.prototype.finally ( _onFinally_ )

              This method performs the following steps when called:

              1. Let _promise_ be the *this* value. 1. If _promise_ is not an Object, throw a *TypeError* exception. - 1. Let _C_ be ? SpeciesConstructor(_promise_, %Promise%). - 1. Assert: IsConstructor(_C_) is *true*. + 1. Let _ctor_ be ? SpeciesConstructor(_promise_, %Promise%). + 1. Assert: IsConstructor(_ctor_) is *true*. 1. If IsCallable(_onFinally_) is *false*, then 1. Let _thenFinally_ be _onFinally_. 1. Let _catchFinally_ be _onFinally_. 1. Else, - 1. Let _thenFinallyClosure_ be a new Abstract Closure with parameters (_value_) that captures _onFinally_ and _C_ and performs the following steps when called: + 1. Let _thenFinallyClosure_ be a new Abstract Closure with parameters (_value_) that captures _onFinally_ and _ctor_ and performs the following steps when called: 1. Let _result_ be ? Call(_onFinally_, *undefined*). - 1. Let _p_ be ? PromiseResolve(_C_, _result_). + 1. Let _p_ be ? PromiseResolve(_ctor_, _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, *""*, « »). - 1. Let _catchFinallyClosure_ be a new Abstract Closure with parameters (_reason_) that captures _onFinally_ and _C_ and performs the following steps when called: + 1. Let _catchFinallyClosure_ be a new Abstract Closure with parameters (_reason_) that captures _onFinally_ and _ctor_ and performs the following steps when called: 1. Let _result_ be ? Call(_onFinally_, *undefined*). - 1. Let _p_ be ? PromiseResolve(_C_, _result_). + 1. Let _p_ be ? PromiseResolve(_ctor_, _result_). 1. Let _throwReason_ be a new Abstract Closure with no parameters that captures _reason_ and performs the following steps when called: - 1. Return ThrowCompletion(_reason_). + 1. Throw _reason_. 1. Let _thrower_ be CreateBuiltinFunction(_throwReason_, 0, *""*, « »). 1. Return ? Invoke(_p_, *"then"*, « _thrower_ »). 1. Let _catchFinally_ be CreateBuiltinFunction(_catchFinallyClosure_, 1, *""*, « »). @@ -47042,14 +51446,14 @@

              Promise.prototype.finally ( _onFinally_ )

              - +

              Promise.prototype.then ( _onFulfilled_, _onRejected_ )

              This method performs the following steps when called:

              1. Let _promise_ be the *this* value. 1. If IsPromise(_promise_) is *false*, throw a *TypeError* exception. - 1. Let _C_ be ? SpeciesConstructor(_promise_, %Promise%). - 1. Let _resultCapability_ be ? NewPromiseCapability(_C_). + 1. Let _ctor_ be ? SpeciesConstructor(_promise_, %Promise%). + 1. Let _resultCapability_ be ? NewPromiseCapability(_ctor_). 1. Return PerformPromiseThen(_promise_, _onFulfilled_, _onRejected_, _resultCapability_). @@ -47060,7 +51464,7 @@

              _onFulfilled_: an ECMAScript language value, _onRejected_: an ECMAScript language value, optional _resultCapability_: a PromiseCapability Record, - ): an ECMAScript language value + ): an Object or *undefined*

              description
              @@ -47088,23 +51492,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 +51516,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,14 +51606,14 @@

              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_ )

              + +

              GeneratorFunction ( ..._paramArgs_, _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:

              - 1. Let _C_ be the active function object. + 1. Let _activeFunc_ be the active function object. 1. If _bodyArg_ is not present, set _bodyArg_ to the empty String. - 1. Return ? CreateDynamicFunction(_C_, NewTarget, ~generator~, _parameterArgs_, _bodyArg_). + 1. Return ? CreateDynamicFunction(_activeFunc_, NewTarget, ~generator~, _paramArgs_, _bodyArg_).

              See NOTE for .

              @@ -47257,9 +51661,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,14 +51708,14 @@

              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_ )

              + +

              AsyncGeneratorFunction ( ..._paramArgs_, _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:

              - 1. Let _C_ be the active function object. + 1. Let _activeFunc_ be the active function object. 1. If _bodyArg_ is not present, set _bodyArg_ to the empty String. - 1. Return ? CreateDynamicFunction(_C_, NewTarget, ~async-generator~, _parameterArgs_, _bodyArg_). + 1. Return ? CreateDynamicFunction(_activeFunc_, NewTarget, ~async-generator~, _paramArgs_, _bodyArg_).

              See NOTE for .

              @@ -47359,9 +51763,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 +51799,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 +51809,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,36 +51819,36 @@

              %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. Return ? GeneratorResumeAbrupt(_g_, _C_, ~empty~). + 1. Let _gen_ be the *this* value. + 1. Let _completion_ be ReturnCompletion(_value_). + 1. Return ? GeneratorResumeAbrupt(_gen_, _completion_, ~empty~).
              - +

              %GeneratorPrototype%.throw ( _exception_ )

              This method performs the following steps when called:

              - 1. Let _g_ be the *this* value. - 1. Let _C_ be ThrowCompletion(_exception_). - 1. Return ? GeneratorResumeAbrupt(_g_, _C_, ~empty~). + 1. Let _gen_ be the *this* value. + 1. Let _completion_ be ThrowCompletion(_exception_). + 1. Return ? GeneratorResumeAbrupt(_gen_, _completion_, ~empty~).
              - -

              %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 +51858,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 +51545,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. @@ -47508,28 +51914,28 @@

              Generator Abstract Operations

              GeneratorStart ( - _generator_: a Generator, - _generatorBody_: a |FunctionBody| Parse Node or an Abstract Closure with no parameters, + _gen_: a Generator, + _genBody_: a |FunctionBody| Parse Node or an Abstract Closure with no parameters, ): ~unused~

              - 1. Assert: The value of _generator_.[[GeneratorState]] is *undefined*. + 1. Assert: _gen_.[[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: + 1. Set the Generator component of _genContext_ to _gen_. + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _genBody_ and performs the following steps when called: 1. Let _acGenContext_ be the running execution context. - 1. Let _acGenerator_ be the Generator component of _acGenContext_. - 1. If _generatorBody_ is a Parse Node, then - 1. Let _result_ be Completion(Evaluation of _generatorBody_). + 1. Let _acGen_ be the Generator component of _acGenContext_. + 1. If _genBody_ is a Parse Node, then + 1. Let _result_ be Completion(Evaluation of _genBody_). 1. Else, - 1. Assert: _generatorBody_ is an Abstract Closure with no parameters. - 1. Let _result_ be _generatorBody_(). + 1. Assert: _genBody_ is an Abstract Closure with no parameters. + 1. Let _result_ be Completion(_genBody_()). 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~. - 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 _acGenerator_ can be discarded at this point. + 1. Set _acGen_.[[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 _acGen_ can be discarded at this point. 1. If _result_ is a normal completion, then 1. Let _resultValue_ be *undefined*. 1. Else if _result_ is a return completion, then @@ -47537,10 +51943,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. Set _gen_.[[GeneratorContext]] to _genContext_. 1. Return ~unused~. @@ -47548,18 +51953,18 @@

              GeneratorValidate ( - _generator_: an ECMAScript language value, - _generatorBrand_: a String or ~empty~, + _gen_: an ECMAScript language value, + _genBrand_: a String or ~empty~, ): either a normal completion containing one of ~suspended-start~, ~suspended-yield~, or ~completed~, or a throw completion

              - 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. Let _state_ be _generator_.[[GeneratorState]]. + 1. Perform ? RequireInternalSlot(_gen_, [[GeneratorState]]). + 1. Perform ? RequireInternalSlot(_gen_, [[GeneratorBrand]]). + 1. If _gen_.[[GeneratorBrand]] is not _genBrand_, throw a *TypeError* exception. + 1. Assert: _gen_ has a [[GeneratorContext]] internal slot. + 1. Let _state_ be _gen_.[[GeneratorState]]. 1. If _state_ is ~executing~, throw a *TypeError* exception. 1. Return _state_. @@ -47568,57 +51973,47 @@

              GeneratorResume ( - _generator_: an ECMAScript language value, + _gen_: an ECMAScript language value, _value_: an ECMAScript language value or ~empty~, - _generatorBrand_: a String or ~empty~, + _genBrand_: a String or ~empty~, ): either a normal completion containing an ECMAScript language value or a throw completion

              - 1. Let _state_ be ? GeneratorValidate(_generator_, _generatorBrand_). - 1. If _state_ is ~completed~, return CreateIterResultObject(*undefined*, *true*). + 1. Let _state_ be ? GeneratorValidate(_gen_, _genBrand_). + 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. - 1. Suspend _methodContext_. - 1. Set _generator_.[[GeneratorState]] to ~executing~. - 1. Push _genContext_ onto the execution context stack; _genContext_ is now the running execution context. - 1. Resume the suspended evaluation of _genContext_ using NormalCompletion(_value_) as the result of the operation that suspended it. Let _result_ be the value returned by the resumed computation. - 1. Assert: When we return here, _genContext_ has already been removed from the execution context stack and _methodContext_ is the currently running execution context. - 1. Return ? _result_. + 1. Let _genContext_ be _gen_.[[GeneratorContext]]. + 1. Set _gen_.[[GeneratorState]] to ~executing~. + 1. Return ? RunSuspendedContext(_genContext_, NormalCompletion(_value_)).

              GeneratorResumeAbrupt ( - _generator_: an ECMAScript language value, + _gen_: an ECMAScript language value, _abruptCompletion_: a return completion or a throw completion, - _generatorBrand_: a String or ~empty~, + _genBrand_: a String or ~empty~, ): either a normal completion containing an ECMAScript language value or a throw completion

              - 1. Let _state_ be ? GeneratorValidate(_generator_, _generatorBrand_). + 1. Let _state_ be ? GeneratorValidate(_gen_, _genBrand_). 1. If _state_ is ~suspended-start~, then - 1. Set _generator_.[[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 _generator_ can be discarded at this point. + 1. Set _gen_.[[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 _gen_ can be discarded at this point. 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]]. - 1. Let _methodContext_ be the running execution context. - 1. Suspend _methodContext_. - 1. Set _generator_.[[GeneratorState]] to ~executing~. - 1. Push _genContext_ onto the execution context stack; _genContext_ is now the running execution context. - 1. Resume the suspended evaluation of _genContext_ using _abruptCompletion_ as the result of the operation that suspended it. Let _result_ be the Completion Record returned by the resumed computation. - 1. Assert: When we return here, _genContext_ has already been removed from the execution context stack and _methodContext_ is the currently running execution context. - 1. Return ? _result_. + 1. Let _genContext_ be _gen_.[[GeneratorContext]]. + 1. Set _gen_.[[GeneratorState]] to ~executing~. + 1. Return ? RunSuspendedContext(_genContext_, _abruptCompletion_).
              @@ -47629,16 +52024,16 @@

              GetGeneratorKind ( ): ~non-generator~, ~sync~, or ~async~

              1. Let _genContext_ be the running execution context. 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. Let _gen_ be the Generator component of _genContext_. + 1. If _gen_ has an [[AsyncGeneratorState]] internal slot, return ~async~. + 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

              @@ -47646,29 +52041,25 @@

              1. Let _genContext_ be the running execution context. 1. Assert: _genContext_ is the execution context of a generator. - 1. Let _generator_ be the value of the Generator component of _genContext_. + 1. Let _gen_ be the value of the Generator component of _genContext_. 1. Assert: GetGeneratorKind() is ~sync~. - 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. Assert: If control reaches here, then _genContext_ is the running execution context again. - 1. Return _resumptionValue_. + 1. Set _gen_.[[GeneratorState]] to ~suspended-yield~. + 1. Return ? RunCallerContext(_iteratorResult_).

              Yield ( - _value_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing an ECMAScript language value or an abrupt completion

              - 1. Let _generatorKind_ be GetGeneratorKind(). - 1. If _generatorKind_ is ~async~, return ? AsyncGeneratorYield(? Await(_value_)). - 1. Otherwise, return ? GeneratorYield(CreateIterResultObject(_value_, *false*)). + 1. Let _genKind_ be GetGeneratorKind(). + 1. If _genKind_ is ~async~, return ? AsyncGeneratorYield(? Await(_arg_)). + 1. Return ? GeneratorYield(CreateIteratorResultObject(_arg_, *false*)).
              @@ -47676,18 +52067,20 @@

              CreateIteratorFromClosure ( _closure_: an Abstract Closure with no parameters, - _generatorBrand_: a String or ~empty~, - _generatorPrototype_: an Object, + _genBrand_: a String or ~empty~, + _genProto_: 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. Let _generator_ be OrdinaryObjectCreate(_generatorPrototype_, _internalSlotsList_). - 1. Set _generator_.[[GeneratorBrand]] to _generatorBrand_. - 1. Set _generator_.[[GeneratorState]] to *undefined*. + 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 _gen_ be OrdinaryObjectCreate(_genProto_, _internalSlotsList_). + 1. Set _gen_.[[GeneratorBrand]] to _genBrand_. + 1. Set _gen_.[[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*. @@ -47695,9 +52088,9 @@

              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 GeneratorStart(_generator_, _closure_). + 1. Perform GeneratorStart(_gen_, _closure_). 1. Remove _calleeContext_ from the execution context stack and restore _callerContext_ as the running execution context. - 1. Return _generator_. + 1. Return _gen_. @@ -47705,7 +52098,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,76 +52119,76 @@

              %AsyncGeneratorPrototype%.constructor

              This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

              - +

              %AsyncGeneratorPrototype%.next ( _value_ )

              - 1. Let _generator_ be the *this* value. + 1. Let _gen_ be the *this* value. 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). - 1. Let _result_ be Completion(AsyncGeneratorValidate(_generator_, ~empty~)). + 1. Let _result_ be Completion(AsyncGeneratorValidate(_gen_, ~empty~)). 1. IfAbruptRejectPromise(_result_, _promiseCapability_). - 1. Let _state_ be _generator_.[[AsyncGeneratorState]]. + 1. Let _state_ be _gen_.[[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. Perform AsyncGeneratorEnqueue(_gen_, _completion_, _promiseCapability_). 1. If _state_ is either ~suspended-start~ or ~suspended-yield~, then - 1. Perform AsyncGeneratorResume(_generator_, _completion_). + 1. Perform AsyncGeneratorResume(_gen_, _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 _gen_ be the *this* value. 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). - 1. Let _result_ be Completion(AsyncGeneratorValidate(_generator_, ~empty~)). + 1. Let _result_ be Completion(AsyncGeneratorValidate(_gen_, ~empty~)). 1. IfAbruptRejectPromise(_result_, _promiseCapability_). - 1. Let _completion_ be Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. - 1. Perform AsyncGeneratorEnqueue(_generator_, _completion_, _promiseCapability_). - 1. Let _state_ be _generator_.[[AsyncGeneratorState]]. + 1. Let _completion_ be ReturnCompletion(_value_). + 1. Perform AsyncGeneratorEnqueue(_gen_, _completion_, _promiseCapability_). + 1. Let _state_ be _gen_.[[AsyncGeneratorState]]. 1. If _state_ is either ~suspended-start~ or ~completed~, then - 1. Set _generator_.[[AsyncGeneratorState]] to ~awaiting-return~. - 1. Perform ! AsyncGeneratorAwaitReturn(_generator_). + 1. Set _gen_.[[AsyncGeneratorState]] to ~draining-queue~. + 1. Perform AsyncGeneratorAwaitReturn(_gen_). 1. Else if _state_ is ~suspended-yield~, then - 1. Perform AsyncGeneratorResume(_generator_, _completion_). + 1. Perform AsyncGeneratorResume(_gen_, _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. + 1. Let _gen_ be the *this* value. 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). - 1. Let _result_ be Completion(AsyncGeneratorValidate(_generator_, ~empty~)). + 1. Let _result_ be Completion(AsyncGeneratorValidate(_gen_, ~empty~)). 1. IfAbruptRejectPromise(_result_, _promiseCapability_). - 1. Let _state_ be _generator_.[[AsyncGeneratorState]]. + 1. Let _state_ be _gen_.[[AsyncGeneratorState]]. 1. If _state_ is ~suspended-start~, then - 1. Set _generator_.[[AsyncGeneratorState]] to ~completed~. + 1. Set _gen_.[[AsyncGeneratorState]] to ~completed~. 1. Set _state_ to ~completed~. 1. If _state_ is ~completed~, then 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _exception_ »). 1. Return _promiseCapability_.[[Promise]]. 1. Let _completion_ be ThrowCompletion(_exception_). - 1. Perform AsyncGeneratorEnqueue(_generator_, _completion_, _promiseCapability_). + 1. Perform AsyncGeneratorEnqueue(_gen_, _completion_, _promiseCapability_). 1. If _state_ is ~suspended-yield~, then - 1. Perform AsyncGeneratorResume(_generator_, _completion_). + 1. Perform AsyncGeneratorResume(_gen_, _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 +52198,16 @@

              Properties of AsyncGenerator Instances

              AsyncGenerator instances are initially created with the internal slots described below:

              - - - - - + + + + + + + - + @@ -47823,7 +52218,7 @@

              Properties of AsyncGenerator Instances

              - + @@ -47839,15 +52234,17 @@

              AsyncGenerator Abstract Operations

              AsyncGeneratorRequest Records

              -

              An AsyncGeneratorRequest is a Record value used to store information about how an async generator should be resumed and contains capabilities for fulfilling or rejecting the corresponding promise.

              +

              An AsyncGeneratorRequest is a Record used to store information about how an async generator should be resumed and contains capabilities for fulfilling or rejecting the corresponding promise.

              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]]
              - - - - - + + + + + + + @@ -47865,36 +52262,35 @@

              AsyncGeneratorRequest Records

              AsyncGeneratorStart ( - _generator_: an AsyncGenerator, - _generatorBody_: a |FunctionBody| Parse Node or an Abstract Closure with no parameters, + _gen_: an AsyncGenerator, + _genBody_: a |FunctionBody| Parse Node or an Abstract Closure with no parameters, ): ~unused~

              - 1. Assert: _generator_.[[AsyncGeneratorState]] is *undefined*. + 1. Assert: _gen_.[[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: + 1. Set the Generator component of _genContext_ to _gen_. + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _genBody_ and performs the following steps when called: 1. Let _acGenContext_ be the running execution context. - 1. Let _acGenerator_ be the Generator component of _acGenContext_. - 1. If _generatorBody_ is a Parse Node, then - 1. Let _result_ be Completion(Evaluation of _generatorBody_). + 1. Let _acGen_ be the Generator component of _acGenContext_. + 1. If _genBody_ is a Parse Node, then + 1. Let _result_ be Completion(Evaluation of _genBody_). 1. Else, - 1. Assert: _generatorBody_ is an Abstract Closure with no parameters. - 1. Let _result_ be Completion(_generatorBody_()). + 1. Assert: _genBody_ is an Abstract Closure with no parameters. + 1. Let _result_ be Completion(_genBody_()). 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 _acGen_.[[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. Perform AsyncGeneratorCompleteStep(_acGen_, _result_, *true*). + 1. Perform AsyncGeneratorDrainQueue(_acGen_). + 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. Set _gen_.[[AsyncGeneratorContext]] to _genContext_. + 1. Set _gen_.[[AsyncGeneratorQueue]] to a new empty List. 1. Return ~unused~.
              @@ -47902,17 +52298,17 @@

              AsyncGeneratorValidate ( - _generator_: an ECMAScript language value, - _generatorBrand_: a String or ~empty~, + _gen_: an ECMAScript language value, + _genBrand_: a String or ~empty~, ): either a normal completion containing ~unused~ or a throw completion

              - 1. Perform ? RequireInternalSlot(_generator_, [[AsyncGeneratorContext]]). - 1. Perform ? RequireInternalSlot(_generator_, [[AsyncGeneratorState]]). - 1. Perform ? RequireInternalSlot(_generator_, [[AsyncGeneratorQueue]]). - 1. If _generator_.[[GeneratorBrand]] is not _generatorBrand_, throw a *TypeError* exception. + 1. Perform ? RequireInternalSlot(_gen_, [[AsyncGeneratorContext]]). + 1. Perform ? RequireInternalSlot(_gen_, [[AsyncGeneratorState]]). + 1. Perform ? RequireInternalSlot(_gen_, [[AsyncGeneratorQueue]]). + 1. If _gen_.[[GeneratorBrand]] is not _genBrand_, throw a *TypeError* exception. 1. Return ~unused~.
              @@ -47920,7 +52316,7 @@

              AsyncGeneratorEnqueue ( - _generator_: an AsyncGenerator, + _gen_: an AsyncGenerator, _completion_: a Completion Record, _promiseCapability_: a PromiseCapability Record, ): ~unused~ @@ -47929,7 +52325,7 @@

              1. Let _request_ be AsyncGeneratorRequest { [[Completion]]: _completion_, [[Capability]]: _promiseCapability_ }. - 1. Append _request_ to _generator_.[[AsyncGeneratorQueue]]. + 1. Append _request_ to _gen_.[[AsyncGeneratorQueue]]. 1. Return ~unused~. @@ -47937,7 +52333,7 @@

              AsyncGeneratorCompleteStep ( - _generator_: an AsyncGenerator, + _gen_: an AsyncGenerator, _completion_: a Completion Record, _done_: a Boolean, optional _realm_: a Realm Record, @@ -47946,9 +52342,9 @@

              - 1. Assert: _generator_.[[AsyncGeneratorQueue]] is not empty. - 1. Let _next_ be the first element of _generator_.[[AsyncGeneratorQueue]]. - 1. Remove the first element from _generator_.[[AsyncGeneratorQueue]]. + 1. Assert: _gen_.[[AsyncGeneratorQueue]] is not empty. + 1. Let _next_ be the first element of _gen_.[[AsyncGeneratorQueue]]. + 1. Remove the first element from _gen_.[[AsyncGeneratorQueue]]. 1. Let _promiseCapability_ be _next_.[[Capability]]. 1. Let _value_ be _completion_.[[Value]]. 1. If _completion_ is a throw completion, then @@ -47958,11 +52354,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~. @@ -47970,22 +52366,17 @@

              AsyncGeneratorResume ( - _generator_: an AsyncGenerator, + _gen_: an AsyncGenerator, _completion_: a Completion Record, ): ~unused~

              - 1. Assert: _generator_.[[AsyncGeneratorState]] is either ~suspended-start~ or ~suspended-yield~. - 1. Let _genContext_ be _generator_.[[AsyncGeneratorContext]]. - 1. Let _callerContext_ be the running execution context. - 1. Suspend _callerContext_. - 1. Set _generator_.[[AsyncGeneratorState]] to ~executing~. - 1. Push _genContext_ onto the execution context stack; _genContext_ is now the running execution context. - 1. Resume the suspended evaluation of _genContext_ using _completion_ as the result of the operation that suspended it. Let _result_ be the Completion Record returned by the resumed computation. - 1. Assert: _result_ is never an abrupt completion. - 1. Assert: When we return here, _genContext_ has already been removed from the execution context stack and _callerContext_ is the currently running execution context. + 1. Assert: _gen_.[[AsyncGeneratorState]] is either ~suspended-start~ or ~suspended-yield~. + 1. Let _genContext_ be _gen_.[[AsyncGeneratorContext]]. + 1. Set _gen_.[[AsyncGeneratorState]] to ~executing~. + 1. Perform ! RunSuspendedContext(_genContext_, _completion_). 1. Return ~unused~.
              @@ -48003,14 +52394,14 @@

              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]]).

              AsyncGeneratorYield ( - _value_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing an ECMAScript language value or an abrupt completion

              @@ -48018,57 +52409,60 @@

              1. Let _genContext_ be the running execution context. 1. Assert: _genContext_ is the execution context of a generator. - 1. Let _generator_ be the value of the Generator component of _genContext_. + 1. Let _gen_ be the value of the Generator component of _genContext_. 1. Assert: GetGeneratorKind() is ~async~. - 1. Let _completion_ be NormalCompletion(_value_). + 1. Let _completion_ be NormalCompletion(_arg_). 1. Assert: The execution context stack has at least two elements. 1. Let _previousContext_ be the second to top element of the execution context stack. 1. Let _previousRealm_ be _previousContext_'s Realm. - 1. Perform AsyncGeneratorCompleteStep(_generator_, _completion_, *false*, _previousRealm_). - 1. Let _queue_ be _generator_.[[AsyncGeneratorQueue]]. + 1. Perform AsyncGeneratorCompleteStep(_gen_, _completion_, *false*, _previousRealm_). + 1. Let _queue_ be _gen_.[[AsyncGeneratorQueue]]. 1. If _queue_ is not empty, then 1. NOTE: Execution continues without suspending the generator. 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 _gen_.[[AsyncGeneratorState]] to ~suspended-yield~. + 1. Let _resumptionValue_ be Completion(RunCallerContext(*undefined*)). + 1. Return ? AsyncGeneratorUnwrapYieldResumption(_resumptionValue_).

              AsyncGeneratorAwaitReturn ( - _generator_: an AsyncGenerator, - ): either a normal completion containing ~unused~ or a throw completion + _gen_: an AsyncGenerator, + ): ~unused~

              - 1. Let _queue_ be _generator_.[[AsyncGeneratorQueue]]. + 1. Assert: _gen_.[[AsyncGeneratorState]] is ~draining-queue~. + 1. Let _queue_ be _gen_.[[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 _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. Let _promiseCompletion_ be Completion(PromiseResolve(%Promise%, _completion_.[[Value]])). + 1. If _promiseCompletion_ is an abrupt completion, then + 1. Perform AsyncGeneratorCompleteStep(_gen_, _promiseCompletion_, *true*). + 1. Perform AsyncGeneratorDrainQueue(_gen_). + 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 _gen_ and performs the following steps when called: + 1. Assert: _gen_.[[AsyncGeneratorState]] is ~draining-queue~. 1. Let _result_ be NormalCompletion(_value_). - 1. Perform AsyncGeneratorCompleteStep(_generator_, _result_, *true*). - 1. Perform AsyncGeneratorDrainQueue(_generator_). - 1. Return *undefined*. + 1. Perform AsyncGeneratorCompleteStep(_gen_, _result_, *true*). + 1. Perform AsyncGeneratorDrainQueue(_gen_). + 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. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _gen_ and performs the following steps when called: + 1. Assert: _gen_.[[AsyncGeneratorState]] is ~draining-queue~. 1. Let _result_ be ThrowCompletion(_reason_). - 1. Perform AsyncGeneratorCompleteStep(_generator_, _result_, *true*). - 1. Perform AsyncGeneratorDrainQueue(_generator_). - 1. Return *undefined*. + 1. Perform AsyncGeneratorCompleteStep(_gen_, _result_, *true*). + 1. Perform AsyncGeneratorDrainQueue(_gen_). + 1. Return NormalCompletion(*undefined*). 1. Let _onRejected_ be CreateBuiltinFunction(_rejectedClosure_, 1, *""*, « »). 1. Perform PerformPromiseThen(_promise_, _onFulfilled_, _onRejected_). 1. Return ~unused~. @@ -48078,7 +52472,7 @@

              AsyncGeneratorDrainQueue ( - _generator_: an AsyncGenerator, + _gen_: an AsyncGenerator, ): ~unused~

              @@ -48086,54 +52480,21 @@

              It drains the generator's AsyncGeneratorQueue until it encounters an AsyncGeneratorRequest which holds a return completion.

              - 1. Assert: _generator_.[[AsyncGeneratorState]] is ~completed~. - 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. Assert: _gen_.[[AsyncGeneratorState]] is ~draining-queue~. + 1. Let _queue_ be _gen_.[[AsyncGeneratorQueue]]. + 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(_gen_). + 1. Return ~unused~. + 1. If _completion_ is a normal completion, then + 1. Set _completion_ to NormalCompletion(*undefined*). + 1. Perform AsyncGeneratorCompleteStep(_gen_, _completion_, *true*). + 1. Set _gen_.[[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,15 +52513,15 @@

              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_ )

              + +

              AsyncFunction ( ..._paramArgs_, _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:

              - 1. Let _C_ be the active function object. + 1. Let _activeFunc_ be the active function object. 1. If _bodyArg_ is not present, set _bodyArg_ to the empty String. - 1. Return ? CreateDynamicFunction(_C_, NewTarget, ~async~, _parameterArgs_, _bodyArg_). + 1. Return ? CreateDynamicFunction(_activeFunc_, NewTarget, ~async~, _paramArgs_, _bodyArg_). See NOTE for . @@ -48205,10 +52566,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 +52578,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 +52599,7 @@

              Async Functions Abstract Operations

              AsyncFunctionStart ( _promiseCapability_: a PromiseCapability Record, - _asyncFunctionBody_: a |FunctionBody| Parse Node or an |ExpressionBody| Parse Node, + _asyncFuncBody_: a |FunctionBody| Parse Node, an |ExpressionBody| Parse Node, or an Abstract Closure with no parameters, ): ~unused~

              @@ -48247,7 +52608,7 @@

              1. Let _runningContext_ be the running execution context. 1. Let _asyncContext_ be a copy of _runningContext_. 1. NOTE: Copying the execution state is required for AsyncBlockStart to resume its execution. It is ill-defined to resume a currently executing context. - 1. Perform AsyncBlockStart(_promiseCapability_, _asyncFunctionBody_, _asyncContext_). + 1. Perform AsyncBlockStart(_promiseCapability_, _asyncFuncBody_, _asyncContext_). 1. Return ~unused~. @@ -48256,32 +52617,34 @@

              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~

              - 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. - 1. Assert: When we return here, _asyncContext_ has already been removed from the execution context stack and _runningContext_ is the currently running execution context. - 1. Assert: _result_ is a normal completion with a value of ~unused~. The possible sources of this value are Await or, if the async function doesn't await anything, step above. + 1. Let _result_ be ! RunSuspendedContext(_asyncContext_, NormalCompletion(~empty~)). + 1. Assert: _result_ is ~unused~. + 1. NOTE: The possible sources of _result_ values are Await or, if the async function doesn't await anything, step above. 1. Return ~unused~. @@ -48289,36 +52652,26 @@

              Await ( - _value_: an ECMAScript language value, + _arg_: an ECMAScript language value, ): either a normal completion containing either an ECMAScript language value or ~empty~, or a throw completion

              1. Let _asyncContext_ be the running execution context. - 1. Let _promise_ be ? PromiseResolve(%Promise%, _value_). + 1. Let _promise_ be ? PromiseResolve(%Promise%, _arg_). 1. Let _fulfilledClosure_ be a new Abstract Closure with parameters (_v_) that captures _asyncContext_ and performs the following steps when called: - 1. Let _prevContext_ be the running execution context. - 1. Suspend _prevContext_. - 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. Perform Completion(RunSuspendedContext(_asyncContext_, NormalCompletion(_v_))). + 1. NOTE: The Completion Record returned by RunSuspendedContext is intentionally ignored. + 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. - 1. Suspend _prevContext_. - 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. Perform Completion(RunSuspendedContext(_asyncContext_, ThrowCompletion(_reason_))). + 1. NOTE: The Completion Record returned by RunSuspendedContext is intentionally ignored. + 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. - 1. Let _callerContext_ be the running execution context. - 1. Resume _callerContext_ passing ~empty~. If _asyncContext_ is ever resumed again, let _completion_ be the Completion Record with which it is resumed. - 1. Assert: If control reaches here, then _asyncContext_ is the running execution context again. - 1. Return _completion_. + 1. Return ? RunCallerContext(~empty~).
              @@ -48341,74 +52694,74 @@

              The Reflect Object

            • does not have a [[Call]] internal method; it cannot be invoked as a function.
            • - -

              Reflect.apply ( _target_, _thisArgument_, _argumentsList_ )

              + +

              Reflect.apply ( _target_, _thisArg_, _args_ )

              This function performs the following steps when called:

              1. If IsCallable(_target_) is *false*, throw a *TypeError* exception. - 1. Let _args_ be ? CreateListFromArrayLike(_argumentsList_). + 1. Let _argList_ be ? CreateListFromArrayLike(_args_). 1. Perform PrepareForTailCall(). - 1. Return ? Call(_target_, _thisArgument_, _args_). + 1. Return ? Call(_target_, _thisArg_, _argList_).
              - -

              Reflect.construct ( _target_, _argumentsList_ [ , _newTarget_ ] )

              + +

              Reflect.construct ( _target_, _args_ [ , _newTarget_ ] )

              This function performs the following steps when called:

              1. If IsConstructor(_target_) is *false*, throw a *TypeError* exception. 1. If _newTarget_ is not present, set _newTarget_ to _target_. 1. Else if IsConstructor(_newTarget_) is *false*, throw a *TypeError* exception. - 1. Let _args_ be ? CreateListFromArrayLike(_argumentsList_). - 1. Return ? Construct(_target_, _args_, _newTarget_). + 1. Let _argList_ be ? CreateListFromArrayLike(_args_). + 1. Return ? Construct(_target_, _argList_, _newTarget_).
              - -

              Reflect.defineProperty ( _target_, _propertyKey_, _attributes_ )

              + +

              Reflect.defineProperty ( _target_, _key_, _attrs_ )

              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. Let _propertyKey_ be ? ToPropertyKey(_key_). + 1. Let _propertyDesc_ be ? ToPropertyDescriptor(_attrs_). + 1. Return ? _target_.[[DefineOwnProperty]](_propertyKey_, _propertyDesc_).
              - -

              Reflect.deleteProperty ( _target_, _propertyKey_ )

              + +

              Reflect.deleteProperty ( _target_, _key_ )

              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. Let _propertyKey_ be ? ToPropertyKey(_key_). + 1. Return ? _target_.[[Delete]](_propertyKey_).
              - -

              Reflect.get ( _target_, _propertyKey_ [ , _receiver_ ] )

              + +

              Reflect.get ( _target_, _key_ [ , _receiver_ ] )

              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 _propertyKey_ be ? ToPropertyKey(_key_). 1. If _receiver_ is not present, then 1. Set _receiver_ to _target_. - 1. Return ? _target_.[[Get]](_key_, _receiver_). + 1. Return ? _target_.[[Get]](_propertyKey_, _receiver_).
              - -

              Reflect.getOwnPropertyDescriptor ( _target_, _propertyKey_ )

              + +

              Reflect.getOwnPropertyDescriptor ( _target_, _key_ )

              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. Return FromPropertyDescriptor(_desc_). + 1. Let _propertyKey_ be ? ToPropertyKey(_key_). + 1. Let _propertyDesc_ be ? _target_.[[GetOwnProperty]](_propertyKey_). + 1. Return FromPropertyDescriptor(_propertyDesc_).
              - +

              Reflect.getPrototypeOf ( _target_ )

              This function performs the following steps when called:

              @@ -48417,17 +52770,17 @@

              Reflect.getPrototypeOf ( _target_ )

              - -

              Reflect.has ( _target_, _propertyKey_ )

              + +

              Reflect.has ( _target_, _key_ )

              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. Let _propertyKey_ be ? ToPropertyKey(_key_). + 1. Return ? _target_.[[HasProperty]](_propertyKey_).
              - +

              Reflect.isExtensible ( _target_ )

              This function performs the following steps when called:

              @@ -48436,7 +52789,7 @@

              Reflect.isExtensible ( _target_ )

              - +

              Reflect.ownKeys ( _target_ )

              This function performs the following steps when called:

              @@ -48446,7 +52799,7 @@

              Reflect.ownKeys ( _target_ )

              - +

              Reflect.preventExtensions ( _target_ )

              This function performs the following steps when called:

              @@ -48455,31 +52808,31 @@

              Reflect.preventExtensions ( _target_ )

              - -

              Reflect.set ( _target_, _propertyKey_, _V_ [ , _receiver_ ] )

              + +

              Reflect.set ( _target_, _key_, _value_ [ , _receiver_ ] )

              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 _propertyKey_ be ? ToPropertyKey(_key_). 1. If _receiver_ is not present, then 1. Set _receiver_ to _target_. - 1. Return ? _target_.[[Set]](_key_, _V_, _receiver_). + 1. Return ? _target_.[[Set]](_propertyKey_, _value_, _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 +52850,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,21 +52869,21 @@

              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:

              1. Let _proxy_ be ? ProxyCreate(_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. 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. Let _activeFunc_ be the active function object. + 1. Let _revocableProxy_ be _activeFunc_.[[RevocableProxy]]. + 1. If _revocableProxy_ is *null*, return NormalCompletion(*undefined*). + 1. Set _activeFunc_.[[RevocableProxy]] to *null*. + 1. Assert: _revocableProxy_ is a Proxy exotic object. + 1. Set _revocableProxy_.[[ProxyTarget]] to *null*. + 1. Set _revocableProxy_.[[ProxyHandler]] to *null*. + 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 +52900,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 +52911,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 +52922,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 +52941,7 @@

              Memory Model Fundamentals

              - + @@ -48608,11 +52963,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 +52978,7 @@

              Memory Model Fundamentals

              - + @@ -48648,11 +53005,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 +53045,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 +53063,13 @@

              Agent Events Records

              An Agent Events Record is a Record with the following fields.

              - - - - - + + + + + + + @@ -48718,7 +53077,7 @@

              Agent Events Records

              - + @@ -48735,11 +53094,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 +53120,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,15 +53150,15 @@

              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. Add _E_ to _events_. + 1. For each Agent Events Record _eventsRecord_ of _execution_.[[EventsRecords]], do + 1. For each Memory event _event_ of _eventsRecord_.[[EventList]], do + 1. Add _event_ to _events_. 1. Return _events_. @@ -48804,14 +53167,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 _event_ of EventSet(_execution_), do + 1. If _event_ is a Shared Data Block event, add _event_ to _events_. 1. Return _events_. @@ -48820,15 +53183,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_). @@ -48837,7 +53197,7 @@

              ComposeWriteEventBytes ( _execution_: a candidate execution, _byteIndex_: a non-negative integer, - _Ws_: a List of either WriteSharedMemory or ReadModifyWriteSharedMemory events, + _writes_: a List of either WriteSharedMemory or ReadModifyWriteSharedMemory events, ): a List of byte values

              @@ -48845,15 +53205,15 @@

              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. Let _payloadIndex_ be _byteLocation_ - _W_.[[ByteIndex]]. - 1. If _W_ is a WriteSharedMemory event, then - 1. Let _byte_ be _W_.[[Payload]][_payloadIndex_]. + 1. For each element _writeEvent_ of _writes_, do + 1. Assert: _writeEvent_ has _byteLocation_ in its memory range. + 1. Let _payloadIndex_ be _byteLocation_ - _writeEvent_.[[ByteIndex]]. + 1. If _writeEvent_ is a WriteSharedMemory event, then + 1. Let _byte_ be _writeEvent_.[[Payload]][_payloadIndex_]. 1. Else, - 1. Assert: _W_ is a ReadModifyWriteSharedMemory event. - 1. Let _bytes_ be ValueOfReadEvent(_execution_, _W_). - 1. Let _bytesModified_ be _W_.[[ModifyOp]](_bytes_, _W_.[[Payload]]). + 1. Assert: _writeEvent_ is a ReadModifyWriteSharedMemory event. + 1. Let _bytes_ be ValueOfReadEvent(_execution_, _writeEvent_). + 1. Let _bytesModified_ be _writeEvent_.[[ModifyOp]](_bytes_, _writeEvent_.[[Payload]]). 1. Let _byte_ be _bytesModified_[_payloadIndex_]. 1. Append _byte_ to _bytesRead_. 1. Set _byteLocation_ to _byteLocation_ + 1. @@ -48871,15 +53231,15 @@

              ValueOfReadEvent ( _execution_: a candidate execution, - _R_: a ReadSharedMemory or ReadModifyWriteSharedMemory event, + _readEvent_: a ReadSharedMemory or ReadModifyWriteSharedMemory event, ): a List of byte values

              - 1. Let _Ws_ be reads-bytes-from(_R_) in _execution_. - 1. Assert: _Ws_ is a List of WriteSharedMemory or ReadModifyWriteSharedMemory events with length equal to _R_.[[ElementSize]]. - 1. Return ComposeWriteEventBytes(_execution_, _R_.[[ByteIndex]], _Ws_). + 1. Let _writes_ be reads-bytes-from(_readEvent_) in _execution_. + 1. Assert: _writes_ is a List of WriteSharedMemory or ReadModifyWriteSharedMemory events with length equal to _readEvent_.[[ElementSize]]. + 1. Return ComposeWriteEventBytes(_execution_, _readEvent_.[[ByteIndex]], _writes_). @@ -48887,13 +53247,13 @@

              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]].
              • +
              • For events _eventA_ and _eventB_, _eventA_ is-agent-order-before _eventB_ in _execution_ if there is some Agent Events Record _eventsRecord_ in _execution_.[[EventsRecords]] such that _eventsRecord_.[[EventList]] contains both _eventA_ and _eventB_ and _eventA_ is before _eventB_ in List order of _eventsRecord_.[[EventList]].
              @@ -48903,13 +53263,13 @@

              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.

                +

                For each ReadSharedMemory or ReadModifyWriteSharedMemory event _readEvent_ in SharedDataBlockEventSet(_execution_), reads-bytes-from(_readEvent_) in _execution_ is a List of length _readEvent_.[[ElementSize]] whose elements are WriteSharedMemory or ReadModifyWriteSharedMemory events _writes_ such that all of the following are true.

                  -
                • Each event _W_ with index _i_ in _Ws_ has _R_.[[ByteIndex]] + _i_ in its range.
                • -
                • _R_ is not in _Ws_.
                • +
                • Each event _writeEvent_ with index _i_ in _writes_ has _readEvent_.[[ByteIndex]] + _i_ in its memory range.
                • +
                • _result_ is not in _writes_.
              @@ -48918,22 +53278,22 @@

              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_.
              • +
              • For events _readEvent_ and _writeEvent_, _readEvent_ reads-from _writeEvent_ in _execution_ if SharedDataBlockEventSet(_execution_) contains both _readEvent_ and _writeEvent_, and reads-bytes-from(_readEvent_) in _execution_ contains _writeEvent_.

              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_.
              • +
              • If _eventA_ host-synchronizes-with _eventB_ in _execution_, HostEventSet(_execution_) contains _eventA_ and _eventB_.
              • There is no cycle in the union of host-synchronizes-with and is-agent-order-before in _execution_.
              -

              For two host-specific events _E_ and _D_ in a candidate execution _execution_, _E_ host-synchronizes-with _D_ in _execution_ implies _E_ happens-before _D_ in _execution_.

              +

              For two host-specific events _eventA_ and _eventB_ in a candidate execution _execution_, _eventA_ host-synchronizes-with _eventB_ in _execution_ implies _eventA_ happens-before _eventB_ in _execution_.

              This Relation allows the host to provide additional synchronization mechanisms, such as `postMessage` between HTML workers.

              @@ -48942,18 +53302,18 @@

              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 _readEvent_ and _writeEvent_, _writeEvent_ synchronizes-with _readEvent_ in _execution_ if _readEvent_ reads-from _writeEvent_ in _execution_, _readEvent_.[[Order]] is ~seq-cst~, _writeEvent_.[[Order]] is ~seq-cst~, and _readEvent_ and _writeEvent_ have equal memory ranges.
              • For each element _eventsRecord_ of _execution_.[[EventsRecords]], the following is true.
                  -
                • For events _S_ and _Sw_, _S_ synchronizes-with _Sw_ in _execution_ if _eventsRecord_.[[AgentSynchronizesWith]] contains (_S_, _Sw_).
                • +
                • For events _eventA_ and _eventB_, _eventA_ synchronizes-with _eventB_ in _execution_ if _eventsRecord_.[[AgentSynchronizesWith]] contains (_eventA_, _eventB_).
              • -
              • For events _E_ and _D_, _E_ synchronizes-with _D_ in _execution_ if _execution_.[[HostSynchronizesWith]] contains (_E_, _D_).
              • +
              • For events _eventA_ and _eventB_, _eventA_ synchronizes-with _eventB_ in _execution_ if _eventA_ host-synchronizes-with _eventB_ in _execution_.
              @@ -48965,26 +53325,26 @@

              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.

              -

              For Shared Data Block events _R_ and _W_ in a candidate execution _execution_ such that _W_ synchronizes-with _R_, _R_ may reads-from other writes than _W_.

              +

              For Shared Data Block events _readEvent_ and _writeEvent_ in a candidate execution _execution_ such that _writeEvent_ synchronizes-with _readEvent_, _readEvent_ may reads-from other writes than _writeEvent_.

              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.

              • -

                For events _E_ and _D_, _E_ happens-before _D_ in _execution_ if any of the following conditions are true.

                +

                For events _eventA_ and _eventB_, _eventA_ happens-before _eventB_ in _execution_ if any of the following conditions are true.

                  -
                • _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.
                • -
                • There is an event _F_ such that _E_ happens-before _F_ and _F_ happens-before _D_ in _execution_.
                • +
                • _eventA_ is-agent-order-before _eventB_ in _execution_.
                • +
                • _eventA_ synchronizes-with _eventB_ in _execution_.
                • +
                • SharedDataBlockEventSet(_execution_) contains both _eventA_ and _eventB_, _eventA_.[[Order]] is ~init~, and _eventA_ and _eventB_ have overlapping memory ranges.
                • +
                • There is an event _eventC_ such that _eventA_ happens-before _eventC_ and _eventC_ happens-before _eventB_ in _execution_.
              @@ -49002,15 +53362,15 @@

              Properties of Valid Executions

              Valid Chosen Reads

              A candidate execution _execution_ has valid chosen reads if the following algorithm returns *true*.

              - 1. For each ReadSharedMemory or ReadModifyWriteSharedMemory event _R_ of SharedDataBlockEventSet(_execution_), do - 1. Let _chosenValueRecord_ be the element of _execution_.[[ChosenValues]] whose [[Event]] field is _R_. + 1. For each ReadSharedMemory or ReadModifyWriteSharedMemory event _readEvent_ of SharedDataBlockEventSet(_execution_), do + 1. Let _chosenValueRecord_ be the element of _execution_.[[ChosenValues]] whose [[Event]] field is _readEvent_. 1. Let _chosenValue_ be _chosenValueRecord_.[[ChosenValue]]. - 1. Let _readValue_ be ValueOfReadEvent(_execution_, _R_). - 1. Let _chosenLen_ be the number of elements in _chosenValue_. - 1. Let _readLen_ be the number of elements in _readValue_. - 1. If _chosenLen_ ≠ _readLen_, then + 1. Let _readValue_ be ValueOfReadEvent(_execution_, _readEvent_). + 1. Let _chosenLength_ be the number of elements in _chosenValue_. + 1. Let _readLength_ be the number of elements in _readValue_. + 1. If _chosenLength_ ≠ _readLength_, then 1. Return *false*. - 1. If _chosenValue_[_i_] ≠ _readValue_[_i_] for some integer _i_ in the interval from 0 (inclusive) to _chosenLen_ (exclusive), then + 1. If _chosenValue_[_i_] ≠ _readValue_[_i_] for some integer _i_ in the interval from 0 (inclusive) to _chosenLength_ (exclusive), then 1. Return *false*. 1. Return *true*. @@ -49020,13 +53380,13 @@

              Valid Chosen Reads

              Coherent Reads

              A candidate execution _execution_ has coherent reads if the following algorithm returns *true*.

              - 1. For each ReadSharedMemory or ReadModifyWriteSharedMemory event _R_ of SharedDataBlockEventSet(_execution_), do - 1. Let _Ws_ be reads-bytes-from(_R_) in _execution_. - 1. Let _byteLocation_ be _R_.[[ByteIndex]]. - 1. For each element _W_ of _Ws_, do - 1. If _R_ happens-before _W_ in _execution_, then + 1. For each ReadSharedMemory or ReadModifyWriteSharedMemory event _readEvent_ of SharedDataBlockEventSet(_execution_), do + 1. Let _writes_ be reads-bytes-from(_readEvent_) in _execution_. + 1. Let _byteLocation_ be _readEvent_.[[ByteIndex]]. + 1. For each element _writeEvent_ of _writes_, do + 1. If _readEvent_ happens-before _writeEvent_ 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 _value_ that has _byteLocation_ in its memory range such that _writeEvent_ happens-before _value_ in _execution_ and _value_ happens-before _readEvent_ in _execution_, then 1. Return *false*. 1. Set _byteLocation_ to _byteLocation_ + 1. 1. Return *true*. @@ -49037,41 +53397,41 @@

              Coherent Reads

              Tear Free Reads

              A candidate execution _execution_ has tear free reads if the following algorithm returns *true*.

              - 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 ReadSharedMemory or ReadModifyWriteSharedMemory event _readEvent_ of SharedDataBlockEventSet(_execution_), do + 1. If _readEvent_.[[NoTear]] is *true*, then + 1. Assert: The remainder of dividing _readEvent_.[[ByteIndex]] by _readEvent_.[[ElementSize]] is 0. + 1. For each Memory event _writeEvent_ such that _readEvent_ reads-from _writeEvent_ in _execution_ and _writeEvent_.[[NoTear]] is *true*, do + 1. If _readEvent_ and _writeEvent_ have equal memory ranges and there exists a Memory event _value_ such that _value_ and _writeEvent_ have equal memory ranges, _value_.[[NoTear]] is *true*, _writeEvent_ and _value_ are not the same Shared Data Block event, and _readEvent_ reads-from _value_ 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.

              -

              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.

              +

              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 _eventA_ and _eventB_, _eventA_ is-memory-order-before _eventB_ in _execution_ if _eventA_ happens-before _eventB_ 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.

                +

                For events _readEvent_ and _writeEvent_ such that _readEvent_ reads-from _writeEvent_ in _execution_, there is no WriteSharedMemory or ReadModifyWriteSharedMemory event _value_ in SharedDataBlockEventSet(_execution_) such that _value_.[[Order]] is ~seq-cst~, _writeEvent_ is-memory-order-before _value_ in _execution_, _value_ is-memory-order-before _readEvent_ 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.
                • +
                • _writeEvent_ synchronizes-with _readEvent_ in _execution_, and _value_ and _readEvent_ have equal memory ranges.
                • +
                • _writeEvent_ happens-before _readEvent_ and _value_ happens-before _readEvent_ in _execution_, _writeEvent_.[[Order]] is ~seq-cst~, and _writeEvent_ and _value_ have equal memory ranges.
                • +
                • _writeEvent_ happens-before _readEvent_ and _writeEvent_ happens-before _value_ in _execution_, _readEvent_.[[Order]] is ~seq-cst~, and _value_ and _readEvent_ 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 _writeEvent_ in SharedDataBlockEventSet(_execution_), if _writeEvent_.[[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 _writeEvent_.

                -

                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.

              @@ -49099,13 +53459,13 @@

              Valid Executions

              Races

              -

              For an execution _execution_ and events _E_ and _D_ that are contained in SharedDataBlockEventSet(_execution_), _E_ and _D_ are in a race if the following algorithm returns *true*.

              +

              For an execution _execution_ and events _eventA_ and _eventB_ that are contained in SharedDataBlockEventSet(_execution_), _eventA_ and _eventB_ are in a race if the following algorithm returns *true*.

              - 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 _eventA_ and _eventB_ are not the same Shared Data Block event, then + 1. If it is not the case that both _eventA_ happens-before _eventB_ in _execution_ and _eventB_ happens-before _eventA_ in _execution_, then + 1. If _eventA_ is either a WriteSharedMemory or ReadModifyWriteSharedMemory event, _eventB_ is either a WriteSharedMemory or ReadModifyWriteSharedMemory event, and _eventA_ and _eventB_ 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. If _eventA_ reads-from _eventB_ in _execution_ or _eventB_ reads-from _eventA_ in _execution_, then 1. Return *true*. 1. Return *false*. @@ -49113,12 +53473,12 @@

              Races

              Data Races

              -

              For an execution _execution_ and events _E_ and _D_ that are contained in SharedDataBlockEventSet(_execution_), _E_ and _D_ are in a data race if the following algorithm returns *true*.

              +

              For an execution _execution_ and events _eventA_ and _eventB_ that are contained in SharedDataBlockEventSet(_execution_), _eventA_ and _eventB_ are in a data race if the following algorithm returns *true*.

              - 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. If _eventA_ and _eventB_ are in a race in _execution_, then + 1. If _eventA_.[[Order]] is not ~seq-cst~ or _eventB_.[[Order]] is not ~seq-cst~, then 1. Return *true*. - 1. If _E_ and _D_ have overlapping ranges, then + 1. If _eventA_ and _eventB_ have overlapping memory ranges, then 1. Return *true*. 1. Return *false*. @@ -49136,18 +53496,18 @@

              Shared Memory Guidelines

              The following are guidelines for ECMAScript programmers working with shared memory.

              We recommend programs be kept data race free, i.e., make it so that it is impossible for there to be concurrent non-atomic operations on the same memory location. Data race free programs have interleaving semantics where each step in the evaluation semantics of each agent are interleaved with each other. For data race free programs, it is not necessary to understand the details of the memory model. The details are unlikely to build intuition that will help one to better write ECMAScript.

              -

              More generally, even if a program is not data race free it may have predictable behaviour, so long as atomic operations are not involved in any data races and the operations that race all have the same access size. The simplest way to arrange for atomics not to be involved in races is to ensure that different memory cells are used by atomic and non-atomic operations and that atomic accesses of different sizes are not used to access the same cells at the same time. Effectively, the program should treat shared memory as strongly typed as much as possible. One still cannot depend on the ordering and timing of non-atomic accesses that race, but if memory is treated as strongly typed the racing accesses will not "tear" (bits of their values will not be mixed).

              +

              More generally, even if a program is not data race free it may have predictable behaviour, so long as atomic operations are not involved in any data races and the operations that race all have the same access size. The simplest way to arrange for atomics not to be involved in races is to ensure that different memory cells are used by atomic and non-atomic operations and that atomic accesses of different sizes are not used to access the same cells at the same time. Effectively, the program should treat shared memory as strongly typed as much as possible. One still cannot depend on the ordering and timing of non-atomic accesses that race, but if memory is treated as strongly typed the racing accesses will not “tear” (bits of their values will not be mixed).

              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 +53543,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.
              • @@ -49361,6 +53721,14 @@

                Expressions

                + +

                + When processing an instance of the production
                +
                + the interpretation of |CoverAwaitExpressionAndAwaitUsingDeclarationHead| is refined using the following grammar: +

                + +

                 

                @@ -49411,8 +53779,17 @@

                Statements

                + + +

                + When processing an instance of the production
                +
                + the interpretation of |CoverAwaitExpressionAndAwaitUsingDeclarationHead| is refined using the following grammar: +

                + +

                 

                @@ -49538,6 +53915,9 @@

                Scripts and Modules

                + + + @@ -49561,7 +53941,6 @@

                Number Conversions

                Time Zone Offset String Format

                - @@ -49581,6 +53960,8 @@

                Regular Expressions

                + + @@ -49638,6 +54019,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 +54127,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 @@ -49858,8 +54242,8 @@

                Static Semantics: CharacterValue

                ClassEscape :: `c` ClassControlLetter - 1. Let _ch_ be the code point matched by |ClassControlLetter|. - 1. Let _i_ be the numeric value of _ch_. + 1. Let _codePoint_ be the code point matched by |ClassControlLetter|. + 1. Let _i_ be the numeric value of _codePoint_. 1. Return the remainder of dividing _i_ by 32. CharacterEscape :: LegacyOctalEscapeSequence @@ -49887,14 +54271,14 @@

                Runtime Semantics: CompileAtom

                CompileAtom rules for the |Atom| productions except for Atom :: PatternCharacter are also used for the |ExtendedAtom| productions, but with |ExtendedAtom| substituted for |Atom|. The following rules, with parameter _direction_, are also added:

                ExtendedAtom :: `\` [lookahead == `c`] - 1. Let _A_ be the CharSet containing the single character `\\` U+005C (REVERSE SOLIDUS). - 1. Return CharacterSetMatcher(_rer_, _A_, *false*, _direction_). + 1. Let _charSet_ be the CharSet containing the single character `\\` U+005C (REVERSE SOLIDUS). + 1. Return CharacterSetMatcher(_regexpRecord_, _charSet_, *false*, _direction_). ExtendedAtom :: ExtendedPatternCharacter - 1. Let _ch_ be the character represented by |ExtendedPatternCharacter|. - 1. Let _A_ be a one-element CharSet containing the character _ch_. - 1. Return CharacterSetMatcher(_rer_, _A_, *false*, _direction_). + 1. Let _char_ be the character represented by |ExtendedPatternCharacter|. + 1. Let _charSet_ be a one-element CharSet containing the character _char_. + 1. Return CharacterSetMatcher(_regexpRecord_, _charSet_, *false*, _direction_).
                @@ -49905,27 +54289,27 @@

                Runtime Semantics: CompileToCharSet

                The following two rules replace the corresponding rules of CompileToCharSet.

                NonemptyClassRanges :: ClassAtom `-` ClassAtom ClassContents - 1. Let _A_ be CompileToCharSet of the first |ClassAtom| with argument _rer_. - 1. Let _B_ be CompileToCharSet of the second |ClassAtom| with argument _rer_. - 1. Let _C_ be CompileToCharSet of |ClassContents| with argument _rer_. - 1. Let _D_ be CharacterRangeOrUnion(_rer_, _A_, _B_). - 1. Return the union of _D_ and _C_. + 1. Let _charSet_ be CompileToCharSet of the first |ClassAtom| with argument _regexpRecord_. + 1. Let _otherSet_ be CompileToCharSet of the second |ClassAtom| with argument _regexpRecord_. + 1. Let _remainingSet_ be CompileToCharSet of |ClassContents| with argument _regexpRecord_. + 1. Let _rangeSet_ be CharacterRangeOrUnion(_regexpRecord_, _charSet_, _otherSet_). + 1. Return the union of _rangeSet_ and _remainingSet_. NonemptyClassRangesNoDash :: ClassAtomNoDash `-` ClassAtom ClassContents - 1. Let _A_ be CompileToCharSet of |ClassAtomNoDash| with argument _rer_. - 1. Let _B_ be CompileToCharSet of |ClassAtom| with argument _rer_. - 1. Let _C_ be CompileToCharSet of |ClassContents| with argument _rer_. - 1. Let _D_ be CharacterRangeOrUnion(_rer_, _A_, _B_). - 1. Return the union of _D_ and _C_. + 1. Let _charSet_ be CompileToCharSet of |ClassAtomNoDash| with argument _regexpRecord_. + 1. Let _otherSet_ be CompileToCharSet of |ClassAtom| with argument _regexpRecord_. + 1. Let _remainingSet_ be CompileToCharSet of |ClassContents| with argument _regexpRecord_. + 1. Let _rangeSet_ be CharacterRangeOrUnion(_regexpRecord_, _charSet_, _otherSet_). + 1. Return the union of _rangeSet_ and _remainingSet_.

                In addition, the following rules are added to CompileToCharSet.

                ClassEscape :: `c` ClassControlLetter - 1. Let _cv_ be the CharacterValue of this |ClassEscape|. - 1. Let _c_ be the character whose character value is _cv_. - 1. Return the CharSet containing the single character _c_. + 1. Let _charValue_ be the CharacterValue of this |ClassEscape|. + 1. Let _char_ be the character whose character value is _charValue_. + 1. Return the CharSet containing the single character _char_. ClassAtomNoDash :: `\` [lookahead == `c`] @@ -49937,19 +54321,19 @@

                Runtime Semantics: CompileToCharSet

                CharacterRangeOrUnion ( - _rer_: a RegExp Record, - _A_: a CharSet, - _B_: a CharSet, + _regexpRecord_: a RegExp Record, + _charSet_: a CharSet, + _otherSet_: a CharSet, ): a CharSet

                - 1. If HasEitherUnicodeFlag(_rer_) is *false*, then - 1. If _A_ does not contain exactly one character or _B_ does not contain exactly one character, then - 1. Let _C_ be the CharSet containing the single character `-` U+002D (HYPHEN-MINUS). - 1. Return the union of CharSets _A_, _B_ and _C_. - 1. Return CharacterRange(_A_, _B_). + 1. If HasEitherUnicodeFlag(_regexpRecord_) is *false*, then + 1. If _charSet_ does not contain exactly one character or _otherSet_ does not contain exactly one character, then + 1. Let _remainingSet_ be the CharSet containing the single character `-` U+002D (HYPHEN-MINUS). + 1. Return the union of CharSets _charSet_, _otherSet_ and _remainingSet_. + 1. Return CharacterRange(_charSet_, _otherSet_).
                @@ -49984,23 +54368,25 @@

                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% - `escape` + *"escape"* The `escape` function () @@ -50011,7 +54397,7 @@

              Additional Properties of the Global Object

              %unescape%
              - `unescape` + *"unescape"* The `unescape` function () @@ -50020,7 +54406,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.

              @@ -50028,60 +54414,60 @@

              escape ( _string_ )

              It performs the following steps when called:

              1. Set _string_ to ? ToString(_string_). - 1. Let _len_ be the length of _string_. - 1. Let _R_ be the empty String. + 1. Let _length_ be the length of _string_. + 1. Let _result_ be the empty String. 1. Let _unescapedSet_ be the string-concatenation of the ASCII word characters and *"@\*+-./"*. 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. Let _C_ be the code unit at index _k_ within _string_. - 1. If _unescapedSet_ contains _C_, then - 1. Let _S_ be _C_. + 1. Repeat, while _k_ < _length_, + 1. Let _codeUnit_ be the code unit at index _k_ within _string_. + 1. If _unescapedSet_ contains _codeUnit_, then + 1. Let _nextPart_ be _codeUnit_. 1. Else, - 1. Let _n_ be the numeric value of _C_. - 1. If _n_ < 256, then - 1. Let _hex_ be the String representation of _n_, formatted as an uppercase hexadecimal number. - 1. Let _S_ be the string-concatenation of *"%"* and StringPad(_hex_, 2, *"0"*, ~start~). + 1. Let _codeUnitNumber_ be the numeric value of _codeUnit_. + 1. If _codeUnitNumber_ < 256, then + 1. Let _hex_ be the String representation of _codeUnitNumber_, formatted as an uppercase hexadecimal number. + 1. Let _nextPart_ be the string-concatenation of *"%"* and StringPad(_hex_, 2, *"0"*, ~start~). 1. Else, - 1. Let _hex_ be the String representation of _n_, formatted as an uppercase hexadecimal number. - 1. Let _S_ be the string-concatenation of *"%u"* and StringPad(_hex_, 4, *"0"*, ~start~). - 1. Set _R_ to the string-concatenation of _R_ and _S_. + 1. Let _hex_ be the String representation of _codeUnitNumber_, formatted as an uppercase hexadecimal number. + 1. Let _nextPart_ be the string-concatenation of *"%u"* and StringPad(_hex_, 4, *"0"*, ~start~). + 1. Set _result_ to the string-concatenation of _result_ and _nextPart_. 1. Set _k_ to _k_ + 1. - 1. Return _R_. + 1. Return _result_.

              The encoding is partly based on the encoding described in RFC 1738, but the entire encoding specified in this standard is described above without regard to the contents of RFC 1738. This encoding does not reflect changes to RFC 1738 made by RFC 3986.

              - +

              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.

              It performs the following steps when called:

              1. Set _string_ to ? ToString(_string_). - 1. Let _len_ be the length of _string_. - 1. Let _R_ be the empty String. + 1. Let _length_ be the length of _string_. + 1. Let _result_ be the empty String. 1. Let _k_ be 0. - 1. Repeat, while _k_ < _len_, - 1. Let _C_ be the code unit at index _k_ within _string_. - 1. If _C_ is the code unit 0x0025 (PERCENT SIGN), then + 1. Repeat, while _k_ < _length_, + 1. Let _codeUnit_ be the code unit at index _k_ within _string_. + 1. If _codeUnit_ is the code unit 0x0025 (PERCENT SIGN), then 1. Let _hexDigits_ be the empty String. 1. Let _optionalAdvance_ be 0. - 1. If _k_ + 5 < _len_ and the code unit at index _k_ + 1 within _string_ is the code unit 0x0075 (LATIN SMALL LETTER U), then + 1. If _k_ + 5 < _length_ and the code unit at index _k_ + 1 within _string_ is the code unit 0x0075 (LATIN SMALL LETTER U), then 1. Set _hexDigits_ to the substring of _string_ from _k_ + 2 to _k_ + 6. 1. Set _optionalAdvance_ to 5. - 1. Else if _k_ + 3 ≤ _len_, then + 1. Else if _k_ + 3 ≤ _length_, then 1. Set _hexDigits_ to the substring of _string_ from _k_ + 1 to _k_ + 3. 1. Set _optionalAdvance_ to 2. 1. Let _parseResult_ be ParseText(_hexDigits_, |HexDigits[~Sep]|). 1. If _parseResult_ is a Parse Node, then - 1. Let _n_ be the MV of _parseResult_. - 1. Set _C_ to the code unit whose numeric value is _n_. + 1. Let _codeUnitNumber_ be the MV of _parseResult_. + 1. Set _codeUnit_ to the code unit whose numeric value is _codeUnitNumber_. 1. Set _k_ to _k_ + _optionalAdvance_. - 1. Set _R_ to the string-concatenation of _R_ and _C_. + 1. Set _result_ to the string-concatenation of _result_ and _codeUnit_. 1. Set _k_ to _k_ + 1. - 1. Return _R_. + 1. Return _result_.
              @@ -50089,179 +54475,180 @@

              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 _S_ be ? ToString(_O_). - 1. Let _size_ be the length of _S_. + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireObjectCoercible(_obj_). + 1. Let _string_ be ? ToString(_obj_). + 1. Let _size_ be the length of _string_. 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_. + 1. Return the substring of _string_ from _intStart_ to _intEnd_.

              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.anchor ( _name_ )

              This method performs the following steps when called:

              - 1. Let _S_ be the *this* value. - 1. Return ? CreateHTML(_S_, *"a"*, *"name"*, _name_). + 1. Let _string_ be the *this* value. + 1. Return ? CreateHTML(_string_, *"a"*, *"name"*, _name_).

              CreateHTML ( - _string_: an ECMAScript language value, + _contents_: an ECMAScript language value, _tag_: a String, - _attribute_: a String, - _value_: an ECMAScript language value, + _attr_: a String, + _attrValue_: an ECMAScript language value, ): either a normal completion containing a String or a throw completion

              - 1. Let _str_ be ? RequireObjectCoercible(_string_). - 1. Let _S_ be ? ToString(_str_). - 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_). - 1. Let _escapedV_ be the String value that is the same as _V_ except that each occurrence of the code unit 0x0022 (QUOTATION MARK) in _V_ has been replaced with the six code unit sequence *"&quot;"*. - 1. Set _p1_ to the string-concatenation of: - * _p1_ + 1. Perform ? RequireObjectCoercible(_contents_). + 1. Let _contentsString_ be ? ToString(_contents_). + 1. Let _part1_ be the string-concatenation of *"<"* and _tag_. + 1. If _attr_ is not the empty String, then + 1. Let _attrValueString_ be ? ToString(_attrValue_). + 1. Let _escapedAttrValue_ be the String value that is the same as _attrValueString_ except that each occurrence of the code unit 0x0022 (QUOTATION MARK) in _attrValueString_ has been replaced with the six code unit sequence *"&quot;"*. + 1. Set _part1_ to the string-concatenation of: + * _part1_ * the code unit 0x0020 (SPACE) - * _attribute_ + * _attr_ * the code unit 0x003D (EQUALS SIGN) * the code unit 0x0022 (QUOTATION MARK) - * _escapedV_ + * _escapedAttrValue_ * the code unit 0x0022 (QUOTATION MARK) - 1. Let _p2_ be the string-concatenation of _p1_ and *">"*. - 1. Let _p3_ be the string-concatenation of _p2_ and _S_. - 1. Let _p4_ be the string-concatenation of _p3_, *"</"*, _tag_, and *">"*. - 1. Return _p4_. + 1. Let _part2_ be the string-concatenation of _part1_ and *">"*. + 1. Let _part3_ be the string-concatenation of _part2_ and _contentsString_. + 1. Let _part4_ be the string-concatenation of _part3_, *"</"*, _tag_, and *">"*. + 1. Return _part4_.
              - +

              String.prototype.big ( )

              This method performs the following steps when called:

              - 1. Let _S_ be the *this* value. - 1. Return ? CreateHTML(_S_, *"big"*, *""*, *""*). + 1. Let _string_ be the *this* value. + 1. Return ? CreateHTML(_string_, *"big"*, *""*, *""*).
              - +

              String.prototype.blink ( )

              This method performs the following steps when called:

              - 1. Let _S_ be the *this* value. - 1. Return ? CreateHTML(_S_, *"blink"*, *""*, *""*). + 1. Let _string_ be the *this* value. + 1. Return ? CreateHTML(_string_, *"blink"*, *""*, *""*).
              - +

              String.prototype.bold ( )

              This method performs the following steps when called:

              - 1. Let _S_ be the *this* value. - 1. Return ? CreateHTML(_S_, *"b"*, *""*, *""*). + 1. Let _string_ be the *this* value. + 1. Return ? CreateHTML(_string_, *"b"*, *""*, *""*).
              - +

              String.prototype.fixed ( )

              This method performs the following steps when called:

              - 1. Let _S_ be the *this* value. - 1. Return ? CreateHTML(_S_, *"tt"*, *""*, *""*). + 1. Let _string_ be the *this* value. + 1. Return ? CreateHTML(_string_, *"tt"*, *""*, *""*).
              - -

              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. Let _string_ be the *this* value. + 1. Return ? CreateHTML(_string_, *"font"*, *"color"*, _colour_).
              - +

              String.prototype.fontsize ( _size_ )

              This method performs the following steps when called:

              - 1. Let _S_ be the *this* value. - 1. Return ? CreateHTML(_S_, *"font"*, *"size"*, _size_). + 1. Let _string_ be the *this* value. + 1. Return ? CreateHTML(_string_, *"font"*, *"size"*, _size_).
              - +

              String.prototype.italics ( )

              This method performs the following steps when called:

              - 1. Let _S_ be the *this* value. - 1. Return ? CreateHTML(_S_, *"i"*, *""*, *""*). + 1. Let _string_ be the *this* value. + 1. Return ? CreateHTML(_string_, *"i"*, *""*, *""*).
              - +

              String.prototype.link ( _url_ )

              This method performs the following steps when called:

              - 1. Let _S_ be the *this* value. - 1. Return ? CreateHTML(_S_, *"a"*, *"href"*, _url_). + 1. Let _string_ be the *this* value. + 1. Return ? CreateHTML(_string_, *"a"*, *"href"*, _url_).
              - +

              String.prototype.small ( )

              This method performs the following steps when called:

              - 1. Let _S_ be the *this* value. - 1. Return ? CreateHTML(_S_, *"small"*, *""*, *""*). + 1. Let _string_ be the *this* value. + 1. Return ? CreateHTML(_string_, *"small"*, *""*, *""*).
              - +

              String.prototype.strike ( )

              This method performs the following steps when called:

              - 1. Let _S_ be the *this* value. - 1. Return ? CreateHTML(_S_, *"strike"*, *""*, *""*). + 1. Let _string_ be the *this* value. + 1. Return ? CreateHTML(_string_, *"strike"*, *""*, *""*).
              - +

              String.prototype.sub ( )

              This method performs the following steps when called:

              - 1. Let _S_ be the *this* value. - 1. Return ? CreateHTML(_S_, *"sub"*, *""*, *""*). + 1. Let _string_ be the *this* value. + 1. Return ? CreateHTML(_string_, *"sub"*, *""*, *""*).
              - +

              String.prototype.sup ( )

              This method performs the following steps when called:

              - 1. Let _S_ be the *this* value. - 1. Return ? CreateHTML(_S_, *"sup"*, *""*, *""*). + 1. Let _string_ be the *this* value. + 1. Return ? CreateHTML(_string_, *"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 +54656,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,43 +54668,43 @@

              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.”

              This method performs the following steps when called:

              - 1. Let _dateObject_ be the *this* value. - 1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]). - 1. Let _t_ be _dateObject_.[[DateValue]]. - 1. If _t_ is *NaN*, return *NaN*. - 1. Return YearFromTime(LocalTime(_t_)) - *1900*𝔽. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _tv_ be _dateObj_.[[DateValue]]. + 1. If _tv_ is *NaN*, return *NaN*. + 1. Return YearFromTime(LocalTime(_tv_)) - *1900*𝔽.
              - +

              Date.prototype.setYear ( _year_ )

              The `setFullYear` method is preferred for nearly all purposes, because it avoids the “year 2000 problem.”

              This method performs the following steps when called:

              - 1. Let _dateObject_ be the *this* value. - 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. Let _yyyy_ be MakeFullYear(_y_). - 1. Let _d_ be MakeDay(_yyyy_, MonthFromTime(_t_), DateFromTime(_t_)). - 1. Let _date_ be MakeDate(_d_, TimeWithinDay(_t_)). - 1. Let _u_ be TimeClip(UTC(_date_)). - 1. Set _dateObject_.[[DateValue]] to _u_. - 1. Return _u_. + 1. Let _dateObj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_dateObj_, [[DateValue]]). + 1. Let _time_ be _dateObj_.[[DateValue]]. + 1. Let _year_ be ? ToNumber(_year_). + 1. If _time_ is *NaN*, set _time_ to *+0*𝔽; else set _time_ to LocalTime(_time_). + 1. Let _fullYear_ be MakeFullYear(_year_). + 1. Let _day_ be MakeDay(_fullYear_, MonthFromTime(_time_), DateFromTime(_time_)). + 1. Let _date_ be MakeDate(_day_, TimeWithinDay(_time_)). + 1. Let _utcTimestamp_ be TimeClip(UTC(_date_)). + 1. Set _dateObj_.[[DateValue]] to _utcTimestamp_. + 1. Return _utcTimestamp_.
              - +

              Date.prototype.toGMTString ( )

              The `toUTCString` method is preferred. This method is provided principally for compatibility with old code.

              @@ -50329,20 +54716,17 @@

              Date.prototype.toGMTString ( )

              Additional Properties of the RegExp.prototype Object

              - +

              RegExp.prototype.compile ( _pattern_, _flags_ )

              This method performs the following steps when called:

              - 1. Let _O_ be the *this* value. - 1. Perform ? RequireInternalSlot(_O_, [[RegExpMatcher]]). + 1. Let _obj_ be the *this* value. + 1. Perform ? RequireInternalSlot(_obj_, [[RegExpMatcher]]). 1. If _pattern_ is an Object and _pattern_ has a [[RegExpMatcher]] internal slot, then 1. If _flags_ is not *undefined*, throw a *TypeError* exception. - 1. Let _P_ be _pattern_.[[OriginalSource]]. - 1. Let _F_ be _pattern_.[[OriginalFlags]]. - 1. Else, - 1. Let _P_ be _pattern_. - 1. Let _F_ be _flags_. - 1. Return ? RegExpInitialize(_O_, _P_, _F_). + 1. Set _flags_ to _pattern_.[[OriginalFlags]]. + 1. Set _pattern_ to _pattern_.[[OriginalSource]]. + 1. Return ? RegExpInitialize(_obj_, _pattern_, _flags_).

              This method completely reinitializes the *this* value RegExp with a new pattern and flags. An implementation may interpret use of this method as an assertion that the resulting RegExp object will be used multiple times and hence is a candidate for extra optimization.

              @@ -50356,13 +54740,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 +54805,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 +54832,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.

              @@ -50652,9 +54882,9 @@

              Initializers in ForIn Statement Heads

              The static semantics of VarScopedDeclarations in are augmented with the following:

              ForInOfStatement : `for` `(` `var` BindingIdentifier Initializer `in` Expression `)` Statement - 1. Let _declarations1_ be « |BindingIdentifier| ». - 1. Let _declarations2_ be the VarScopedDeclarations of |Statement|. - 1. Return the list-concatenation of _declarations1_ and _declarations2_. + 1. Let _decls1_ be « |BindingIdentifier| ». + 1. Let _decls2_ be the VarScopedDeclarations of |Statement|. + 1. Return the list-concatenation of _decls1_ and _decls2_.

              The runtime semantics of ForInOfLoopEvaluation in are augmented with the following:

              ForInOfStatement : `for` `(` `var` BindingIdentifier Initializer `in` Expression `)` Statement @@ -50678,32 +54908,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 +54925,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.

              +
              @@ -50732,7 +54951,7 @@

              The Strict Mode of ECMAScript

              A conforming implementation, when processing strict mode code, must disallow instances of the productions EscapeSequence :: LegacyOctalEscapeSequence and EscapeSequence :: NonOctalDecimalEscapeSequence.
            • - Assignment to an undeclared identifier or otherwise unresolvable reference does not create a property in the global object. When a simple assignment occurs within strict mode code, its |LeftHandSideExpression| must not evaluate to an unresolvable Reference. If it does a *ReferenceError* exception is thrown (). The |LeftHandSideExpression| also may not be a reference to a data property with the attribute value { [[Writable]]: *false* }, to an accessor property with the attribute value { [[Set]]: *undefined* }, nor to a non-existent property of an object whose [[Extensible]] internal slot is *false*. In these cases a `TypeError` exception is thrown (). + Assignment to an undeclared identifier or otherwise unresolvable reference does not create a property in the global object. When a simple assignment occurs within strict mode code, its |LeftHandSideExpression| must not evaluate to an unresolvable Reference. If it does a *ReferenceError* exception is thrown (). The |LeftHandSideExpression| also may not be a reference to a data property with the attribute value { [[Writable]]: *false* }, to an accessor property with the attribute value { [[Setter]]: *undefined* }, nor to a non-existent property of an object whose [[Extensible]] internal slot is *false*. In these cases a `TypeError` exception is thrown ().
            • An |IdentifierReference| with the StringValue *"eval"* or *"arguments"* may not appear as the |LeftHandSideExpression| of an Assignment operator () or of an |UpdateExpression| () or as the |UnaryExpression| operated upon by a Prefix Increment () or a Prefix Decrement () operator. @@ -50793,6 +55012,7 @@

              Host Hooks

              HostGrowSharedArrayBuffer(...)

              HostHasSourceTextAvailable(...)

              HostLoadImportedModule(...)

              +

              HostGetSupportedImportAttributes(...)

              HostMakeJobCallback(...)

              HostPromiseRejectionTracker(...)

              HostResizeArrayBuffer(...)

              @@ -50805,7 +55025,6 @@

              Host-defined Fields

              [[HostDefined]] on Script Records: See .

              [[HostDefined]] on Module Records: See .

              [[HostDefined]] on JobCallback Records: See .

              -

              [[HostSynchronizesWith]] on Candidate Executions: See .

              [[IsHTMLDDA]]: See .

              @@ -50839,8 +55058,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.

              @@ -50865,7 +55084,7 @@

              Additions and Changes That Introduce Incompatibilities with Prior Editions: In ECMAScript 2015, it is an early error for a |Catch| clause to contain a `var` declaration for the same |Identifier| that appears as the |Catch| clause parameter. In previous editions, such a variable declaration would be instantiated in the enclosing variable environment but the declaration's |Initializer| value would be assigned to the |Catch| parameter.

              , : In ECMAScript 2015, a runtime *SyntaxError* is thrown if a |Catch| clause evaluates a non-strict direct `eval` whose eval code includes a `var` or `FunctionDeclaration` declaration that binds the same |Identifier| that appears as the |Catch| clause parameter.

              : In ECMAScript 2015, the result of a |TryStatement| is never the value ~empty~. If the |Block| part of a |TryStatement| evaluates to a normal completion containing ~empty~, the result of the |TryStatement| is *undefined*. If the |Block| part of a |TryStatement| evaluates to a throw completion and it has a |Catch| part that evaluates to a normal completion containing ~empty~, the result of the |TryStatement| is *undefined* if there is no |Finally| clause or if its |Finally| clause evaluates to an ~empty~ normal completion.

              -

              In ECMAScript 2015, the function objects that are created as the values of the [[Get]] or [[Set]] attribute of accessor properties in an |ObjectLiteral| are not constructor functions and they do not have a *"prototype"* own property. In the previous edition, they were constructors and had a *"prototype"* property.

              +

              In ECMAScript 2015, the function objects that are created as the values of the [[Getter]] or [[Setter]] attribute of accessor properties in an |ObjectLiteral| are not constructor functions and they do not have a *"prototype"* own property. In the previous edition, they were constructors and had a *"prototype"* property.

              : In ECMAScript 2015, if the argument to `Object.freeze` is not an object it is treated as if it was a non-extensible ordinary object with no own properties. In the previous edition, a non-object argument always causes a *TypeError* to be thrown.

              : In ECMAScript 2015, if the argument to `Object.getOwnPropertyDescriptor` is not an object an attempt is made to coerce the argument using ToObject. If the coercion is successful the result is used in place of the original argument value. In the previous edition, a non-object argument always causes a *TypeError* to be thrown.

              : In ECMAScript 2015, if the argument to `Object.getOwnPropertyNames` is not an object an attempt is made to coerce the argument using ToObject. If the coercion is successful the result is used in place of the original argument value. In the previous edition, a non-object argument always causes a *TypeError* to be thrown.

              @@ -50890,13 +55109,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 +55165,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 3bafffaee3d..1b6479a1269 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 169823b7b9f..8ab11640ed8 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 b8af3e7b4d5..2bf328116d7 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