Remove the newly-added allowDeclaredFields setting for Babel.
Review Request #14406 — Created April 28, 2025 and submitted
I recently added
allowDeclaredFieldsso that I could utilize the
declaremodifier for variables. However, with Babel, this isn't what
we want.Normally, any variable defined in a class but not set to a value will be
simply left out of the prototype (an implicitundefined), but with
this setting enabled, only variables withdeclarewill be left out
(everything else will be set to an explicitundefined).That breaks checks like
this.prototype.hasOwnProperty(...)that should
have beenfalseif a variable was not explicitly set.We can instead avoid
declareand just define it, getting the same
results. This only really matters to us today for static variables
promoted to prototype attributes through Spina.
Rebuilt all static media and verified the breakages in unit tests have
been fixed.
| Summary | ID |
|---|---|
| ab56bb999c5701d7980d05b06cbcd4a61d16a73a |
| Description | From | Last Updated |
|---|---|---|
|
Will there be a corresponding change where we get rid of the declare usage? |
|