You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Let's change MakeBasicObject to take anonymous records of { [[SlotName]]: initialValue } "templates"
Do the exercise of changing the callers to use the new form, which hopefully naturally points out where currently the initialization is already too far away from the allocation
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 valueundefined
in the interim.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.
The text was updated successfully, but these errors were encountered: