jscript: Better handling of to_integer result in String.slice.