1
This commit is contained in:
parent
d82df9df79
commit
607a4887d0
@ -1,6 +1,7 @@
|
|||||||
package q5
|
package q5
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"reflect"
|
||||||
"net/url"
|
"net/url"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
@ -223,7 +224,7 @@ func (this *XObject) fromInterface(iVal interface{}) *XObject {
|
|||||||
this._type = XOT_SIMPLE
|
this._type = XOT_SIMPLE
|
||||||
this._val = NewXUndefined()
|
this._val = NewXUndefined()
|
||||||
if !this.AsXValue().TryFromInterface(iVal) {
|
if !this.AsXValue().TryFromInterface(iVal) {
|
||||||
panic("XObject.fromInterface type error2")
|
panic("XObject.fromInterface type error2 type" + reflect.TypeOf(iVal).String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
|
@ -271,6 +271,11 @@ func (this *XValue) ToJsonInterface() interface{} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *XValue) TryFromInterface(val interface{}) bool {
|
func (this *XValue) TryFromInterface(val interface{}) bool {
|
||||||
|
if val == nil {
|
||||||
|
this._type = XVT_UNDEFINED
|
||||||
|
this._val = nil
|
||||||
|
return true
|
||||||
|
}
|
||||||
switch val.(type) {
|
switch val.(type) {
|
||||||
case int8:
|
case int8:
|
||||||
this.SetInt8(val.(int8))
|
this.SetInt8(val.(int8))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user