From e77c3a040d93401259861f702a52f42f16e1e5f3 Mon Sep 17 00:00:00 2001 From: visualfc Date: Mon, 7 Jul 2025 10:31:22 +0800 Subject: [PATCH] runtime: support syscall/js --- runtime/build.go | 1 + runtime/{js => internal}/embind/_wrap/emval.cpp | 0 runtime/{js => internal}/embind/embind.go | 0 runtime/{ => internal/lib/syscall}/js/emval.go | 2 +- runtime/{ => internal/lib/syscall}/js/func.go | 0 runtime/{ => internal/lib/syscall}/js/js.go | 3 +++ 6 files changed, 5 insertions(+), 1 deletion(-) rename runtime/{js => internal}/embind/_wrap/emval.cpp (100%) rename runtime/{js => internal}/embind/embind.go (100%) rename runtime/{ => internal/lib/syscall}/js/emval.go (98%) rename runtime/{ => internal/lib/syscall}/js/func.go (100%) rename runtime/{ => internal/lib/syscall}/js/js.go (99%) diff --git a/runtime/build.go b/runtime/build.go index 1604e559..0016450d 100644 --- a/runtime/build.go +++ b/runtime/build.go @@ -47,6 +47,7 @@ var hasAltPkg = map[string]none{ "sync": {}, "sync/atomic": {}, "syscall": {}, + "syscall/js": {}, "time": {}, "os": {}, "os/exec": {}, diff --git a/runtime/js/embind/_wrap/emval.cpp b/runtime/internal/embind/_wrap/emval.cpp similarity index 100% rename from runtime/js/embind/_wrap/emval.cpp rename to runtime/internal/embind/_wrap/emval.cpp diff --git a/runtime/js/embind/embind.go b/runtime/internal/embind/embind.go similarity index 100% rename from runtime/js/embind/embind.go rename to runtime/internal/embind/embind.go diff --git a/runtime/js/emval.go b/runtime/internal/lib/syscall/js/emval.go similarity index 98% rename from runtime/js/emval.go rename to runtime/internal/lib/syscall/js/emval.go index 0e53fdab..06029ad8 100644 --- a/runtime/js/emval.go +++ b/runtime/internal/lib/syscall/js/emval.go @@ -7,7 +7,7 @@ import ( _ "unsafe" c "github.com/goplus/llgo/runtime/internal/clite" - _ "github.com/goplus/llgo/runtime/js/embind" + _ "github.com/goplus/llgo/runtime/internal/embind" ) var ( diff --git a/runtime/js/func.go b/runtime/internal/lib/syscall/js/func.go similarity index 100% rename from runtime/js/func.go rename to runtime/internal/lib/syscall/js/func.go diff --git a/runtime/js/js.go b/runtime/internal/lib/syscall/js/js.go similarity index 99% rename from runtime/js/js.go rename to runtime/internal/lib/syscall/js/js.go index 40509936..de82b76b 100644 --- a/runtime/js/js.go +++ b/runtime/internal/lib/syscall/js/js.go @@ -18,6 +18,9 @@ import ( c "github.com/goplus/llgo/runtime/internal/clite" ) +//llgo:skipall +type _js struct{} + // Value represents a JavaScript value. The zero value is the JavaScript value "undefined". // Values can be checked for equality with the Equal method. type Value struct {