-
Notifications
You must be signed in to change notification settings - Fork 30k
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
doc: fix doc example for cctest #17355
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 <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]>
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 <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]>
cctest guide example wasn't working because of a few typos. PR-URL: #17355 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]>
cctest guide example wasn't working because of a few typos. PR-URL: #17355 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]>
cctest guide example wasn't working because of a few typos. PR-URL: #17355 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]>
cctest guide example wasn't working because of a few typos.
Checklist
Affected core subsystem(s)
doc