diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-02-01 17:38:28 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-02-03 22:35:27 +0300 |
commit | 30545a5b21fecee1ff6c646ea49b3719644b200a (patch) | |
tree | b804868074a82a5fd4aafb1c735129e54aee357f /src/node_errors.cc | |
parent | d0bce9a82d820df9b297de58881fb00a57f6775c (diff) |
src: use struct as arguments to node::Assert
This just makes the code a bit more obvious (subjectively).
PR-URL: https://github.com/nodejs/node/pull/25869
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node_errors.cc')
-rw-r--r-- | src/node_errors.cc | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/node_errors.cc b/src/node_errors.cc index 5a9f08839ce..ab608f96dd0 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -166,23 +166,17 @@ void AppendExceptionLine(Environment* env, ABORT_NO_BACKTRACE(); } -[[noreturn]] void Assert(const char* const (*args)[4]) { - auto filename = (*args)[0]; - auto linenum = (*args)[1]; - auto message = (*args)[2]; - auto function = (*args)[3]; - +[[noreturn]] void Assert(const AssertionInfo& info) { char name[1024]; GetHumanReadableProcessName(&name); fprintf(stderr, - "%s: %s:%s:%s%s Assertion `%s' failed.\n", + "%s: %s:%s%s Assertion `%s' failed.\n", name, - filename, - linenum, - function, - *function ? ":" : "", - message); + info.file_line, + info.function, + *info.function ? ":" : "", + info.message); fflush(stderr); Abort(); |