webassemblyjs icon indicating copy to clipboard operation
webassemblyjs copied to clipboard

Result property of AST node should always be an array

Open maurobringolf opened this issue 7 years ago • 0 comments

I noticed that the block node has result: null instead of result: [] when its result type is omitted:

https://github.com/xtuc/webassemblyjs/blob/master/packages/wast-parser/test/fixtures/block/empty/expected.json#L12

This should be [] for consistency, maybe there are other instructions that have this as well. And if it has a result it is currently a string, but should also be an array imo:

https://github.com/xtuc/webassemblyjs/blob/master/packages/wast-parser/test/fixtures/block/with-result/expected.json#L12.

Plus the naming is result (Block) and resulttype (Loop), would be nice if we unify this too.

maurobringolf avatar Apr 04 '18 07:04 maurobringolf