Use globalThis instead of global (#61)

* Use `globalThis` instead of `global`

* Update `standard`
This commit is contained in:
Kasper Isager Dalsgarð 2021-11-02 16:36:15 +01:00 committed by GitHub
parent 7ef6e52870
commit 87ff2a56bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
node_modules
package-lock.json

View File

@ -17,7 +17,7 @@ var sink
function loadSink () {
if (sink) return sink
var MessageChannel = global.MessageChannel
var MessageChannel = globalThis.MessageChannel
if (MessageChannel == null) ({ MessageChannel } = require('worker' + '_threads'))
sink = new MessageChannel()
return sink

View File

@ -15,7 +15,7 @@
"devDependencies": {
"browserify": "^16.5.1",
"sodium-test": "^0.10.0",
"standard": "^14.3.4",
"standard": "^15.0.1",
"tape-run": "^7.0.0"
},
"standard": {

View File

@ -2,7 +2,7 @@ var assert = require('nanoassert')
var randombytes = (function () {
var QUOTA = 65536 // limit for QuotaExceededException
var crypto = global.crypto || global.msCrypto
var crypto = globalThis.crypto || globalThis.msCrypto
function browserBytes (out, n) {
for (let i = 0; i < n; i += QUOTA) {