sjbarag / brs

An interpreter for the BrightScript language that runs on non-Roku platforms.
MIT License
113 stars 43 forks source link

`no active host node: (internal):(-1)` occurs when attempting to observe a node that was passed in via callFunc #585

Closed gincwang closed 3 years ago

gincwang commented 3 years ago
Assuming nodeA has field `field1`, and nodeB has function field `func1`

if we attempt to do this inside nodeB's func1:

' // some other component
nodeB.callFunc("func1", nodeA)

' // nodeB.brs
sub func1(nodeA as object)
    m.nodeA = nodeA
    m.nodeA.observeField("field1", "onField1Changed")       ' this emits "BRIGHTSCRIPT: ERROR: roSGNode.ObserveField: no active host node: (internal):(-1)" error in the log
end func
gincwang commented 3 years ago

Also, same error happens in another scenario: if a node was returned via callFunc, and we try to observe a field on that returned node