A microtask checkpoint should notify about rejected promises. After cleaning up after running script involves running a microtask checkpoint. So the order of unhandledrejection should occur before error2.