Design by contract in JavaScript, part 3: XPCOM class invariants In the last DBC-JS article, I wrote about precondition and postcondition support for JavaScript in general. At the time, I lamented the inability to implement any kind of invariant checking. Today, I created a way to implement class invariants for JavaScript-based XPCOM components, courtesy of mozilla.org's nsIScriptableInterfaceInfo