@endo/init
Advanced tools
Comparing version 0.5.56 to 0.5.57
{ | ||
"name": "@endo/init", | ||
"version": "0.5.56", | ||
"version": "0.5.57", | ||
"description": "Prepare Endo environment on import", | ||
@@ -32,11 +32,11 @@ "type": "module", | ||
"devDependencies": { | ||
"@endo/compartment-mapper": "^0.8.4", | ||
"@endo/ses-ava": "^0.2.40", | ||
"@endo/compartment-mapper": "^0.8.5", | ||
"@endo/ses-ava": "^0.2.41", | ||
"ava": "^5.1.1" | ||
}, | ||
"dependencies": { | ||
"@endo/base64": "^0.2.31", | ||
"@endo/eventual-send": "^0.17.2", | ||
"@endo/lockdown": "^0.1.28", | ||
"@endo/promise-kit": "^0.2.56" | ||
"@endo/base64": "^0.2.32", | ||
"@endo/eventual-send": "^0.17.3", | ||
"@endo/lockdown": "^0.1.29", | ||
"@endo/promise-kit": "^0.2.57" | ||
}, | ||
@@ -76,3 +76,3 @@ "files": [ | ||
}, | ||
"gitHead": "38c2c59d6ae8c53f84cd333e6c7828e2d37604e2" | ||
"gitHead": "106da55b8bcea3067f70c29c357806f3f2e55c52" | ||
} |
import { setup } from './node-async_hooks.js'; | ||
import './node-async-local-storage-patch.js'; | ||
setup({ withDestroy: true }); |
@@ -13,7 +13,7 @@ import { createHook, AsyncResource } from 'async_hooks'; | ||
if (!(description in asyncHooksSymbols)) { | ||
throw new Error('Unknown symbol'); | ||
throw Error('Unknown symbol'); | ||
} else if (!asyncHooksSymbols[description]) { | ||
if (symbol.description !== description) { | ||
// Throw an error since the whitelist mechanism relies on the description | ||
throw new Error( | ||
throw Error( | ||
`Mismatched symbol found for ${description}: ${String(symbol)}`, | ||
@@ -42,3 +42,5 @@ ); | ||
let found = 0; | ||
Object.getOwnPropertySymbols(new AsyncResource('Bootstrap')).forEach(sym => { | ||
for (const sym of Object.getOwnPropertySymbols( | ||
new AsyncResource('Bootstrap'), | ||
)) { | ||
const { description } = sym; | ||
@@ -50,3 +52,3 @@ if (description && description in asyncHooksSymbols) { | ||
} | ||
}); | ||
} | ||
return found; | ||
@@ -116,3 +118,3 @@ }; | ||
// } | ||
symbols.forEach(symbol => { | ||
for (const symbol of symbols) { | ||
const value = resource[symbol]; | ||
@@ -128,3 +130,3 @@ let type; | ||
// process._rawDebug(`Unexpected symbol`, symbol); | ||
return; | ||
return undefined; | ||
} | ||
@@ -135,3 +137,3 @@ | ||
} | ||
}); | ||
} | ||
return found; | ||
@@ -189,3 +191,3 @@ } else { | ||
} else { | ||
// process._rawDebug('fallback set of async id', symbol, value, new Error().stack); | ||
// process._rawDebug('fallback set of async id', symbol, value, Error().stack); | ||
setAsyncIdFallback(this, symbol, value); | ||
@@ -192,0 +194,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30988
29
377
Updated@endo/base64@^0.2.32
Updated@endo/eventual-send@^0.17.3
Updated@endo/lockdown@^0.1.29
Updated@endo/promise-kit@^0.2.57