Skip to content

Can we get frozen-by-default by refactoring the proposal into a reviver factory? #10

Description

@shicks

(This is following up on a question I briefly raised at plenary last week)

With the proposal framed as an options bag on JSON.parse, we're constrained to keeping the same default behavior. If instead we pivot to defining a standard reviver factory for getting revivers to pass to JSON.parse, then we could potentially update the defaults since you're opting into using it by calling the function.

For example,

JSON.parse(str, JSON.frozen())

It's not quite as simple as {}, and is probably a non-starter because preventing communication channels will require returning a brand new function every time, making it infeasible from a performance standpoint, but I figured I'd at least follow up here.

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