Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix segmentation fault when using setters or getters that are not defined #148

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,11 @@ if (typeof global.gc === 'function') {
const child = require('./napi_child').spawnSync(process.argv[0], [ '--expose-gc', __filename ], {
stdio: 'inherit',
});
process.exitCode = child.status;

if (child.signal) {
console.log(`Tests aborted with ${child.signal}`);
process.exitCode = 1;
} else {
process.exitCode = child.status;
}
}
2 changes: 2 additions & 0 deletions test/objectwrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class TestIter : public Napi::ObjectWrap<TestIter> {
Constructor = Napi::Persistent(DefineClass(env, "TestIter", {
InstanceMethod("next", &TestIter::Next),
}));

Constructor.SuppressDestruct();
}

static Napi::FunctionReference Constructor;
Expand Down