Use globalThis
instead of global
(#61)
* Use `globalThis` instead of `global` * Update `standard`
This commit is contained in:
parent
7ef6e52870
commit
87ff2a56bd
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
node_modules
|
||||
package-lock.json
|
||||
|
@ -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
|
||||
|
@ -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": {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user