Skip to content

Fixed use of "window" instead of "global".#1

Merged
dignifiedquire merged 1 commit intodignifiedquire:masterfrom
tswindell:master
Jan 14, 2017
Merged

Fixed use of "window" instead of "global".#1
dignifiedquire merged 1 commit intodignifiedquire:masterfrom
tswindell:master

Conversation

@tswindell
Copy link

Signed-off-by: Tom Swindell t.swindell@rubyx.co.uk

Signed-off-by: Tom Swindell <t.swindell@rubyx.co.uk>
_CryptoKey = global.CryptoKey || global.Key || Object;

var isEdge = window.navigator.userAgent.indexOf('Edge/') > -1
var isEdge = global.navigator.userAgent.indexOf('Edge/') > -1
Copy link
Owner

@dignifiedquire dignifiedquire Jan 14, 2017

Choose a reason for hiding this comment

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

I don't think global is defined in all browsers, maybe check for not being undefined in this order

  1. global
  2. window
  3. self

Copy link
Author

Choose a reason for hiding this comment

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

global is a local variable, it is the variable that is assigned to window or self.

Copy link
Owner

Choose a reason for hiding this comment

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

I should read the code I'm reviewing more closely :/

@dignifiedquire
Copy link
Owner

Thank you :octocat:

@dignifiedquire dignifiedquire merged commit effe03d into dignifiedquire:master Jan 14, 2017
@tswindell
Copy link
Author

Is this closed now then? ;)

@dignifiedquire
Copy link
Owner

latest libp2p-crypto includes this and runs tests in webworkers so should work all good now :)

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.

2 participants