crypto
crypto copied to clipboard
Is there a way to mock m.top.getScene() call?
I currently have a component that is dependent on m.top.getScene(). Is there a way to mock this function so I wouldn't have to change the current code base?
Currently, it isn't available in a Node scope.
SomeNode.brs(17,19-20): 'getScene' is not a function and cannot be called.Runtime error encountered in BRS implementation: Error: Something terrible happened and we didn't throw a `BlockEnd` instance.
The getScene() function is declared in the ifSGNodeChildren interface, which is implemented by roSGNode:
getScene() as roSGNode
Description Returns the node's root Scene. This returns a valid Scene even if the node is not parented.
Return Value The node's root Scene.
We don't currently have any scene support, unfortunately. But I think that it should be possible to mock it with #495.