My patch introduces a new Warnings mechanism for JS. If this works
nicely, I'd like to extend this to C++.

Basically, whenever you encounter a situation that should never happen
in production but that is not quite fatal enough to warrant a crash, we
call (from the top of my head)

Warnings.warn("the module that triggered the warning",
   `Hey, I still have ${n} splines to reticulate, I should have 0.`);

By default, this causes tests to fail. However, tests that are designed
to cause this kind of warning can whitelist the warning with

Assert.expect("the module that triggered the warning",
  /Hey, I still have [0-9]* splines to reticulate, I should have 0./)
(note the regexp)

and tests that are known to cause this kind of warning can graylist it
until the warning has been fixed

Assert.FIXME("the module that triggered the warning"
    /Hey, I still have [0-9]* splines to reticulate, I should have 0./)
(also a regexp)

This API covers all the needs I have encountered for warnings so far in
JS code. I don't think it's terribly different in C++ code.

Cheers,
 David


On 05/06/15 00:14, Ehsan Akhgari wrote:
> Families of warnings?  I don't really understand what you mean.  Also,
> looking at the patch in the bug, your changes seem to affect Assert.jsm
> stuff, which is not related to NS_WARNING.


-- 
David Rajchenbach-Teller, PhD
 Performance Team, Mozilla
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to