-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcallframe_unix.go
More file actions
67 lines (55 loc) · 1.64 KB
/
Copy pathcallframe_unix.go
File metadata and controls
67 lines (55 loc) · 1.64 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//go:build !js
package rx
import "io"
type Type int
// from syscall/js.Value
// TODO(rdo) make this available for unit testing
type JSValue interface {
Bool() bool
Call(m string, args ...any) JSValue
Delete(p string)
Equal(w JSValue) bool
Float() float64
Get(p string) JSValue
Index(i int) JSValue
InstanceOf(t JSValue) bool
Int() int
Invoke(args ...any) JSValue
IsNaN() bool
IsNull() bool
IsUndefined() bool
Length() int
New(args ...any) JSValue
Set(p string, x any)
SetIndex(i int, x any)
String() string
Truthy() bool
Type() Type
}
// CallFrame mock implementation for Unix
type CallFrame struct {
IntentType
Entity
Mouse Coord
Point int // DEPRECATED: Only meaningful with the lioli
Registers [4]JSValue
Returns [4]JSValue
Modifiers struct {
CTRL, SHIFT, ALT bool
}
Continuation chan CallFrame
Gen int
}
func R1(ctx Context) string { return ctx.ng.Registers[0].String() }
func R2(ctx Context) string { return ctx.ng.Registers[1].String() }
func R3(ctx Context) string { return ctx.ng.Registers[2].String() }
func R4(ctx Context) string { return ctx.ng.Registers[3].String() }
// Continuation outputs
func S1(ctx Context, v any) { ctx.ng.Returns[0] = _panicOn(v) } //lint:ignore U1000 this is an API
func S2(ctx Context, v any) { ctx.ng.Returns[1] = _panicOn(v) } //lint:ignore U1000 this is an API
func S3(ctx Context, v any) { ctx.ng.Returns[2] = _panicOn(v) } //lint:ignore U1000 this is an API
func S4(ctx Context, v any) { ctx.ng.Returns[3] = _panicOn(v) } //lint:ignore U1000 this is an API
func _panicOn(any) JSValue { panic("not implemented") }
func Pipe() (JSValue, io.WriteCloser) {
panic("not implemented")
}