Skip to content

Commit 5e35543

Browse files
committed
fix(test): fix allocation failure GC in old space
🔪 wasm code to big for test, need to enable LTO ❌ smoke test fail! use export {default} instead *
1 parent 9b9a093 commit 5e35543

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed

examples/node_wasm

src/wrapper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ export default function(buffer: Buffer) {
2828
promiseWebAssembly: {
2929
Module:
3030
polyfill +
31-
`module.exports = () => WebAssembly.compile(
31+
`export default () => WebAssembly.compile(
3232
Buffer.from([${data}])
3333
)`,
3434
Instance:
3535
polyfill +
36-
`module.exports = importObject => WebAssembly.instantiate(
36+
`export default importObject => WebAssembly.instantiate(
3737
new WebAssembly.Module(Buffer.from([${data}])),
3838
importObject
3939
)`,
4040
Both:
4141
polyfill +
42-
`module.exports = importObject => WebAssembly.instantiate(
42+
`export default importObject => WebAssembly.instantiate(
4343
Buffer.from([${data}]), importObject
4444
)`
4545
}

test/fixtures/hook_function/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ authors = ["Fahmi Akbar Wildana <fahmi.a.w@gmail.com>"]
55

66
[lib]
77
crate-type = ["cdylib"]
8-
path = "lib.rs"
8+
path = "lib.rs"
9+
10+
[profile.release]
11+
lto = true
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './lib.rs';
1+
export { default } from './lib.rs';

test/fixtures/single_function/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ authors = ["Fahmi Akbar Wildana <fahmi.a.w@gmail.com>"]
55

66
[lib]
77
crate-type = ["cdylib"]
8-
path = "lib.rs"
8+
path = "lib.rs"
9+
10+
[profile.release]
11+
lto = true
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './lib.rs';
1+
export { default } from './lib.rs';

0 commit comments

Comments
 (0)