Skip to content

Commit 511f3ed

Browse files
committed
add --error-on-unknown-section to wasmdump
1 parent edb8881 commit 511f3ed

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

packages/cli/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,16 @@ Options:
2323
| `--no-name-resolution` | disable name resolution |
2424
| `--ignore-code-section` | don't print the code |
2525

26+
27+
### `wasmdump`
28+
29+
```sh
30+
wasmdump module.wasm
31+
```
32+
33+
Options:
34+
35+
| name | description |
36+
|------|-------------|
37+
| `--ignore-code-section` | don't print the code |
38+
| `--error-on-unknown-section` | error on unknown section |

packages/cli/src/wasmdump.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ if (process.argv.indexOf("--ignore-code-section") !== -1) {
2121
decoderOpts.ignoreCodeSection = true;
2222
}
2323

24+
if (process.argv.indexOf("--error-on-unknown-section") !== -1) {
25+
decoderOpts.errorOnUnknownSection = true;
26+
}
27+
2428
// $FlowIgnore: this is correct but not correctly documented
2529
const buff = toArrayBuffer(readFileSync(filename, null));
2630

0 commit comments

Comments
 (0)