Skip to content

Conversation

@devalgupta404
Copy link
Contributor

Root Cause

The exportWasmSymbols function had conditional logic that prevented proper global export:

// before :
if (typeof exportedSymbol.value === 'undefined') {
  // Export functions 
} 

Solution

Removed the if condition and simplified to export all symbols unconditionally:

// After (fixed):
// Export all symbols (both functions and globals) to the global scope
// when DECLARE_ASM_MODULE_EXPORTS=0
globalThis[name] = exportedSymbol;

Changes

  • Modified: src/lib/libcore.js - Simplified exportWasmSymbols function
  • Enabled: test/test_core.py - Removed @no_omit_asm_module_exports decorator

@devalgupta404
Copy link
Contributor Author

@sbc100 please review it

@kleisauke
Copy link
Collaborator

This is expected to be addressed by PR #25568.

@sbc100
Copy link
Collaborator

sbc100 commented Oct 21, 2025

@devalgupta404 are you using DECLARE_ASM_MODULE_EXPORTS=0 yourself? Can I ask why you are using it?

@sbc100
Copy link
Collaborator

sbc100 commented Oct 21, 2025

This a fix for #25556 right?

I don't think this is the right fix though since it would change the way immutable globls are currently exported.. right now they are plain numbers, after this change they would be Wasm globals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants