-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement clone #672
base: main
Are you sure you want to change the base?
Implement clone #672
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. A few suggestions that might clean things up a bit.
// A deep clone also copies children. | ||
if (isDeepCopy) { | ||
let appendChild = copy.getMethod("appendchild"); | ||
let getChildren = toBeCloned.getMethod("getchildren"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code would be a little cleaner if we exposed getChildren
in typescript. I wonder if that's worth it. Then the callable would just wrap that response in an RoArray
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @strattonbrazil suggestions, otherwise this looks great 👍🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes
This reverts commit 7ba2022.
@anyatokar this project is stalled and the Roku Community has forked it (see @sjbarag suggestion on #681) do you mind re-pushing your PR on https://github.com/rokucommunity/brs ? |
Implemented
.clone(isDeepCopy as Boolean)
for ifSGNodeDict interface. Both shallow and deep clones copy Fields but only the deep clone copies Children.Added associated unit and e2e tests.