Task-based xpcshell driver breaks if a test rejects a promise with 'undefined' or 'null'

NEW
Unassigned

Status

Testing
XPCShell Harness
3 years ago
3 years ago

People

(Reporter: Irving, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

An xpcshell test I was working on happened to yield on a promise, and that promise rejected with 'undefined' as its value; minimal test case:

add_task(function* yield_error() {
  yield Promise.reject(undefined);
});


yield Promise.reject(null) has the same effect.


The test prints out the following and then hangs:

 0:04.06 *************************
 0:04.06 A coding exception was thrown in a Promise rejection callback.
 0:04.06 See https://developer.mozilla.org/Mozilla/JavaScript_code_modules/Promise.jsm/Promise
 0:04.06
 0:04.06 Full message: TypeError: ex is undefined
 0:04.06 Full stack: do_report_unexpected_exception@/Users/ireid/tbird/mozilla-central-PB/testing/xpcshell/head.js:693:3
 0:04.06 run_next_test/_run_next_test/<@/Users/ireid/tbird/mozilla-central-PB/testing/xpcshell/head.js:1310:44
 0:04.06 Handler.prototype.process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:868:21
 0:04.06 this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:744:7
 0:04.06 _do_main@/Users/ireid/tbird/mozilla-central-PB/testing/xpcshell/head.js:191:5
 0:04.06 _execute_test@/Users/ireid/tbird/mozilla-central-PB/testing/xpcshell/head.js:405:5
 0:04.06 @-e:1:1
 0:04.06
 0:04.06 *************************
You need to log in before you can comment on or make changes to this bug.