You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TestIssue22073 test in reflect package is currently not passing without some modifications. This is because the GopherJS doesn't produce correct method set order when method names begin with non-ASCII characters.
Before Go 1.10, methods were sorted by name. That happened to guarantee that exported ASCII methods appear before non-exported ASCII methods, but it broke down when Unicode method names were considered. Go 1.10 changed that in golang/go@6f1724f. GopherJS needs to be updated to match behavior.
Currently, its method set sorting code, implemented in JavaScript in compiler/prelude/types.go, sorts by name:
That code puts nonexported before ΦExported (encoded as "\xCE\xA6Exported"). That's not correct.
The following hacky fix, temporarily tested out via c4db7b2 (but eventually reverted in 88dc1af), made the test pass:
typ.methodSetCache=[];varx=Object.keys(base).sort();if(x.length===2&&x[0]==="nonexported"&&x[1]==="\xCE\xA6Exported"){/* HACK: Hacky fix for TestIssue22073. Need to find a good general fix. */x[0]="\xCE\xA6Exported";x[1]="nonexported";}x.forEach(function(name){typ.methodSetCache.push(base[name]);});returntyp.methodSetCache;
It needs to be generalized and applied to resolve the issue.
The text was updated successfully, but these errors were encountered:
This reverts commit c4db7b2.
That commit was a temporary hacky fix to help find out where the issue
was. It's not a general fix. Revert it, and file issue #763 to resolve
this issue fully and correctly.
Uh oh!
There was an error while loading. Please reload this page.
The
TestIssue22073
test inreflect
package is currently not passing without some modifications. This is because the GopherJS doesn't produce correct method set order when method names begin with non-ASCII characters.Before Go 1.10, methods were sorted by name. That happened to guarantee that exported ASCII methods appear before non-exported ASCII methods, but it broke down when Unicode method names were considered. Go 1.10 changed that in golang/go@6f1724f. GopherJS needs to be updated to match behavior.
Currently, its method set sorting code, implemented in JavaScript in
compiler/prelude/types.go
, sorts by name:For the given type:
That code puts
nonexported
beforeΦExported
(encoded as"\xCE\xA6Exported"
). That's not correct.The following hacky fix, temporarily tested out via c4db7b2 (but eventually reverted in 88dc1af), made the test pass:
It needs to be generalized and applied to resolve the issue.
The text was updated successfully, but these errors were encountered: