Skip to content

Commit

Permalink
Fix error rethrow tests
Browse files Browse the repository at this point in the history
Improper rethrow of an Error caught by reference caused a double napi_ref delete, which failed in release builds of Node-ChakraCore.
  • Loading branch information
jasongin committed May 22, 2017
1 parent 3bb8676 commit b6e2278
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/error.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void CatchAndRethrowError(const CallbackInfo& info) {
thrower({});
} catch (Error& e) {
e.Set("caught", Boolean::New(info.Env(), true));
throw e;
throw;
}
}

Expand All @@ -68,7 +68,7 @@ void CatchAndRethrowErrorThatEscapesScope(const CallbackInfo& info) {
ThrowErrorThatEscapesScope(info);
} catch (Error& e) {
e.Set("caught", Boolean::New(info.Env(), true));
throw e;
throw;
}
}

Expand Down

0 comments on commit b6e2278

Please sign in to comment.