node-red/test
Nick O'Leary 84771f5864
Flows/subflows must preinitialise their context objects
Fixes #2513

If a node inside a subflow accessed its context object in its
constructor, the subflow-instance flow context would not yet
have been created. This would cause a place holder context
to get created on its behalf, but that place holder doesn't
have its parent set properly. This then breaks the usage
of $parent inside such a subflow.

This fix has changed it so flows (and subflows) create their
flow context as part of their initial creation. That ensures
it exists when individual nodes from the subflow are created,
allowing them to safely access their context.

This has also fixed a related issue where any attempt to use
$parent to access beyond the root parent would seemingly hang
as the callback was never being called. This would cause
messages to get stuck in flows. The fix ensures the callback
is used in the root context objects and undefined is returned.
2020-03-27 23:47:12 +00:00
..
editor Add page objects for UI testing (#2501) 2020-03-13 13:20:16 +00:00
node_modules/nr-test-utils Fixup all the tests 2018-08-20 16:17:24 +01:00
nodes Ensure join node handles missing buffer joiner when not in string mode 2020-03-02 19:50:39 +00:00
resources Merge branch 'master' into runtime-api 2018-07-29 23:47:19 +01:00
unit Flows/subflows must preinitialise their context objects 2020-03-27 23:47:12 +00:00