Optionally allow to treat script assert as warning

This commit allows us to treat variable use before assign errors and local variables inside of the global scope as warnings instead of asserts. This will allow for easier porting of legacy scripts. It is highly recommended use this as an aid to port scripts, but can be used in production if needbe.
This commit is contained in:
Jeff Hutchinson 2021-11-16 23:56:52 -05:00
parent b5bd242e23
commit 2e03108856
6 changed files with 60 additions and 12 deletions

View file

@ -691,7 +691,8 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa
setFrame = -1;
// Do we want this code to execute using a new stack frame?
if (setFrame < 0)
// compiling a file will force setFrame to 0, forcing us to get a new frame.
if (setFrame <= 0)
{
// argc is the local count for eval
gEvalState.pushFrame(NULL, NULL, argc);