node/test/fixtures/es-module-loaders/thenable-load-hook-rejected...

11 lines
274 B
JavaScript

export function load () {
let thenAlreadyAccessed = false;
return {
get then() {
if (thenAlreadyAccessed) throw new Error('must not call');
thenAlreadyAccessed = true;
return (_, reject) => reject(new Error('must crash the process'));
}
};
}