Skip to content

Declaring constructors as methods is strange #31

@domenic

Description

@domenic

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions