Skip to content
  • Rob Swindell's avatar
    d5516d0f
    Global JS exit() function now sets 'exit_code' to 0 by default · d5516d0f
    Rob Swindell authored
    Calling exit() causes JS_ExecuteScript() to return false (same return value
    as if there's a syntax error) - so if we always set exit_code in exit()
    (even when not passed a parameter) and then use that exit code if the property
    is defined, then we get the -1 return value from js_execfile() if the script
    is terminated prematurely without using exit().
    
    This fixes the issue introduced in the previous commit where scripts that
    call exit() - without any parameters, were causing errors to be logged about
    scripts (e.g. timed events) returning -1.
    d5516d0f
    Global JS exit() function now sets 'exit_code' to 0 by default
    Rob Swindell authored
    Calling exit() causes JS_ExecuteScript() to return false (same return value
    as if there's a syntax error) - so if we always set exit_code in exit()
    (even when not passed a parameter) and then use that exit code if the property
    is defined, then we get the -1 return value from js_execfile() if the script
    is terminated prematurely without using exit().
    
    This fixes the issue introduced in the previous commit where scripts that
    call exit() - without any parameters, were causing errors to be logged about
    scripts (e.g. timed events) returning -1.
Loading