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

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

Merged
merged 1 commit into from Aug 12, 2019

Conversation

@dmitshur
Copy link
Member

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.

build, compiler/natives/src/reflect: remove Go 1.11-specific code
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

This comment has been minimized.

Copy link
Member Author

commented Aug 11, 2019

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")
}

This comment has been minimized.

Copy link
@hajimehoshi

hajimehoshi Aug 12, 2019

Member

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

This comment has been minimized.

Copy link
@dmitshur

dmitshur Aug 12, 2019

Author Member

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?

This comment has been minimized.

Copy link
@hajimehoshi

hajimehoshi Aug 12, 2019

Member

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) {

This comment has been minimized.

Copy link
@hajimehoshi

hajimehoshi Aug 12, 2019

Member

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

This comment has been minimized.

Copy link
@dmitshur

dmitshur Aug 12, 2019

Author Member

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.
@hajimehoshi
Copy link
Member

left a comment

lgtm!

@dmitshur

This comment has been minimized.

Copy link
Member Author

commented Aug 12, 2019

Thank you for reviewing.

@dmitshur dmitshur merged commit 5d27143 into master Aug 12, 2019

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@dmitshur dmitshur deleted the rm-go1111 branch Aug 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.