Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Restrict contextual WASM references to module namespaces

Manav Rathi6b26e41868d2
diff --git a/web/checks/wasm-exports/exports.mjs b/web/checks/wasm-exports/exports.mjs
index 87416cb4dd..a72f27748e 100644
--- a/web/checks/wasm-exports/exports.mjs
+++ b/web/checks/wasm-exports/exports.mjs
@@ -206,8 +206,8 @@ export function unusedExports(files, projects, rustOrigins = new Map()) {
) {
reference(checker.getSymbolAtLocation(node));
const context = checker.getContextualType(node);
- if (context) {
- const type = checker.getTypeAtLocation(node);
+ const type = checker.getTypeAtLocation(node);
+ if (context && type.symbol?.flags & ts.SymbolFlags.Module) {
for (const property of context.getProperties()) {
reference(type.getProperty(property.name));
}