Skip to content

Commit 4b8d904

Browse files
committed
fix for emscripten 5.0.3
1 parent c9743cf commit 4b8d904

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.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:
@@ -156,6 +157,8 @@ jobs:
156157
157158
release:
158159
name: Release main packages
160+
env:
161+
EM_VERSION: '4.0.11'
159162
if: ${{ github.event_name == 'workflow_dispatch' && inputs.release_independent_package == 'main' }}
160163
needs: build
161164
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": "commonjs",
66
"main": "./lib/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
@@ -489,9 +489,9 @@ function transformWithOptions (fileName: string, sourceText: string, options?: T
489489

490490
const prefix = [
491491
...defaultLibraryFuncsToInclude
492-
.map(sym => `{{{ ((DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.indexOf("${sym}") === -1 ? DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.push("${sym}") : undefined), "") }}}`),
492+
.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)), "") }}}`),
493493
...exportedRuntimeMethods
494-
.map(sym => `{{{ ((EXPORTED_RUNTIME_METHODS.indexOf("${sym}") === -1 ? EXPORTED_RUNTIME_METHODS.push("${sym}") : undefined), "") }}}`)
494+
.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)), "") }}}`)
495495
].join(EOL)
496496

497497
if (processDirective) {

0 commit comments

Comments
 (0)