emberjs/ember-classic-decorator

Breaks if user is shadowing `window`

ef4 opened this issue · 0 comments

ef4 commented

It's legal for the user to shadow window with a local variable:

let window = 'whatever';
class Foo {}

Which will result in:

let window = 'whatever';
class Foo {}
window.__CLASSIC_OWN_CLASSES__.set(Foo, true);

which throws an exception.

I think the output should change to:

__CLASSIC_OWN_CLASSES__.set(Foo, true);

so it's always accessing the global scope, regardless of what happens to window.