Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
n-api: provide node::FatalError() when internals are absent
src/node_api.cc must build both as a part of node and as an addon against an older version of node, so that it may be possible to make N-API available on older, already-published versions of node. Thus, it must not make use of node internals such as node::FatalError(). Yet N-API must also exit with a fatal error in the absence of a napi_env pointer. To that end, node::FatalError() is implemented if internals are unavailable by copying PrintErrorString() from node.cc, simplifying it to accept only a location and an error message, and augmenting it with fflush() and platform-ifdefed abort(), the latter two of which are also copied from node.cc. Re nodejs#232 Re https://github.com/nodejs/node-api
- Loading branch information