I was trying to find a flow logic error and wasted about 2 hours double checking everything. Only to find that it appears the javascript parser missed a typo? Do you see it? Hint DEVICE const.
The above is not correct, but NR parser did not flag it? Now I suspect this is actually a node parser error, because NR is just using node to validate function nodes?
Are you using the (default) ACE editor, or have you enabled the monaco editor?
What you have shared there is actually valid JavaScript (albeit not 'good' JavaScript). If you open your browser's JavaScript console and paste that in and run it, you won't get an error.
That said, it isn't good JavaScript because you are setting MONITOR etc without having declared them as var/let/const etc. However, the built-in JavaScript parser used by ACE doesn't flag this.
The monaco editor widget has much better defaults for highlighting this type of thing:
Right, to me this is just a typical typo, comma in the wrong place, was surprised it was not flagged.
No, I have not customized the editor at all.
Yeah, I figured this was not NR per se! Just found it odd.
Oh, so 'good' JavaScript wants explicit declaration per variable/constant? Interesting, my experience with C, C#, VB, VB.NET, python, etc. complex or combined declarations is typical, because JavaScript never flagged it, I never really considered it an issue, live and learn.
Looking forward to 3.0, I just seem to have all the fun. LOL.
Ah... man reminds me of my 'compiler theory' class at University, where there were just 'wonderful' code parsing complexities. Never look at a parser... the code is always ugly... I remember my professor stated.