diff --git a/src/core/browserfs.ts b/src/core/browserfs.ts index 3d3092fc..94906b90 100644 --- a/src/core/browserfs.ts +++ b/src/core/browserfs.ts @@ -13,7 +13,7 @@ import * as BFSUtils from './util'; import * as Errors from './api_error'; import setImmediate from '../generic/setImmediate'; -if (( process)['initializeTTYs']) { +if (process && ( process)['initializeTTYs']) { ( process)['initializeTTYs'](); } diff --git a/src/core/global.ts b/src/core/global.ts index b14ec46f..7e947a13 100644 --- a/src/core/global.ts +++ b/src/core/global.ts @@ -6,9 +6,9 @@ * @hidden * @private */ -declare var global: any; +declare var globalThis: any; /** * @hidden */ -const toExport: any = typeof(window) !== 'undefined' ? window : typeof(self) !== 'undefined' ? self : global; +const toExport: any = typeof(window) !== 'undefined' ? window : typeof(self) !== 'undefined' ? self : typeof (global) !== "undefined" ? global : globalThis; export default toExport;