Commit c09a7134 authored by Ben Noordhuis's avatar Ben Noordhuis Committed by Myles Borins
Browse files

n-api: wrap control flow macro in do/while

Make CHECK_ENV() safe to use in the following context:

    if (condition)
      CHECK_ENV(env);
    else
      something_else();

Backport-PR-URL: https://github.com/nodejs/node/pull/19447
PR-URL: https://github.com/nodejs/node/pull/18532


Reviewed-By: default avatarMichael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarAli Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: default avatarRuben Bridgewater <ruben@bridgewater.de>
Reviewed-By: default avatarTiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: default avatarDaniel Bevenius <daniel.bevenius@gmail.com>
parent b565ba2d
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment