-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Chrome use counter data show there are indeed in-the-wild usage of extending non-extensible objects with private fields.
The percentage of page load is very low at time of this writing (0.000011%), and are found to be concentrated in two pieces of software.
disy Cadenza
Most breakages come from Cadenza, which seems to be a closed-source German GIS software. The pattern used is freezing a class with nothing but static fields using the RHS of a private field initializer. The minified version looks like the following.
class _ {
static FOO = ...;
static BAR = ...;
static #t = void (Object.keys(_).forEach((t) => {
_[t].type = t;
}), Object.freeze(_));
}"Axial"
The remaining breakages (https://heidebeat.de/ and https://www.rt-strafverteidiger.de/) seem to be a UI framework. Both sites have identically structured source, with very similar JS, all referencing code with "Axial" in variable names. The pattern used is freezing this in a superclass constructor, but have many subclasses with private fields.
class t extends EventTarget {
constructor() {
super();
Object.freeze(this);
}
}
class h extends t {
#foo;
#bar;
constructor() {
super();
this.#foo = ...;
}
}I cannot find references to this framework on GitHub or the web. If anyone knows how to contact the developers of this framework, please let me know.