Open utterances-bot opened 5 years ago
how to add -D debug to use this function? I don't want use for Release version .
@sonygod At the beginning of the assert
macro function, you could put something like:
if (!haxe.macro.Context.defined("debug"))
return macro {};
Keep in mind that this means whatever is inside the assert
call will not be evaluated at all in release builds, so don't rely on any side effects.
@Aurel300 is that possible support js map? current only support gen js?
@sonygod I don't know what you're asking. Are you sure it's related to this article?
I mean support *.js.map @Aurel300
Assert macro that shows sub-expression values - Macros - Haxe programming language cookbook
Sometimes failed assertion checks make it difficult to tell what went wrong. For debugging the programmer not only wants to know that a check failed, but also why it failed. This macro outputs the values of all sub-expressions.
https://code.haxe.org/category/macros/assert-with-values.html