Class double-bind

Domenic Denicola d at domenic.me
Thu Mar 5 16:50:27 UTC 2015


From: es-discuss [mailto:es-discuss-bounces at mozilla.org] On Behalf Of Boris Zbarsky

> Just to be clear, this would make class declarations behave differently from builtins, both the ES kind and the IDL kind, right?

I think that would be true if your mental model of built-ins is that, in the global scope, someone did `class Array { ... }` or `class Window { ... }`.

But my mental model has been that, in some other scope (probably a closure to encapsulate private helper functions, or a module) someone does `global.Array = class Array { ... }` and `global.Window = class Window { ... }`. That is, at least, what we do in jsdom.


More information about the es-discuss mailing list