Use globalThis instead of global

This commit is contained in:
Kasper Isager Dalsgarð 2021-11-02 14:47:15 +01:00
parent 7ef6e52870
commit d5b61d4f3c
2 changed files with 2 additions and 2 deletions

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

@ -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) {