-
Notifications
You must be signed in to change notification settings - Fork 503
Make JS harness optional and compatible with async #407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| "-s", Arg.Set Flags.print_sig, " show module signatures"; | ||
| "-u", Arg.Set Flags.unchecked, " unchecked, do not perform validation"; | ||
| "-us", Arg.Set Flags.unchecked_soft, " do not perform soft validation checks"; | ||
| "-h", Arg.Clear Flags.harness, " exclude harness for JS convesion"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
convesion => conversion
|
LGTM. Could there a way to also wrap up all the function calls with arbitrary JS, or some predefined string? For instance, transforming |
|
Hm, what prevents the |
|
It's because the harness For example: https://github.com/bnjbvr/wasm-spec/blob/testing/test/out/js/call.wast.js#L7 one error could occur in the That is, I'd like to turn this: instance("\x00\x61\x73\x6d\x0d\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x24\x08\x74\x79\x70\x65\x2d\x69\x36\x34\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x98\x80\x80\x80\x00\x01\x92\x80\x80\x80\x00\x00\x02\x40\x10\x00\x01\x42\xe4\x02\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", {$$: $$.exports}).exports.run(); // assert_return(() => $$.exports["type-i64"](), int64("356"))into that: test(() => instance("\x00\x61\x73\x6d\x0d\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x24\x08\x74\x79\x70\x65\x2d\x69\x36\x34\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x98\x80\x80\x80\x00\x01\x92\x80\x80\x80\x00\x00\x02\x40\x10\x00\x01\x42\xe4\x02\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", {$$: $$.exports}).exports.run());(out of curiosity, for this particular test: does this create a wasm instance that emulates the behavior of Alternatively, the |
|
I see. Isn't the bigger problem that you would need to make the work asynchronously. You would need to have an If only JS had real monads instead of its hacky async/promise mess. :) The only way I can see this being solved in a generic manner is by not generating uses of In an async harness, Yes, the auxiliary modules whose |
|
Yes, this makes sense and would be great to have indeed. Thanks! |
|
I added harness abstractions for |
* [spec] automate instruction index rebuild (WebAssembly#1259) * [test] Add test for malformed functype (WebAssembly#1254) * [test] Correct tests for missing elements (WebAssembly#1251) Remove the code section in tests for malformed element section. Otherwise the code section id (0x0a) is taken as an element's table index what is a validation error. This is similar to the previously reported issue: WebAssembly#1170. * [test] Add tests for data segment with memidx 1 (WebAssembly#1249) * [test] Correct i32.store alignment in a LEB128 test (WebAssembly#1261) In the binary-leb128.wast, change the alignment of an i32.store instruction from 3 (invalid) to 2 (the intention suggested by the comment). Co-authored-by: Andreas Rossberg <rossberg@dfinity.org> Co-authored-by: Paweł Bylica <chfast@gmail.com>
This allows for use of the JS-converted files with alternative test harnesses.