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

Internal method invariants vague about exceptions #680

Closed
annevk opened this issue Aug 30, 2016 · 8 comments
Closed

Internal method invariants vague about exceptions #680

annevk opened this issue Aug 30, 2016 · 8 comments
Labels
completion records Relates to completion records, and ? / ! notation.

Comments

@annevk
Copy link
Member

annevk commented Aug 30, 2016

A number of internal methods can throw per HTML, but https://tc39.github.io/ecma262/#sec-invariants-of-the-essential-internal-methods is not clear on whether that is allowed. (Despite it already being implicitly allowed, e.g., OrdinaryDelete invoking [[GetOwnProperty]] with a ? in front of it.)

This came up in whatwg/html#1726 as cross-origin [[Delete]] always throws in implementations, even outside "strict mode", and therefore cannot simply return false.

@claudepache
Copy link
Contributor

All internal methods may throw: that can happen notably, but not exclusively, when user-defined code is triggered and throws (Proxies, user-defined accessors, etc.). And https://tc39.github.io/ecma262/#sec-invariants-of-the-essential-internal-methods applies only when the internal method returns nonabruptly: maybe that should be said explicitly?

@annevk
Copy link
Member Author

annevk commented Aug 30, 2016

It would help me, I think I got myself confused a few times now reading that section.

@ljharb ljharb added the completion records Relates to completion records, and ? / ! notation. label Mar 21, 2018
@jmdyck
Copy link
Collaborator

jmdyck commented Aug 9, 2019

(Just noticed this issue.) See #1537 for related discussion, and #1539 which should resolve @annevk's original concern.

@allenwb
Copy link
Member

allenwb commented Aug 9, 2019

Note that 6.1.7.2 says:

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.

@jmdyck
Copy link
Collaborator

jmdyck commented Aug 9, 2019

(Yes, but also note that it didn't say that when @annevk opened this issue.)

@allenwb
Copy link
Member

allenwb commented Aug 9, 2019

We ES6, at approximately the same place said:

An internal method implicitly returns a Completion Record as described in 6.2.2.

The explicit case would have been covered by being explicit.

@jmdyck
Copy link
Collaborator

jmdyck commented Aug 9, 2019

Yup, and saying that it returns a Completion Record wasn't enough to answer the original question.

@annevk
Copy link
Member Author

annevk commented Aug 12, 2019

Thanks for fixing this @jmdyck!

@annevk annevk closed this as completed Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completion records Relates to completion records, and ? / ! notation.
Projects
None yet
Development

No branches or pull requests

5 participants