keithamus / proposal-object-freeze-seal-syntax

A JavaScript TC39 proposal for Object.freeze & Object.seal syntax
https://www.keithcirkel.co.uk/object-freeze-seal-syntax
59 stars 8 forks source link

syntax for syntax for null prototype literals #13

Open graingert opened 6 years ago

graingert commented 6 years ago

eg Object.assign(Object.create(null), { foo: 'bar' }); with no freeze or seal

graingert commented 6 years ago

because { __proto__: null, foo: 'bar'} is discouraged

keithamus commented 6 years ago

🎉

graingert commented 6 years ago

keithamus this isn't closed yet.

keithamus commented 6 years ago

Yeah, I dont know why I closed this one.

adrianhelvik commented 5 years ago

What about object extension literals?

// Object.assign(Object.create(null), { foo: 'bar'})
let x = null {
  foo: 'bar'
}

// Object.assign(Object.create(x), { bar: 'baz'})
let y = x {
  bar: 'baz'
}