0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/tools/dcheck_macros.py
Gus Caplan 3ed363cb36
lib: add internal check macros
PR-URL: https://github.com/nodejs/node/pull/18852
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-03-05 08:35:44 -06:00

8 lines
368 B
Python

macro DCHECK(x) = do { if (!(x)) (process._rawDebug("DCHECK: x == true"), process.abort()) } while (0);
macro DCHECK_EQ(a, b) = DCHECK((a) === (b));
macro DCHECK_GE(a, b) = DCHECK((a) >= (b));
macro DCHECK_GT(a, b) = DCHECK((a) > (b));
macro DCHECK_LE(a, b) = DCHECK((a) <= (b));
macro DCHECK_LT(a, b) = DCHECK((a) < (b));
macro DCHECK_NE(a, b) = DCHECK((a) !== (b));