Hello Dear Community,
I am working on migration of SuiteScripts from 2.0/x to 2.1.
I noticed an issue regarding the options in General Preferences to "Execute SuiteScript 2.x Server Scripts as" and "Execute SuiteScript 2.0 Server Scripts as 2.1".
I enabled both options and tested with a User Event script that is @NApiVersion 2.x. In that script I intentionally put syntax that is bound to fail under 2.1. The script didn't return error upon execution. When I explicitly changed the version in the annotation to 2.1. Then, the script failed. For Suitelets however, both General Preferences options work as expected and @NApiVersion 2.x scripts fail if they contain the same bad syntax.
The syntax I test with is just simple overwriting of variables defined with const. And also JSON.parse() calls of malformed objects ( for example ending with comma ) - {"mykey" : 1, }.
Basically I based my testing on the article:
Can you please confirm my concern or let me know if I am wrong somewhere?
Thanks!