Closed
Description
When noImplicitThis
is turned on, you are unable to reference the global this
(which may be window, or global, or other value in various runtime environments).
I'm not sure if there is a recommended way around this, but currently there does not appear to be a way to get the "global" this
without an error 'this' implicitly has type 'any' because it does not have a type annotation.
This may be something I'm just not seeing. I tried to define global
but that wasn't much help.
TypeScript Version: 2.3.x
Code
(function (this: any, root) {
// do something isolated
})(<any>this);
Expected behavior:
Be able to use the global this
without error.
Actual behavior:
Compiler error 'this' implicitly has type 'any' because it does not have a type annotation.
when using this
globally.
cc @benlesh