gopherjs / gopherjs/gopherjs

compiler: internal/poll override incomplete

Open
#781 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

NeedsInvestigation
Dominant language
Go
Stars
13.2k
Forks
573
PR merge metrics
No merged PRs in 30d

Description

I'm not so familiar with this so will defer to @neelance and @shurcooL

The compiler appears to have an override for the internal/poll package.

When looking into an issue reported on Slack, I noticed the unreachable code is being generated in the transpiled internal/poll.FD.WriteMsg method.

This method does not appear to have a dummy implementation in our override, hence the actual implementation (for _unix) is transpiled:

https://github.com/golang/go/blob/7e34ac1f4c6e940dd73756c10fce078804a20a05/src/internal/poll/fd_unix.go#L338

What should be happening here?

In case this is as expected then we can look further into why unreachable code is being detected (by Firefox and not Chrome).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with compiler/natives/src/internal/poll/fd_poll_js.go and compare its override with internal/poll.FD.WriteMsg and the referenced upstream fd_unix.go implementation. Determine whether the override should cover this method, then verify the transpiled output no longer contains the reported unreachable implementation or document why it is expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.