Skip to content

Commit

Permalink
quote the value if it is a string
Browse files Browse the repository at this point in the history
  • Loading branch information
deelawn committed Oct 28, 2023
1 parent c935b3c commit cc76cbd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gnovm/pkg/gnolang/values_string.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ func (tv TypedValue) ProtectedString(seen map[Value]struct{}) string {
} else {
// vs = fmt.Sprintf("%v", tv.V)
vs = tv.ProtectedSprint(seen, false)
if base := baseOf(tv.T); base == StringType || base == UntypedStringType {
vs = strconv.Quote(vs)
}
}

ts := tv.T.String()
Expand Down

0 comments on commit cc76cbd

Please sign in to comment.