Conversation
efe0844 to
7593a90
Compare
| errors.push(...isConst(ast, moduleContext)); | ||
| errors.push(...importOrderValidate(ast)); | ||
| errors.push(...typeChecker(ast, moduleContext)); | ||
| }); |
There was a problem hiding this comment.
There are some inconsistencies in the way the repl constructs modules. It doesnt always pass a Program here, but sometimes ast is directly a Module node itself. I tried checking for it here, but it didnt fix all the tests, so it probably requires some changes to the repl?
There was a problem hiding this comment.
I found the problem. The repl also used the type checker directly. I switched to the new getValidationErrors API.
aebc4a6 to
d436777
Compare
|
@xtuc I finally got around fixing this, except for one spec test. But I am not sure how it relates to the current changes in the specification: WebAssembly/spec#814. Do you know when the official testsuite is updated? |
|
@maurobringolf (sorry for the delai). I tried to upgrade our spec tests here #296, I will try to finish it eventually. The issue with mutable global is that you can't really use them atm, no support but it's coming soon |
Some refactor of validations improving a couple of things:
Mutable globals cannot be used in global initialization Fixes initializer expression cannot reference a mutable global #355.
ModuleContext is created before running validations and passed to the individual steps.
Validation
fixturesnow run all validation steps, not just type-checking and I removed the separateisConsttests since its API changed toProgram -> Array<string>giving a list of errors too.We should probably merge all validation visitors and then run one big
traversedoing all the work at the same time?