[JS API] 'run a host function' and 'create a host function' don't consistently handle completion records
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, wasm
Research direction
Read document/js-api/index.bs at the linked run-a-host-function algorithm and compare it with create-a-host-function, then review exception-handling PR #301 for the overlapping change. Done means the completion-record behavior is consistent in both locations and the specification changes integrate with that proposal.
Written by the indexing model from the issue text.
Description
The algorithm for run a host function
uses ReturnIfAbrupt ([=?=]) when calling the underlying JS function (meaning it can just return the completion record), or otherwise returns the result value(s) converted with ToWebAssemblyValue. But 'create a host function' just treats its result value as a completion record when it asserts that the type is normal or throw and returns result.Value. Maybe 'run a host function' should just convert the JS results to WebAssembly values as it does now and put them back into result.Value, and return the whole completion record.
I noticed this while while working on https://github.com/WebAssembly/exception-handling/pull/301 which changes some of this code. We could just fix the issue there, which would simplify merging the EH proposal into the spec. Or we could fix it in both places.
- Dominant language
- WebAssembly
- Stars
- 3.5k
- Forks
- 540
- Avg merge
- 11h 12m
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from WebAssembly/spec
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
WebAssembly/spec#2253 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
WebAssembly/spec#2245 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
WebAssembly/spec#2235 · 9 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
WebAssembly/spec#2196 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
WebAssembly/spec#2155 · 2 comments ·
Maintainers usually reply within 1 day
All issues in WebAssembly/spec
Similar issues
-
ToTriage
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
microsoftgraph/msgraph-metadata#1217 ·
Maintainers usually reply within 4 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
jaegertracing/jaeger-ui#4547 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
area:dictation bug P1 regression
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
uttrflow/uttrflow-swift#3387 ·
Maintainers usually reply within 1 day
-
area:cpan-port area:database bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
fglock/PerlOnJava#1604 ·
Maintainers usually reply within 1 day