WebAudio / web-audio-api

The Web Audio API v1.0, developed by the W3C Audio WG
https://webaudio.github.io/web-audio-api/
Other
1.04k stars 166 forks source link

ECMA262 Completion links #2339

Closed svgeesus closed 3 years ago

svgeesus commented 3 years ago

Describe the issue

Broken links to https://tc39.es/ecma262/#sec-completion

Set <var>completion</var> to new <a href="https://tc39.es/ecma262/#sec-completion">Completion</a>
{[[Type]]: throw,

I believe this should be https://tc39.es/ecma262/#sec-throwcompletion

Set <var>completion</var> to new <a href="https://tc39.es/ecma262/#sec-throwcompletion">Completion</a>
{[[Type]]: throw,

and also

<b id="audio-worklet-render-return">Return:</b> at this point <var>completion</var> will be set to an ECMAScript <a href="https://tc39.es/ecma262/#sec-completion">completion</a> value.

I believe in this case it should link to https://tc39.es/ecma262/#sec-completion-record-specification-type

<b id="audio-worklet-render-return">Return:</b> at this point <var>completion</var> will be set to an ECMAScript <a href=" https://tc39.es/ecma262/#sec-completion-record-specification-type">completion</a> value.

(I have made these changes to the Proposed Rec)

rtoy commented 3 years ago

Looking at https://tc39.es/ecma262/#sec-throwcompletion and https://tc39.es/ecma262/#sec-completion-record-specification-type, it does seem like throw-completion is what we want. But I think we might want to say:

Set completion to `throwCompletion({[[Type]: throw, [[Value]]: newly created TypeError, [[Target]]: empty})

I find the phrasing here a bit odd. It might be better to have step 0:

0. Let |value| be a newly created `TypeError` object.
1. Set |completion| to throwCompletiong({[[Type]: throw, [[Value]]: value, [[Target]]: empty}).

I think the second point about the record type is correct.

Since you already made the change for the PR, I don't know what we can do. At the very least we should match what you did in the PR.

padenot commented 3 years ago

Can we have a diff and back port here?