Skip to content

Commit e673a66

Browse files
committed
fix for emscripten 5.0.3
1 parent 46a82b7 commit e673a66

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ env:
3535
WASI_VERSION: '29'
3636
WASI_VERSION_FULL: '29.0'
3737
WASI_SDK_PATH: './wasi-sdk-29.0'
38-
EM_VERSION: '4.0.11'
3938
EM_CACHE_FOLDER: 'emsdk-cache'
4039
NODE_VERSION: '24.11.1'
4140

@@ -44,6 +43,8 @@ jobs:
4443
timeout-minutes: 15
4544
name: Build
4645
runs-on: ubuntu-latest
46+
env:
47+
EM_VERSION: '5.0.3'
4748
strategy:
4849
fail-fast: false
4950
matrix:
@@ -159,6 +160,8 @@ jobs:
159160
160161
release:
161162
name: Release main packages
163+
env:
164+
EM_VERSION: '4.0.11'
162165
if: ${{ github.event_name == 'workflow_dispatch' && inputs.release_independent_package == 'main' }}
163166
needs: build
164167
runs-on: ubuntu-latest

packages/ts-transform-emscripten-esm-library/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@emnapi/ts-transform-emscripten-esm-library",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Using ESM to write Emscripten JavaScript library",
55
"type": "module",
66
"main": "./dist/index.js",

packages/ts-transform-emscripten-esm-library/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,9 @@ function transformWithOptions (fileName: string, sourceText: string, options?: T
490490

491491
const prefix = [
492492
...defaultLibraryFuncsToInclude
493-
.map(sym => `{{{ ((DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.indexOf("${sym}") === -1 ? DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.push("${sym}") : undefined), "") }}}`),
493+
.map(sym => `{{{ ((typeof DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.add === "function" ? DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.add("${sym}") : (DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.indexOf("${sym}") === -1 ? DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.push("${sym}") : undefined)), "") }}}`),
494494
...exportedRuntimeMethods
495-
.map(sym => `{{{ ((EXPORTED_RUNTIME_METHODS.indexOf("${sym}") === -1 ? EXPORTED_RUNTIME_METHODS.push("${sym}") : undefined), "") }}}`)
495+
.map(sym => `{{{ ((typeof EXPORTED_RUNTIME_METHODS.add === "function" ? EXPORTED_RUNTIME_METHODS.add("${sym}") : (EXPORTED_RUNTIME_METHODS.indexOf("${sym}") === -1 ? EXPORTED_RUNTIME_METHODS.push("${sym}") : undefined)), "") }}}`)
496496
].join(EOL)
497497

498498
if (processDirective) {

0 commit comments

Comments
 (0)