jsre: fix pretty printer for upstream otto change
This commit is contained in:
parent
d6c6bcc9f3
commit
2680e23b15
@ -202,9 +202,18 @@ func (ctx ppctx) doOwnProperties(v otto.Value, f func(string)) {
|
|||||||
Object, _ := ctx.vm.Object("Object")
|
Object, _ := ctx.vm.Object("Object")
|
||||||
rv, _ := Object.Call("getOwnPropertyNames", v)
|
rv, _ := Object.Call("getOwnPropertyNames", v)
|
||||||
gv, _ := rv.Export()
|
gv, _ := rv.Export()
|
||||||
for _, v := range gv.([]interface{}) {
|
switch gv := gv.(type) {
|
||||||
|
case []interface{}:
|
||||||
|
for _, v := range gv {
|
||||||
f(v.(string))
|
f(v.(string))
|
||||||
}
|
}
|
||||||
|
case []string:
|
||||||
|
for _, v := range gv {
|
||||||
|
f(v)
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
panic(fmt.Errorf("Object.getOwnPropertyNames returned unexpected type %T", gv))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ctx ppctx) isBigNumber(v *otto.Object) bool {
|
func (ctx ppctx) isBigNumber(v *otto.Object) bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user