Axel Rauschmayer wrote:
Again, are you suggesting a retrofit along the lines I diagrammed, so that ("hi" instanceof string) would be true?

I don’t have a definite answer for how to best fix this, but it would be lovely if we could.

Would it? Having string as well as String might be useful at the limit, but is string.prototype the same object as String.prototype, or an Object instance full of the same methods?

I find it challenging myself ATM and pity newcomers.

Are newcomers going to face string and String? If yes, that seems worse than status quo. If no, then you're hiding string from them, not String, and recommending typeof to distinguish string from other values -- so how is that different from status quo?

It seems to me the issue is not newcomers or whether instanceof can be made to supplant typeof (cross-frame issues remain but they vex any extensible mechanism too, as I conceded in the earlier posts talking about realms). The issue is whether we want a bunch of "constructors" (not callable via 'new', remember) in a tree that spans some kind of subtype semi-lattice -- but which may not pay for its user-facing-complexity costs.

So I’m insisting more on the problem than on my solution.

There are trade-offs but I don't see a clean win. Going back to 1995 and making "everything an object" (and no typeof at all? cross-window was a thing then too) is a dream. We should stick to realistic alternatives and weigh them carefully.

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to