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

spec language of calling ThrowCompletion seems strange #65

Open
FrankYFTang opened this issue May 10, 2024 · 1 comment
Open

spec language of calling ThrowCompletion seems strange #65

FrankYFTang opened this issue May 10, 2024 · 1 comment

Comments

@FrankYFTang
Copy link
Contributor

I think the language used in the spec text about calling ThrowCompletion() may need to be change via editorial PR

We now have

  1. Let error be ThrowCompletion(TypeError).
    in https://tc39.es/proposal-intl-messageformat/#sec-selectpattern

a. Let error be ThrowCompletion(ReferenceError).
in https://tc39.es/proposal-intl-messageformat/#sec-resolveexpression

a. Let error be ThrowCompletion(ReferenceError).
i. Let error be ThrowCompletion(TypeError).
in https://tc39.es/proposal-intl-messageformat/#sec-resolvefunction

i. Let error be ThrowCompletion(ReferenceError).

  1. Let error be ThrowCompletion(ReferenceError).
    in https://tc39.es/proposal-intl-messageformat/#sec-resolvevalue

but ThrowCompletion is expecting a an ECMAScript language value
see https://tc39.es/ecma262/#sec-throwcompletion
but TypeError and ReferenceError are "Global Name" as defined in
and https://tc39.es/ecma262/#sec-well-known-intrinsic-objects

Is "Global Name" an ECMAScript language value ?

Looks other part of ecma262. it seems the language in spec text is

  1. Return ThrowCompletion(a newly created TypeError object).

i. Let error be ThrowCompletion(a newly created TypeError object).

a. Let error be a newly created TypeError object.

  1. Let error be a newly created AggregateError object.
    etc
@ljharb
Copy link
Member

ljharb commented May 10, 2024

Indeed, ThrowCompletion does not take a constructor, it takes an error object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants