Skip to content

Extend scope to include discoverability #11

@mhofman

Description

@mhofman

As discussed in the TG3 meeting, we'd like the ability to discover all intrinsics in a unified way. Given the relation with getting access to known intrinsics, we'd like to extend the scope of this proposal to include a discoverability feature.

Currently to discover all intrinsics we have to follow all properties descriptors and prototypes from 3 kind of starting points:

  • The global object when user code starts (most intrinsics)
  • An object created by some syntax (e.g. %AsyncFunctionPrototype%)
  • The return value of some API calls

The last 2 are problematic as new syntax or APIs may introduce new intrinsics, and require an explicit update of code wishing to discover all intrinsics. Especially problematic for SES / Hardened JS is intrinsics exposed by syntax (undeniable) or updates to existing API calls that are already allow-listed.

If there was a pre-existing unified point through which all intrinsics were discoverable, proposals would no longer have the burden of carefully exposing their otherwise hidden intrinsics in an ad-hoc way.

We believe that discoverability would not be more onerous on implementations than the current scope of a simple access, since implementations would already have to cache all the initial intrinsic values along with their names. It may be worth exploring an API shape that allows the implementation to discover an intrinsic is never reached through this API so that the implementation can collect those intrinsics if otherwise able to.

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