Remove the newly-added allowDeclaredFields setting for Babel.

Review Request #14406 — Created April 28, 2025 and submitted — Latest diff uploaded

Information

Review Board
release-7.1.x

Reviewers

I recently added allowDeclaredFields so that I could utilize the
declare modifier 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 implicit undefined), but with
this setting enabled, only variables with declare will be left out
(everything else will be set to an explicit undefined).

That breaks checks like this.prototype.hasOwnProperty(...) that should
have been false if a variable was not explicitly set.

We can instead avoid declare and 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.

Commits

Files