From 7e3d6d14a1fe4b2dd9315365cf3cc65bf0bd6ac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E7=BA=A2=E5=B2=A9?= Date: Mon, 27 Mar 2023 16:29:19 +0800 Subject: [PATCH] upgrade-dev v2.3.41 --- cef/bind/v8-bind.go | 1 + cef/bind/v8-js-array.go | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cef/bind/v8-bind.go b/cef/bind/v8-bind.go index 6bb6bb12..1da98eee 100644 --- a/cef/bind/v8-bind.go +++ b/cef/bind/v8-bind.go @@ -94,6 +94,7 @@ func Test() { integerKey.SetValue("变成字符串") fmt.Println("integerKey", integerKey.AsString().Value()) integerKey.SetValue(true) + fmt.Println("integerKey", integerKey.AsBoolean().Value()) boolField := integerKey.AsBoolean() fmt.Println("boolField", boolField.Value()) fmt.Println("boolField", bind.GetJSValue(boolField.Id()).AsBoolean().Value()) diff --git a/cef/bind/v8-js-array.go b/cef/bind/v8-js-array.go index 0a4135aa..41bbcf88 100644 --- a/cef/bind/v8-js-array.go +++ b/cef/bind/v8-js-array.go @@ -11,12 +11,10 @@ // V8 JSValue JSArray 类型实现 package bind -import "github.com/energye/energy/pkgs/json" - type JSArray interface { JSValue AsArray() JSArray - Value() json.JSONArray + Value() any } // JSArray 类型 先保留 未添加 @@ -31,6 +29,9 @@ func (m *jsArray) AsArray() JSArray { return nil } -func (m *jsArray) Value() json.JSONArray { - return m.value.JSONArray() +func (m *jsArray) Value() any { + if m.IsArray() { + return m.value.Data() + } + return nil }