Skip to content

Odd behavior with [[Set]] on non-frozen objects inheriting from frozen objects #1154

@dead-claudia

Description

@dead-claudia

I can't tell if this is a spec bug or feature request. But this came up just now on ES Discuss, and it seems incredibly odd that [[Set]] doesn't seem to take into account some properties on non-frozen objects are inherited from frozen ones. Is there a reason it's checking the frozenness of the inherited object, when it's only the base object that such a property would be set if not frozen?

// Adapted example
const proto = {foo: "foo", bar: "bar"}
const o = Object.create(proto)

o.foo = 1 // works
Object.freeze(proto)
o.bar = 2 // fails?

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