When using public class fields, assume that they don't shadow any getter in the current class,
in its subclasses or in its superclass. Thus, it's safe to assign them rather than using
Object.defineProperty.
For example:
Input:
classTest { field = 2;
staticstaticField = 3; }
When set_public_class_fields is true, the output will be:
NOTE: For TypeScript, if you wanted behavior is equivalent to useDefineForClassFields: false, you should
set both set_public_class_fields and [crate::TypeScriptOptions::remove_class_fields_without_initializer]
to true.
When using public class fields, assume that they don't shadow any getter in the current class, in its subclasses or in its superclass. Thus, it's safe to assign them rather than using
Object.defineProperty.For example:
Input:
When
set_public_class_fieldsistrue, the output will be:Otherwise, the output will be:
NOTE: For TypeScript, if you wanted behavior is equivalent to
useDefineForClassFields: false, you should set bothset_public_class_fieldsand [crate::TypeScriptOptions::remove_class_fields_without_initializer] totrue.