mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
[runtime] Add cancelation of bound method calls and context passing
This commit is contained in:
@@ -3,7 +3,6 @@ package parser
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/wailsapp/wails/v3/internal/flags"
|
||||
"go/ast"
|
||||
"go/build"
|
||||
"go/parser"
|
||||
@@ -16,6 +15,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/wailsapp/wails/v3/internal/flags"
|
||||
|
||||
"github.com/samber/lo"
|
||||
"github.com/wailsapp/wails/v3/internal/hash"
|
||||
)
|
||||
@@ -138,6 +139,16 @@ type BoundMethod struct {
|
||||
Alias *uint32
|
||||
}
|
||||
|
||||
func (m BoundMethod) JSInputs() []*Parameter {
|
||||
if len(m.Inputs) > 0 {
|
||||
if firstArg := m.Inputs[0]; isContext(firstArg) {
|
||||
return m.Inputs[1:]
|
||||
}
|
||||
}
|
||||
|
||||
return m.Inputs
|
||||
}
|
||||
|
||||
func (m BoundMethod) IDAsString() string {
|
||||
return strconv.Itoa(int(m.ID))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user