(type $type234 <...>)These numbers were often changing which made us need to re-generate the expectation files.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
if (output == '-') {This is different than the documentation which says by default we print to stdout.
One of them should be updated. I suggest we update this line and print to stdout when output is not provided. Because otherwise the default doesn't do anything, and I doubt you ever run this program to do nothing.
help: 'Print functions/types/... in sorted order (sort by name).')Why not print sorted all the time? Is there a case where we don't want to sort?
'The filepath where the output will be written to (default: stdout). 'I don't think the default is right. It doesn't do anything when I don't pass `-o`. I tried this:
```
$ dart pkg/dart2wasm/bin/wasm2wat.dart /usr/local/google/home/omersa/dart/sdk/test/test.wasm
```
Which doesn't print anything.
'If omitted will write `<inpput.wasm>.wat` files.');inpput -> input
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
This is different than the documentation which says by default we print to stdout.
One of them should be updated. I suggest we update this line and print to stdout when output is not provided. Because otherwise the default doesn't do anything, and I doubt you ever run this program to do nothing.
Okay, I've redone this now a bit differently and put my new use case under a `--write` flag.
help: 'Print functions/types/... in sorted order (sort by name).')Why not print sorted all the time? Is there a case where we don't want to sort?
Well, there's advantages to be able to dump the wasm file as text without real loss of information - so one can see e.g. if a new binaryen version reorders things.
In our IR tests specifically we're not interested in this and care more about stability of the text.
Since it's easy to have both options, I thought why not allow both.
'The filepath where the output will be written to (default: stdout). 'I don't think the default is right. It doesn't do anything when I don't pass `-o`. I tried this:
```
$ dart pkg/dart2wasm/bin/wasm2wat.dart /usr/local/google/home/omersa/dart/sdk/test/test.wasm
```
Which doesn't print anything.
It does print something into `test.wasm.wat`.
So the reason I did this change is
I've done it now differently, this is now the supported usage pattern
'If omitted will write `<inpput.wasm>.wat` files.');Martin Kustermanninpput -> input
Done
(type $type234 <...>)These numbers were often changing which made us need to re-generate the expectation files.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
6 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: pkg/dart2wasm/bin/wasm2wat.dart
Insertions: 28, Deletions: 11.
The diff is too large to show. Please review the diff.
```
[dart2wasm] Make IR tests more stable
To avoid depending on exact ordering binaryen uses in the wasm module,
we start
* enqueue functions/types/... based on sort name instead of index
in wasm module
* only assign increasing ids in `Namer` if we actually want to print
the name
* print functions/types/... in sorted order
for IR tests.
We also update the `pkg/dart2wasm/bin/wasm2wat.dart` tool to be
able to dump wat for multiple wasm modules.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |