Skip to content
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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Implement clone #672

wants to merge 12 commits into from

Conversation

anyatokar
Copy link

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.

Copy link
Collaborator

@strattonbrazil strattonbrazil left a 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.

src/brsTypes/components/RoSGNode.ts Outdated Show resolved Hide resolved
src/brsTypes/components/RoSGNode.ts Outdated Show resolved Hide resolved
src/brsTypes/components/RoSGNode.ts Show resolved Hide resolved
// A deep clone also copies children.
if (isDeepCopy) {
let appendChild = copy.getMethod("appendchild");
let getChildren = toBeCloned.getMethod("getchildren");
Copy link
Collaborator

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.

Copy link
Contributor

@underwoo16 underwoo16 left a 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 👍🏼

Copy link
Collaborator

@alimnios72 alimnios72 left a 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

@lvcabral
Copy link
Contributor

@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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants