Ensuring `instanceof` operator works as planned for promises