Skip to content

Instantly share code, notes, and snippets.

@trevnorris
Created August 22, 2017 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trevnorris/b86613d712f61bffe23cb0955b0867e1 to your computer and use it in GitHub Desktop.
Save trevnorris/b86613d712f61bffe23cb0955b0867e1 to your computer and use it in GitHub Desktop.
diff --git a/test/addons/async-hello-world/binding.cc b/test/addons/async-hello-world/binding.cc
index da2bd41..5ddd61f 100644
--- a/test/addons/async-hello-world/binding.cc
+++ b/test/addons/async-hello-world/binding.cc
@@ -44,13 +44,11 @@ void AfterAsync(uv_work_t* r) {
v8::Local<v8::Function>::New(isolate, req->callback);
callback->Call(isolate->GetCurrentContext()->Global(), 2, argv);
+ printf("did rethrow: %s\n", !try_catch.ReThrow().IsEmpty() ? "true" : "false");
+
// cleanup
req->callback.Reset();
delete req;
-
- if (try_catch.HasCaught()) {
- node::FatalException(isolate, try_catch);
- }
}
void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
diff --git a/test/addons/async-hello-world/test.js b/test/addons/async-hello-world/test.js
index fbd0d7e..e185e80 100644
--- a/test/addons/async-hello-world/test.js
+++ b/test/addons/async-hello-world/test.js
@@ -4,7 +4,5 @@ const assert = require('assert');
const binding = require(`./build/${common.buildType}/binding`);
binding(5, common.mustCall(function(err, val) {
- assert.strictEqual(err, null);
- assert.strictEqual(val, 10);
- process.nextTick(common.mustCall());
+ throw new Error('ah crap');
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment