ecma262
ecma262 copied to clipboard
Editorial: Rework Module Namespace's [[Get]] method
This PR merely inlines Module Namespace's [[Get]] into its [[GetOwnProperty]] method because:
[[Get]]doesn't (need to) terminate prototype chain traversal, unlike TypedArray's[[Get]], since module namespace object's prototype isnulland it's non-extensible.- Some Module Namespace's methods like
[[HasProperty]]or[[Delete]]are subtly different from ordinary ones: they prevent from calling into[[GetOwnProperty]]that may throw. We should avoid having methods that are totally equivalent to ordinary ones, like[[Get]], so they won't be accidentally ignored by implementors. - It relieves runtimes from calling into
[[Get]]override, and continue performingOrdinaryGet, which is preferred for simplicity / performance reasons.
We discussed this on the editor call, and the conclusion is:
- We like the change to get [[Get]] delegating to [[GetOwnProperty]], since that's the usual state of things.
- We'd like to keep an explicit [[Get]] instead of removing it for clarity. We recommend copy/pasting the relevant parts of ordinary objects' [[Get]], with the irrelevant parts omitted. A note that says this is just ordinary [[Get]] with irrelevant parts omitted would be helpful.
- Keep the steps inlined into [[GetOwnProperty]] as you currently have.