Why is MM_SYSTEM_RESTART_SECONDS undefined in the following snippet?
If var MM_SYSTEM_RESTART_SECONDS = 40; is put inside the function, then MM_SYSTEM_RESTART_SECONDS is 40, but if outside the function,
then MM_SYSTEM_RESTART_SECONDS is always undefined.
var MM_SYSTEM_RESTART_SECONDS = 40;
function wait_until_MM_restarts()
{
restart_timeout_start_seconds = get_cookie( "restart_timeout_start_seconds" )
elapsed_restart_seconds = elapsed_seconds( restart_timeout_start_seconds )
append_debug_message( elapsed_restart_seconds + "/" + MM_SYSTEM_RESTART_SECONDS )
if( elapsed_restart_seconds > MM_SYSTEM_RESTART_SECONDS )
MM_SYSTEM_RESTART_SECONDSis defined in some other scope (inside some other function) and isn't available from this function because as you've shown it here, it would work just fine.