Skip to content

don't automatically initialise all internal slots to undefined #3399

@michaelficarra

Description

@michaelficarra

We need to clean up how we create objects and set initial values of their internal slots. It is a common pattern today to call OrdinaryCreateFromConstructor with a list of additional slot names and then in the immediately following steps, set the initial values of each of these additional fields. But technically according to 6.1.7.2 Object Internal Methods and Internal Slots, these slots are given the value undefined in the interim.

Unless specified otherwise, the initial value of an internal slot is the value undefined.

This means that the declared type of each of these internal slots is implicitly unioned with undefined. We should instead create these slots and give them their initial values atomically, then remove this provision.

See related #3383.

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