-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
doc: fix doc example for cctest #17355
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
doc/guides/writing-tests.md
Outdated
@@ -312,7 +312,7 @@ TEST_F(EnvTest, RunAtExit) { | |||
v8::Local<v8::Context> context = v8::Context::New(isolate_); | |||
node::IsolateData* isolateData = node::CreateIsolateData(isolate_, uv_default_loop()); | |||
Argv argv{"node", "-e", ";"}; | |||
auto env = Environment:CreateEnvironment(isolateData, context, 1, *argv, 2, *argv); | |||
auto env = node::CreateEnvironment(isolateData, context, 1, *argv, 2, *argv); | |||
node::AtExit(at_exit_callback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, could you also pass the env
to the AtExit function:
node::AtExit(env, at_exit_callback);
Without this AtExit will use the thread local environment which will be different and cause a segment fault. I'll take a closer look into the exact cause of this, or let me know if you'd like to dig into it further.
cctest guide example wasn't working because of a few typos.
878c380
to
4bb9e53
Compare
@danbev |
Landing... |
cctest guide example wasn't working because of a few typos. PR-URL: #17355 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Thank you for your contribution, landed in c9d1704. |
cctest guide example wasn't working because of a few typos. PR-URL: #17355 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
cctest guide example wasn't working because of a few typos. PR-URL: #17355 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
cctest guide example wasn't working because of a few typos. PR-URL: #17355 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
cctest guide example wasn't working because of a few typos. PR-URL: #17355 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
cctest guide example wasn't working because of a few typos.
Checklist
Affected core subsystem(s)
doc