-
Notifications
You must be signed in to change notification settings - Fork 570
Go 1.9 support (version bump to GopherJS 1.9-1). #651
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
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
15a2eea
Target Go 1.9 Beta 1, update version to GopherJS 1.9-wip.
dmitshur 72e0b64
compiler/natives/src/runtime: Keep throw accessible for Go code to use.
dmitshur 0927aef
compiler/natives/src/runtime: Add noop implementation of CallersFrames.
dmitshur 0cbbd7f
compiler/natives/src/sync: Update SemacquireMutex, Semrelease signatu…
dmitshur c5eec2e
compiler/natives/src/time: Update now signature for monotonic time.
dmitshur 7b4a889
compiler/natives/src/reflect: Update signatures.
dmitshur 9212049
compiler/natives: Regenerate.
dmitshur 981eddd
compiler/natives/src/os/signal: Create no-op implementation.
dmitshur b946d67
compiler/natives/src/testing: Use a basic but working callerName.
dmitshur 956dce4
compiler/natives/src/internal/poll: Create no-op I/O poller implement…
dmitshur 38f3fb7
compiler/natives: Regenerate.
dmitshur 9ffc87e
WIP: nosync: Implement sync.Map.
dmitshur 640751f
compiler: Set anonymous bit for struct fields correctly.
dmitshur 44d151d
compiler/natives/src/reflect: Set pkgPath for new implements checks.
dmitshur 15ab3c0
compiler: Fix panic due to type aliases.
dmitshur c8a99bb
compiler/natives/src/math/big: Remove bitLen, override Word.
dmitshur 67e7e39
compiler/natives: Regenerate.
dmitshur b9c0354
CI: Don't minify when running tests.
dmitshur dd65c22
compiler/natives/src/math: Implement missing functions.
dmitshur c7683d9
compiler/natives/src/net: Implement missing private helpers.
dmitshur fbf0086
compiler/natives/src/encoding/gob: Disable broken test case.
dmitshur 41a477d
compiler/natives: Regenerate.
dmitshur d8a12c0
compiler/natives/src/sync: Add missing private helper.
dmitshur 63f374f
compiler/natives/src/time: Add initial support for monotonic clock.
dmitshur 576b4d7
compiler/natives: Regenerate.
dmitshur dcc17c5
tests: Classify new Go 1.9 tests.
dmitshur e39dba4
compiler/natives/src/crypto/x509: Update package and tests for Go 1.9.
dmitshur ce54604
CI: Use --verbose flag with gopherjs test command.
dmitshur ffae93c
compiler/natives: Regenerate.
dmitshur 8b8c47a
CI: Update to Go 1.9 Beta 2.
dmitshur cc16cdc
CI: Update to Go 1.9 RC 1.
dmitshur b0dc25e
compiler/natives/src/internal/poll: Add pollDesc.pollable method.
dmitshur 99fd1ff
compiler/natives: Regenerate.
dmitshur 49ee3df
compiler/natives/src/math/big: Use math_big_pure_go build tag.
dmitshur 355d52e
compiler/natives/src/sync: Implement newly referenced test helpers.
dmitshur 052972b
compiler/natives: Add missing // +build js build constraint.
dmitshur cc693ed
compiler/natives: Regenerate.
dmitshur 208c5eb
Address remaining code review comments.
dmitshur f6209e7
compiler/natives: Regenerate.
dmitshur 6759a49
CI: Fix check for forgotten // +build js constraints in natives.
dmitshur 00a3767
build: Don't use cgo for "os/user", "crypto/x509".
dmitshur ba3e852
CI: Update to Go 1.9 RC 2.
dmitshur 07ee55b
CI: Update to Go 1.9 final release.
dmitshur 7e6a73a
Add math/bits to supported package list.
dmitshur 91dd575
compiler: Restore previous behavior of skipping unsafe import.
dmitshur 62cb4ed
CI: Prefer --minify flag for all tests.
dmitshur be67827
compiler: Replace old importer with x/tools/go/gcimporter15.
dmitshur 61693e9
compiler: Simplify type alias handling.
dmitshur 34e2783
compiler: Skip type aliases in all named type considerations.
dmitshur fe63fb1
compiler: Bump GopherJS version to 1.9-1.
dmitshur File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
// +build js | ||
|
||
package gob | ||
|
||
import ( | ||
"bytes" | ||
"reflect" | ||
"testing" | ||
) | ||
|
||
// TODO: TestEndToEnd override can be removed once the bug with Marr field is fixed. | ||
func TestEndToEnd(t *testing.T) { | ||
type T2 struct { | ||
T string | ||
} | ||
type T3 struct { | ||
X float64 | ||
Z *int | ||
} | ||
type T1 struct { | ||
A, B, C int | ||
M map[string]*float64 | ||
M2 map[int]T3 | ||
Mstring map[string]string | ||
Mintptr map[int]*int | ||
Mcomp map[complex128]complex128 | ||
Marr map[[2]string][2]*float64 | ||
EmptyMap map[string]int // to check that we receive a non-nil map. | ||
N *[3]float64 | ||
Strs *[2]string | ||
Int64s *[]int64 | ||
RI complex64 | ||
S string | ||
Y []byte | ||
T *T2 | ||
} | ||
pi := 3.14159 | ||
e := 2.71828 | ||
two := 2.0 | ||
meaning := 42 | ||
fingers := 5 | ||
s1 := "string1" | ||
s2 := "string2" | ||
var comp1 complex128 = complex(1.0, 1.0) | ||
var comp2 complex128 = complex(1.0, 1.0) | ||
var arr1 [2]string | ||
arr1[0] = s1 | ||
arr1[1] = s2 | ||
var arr2 [2]string | ||
arr2[0] = s2 | ||
arr2[1] = s1 | ||
var floatArr1 [2]*float64 | ||
floatArr1[0] = &pi | ||
floatArr1[1] = &e | ||
var floatArr2 [2]*float64 | ||
floatArr2[0] = &e | ||
floatArr2[1] = &two | ||
t1 := &T1{ | ||
A: 17, | ||
B: 18, | ||
C: -5, | ||
M: map[string]*float64{"pi": &pi, "e": &e}, | ||
M2: map[int]T3{4: T3{X: pi, Z: &meaning}, 10: T3{X: e, Z: &fingers}}, | ||
Mstring: map[string]string{"pi": "3.14", "e": "2.71"}, | ||
Mintptr: map[int]*int{meaning: &fingers, fingers: &meaning}, | ||
Mcomp: map[complex128]complex128{comp1: comp2, comp2: comp1}, | ||
// TODO: Fix this problem: | ||
// TypeError: dst.$set is not a function | ||
// at typedmemmove (/github.com/gopherjs/gopherjs/reflect.go:487:3) | ||
//Marr: map[[2]string][2]*float64{arr1: floatArr1, arr2: floatArr2}, | ||
EmptyMap: make(map[string]int), | ||
N: &[3]float64{1.5, 2.5, 3.5}, | ||
Strs: &[2]string{s1, s2}, | ||
Int64s: &[]int64{77, 89, 123412342134}, | ||
RI: 17 - 23i, | ||
S: "Now is the time", | ||
Y: []byte("hello, sailor"), | ||
T: &T2{"this is T2"}, | ||
} | ||
b := new(bytes.Buffer) | ||
err := NewEncoder(b).Encode(t1) | ||
if err != nil { | ||
t.Error("encode:", err) | ||
} | ||
var _t1 T1 | ||
err = NewDecoder(b).Decode(&_t1) | ||
if err != nil { | ||
t.Fatal("decode:", err) | ||
} | ||
if !reflect.DeepEqual(t1, &_t1) { | ||
t.Errorf("encode expected %v got %v", *t1, _t1) | ||
} | ||
// Be absolutely sure the received map is non-nil. | ||
if t1.EmptyMap == nil { | ||
t.Errorf("nil map sent") | ||
} | ||
if _t1.EmptyMap == nil { | ||
t.Errorf("nil map received") | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// +build js | ||
|
||
package poll | ||
|
||
import "time" | ||
|
||
// pollDesc is a no-op implementation of an I/O poller for GOARCH=js. | ||
// | ||
// Its implementation is based on NaCL in gc compiler (see GOROOT/src/internal/poll/fd_poll_nacl.go), | ||
// but it does even less. | ||
type pollDesc struct { | ||
closing bool | ||
} | ||
|
||
func (pd *pollDesc) init(fd *FD) error { return nil } | ||
|
||
func (pd *pollDesc) close() {} | ||
|
||
func (pd *pollDesc) evict() { pd.closing = true } | ||
|
||
func (pd *pollDesc) prepare(mode int, isFile bool) error { | ||
if pd.closing { | ||
return errClosing(isFile) | ||
} | ||
return nil | ||
} | ||
|
||
func (pd *pollDesc) prepareRead(isFile bool) error { return pd.prepare('r', isFile) } | ||
|
||
func (pd *pollDesc) prepareWrite(isFile bool) error { return pd.prepare('w', isFile) } | ||
|
||
func (pd *pollDesc) wait(mode int, isFile bool) error { | ||
if pd.closing { | ||
return errClosing(isFile) | ||
} | ||
return ErrTimeout | ||
} | ||
|
||
func (pd *pollDesc) waitRead(isFile bool) error { return pd.wait('r', isFile) } | ||
|
||
func (pd *pollDesc) waitWrite(isFile bool) error { return pd.wait('w', isFile) } | ||
|
||
func (*pollDesc) waitCanceled(mode int) {} | ||
|
||
func (*pollDesc) pollable() bool { return true } | ||
|
||
func (*FD) SetDeadline(t time.Time) error { return nil } | ||
|
||
func (*FD) SetReadDeadline(t time.Time) error { return nil } | ||
|
||
func (*FD) SetWriteDeadline(t time.Time) error { return nil } | ||
|
||
// PollDescriptor returns the descriptor being used by the poller, | ||
// or ^uintptr(0) if there isn't one. This is only used for testing. | ||
func PollDescriptor() uintptr { | ||
return ^uintptr(0) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Would this list be better maintained as an exclusion list? Not that there are many new packages added to core... but still.
Uh oh!
There was an error while loading. Please reload this page.
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 agree, that'd be better. Not as part of this PR, but let's make a follow up enhancement PR after this one is merged.
Edit: Filed #686 to track it.