Not sure why I have not seen this before, but I was writing a flow that need use of context, so I did the following... Where msg.topic just happened to be FQDN reference, say www.google.com.
var theDevice = flow.get(msg.topic) || {};
theDevice.ping = msg.payload;
if (typeof theDevice.exclude === undefined)
theDevice.exclude = false;
flow.set(msg.topic, theDevice);
return msg;
When I looked at the context, I found...
I don't yet have a lot of experience with JS, but I take it somewhere there is a rule that says periods can't be part of a variable name, because they are parsed as part of the property (tree). But why is context doing this when context requires a string?
For example, you do flow.get('somestring') or flow.set('somestring', theValue). If 'somestring' has a period in it... that should not be an issue. It is a string, not a variable. Or is this a case where I have to do $(msg.topic}
to avoid the parsing? That did not work either.
Of course I then tried a literal string flow.set('www.google.com'), and that also was parsed, IMHO that just does not make sense at face value, JS variable rules not withstanding. So is this something unique to JS? Or even NR? What if I really want a flow reference label to have a period in it? Is that not possible, or such?
Of course an object property key can have a period in it, for example "www.google.com: true" can be done. Even { "www.google.com": { "www.microsoft.com": false, "red.hat.com": true} } can be done.
For example...
theDevice['this.is.a.test']='test';
var theTest = theDevice['this is a test'];
The above shows up as 'this.is.a.test': 'test' in context.