_("Make sure a normal call will call and return");
rightThis = didCall = false;
state = 0;
ret = await obj.func(); Assert.equal(ret, 5); Assert.ok(rightThis); Assert.ok(didCall); Assert.equal(lockState, 1); Assert.equal(unlockState, 2); Assert.equal(state, 2);
_("Make sure code that calls locked code throws");
ret = null;
rightThis = didCall = false; try {
ret = await obj.throwy();
do_throw("throwy internal call should have thrown!");
} catch (ex) { // Should throw an Error, not a string.
do_check_begins(ex.message, "Could not acquire lock");
} Assert.equal(ret, null); Assert.ok(rightThis); Assert.ok(didCall);
_("Lock should be called twice so state 3 is skipped"); Assert.equal(lockState, 4); Assert.equal(lockedState, 5); Assert.equal(unlockState, 6); Assert.equal(state, 6);
});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.