Skip to content

Proxy traps to handle Object and Reflect APIs consistently. #24

@jdalton

Description

@jdalton

Throwing errors is appropriate for Object methods like Object.defineProperty when run in strict mode code. However, Reflect.defineProperty should return false without throwing an error. The proxy traps need to be constructed in a way to handle this. To solve this in esm I did two things.

Since we own the secure realm though we can monkey-patch Reflect to avoid throwing and return booleans.

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