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

src: fix use of deprecated ToObject() #23314

Merged
merged 2 commits into from
Oct 10, 2018
Merged

src: fix use of deprecated ToObject() #23314

merged 2 commits into from
Oct 10, 2018

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Oct 7, 2018

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. http_parser Issues and PRs related to the HTTP Parser dependency or the http_parser binding. labels Oct 7, 2018
src/exceptions.cc Show resolved Hide resolved
@@ -617,7 +617,8 @@ class Parser : public AsyncWrap, public StreamListener {
enum http_errno err = HTTP_PARSER_ERRNO(&parser_);

Local<Value> e = Exception::Error(env()->parse_error_string());
Local<Object> obj = e->ToObject(env()->isolate());
Local<Object> obj = e->ToObject(env()->isolate()->GetCurrentContext())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@addaleax what about this one?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This scope has an EscapableHandleScope, so maybe it'll be self documenting to use scope.GetIsolate()?

Copy link
Member

@addaleax addaleax Oct 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@targos I think it currently doesn’t matter because we only provide built-in native modules for the main context of an Environment… This would probably the correct choice if we were to change that. On the other hand, using env()->context() might be a tiny bit faster.

This scope has an EscapableHandleScope, so maybe it'll be self documenting to use scope.GetIsolate()?

That would be very unidiomatic.

src/exceptions.cc Show resolved Hide resolved
@danbev
Copy link
Contributor

danbev commented Oct 10, 2018

CI: https://ci.nodejs.org/job/node-test-pull-request/17716/
Is it alright to fix the travis CI failure (blank line) when merging? This might have been fixed already so I'll try to restart that job.

@danbev
Copy link
Contributor

danbev commented Oct 10, 2018

Re-run of failing node-test-commit-linux ✔️
Re-run of failing node-test-commit-arm ✔️
Re-run of failing node-test-commit-arm-fanned

PR-URL: nodejs#23314
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
PR-URL: nodejs#23314
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
@cjihrig cjihrig merged commit 20de5f3 into nodejs:master Oct 10, 2018
@cjihrig cjihrig deleted the deprs branch October 10, 2018 14:34
targos pushed a commit that referenced this pull request Oct 10, 2018
PR-URL: #23314
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
targos pushed a commit that referenced this pull request Oct 10, 2018
PR-URL: #23314
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
jasnell pushed a commit that referenced this pull request Oct 17, 2018
PR-URL: #23314
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
jasnell pushed a commit that referenced this pull request Oct 17, 2018
PR-URL: #23314
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. http_parser Issues and PRs related to the HTTP Parser dependency or the http_parser binding.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants