Skip to content

Restrict signature of the Ordinary* AOs #3612

Open
@nicolo-ribaudo

Description

@nicolo-ribaudo

All the Ordinary* MOP-related AOs (e.g. OrdinaryGetPrototypeOf) are typed as taking "an Object", however some of them assume that the object has the same internal slots as an ordinary object:

  • OrdinaryGetPrototypeOf
  • OrdinarySetPrototypeOf
  • OrdinaryIsExtensible
  • OrdinaryPreventExtensions

While others can actually be called on arbitrary objects:

  • OrdinaryGetOwnProperty
  • OrdinaryDefineOwnProperty
  • OrdinaryHasProperty
  • OrdinaryGet
  • OrdinarySet
  • OrdinaryDelete
  • OrdinaryOwnPropertyKeys

It might be worth updating the type of the first group to say that they cannot be used on arbitrary exotic objects (while the second group can). However, their type cannot be restricted to "an ordinary object", because the for example work (and are used) with TypedArray exotic objects.

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