Consider the following: ```js class Base {} class Ex extends Base { #foo = 1; isExample() { return this.#foo === 1; } } const o = {}; Ex.__proto__ = function() { return o; }; new Ex; Ex.prototype.isExample.call(o); // => true ``` Now consider the analogous setup with the `Node` and `Text` classes: ```js const o = {}; Text.__proto__ = function () { return o; }; new Text(); Text.prototype.splitText.call(o); // throws!! ``` or, using ES262 classes: ```js const o = {}; Uint8Array.__proto__ = function () { return o; }; new Uint8Array(); ArrayBuffer.isView(o); // false ``` This mismatch is worrying. It means that we cannot use private fields for self-hosting any classes involved in inheritance hierarchies. I'm not sure what a good fix would be, but it seems like we should investigate what can be done here.
Consider the following:
Now consider the analogous setup with the
NodeandTextclasses:or, using ES262 classes:
This mismatch is worrying. It means that we cannot use private fields for self-hosting any classes involved in inheritance hierarchies.
I'm not sure what a good fix would be, but it seems like we should investigate what can be done here.