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

Unclear requirement on Module Source Objects prototypes #67

Open
Ms2ger opened this issue Nov 26, 2024 · 4 comments
Open

Unclear requirement on Module Source Objects prototypes #67

Ms2ger opened this issue Nov 26, 2024 · 4 comments

Comments

@Ms2ger
Copy link

Ms2ger commented Nov 26, 2024

All Module Source Objects should have a prototype of %AbstractModuleSource%.prototype.

Why "should"? Per RFC 2119:

3. SHOULD   This word, or the adjective "RECOMMENDED", mean that there
   may exist valid reasons in particular circumstances to ignore a
   particular item, but the full implications must be understood and
   carefully weighed before choosing a different course.

I think it should (pun not intended) either say "must" or clarify when it should be different

@nicolo-ribaudo
Copy link
Member

The problem is that users can Object.setPrototypeOf on them, but that doesn't make the less Module Source Objects.

@Ms2ger
Copy link
Author

Ms2ger commented Nov 26, 2024

Sure, but I assume this line is meant to require things about the initial situation.

@ljharb
Copy link
Member

ljharb commented Nov 26, 2024

indeed; they must initially have that prototype; it's fine if it's changed by user code later.

@guybedford
Copy link
Collaborator

guybedford commented Nov 26, 2024

I added an editorial update in tc39/ecma262@a91247d to change this to "must be initialized" over should.

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

4 participants