Use globalThis
instead of global
This commit is contained in:
parent
7ef6e52870
commit
d5b61d4f3c
@ -17,7 +17,7 @@ var sink
|
|||||||
|
|
||||||
function loadSink () {
|
function loadSink () {
|
||||||
if (sink) return sink
|
if (sink) return sink
|
||||||
var MessageChannel = global.MessageChannel
|
var MessageChannel = globalThis.MessageChannel
|
||||||
if (MessageChannel == null) ({ MessageChannel } = require('worker' + '_threads'))
|
if (MessageChannel == null) ({ MessageChannel } = require('worker' + '_threads'))
|
||||||
sink = new MessageChannel()
|
sink = new MessageChannel()
|
||||||
return sink
|
return sink
|
||||||
|
@ -2,7 +2,7 @@ var assert = require('nanoassert')
|
|||||||
|
|
||||||
var randombytes = (function () {
|
var randombytes = (function () {
|
||||||
var QUOTA = 65536 // limit for QuotaExceededException
|
var QUOTA = 65536 // limit for QuotaExceededException
|
||||||
var crypto = global.crypto || global.msCrypto
|
var crypto = globalThis.crypto || globalThis.msCrypto
|
||||||
|
|
||||||
function browserBytes (out, n) {
|
function browserBytes (out, n) {
|
||||||
for (let i = 0; i < n; i += QUOTA) {
|
for (let i = 0; i < n; i += QUOTA) {
|
||||||
|
Loading…
Reference in New Issue
Block a user