-
Notifications
You must be signed in to change notification settings - Fork 569
Support Go1.12 #900
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
Support Go1.12 #900
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
62c39c2
Target Go 1.12, update version to GopherJS 1.12-wip.
hajimehoshi a395e60
compiler/natives/src/internal/cpu: Add CacheLinePadSize
hajimehoshi f022788
compiler/natives/src/reflect: Update function signatures
hajimehoshi 80a8d4e
compiler/natives/src/syscall: Add Syscall18
hajimehoshi 9576d72
compiler/natives/src/syscall: Rename syscall
hajimehoshi 756c79f
Update circle.yml
hajimehoshi 96c95ab
compiler/natives/src/internal/syscall/unix: Add fstatatTrap
hajimehoshi 6b3d4d1
go generate
hajimehoshi f65c39d
compiler/natives/src/syscall: Define syscall functions for Darwin
hajimehoshi 9793ddf
compiler/natives/src/crypto/rand: Add func batched
hajimehoshi c0c4111
compiler/natives/src: Fix some test failures
hajimehoshi 3a29d97
compiler/natives/src: Fix test failures
hajimehoshi 250c084
compiler/natives/src/reflect: Fix failure tests
hajimehoshi 57d7708
tests: Add new failure tests in Go 1.12
hajimehoshi cf99cfe
Address on reviews
hajimehoshi 158447e
Address on reviews
hajimehoshi db381e3
Fix circle.yml
hajimehoshi 35239cf
Fix testing issues on macOS
hajimehoshi 2ea661b
reflect: Reimplement mapiter functions
hajimehoshi 4711f47
Remove filename suffixes _js
hajimehoshi a2f6a71
Add .std_test_pkg_exlusions
hajimehoshi 9da6e14
Test internal/fmtsort
hajimehoshi 3844e18
Add more testable standard libs
hajimehoshi e34c676
Fix .std_test_pkg_exclusions
hajimehoshi 18df411
go generate
hajimehoshi 8471480
compiler/natives/src/reflect: Add comments
hajimehoshi 09ef6f4
compiler: Update version to 1.12-1
hajimehoshi 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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// +build js | ||
|
||
package bytealg | ||
|
||
func Equal(a, b []byte) bool { | ||
if len(a) != len(b) { | ||
return false | ||
} | ||
for i, c := range a { | ||
if c != b[i] { | ||
return false | ||
} | ||
} | ||
return true | ||
} |
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,8 @@ | ||
// +build js | ||
|
||
package cpu | ||
|
||
const ( | ||
CacheLineSize = 0 | ||
CacheLinePadSize = 0 | ||
) |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// +build js | ||
|
||
package fmtsort_test | ||
|
||
import ( | ||
"math" | ||
"reflect" | ||
"testing" | ||
|
||
"internal/fmtsort" | ||
) | ||
|
||
// needsSkip reports whether the kind doesn't work for sorting on GopherJS. | ||
func needsSkip(k reflect.Kind) bool { | ||
switch k { | ||
case reflect.Ptr, reflect.Chan: | ||
return true | ||
} | ||
return false | ||
} | ||
|
||
// Note: sync with the original TestCompare. | ||
func TestCompare(t *testing.T) { | ||
for _, test := range compareTests { | ||
for i, v0 := range test { | ||
for j, v1 := range test { | ||
if needsSkip(v0.Kind()) { | ||
continue | ||
} | ||
if needsSkip(v1.Kind()) { | ||
continue | ||
} | ||
|
||
c := fmtsort.Compare(v0, v1) | ||
var expect int | ||
switch { | ||
case i == j: | ||
expect = 0 | ||
// NaNs are tricky. | ||
if typ := v0.Type(); (typ.Kind() == reflect.Float32 || typ.Kind() == reflect.Float64) && math.IsNaN(v0.Float()) { | ||
expect = -1 | ||
} | ||
case i < j: | ||
expect = -1 | ||
case i > j: | ||
expect = 1 | ||
} | ||
if c != expect { | ||
t.Errorf("%s: compare(%v,%v)=%d; expect %d", v0.Type(), v0, v1, c, expect) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
func TestOrder(t *testing.T) { | ||
t.Skip("known issue: nil key doesn't work") | ||
} |
File renamed without changes.
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,18 @@ | ||
// +build js | ||
|
||
package bits | ||
|
||
type _err string | ||
|
||
func (e _err) Error() string { | ||
return string(e) | ||
} | ||
|
||
// RuntimeError implements runtime.Error. | ||
func (e _err) RuntimeError() { | ||
} | ||
|
||
var ( | ||
overflowError error = _err("runtime error: integer overflow") | ||
divideError error = _err("runtime error: integer divide by zero") | ||
) |
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
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,34 @@ | ||
// +build js | ||
|
||
package syscall | ||
|
||
import ( | ||
"github.com/gopherjs/gopherjs/js" | ||
) | ||
|
||
func funcPC(f func()) uintptr { | ||
if js.InternalObject(f) == js.InternalObject(libc_write_trampoline) { | ||
return SYS_WRITE | ||
} | ||
return uintptr(minusOne) | ||
} | ||
|
||
func syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) { | ||
return Syscall(trap, a1, a2, a3) | ||
} | ||
|
||
func syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) { | ||
return Syscall6(trap, a1, a2, a3, a4, a5, a6) | ||
} | ||
|
||
func syscall6X(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) { | ||
panic("syscall6X is not implemented") | ||
} | ||
|
||
func rawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) { | ||
return RawSyscall(trap, a1, a2, a3) | ||
} | ||
|
||
func rawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) { | ||
return RawSyscall6(trap, a1, a2, a3, a4, a5, a6) | ||
} |
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.
Uh oh!
There was an error while loading. Please reload this page.