Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: add Promise.try (#3327) #3327

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ 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
- uses: actions/checkout@v4
- uses: ljharb/actions/node/install@6bc39109c48f74895ad72ec03ca0bb4e4da2fa3f
name: 'nvm install lts/* && npm ci --no-audit'
env:
NPM_CONFIG_AUDIT: false
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ 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
- uses: actions/checkout@v4
- uses: ljharb/actions/node/install@6bc39109c48f74895ad72ec03ca0bb4e4da2fa3f
name: 'nvm install lts/* && npm ci --no-audit'
env:
NPM_CONFIG_AUDIT: false
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/enforce-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ 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
- uses: actions/checkout@v4
- uses: ljharb/actions/node/install@6bc39109c48f74895ad72ec03ca0bb4e4da2fa3f
name: 'nvm install lts/* && npm ci --no-audit'
env:
NPM_CONFIG_AUDIT: false
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/esmeta-typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ on: [pull_request]
jobs:
esmeta-typecheck:
name: 'esmeta typecheck'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

env:
ESMETA_HOME: vendor/esmeta

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Setup SBT
uses: sbt/setup-sbt@v1
- name: download esmeta
run: |
mkdir -p "${ESMETA_HOME}"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ipr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ 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
- uses: actions/checkout@v4
- uses: ljharb/actions/node/install@6bc39109c48f74895ad72ec03ca0bb4e4da2fa3f
name: 'nvm install lts/* && npm ci --no-audit'
env:
NPM_CONFIG_AUDIT: false
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ on: [pull_request]
jobs:
build:
name: 'build PR preview'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae
- uses: actions/checkout@v4
- uses: ljharb/actions/node/install@6bc39109c48f74895ad72ec03ca0bb4e4da2fa3f
name: 'nvm install lts/* && npm ci --no-audit'
env:
NPM_CONFIG_AUDIT: false
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
upload:
name: 'upload PR preview'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: >
${{
github.event.workflow_run.event == 'pull_request' &&
Expand All @@ -18,8 +18,8 @@ jobs:
}}

steps:
- uses: actions/checkout@v3
- uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae
- uses: actions/checkout@v4
- uses: ljharb/actions/node/install@6bc39109c48f74895ad72ec03ca0bb4e4da2fa3f
name: 'nvm install lts/* && npm ci --no-audit'
env:
NPM_CONFIG_AUDIT: false
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-biblio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ on:
jobs:
publish:
name: 'publish ecma262-biblio'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: ${{ github.repository == 'tc39/ecma262' }}

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/require-allow-edits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ on: [pull_request]
jobs:
spellcheck:
name: 'check for newly-introduced spelling errors'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- run: sudo apt-get install aspell
- uses: actions/checkout@v3
- 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@d9f477827ed71a259056764107f74afc29febcae
- uses: ljharb/actions/node/install@6bc39109c48f74895ad72ec03ca0bb4e4da2fa3f
name: 'nvm install lts/* && npm ci --no-audit'
env:
NPM_CONFIG_AUDIT: false
Expand Down
19 changes: 19 additions & 0 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -47588,6 +47588,25 @@ <h1>
</emu-clause>
</emu-clause>
ljharb marked this conversation as resolved.
Show resolved Hide resolved

<emu-clause id="sec-promise.try">
<h1>Promise.try ( _callback_, ..._args_ )</h1>
<p>When the `try` method is called with argument _callback_, the following steps are taken:</p>
<emu-alg>
1. Let _C_ be the *this* value.
1. If _C_ is not an Object, throw a *TypeError* exception.
1. Let _promiseCapability_ be ? NewPromiseCapability(_C_).
1. Let _status_ be Completion(Call(_callback_, *undefined*, _args_)).
1. If _status_ is an abrupt completion, then
1. Perform ? Call(_promiseCapability_.[[Reject]], *undefined*, « _status_.[[Value]] »).
1. Else,
1. Perform ? Call(_promiseCapability_.[[Resolve]], *undefined*, « _status_.[[Value]] »).
1. Return _promiseCapability_.[[Promise]].
</emu-alg>
<emu-note>
<p>This function expects its *this* value to be a constructor function that supports the parameter conventions of the Promise constructor.</p>
</emu-note>
</emu-clause>

<emu-clause id="sec-promise.withResolvers">
<h1>Promise.withResolvers ( )</h1>
<p>This function returns an object with three properties: a new promise together with the `resolve` and `reject` functions associated with it.</p>
Expand Down
Loading