Skip to content

Commit

Permalink
Merge pull request #38 from extism/globalThis
Browse files Browse the repository at this point in the history
  • Loading branch information
nilslice authored Dec 15, 2023
2 parents efaafcf + 9c7fa5b commit 540c066
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ build_browser out='browser' args='[]':
[{
"entryPoints": ["src/mod.ts"],
"platform": "browser",
"define": {"global": "window"},
"define": {"global": "globalThis"},
"format": "esm",
"alias": {
"js-sdk:capabilities": "./src/polyfills/browser-capabilities.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/polyfills/browser-capabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export const CAPABILITIES: Capabilities = {
fsAccess: false,

hasWorkerCapability:
typeof window !== 'undefined'
? (window as any).crossOriginIsolated && typeof SharedArrayBuffer !== 'undefined'
typeof globalThis !== 'undefined'
? (globalThis as any).crossOriginIsolated && typeof SharedArrayBuffer !== 'undefined'
: true,

supportsWasiPreview1: true,
Expand Down

0 comments on commit 540c066

Please sign in to comment.