mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 862921 - Generalize AssertSequentialIsOK logic and improve its message. r=nmatsakis
1. If one passes a `mode` argument without a property named `mode`, the previous version will fall into the ThrowError branch (because mode.mode => undefined and undefined !== "seq") 2. The old error message used the strings "par" and "seq", which might make the reader think that the assertion is solely about the appropriate value for the `mode` property, which happens to take on the values "par" or "seq" in some cases. But the real condition being signalled here is not about the string values "par" or "seq"; it is instead about the dynamic behavior of the runtime system. This changes the error message to use longer phrases, which should hopefully make the intent clearer. There is a third change I want to make, changing the logic of the conditional guard further, but that change is not as important to me as the two above.
This commit is contained in:
parent
febd320fc7
commit
3b88aa7514
@ -1247,8 +1247,8 @@ function ParallelArrayToString() {
|
||||
* sequential execution
|
||||
*/
|
||||
function AssertSequentialIsOK(mode) {
|
||||
if (mode && mode.mode !== "seq" && ParallelTestsShouldPass())
|
||||
ThrowError(JSMSG_WRONG_VALUE, "par", "seq");
|
||||
if (mode && mode.mode && mode.mode !== "seq" && ParallelTestsShouldPass())
|
||||
ThrowError(JSMSG_WRONG_VALUE, "parallel execution", "sequential was forced");
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user