mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 08:56:07 +00:00
update
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
@@ -14,10 +13,8 @@ func input(args ...any) string {
|
||||
output = append(output, anyToArgon(args[i], false, true, 3, 0, true, 0))
|
||||
}
|
||||
fmt.Print(output...)
|
||||
scanner := bufio.NewScanner(os.Stdin)
|
||||
scanner.Scan()
|
||||
input := scanner.Text()
|
||||
return input
|
||||
inputData := []byte{}
|
||||
return string(inputData)
|
||||
}
|
||||
|
||||
func getPassword(args ...any) (string, error) {
|
||||
|
||||
27
src/wasm.go
27
src/wasm.go
@@ -74,6 +74,33 @@ func wasmRun(code string, allowDocument bool) (any, ArErr) {
|
||||
return ThrowOnNonLoop(run(translated, stack{global, localvars, local}))
|
||||
}
|
||||
|
||||
func await(awaitable js.Value) ([]js.Value, []js.Value) {
|
||||
then := make(chan []js.Value)
|
||||
defer close(then)
|
||||
thenFunc := js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
||||
then <- args
|
||||
return nil
|
||||
})
|
||||
defer thenFunc.Release()
|
||||
|
||||
catch := make(chan []js.Value)
|
||||
defer close(catch)
|
||||
catchFunc := js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
||||
catch <- args
|
||||
return nil
|
||||
})
|
||||
defer catchFunc.Release()
|
||||
|
||||
awaitable.Call("then", thenFunc).Call("catch", catchFunc)
|
||||
|
||||
select {
|
||||
case result := <-then:
|
||||
return result, nil
|
||||
case err := <-catch:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
var IntervalList = []int{}
|
||||
var TimeoutList = []int{}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user