Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add global this value lookup to enable node support #32

Merged
merged 5 commits into from
Mar 5, 2019

Conversation

pmdartus
Copy link
Member

@pmdartus pmdartus commented Mar 4, 2019

Add global object lookup to not only rely on the window object but also global (node) and self (web worker).

Fix #29

@pmdartus pmdartus requested a review from caridy March 4, 2019 10:49
@pmdartus pmdartus changed the title fix: Add global this value lookup to enable node support fix: Add global this value lookup to enable node support Mar 4, 2019
@@ -67,18 +63,32 @@ const formatter: DevToolFormatter = {
}
};

// Inspired from paulmillr/es6-shim
// https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L176-L185
function getGlobal(): any {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this! Maybe it is also time to start doing globalThis (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis) as part of this condition.

Copy link
Contributor

@caridy caridy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nip, maybe adding globalThis to the mix.

@pmdartus pmdartus merged commit 4e6df47 into master Mar 5, 2019
@pmdartus pmdartus deleted the pmdartus/custom-formatter-guard branch March 5, 2019 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants