exec.js 271 B

1234567891011121314
  1. "use strict";
  2. function mandatory(paramName) {
  3. throw new Error(`Missing parameter: ${paramName}`);
  4. }
  5. async function foo({ a, b = mandatory("b") } = {}) {
  6. return Promise.resolve(b);
  7. }
  8. return foo().then(() => {
  9. throw new Error('should not occcur');
  10. }, () => true);