Add v8.ASSERT() for v8 extras |
|
Issue description
It would be nice if V8 Extras could use a v8.ASSERT() function which would work in debug builds but be compiled out of optimised builds. Or it could just be a no-op in optimised builds, which would still be useful for many cheap checks.
I am thinking of a syntax like
v8.ASSERT(condition, message)
which would do nothing if |condition| was true. If |condition| was false, it would print
`Assertion failed: ${message}`, then a stack trace, and abort hard enough to cause a layout test to fail (crashing the process would fulfill this requirement).
Example:
v8.ASSERT(new Date() > 0, 'Javascript has been invented');
,
Aug 2 2017
I've actually been considering running the files through the C preprocessor. Javascript syntax is close enough to C that it can remove whole function calls. |
|
►
Sign in to add a comment |
|
Comment 1 by domenic@chromium.org
, Aug 1 2017