Fixes typo in promises implementation for legacy browsers

Fixes #5076.