This repository was archived by the owner on Jan 25, 2022. It is now read-only.
This repository was archived by the owner on Jan 25, 2022. It is now read-only.
Use [[Set]] by default, add define
keyword. (was: TypeScript class fields have [[Set]] semantics.) #248
Open
Description
Class-fields in TypeScript have [[Set]]
semantics. Foresee code breaking when JavaScript projects convert to TypeScript (or vice versa), and the pain caused from hard-to-find bugs, because of JavaScript class-fields using [[Define]]
semantics.
I know this has been discussed in other threads, but I thought I'd open an official issue for it.
EDIT: Why not add a define
keyword:
class Foo {
foo = 'foo' // uses [[Set]] semantics
define bar = 'bar' // uses [[Define]] semantics
}
Honestly, it would make most people (talking about end users who develop products, not language designers or implementors) happy.
Metadata
Metadata
Assignees
Labels
No labels