Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
- Move define to src
- Correct fix implementation
  • Loading branch information
KevinEady committed Apr 23, 2021
1 parent 5382c4a commit a089697
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
}
}]
],
'defines': [ 'NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS' ],
'include_dirs': ["<!(node -p \"require('../').include_dir\")"],
'cflags': [ '-Werror', '-Wall', '-Wextra', '-Wpedantic', '-Wunused-parameter' ],
'cflags_cc': [ '-Werror', '-Wall', '-Wextra', '-Wpedantic', '-Wunused-parameter' ]
Expand Down
5 changes: 0 additions & 5 deletions napi-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2418,11 +2418,6 @@ inline void Error::ThrowAsJavaScriptException() const {
napi_status status = napi_throw(_env, Value());
#endif

if (status == napi_pending_exception) {
// The environment could be terminating.
return;
}

#ifdef NAPI_CPP_EXCEPTIONS
if (status != napi_ok) {
throw Error::New(_env);
Expand Down
1 change: 1 addition & 0 deletions test/error.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS
#include <future>
#include "napi.h"

Expand Down

0 comments on commit a089697

Please sign in to comment.