Skip to content
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

Allow access to the public fields of unexported embedded struct #578

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

ganigeorgiev
Copy link
Contributor

This is a small change to allow accessing the public fields of unexported embedded struct. For example:

type base struct {
    Name string
}

type Foo struct {
    base
}

vm := goja.New()
vm.Set("foo", Foo{base{Name: "test"}})
vm.RunString("foo.Name") // currently prints undefined, expected "test"

@dop251 dop251 merged commit c24c3bd into dop251:master Jun 10, 2024
4 checks passed
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.

2 participants