Propose:
function(const foo, const bar) {
}
{
const foo: bar
}
Such that the names foo and bar are not assignable in the function body or
as an object property - such assignment would ideally have identical
behaviour to assigning to a const variable, i.e. a SyntaxError, although in
the object case, as the 'constness' is not statically determinable, so I
think this would have to just behave like a non writable property, or throw
a runtime error instead.
Possible equivalence to:
function(foo_, bar_) {
const foo = foo_;
const bar = bar_;
}
Object.create(Object.prototype, {
foo: {enumerable: true},
})
Cheers
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss