Skip to content

build, compiler/natives/src/reflect: remove Go 1.11-specific code #933

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 1 commit into from
Aug 12, 2019

Conversation

dmitshur
Copy link
Member

@dmitshur dmitshur commented Aug 11, 2019

GopherJS 1.12 is out by now, so it's safe to remove this code that
was added to deal with differences between Go 1.11.0 and Go 1.11.1.

There should not be any change in behavior.

Regenerate ./compiler/natives.

Updates #862.

GopherJS 1.12 is out by now, so it's safe to remove this code that
was added to deal with differences between Go 1.11.0 and Go 1.11.1.

There should not be any change in behavior, except the internal and
temporary go1.11.1 build tag will no longer be set by GopherJS.
It was never intended to be used externally, so hopefully nobody did.

Regenerate ./compiler/natives.

Updates #862.
@dmitshur
Copy link
Member Author

There should not be any change in behavior, except the internal and
temporary go1.11.1 build tag will no longer be set by GopherJS.
It was never intended to be used externally, so hopefully nobody did.

Never mind, that tag was never available externally. It was added to nativesContext, which is the context used to import std package overrides from the natives filesystem.

if runtime.Version() != "go1.11" {
nativesContext.ReleaseTags = append(nativesContext.ReleaseTags, "go1.11.1")
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As runtime.Version() != "go1.11" becomes always true, nativesContext.ReleaseTags = append(nativesContext.ReleaseTags, "go1.11.1") should always be kept. Is this correct?

Copy link
Member Author

@dmitshur dmitshur Aug 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not be kept, because it's no longer needed. It was only needed during GopherJS 1.11-* versions. This is described in the commit PR description and my comment above. Can I make it more clear?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I understood this was originally not needed.

@@ -694,6 +694,39 @@ func Copy(dst, src Value) int {
return js.Global.Call("$copySlice", dstVal, srcVal).Int()
}

func methodReceiver(op string, v Value, i int) (_ *rtype, t *funcType, fn unsafe.Pointer) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this PR's intention. Does this PR remove unnecessary things? I was wondering why you added new code.

Copy link
Member Author

@dmitshur dmitshur Aug 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code isn't new, it's moved from reflect_go1111.go. The rest is removed, for a total diff of +251 −426.

There were two copies of these functions, one for Go 1.11.0 in reflect_go111.go and another for Go 1.11.1+ in reflect_go1111.go.

The copy in reflect_go111.go is no longer ever needed, because we don't support Go 1.11.0 in GopherJS 1.12. This PR removes it. It moves the actively used code from reflect_go1111.go back into reflect.go, since there's no need for it to be in a separate file anymore.

It effectively reverts PR #865, which added complexity that was needed at the time to fix issue #865.

It resolves the TODO comment:

// TODO: Remove this ad hoc special behavior in GopherJS 1.12.

Copy link
Member

@hajimehoshi hajimehoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@dmitshur
Copy link
Member Author

Thank you for reviewing.

@dmitshur dmitshur merged commit 5d27143 into master Aug 12, 2019
@dmitshur dmitshur deleted the rm-go1111 branch August 12, 2019 05:52
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