Skip to content

How to access global from the module body #21

Open
@caridy

Description

@caridy

From what I can remember, Reflect.global was suppose to provide a way to access the global now that this is undefined in modules, but it is not in the spec for what I can tell. Using new Function() is not an option if you're using CSP, the only option at this point is to cross your fingers and do: typeof global !== 'undefined' ? global : window;.

/cc @ericf

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions