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

Declaring constructors as methods is strange #31

Open
domenic opened this issue Jun 20, 2024 · 0 comments
Open

Declaring constructors as methods is strange #31

domenic opened this issue Jun 20, 2024 · 0 comments

Comments

@domenic
Copy link

domenic commented Jun 20, 2024

In https://privacycg.github.io/saa-non-cookie-storage/#storageaccesshandle the members BroadcastChannel and SharedWorker are presumably supposed to be sort of namespaced versions of the global BroadcastChannel and SharedWorker constructors.

However, since they are declared as Web IDL operations, they end up as JavaScript methods, not constructors.

This has several observable differences, notably around how they don't require new, and fail various IsConstructor tests. E.g. they cannot be subclassed.

Ideally we would define these as constructors. Doing so would probably require new Web IDL infrastructure, however...

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

1 participant