Array with string:
<Component: roArray> =
[
"Test string"
]
AA with string:
<Component: roAssociativeArray> =
{
entry: "Test string"
}
List with string:
<Component: roList> =
(
"Test string"
)
type("Test string"): String
type(listWithString[0]) (!): roString
Node with string:
<Component: roSGNode:Node> =
{
change: <Component: roAssociativeArray>
focusable: false
focusedChild: <Component: roInvalid>
id: ""
stringfield: "Test string"
}
What this PR changes:
Tests have been updated with the fixed output of the strings.
BrsStringtoString(...) function output now depends on parent existence. toString(...) gets parent only in case this string has any kind of container (array, AA, node etc.). This perfectly correspond to Roku's behavior.
I've also made roString pass parent to its internal BrsString. List boxes strings into roStrings, so this is needed for proper string print.
Fixes #416
It's my first PR here -- please be gentle with me. 😅
OK, so Roku doesn't add quotes to a string only in 1 case: if we're printing a simple string variable:
Output:
I all other cases, Roku adds quotes. Whether it's an array, AA, list, or field of a node:
Output:
What this PR changes:
BrsString
toString(...)
function output now depends on parent existence.toString(...)
gets parent only in case this string has any kind of container (array, AA, node etc.). This perfectly correspond to Roku's behavior.I've also made
roString
passparent
to its internalBrsString
.List
boxes strings intoroString
s, so this is needed for proper string print.