This implements and tests the API described in #27 (comment) for V8 as present in Node.js 6.2.0.
API: Implement napi_trycatch
Tests: Add test for napi_trycatch
(cherry picked from commit 8d8c17fc3458b70abfd2efcaee97538b49ca3008)
Based on discussion today in the api meeting I'll wait to review until I get back from holidays next week as I believe there may be some changes.
Should there be a napi_trycatch_rethrow function, so that code that calls napi_trycatch_exception can decide not to handle the exception after looking at it?
There should probably be a Napi::TryCatch RAII helper class in node_api_helpers.h that takes care of automatically deleting the trycatch when it goes out of scope.
Should add 2 (negative) test cases for when no exception is thrown and napi_trycatch_exception is/is not called.
Now I realize this PR is made obsolete by the newer Try catch global persistent exception PR... I think.
Yeah, actually. It's probably bet to close it.
Sorry about the confusion!
Should the chakracore port of this be closed also?