-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtype.go
More file actions
25 lines (20 loc) · 625 Bytes
/
type.go
File metadata and controls
25 lines (20 loc) · 625 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//go:build js && wasm
package safejs
import "syscall/js"
// Type represents the JavaScript type of a Value.
type Type int
// Available JavaScript types
const (
TypeUndefined = Type(js.TypeUndefined)
TypeNull = Type(js.TypeNull)
TypeBoolean = Type(js.TypeBoolean)
TypeNumber = Type(js.TypeNumber)
TypeString = Type(js.TypeString)
TypeSymbol = Type(js.TypeSymbol)
TypeObject = Type(js.TypeObject)
TypeFunction = Type(js.TypeFunction)
)
func (t Type) String() string {
// String() has a panic line, however it should be impossible to hit barring memory corruption
return js.Type(t).String()
}