tc39/proposal-object-freeze-seal-syntax

Use Object.create(null); to create frozen/sealed objects

Closed this issue · 4 comments

That way messing with Object.prototype would not effect these new object literals

Agreed. This is in the plan for future changes to this spec

@keithamus where is the plan?

Sorry @graingert. Plan is in my head. I'll be making changes soon to this proposal, but for now I'd happily accept a PR to change the existing examples - like those two commits you have (except I'd prefer to see the paths inline rather than as functions)

@keithamus babel supports helper functions, and with tranform runtime they are moved into imports, that way the code is much smaller