-
Notifications
You must be signed in to change notification settings - Fork 570
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
Conversation
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.
Never mind, that tag was never available externally. It was added to |
if runtime.Version() != "go1.11" { | ||
nativesContext.ReleaseTags = append(nativesContext.ReleaseTags, "go1.11.1") | ||
} | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Thank you for reviewing. |
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.