Skip to content

Commit c548151

Browse files
working on reflectlite and abi
1 parent 2f0e427 commit c548151

File tree

1 file changed

+8
-8
lines changed
  • compiler/natives/src/internal/reflectlite

1 file changed

+8
-8
lines changed

compiler/natives/src/internal/reflectlite/value.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -568,22 +568,22 @@ func (v Value) Field(i int) Value {
568568

569569
prop := jsType(v.typ).Get("fields").Index(i).Get("prop").String()
570570
field := &tt.Fields[i]
571-
typ := field.typ
571+
typ := field.Typ
572572

573573
fl := v.flag&(flagStickyRO|flagIndir|flagAddr) | flag(typ.Kind())
574-
if !field.name.isExported() {
575-
if field.embedded() {
574+
if !field.Name.IsExported() {
575+
if field.Embedded() {
576576
fl |= flagEmbedRO
577577
} else {
578578
fl |= flagStickyRO
579579
}
580580
}
581581

582-
if tag := tt.fields[i].name.tag(); tag != "" && i != 0 {
582+
if tag := tt.Fields[i].Name.Tag(); tag != "" && i != 0 {
583583
if jsTag := getJsTag(tag); jsTag != "" {
584584
for {
585585
v = v.Field(0)
586-
if v.typ == jsObjectPtr {
586+
if toRType(v.typ) == jsObjectPtr {
587587
o := v.object().Get("object")
588588
return Value{
589589
typ: typ,
@@ -606,11 +606,11 @@ func (v Value) Field(i int) Value {
606606
return Value{
607607
typ: typ,
608608
ptr: unsafe.Pointer(jsPtrTo(typ).New(
609-
js.InternalObject(func() *js.Object { return wrapJsObject(typ, s.Get(prop)) }),
610-
js.InternalObject(func(x *js.Object) { s.Set(prop, unwrapJsObject(typ, x)) }),
609+
js.InternalObject(func() *js.Object { return wrapJsObject(toRType(typ), s.Get(prop)) }),
610+
js.InternalObject(func(x *js.Object) { s.Set(prop, unwrapJsObject(toRType(typ), x)) }),
611611
).Unsafe()),
612612
flag: fl,
613613
}
614614
}
615-
return makeValue(typ, wrapJsObject(typ, s.Get(prop)), fl)
615+
return makeValue(typ, wrapJsObject(toRType(typ), s.Get(prop)), fl)
616616
}

0 commit comments

Comments
 (0)