mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-09-11 23:19:30 +00:00
reflect,reflectlite: make IsRO/MakeRO package methods
Having them as methods on reflectlite.Value makes them visible to the user. Also move new functions out of all_test.go so it can stay closer to upstream (except for comments).
This commit is contained in:
committed by
Damian Gryski
parent
33ddee76db
commit
10224a4bf8
@@ -4722,14 +4722,6 @@ var convertTests = []struct {
|
||||
|
||||
}
|
||||
|
||||
func IsRO(v Value) bool {
|
||||
return v.IsRO()
|
||||
}
|
||||
|
||||
func MakeRO(v Value) Value {
|
||||
return Value{v.MakeRO(true)}
|
||||
}
|
||||
|
||||
func TestConvert(t *testing.T) {
|
||||
canConvert := map[[2]Type]bool{}
|
||||
all := map[Type]bool{}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"internal/reflectlite"
|
||||
. "reflect"
|
||||
"runtime"
|
||||
"slices"
|
||||
@@ -992,3 +993,13 @@ func TestTypeAssertPanic(t *testing.T) {
|
||||
t.Fatalf("TypeAssert did not panic")
|
||||
})
|
||||
}
|
||||
|
||||
// Functions needed by all_test.go
|
||||
|
||||
func IsRO(v Value) bool {
|
||||
return reflectlite.IsRO(v.Value)
|
||||
}
|
||||
|
||||
func MakeRO(v Value) Value {
|
||||
return Value{reflectlite.MakeRO(v.Value, true)}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user