Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Correctly handle built-ins and js.Object methods with go keyword. #1090

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

Merged
merged 3 commits into from
Dec 19, 2021

Conversation

nevkontakte
Copy link
Member

Built-ins and js.Object methods are represented by JS expressions that may not be straightforward function calls, or reference functions defined in the prelude. In such cases, the callable expression must be wrapped in a lambda.

#998 has fixed a similar issue for the defer keyword, and this change generalizes the same fix for the go keyword.

This change also contains a small improvement to the compiler panic message, which makes it easier to read at-a-glance.

Fixes #547.

@nevkontakte nevkontakte requested a review from flimzy November 21, 2021 16:49
@nevkontakte nevkontakte force-pushed the go-builtin branch 2 times, most recently from 387387a to 841d55f Compare November 21, 2021 16:54
  - Adjust formatting to make it easier for an eye to find different
    sections.
  - Print go-syntax statement where the panic occurred in addition to
    AST dump.
Built-ins and `js.Object` methods are represented by JS expressions that
may not be straightforward function calls, or reference functions
defined in the prelude. In such cases, the callable expression must be
wrapped in a lambda.

gopherjs#998 has fixed a similar issue
for the `defer` keyword, and this change generalizes the same fix for
the `go` keyword.

Fixes gopherjs#547.
@nevkontakte nevkontakte merged commit ec9572f into gopherjs:master Dec 19, 2021
@nevkontakte nevkontakte deleted the go-builtin branch December 19, 2021 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

go close(ch) causes compile error
2 participants