MCPcopy
hub / github.com/gopherjs/gopherjs / toJavaScriptType

Function toJavaScriptType

compiler/utils.go:704–718  ·  view source on GitHub ↗
(t *types.Basic)

Source from the content-addressed store, hash-verified

702}
703
704func toJavaScriptType(t *types.Basic) string {
705 switch t.Kind() {
706 case types.UntypedInt:
707 return "Int"
708 case types.Byte:
709 return "Uint8"
710 case types.Rune:
711 return "Int32"
712 case types.UnsafePointer:
713 return "UnsafePointer"
714 default:
715 name := t.String()
716 return strings.ToUpper(name[:1]) + name[1:]
717 }
718}
719
720func is64Bit(t *types.Basic) bool {
721 return t.Kind() == types.Int64 || t.Kind() == types.Uint64

Callers 4

typeNameMethod · 0.85
typeKindFunction · 0.85
translateExprMethod · 0.85
loadStructMethod · 0.85

Calls 2

KindMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…