diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-02-15 11:25:02 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-02-17 18:09:14 +0100 |
commit | 783c65ebc4143ed9afa723f26eaebdecf5f98691 (patch) | |
tree | 635afba4bcfa4a7447d0b7313ad3c859e6efcbd2 /src/node_errors.cc | |
parent | 586318aa9f70cdd0f5e0bc93b031ff68f572ed64 (diff) | |
download | node-new-783c65ebc4143ed9afa723f26eaebdecf5f98691.tar.gz |
src: add debug CHECKs against empty handles
These checks were useful while investigating other issues;
using empty `Local<>`s can be very un-debuggable, because that
typically does not lead to assertions with debugging information
but rather crashes based on accessing invalid memory.
PR-URL: https://github.com/nodejs/node/pull/26125
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_errors.cc')
-rw-r--r-- | src/node_errors.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/node_errors.cc b/src/node_errors.cc index 42e19f6905..39673abf7f 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -710,6 +710,7 @@ void DecorateErrorStack(Environment* env, void FatalException(Isolate* isolate, Local<Value> error, Local<Message> message) { + CHECK(!error.IsEmpty()); HandleScope scope(isolate); Environment* env = Environment::GetCurrent(isolate); |