Closed Bug 885766 Opened 11 years ago Closed 8 months ago

Saner testing API for JS options

Categories

(Core :: JavaScript Engine, defect)

defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: jorendorff, Unassigned)

Details

What we have: var hadWerror = options().split(",").indexOf("werror") !== -1; // Ensure the "werror" option is disabled. if (hadWerror) options("werror"); try { ... } catch (exc) { if (hadWerror) options("werror"); throw exc; } // Enable the "werror" option. options("werror"); try { ... } finally { if (!hadWerror) options("werror"); } What we want: var hadWerror = options.werror; try { options.werror = true; ... options.werror = false; ... } finally { options.werror = hadWerror; } Or maybe: withOptions({werror: true}, () => { ...; }); withOptions({werror: false}, () => { ...; });
Assignee: general → nobody
Severity: normal → S3
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.