Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Update V8 API usages for compatibility with node 12 - #72

Merged
maxbrunsfeld merged 1 commit into
masterfrom
mb-node-12-compat
Jul 22, 2019
Merged

maxbrunsfeld merged 1 commit into
masterfrom
mb-node-12-compat

Conversation

@maxbrunsfeld

Copy link
Copy Markdown
Contributor

I've also updated the Travis build to include Node 12, alongside versions 8 and 10.

// Nan doesn't wrap this functionality
#if NODE_MAJOR_VERSION >= 12
Isolate::GetCurrent(),
#endif

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In node 12, the v8::String::Write method changed to take a v8::Isolate as its first parameter. Usually we don't have to manually deal with different Node/V8 versions in our code, because Nan wraps these APIs for us. But Nan does not provide a wrapper for String::Write.

// Nan doesn't wrap this functionality
#if NODE_MAJOR_VERSION >= 12
Isolate::GetCurrent(),
#endif

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here's another case where we really want to use String::Write for performance, because it allows us to reuse the std::string that we've already allocated.

@akurtakov

Copy link
Copy Markdown

What is blocking this one?

@akurtakov

Copy link
Copy Markdown

Anyone interested in this one? Node 12 is more and more widespread now.

@maxbrunsfeld

Copy link
Copy Markdown
Contributor Author

I think this is ready to go. Just needs a look from someone on @atom/core.

@as-cii as-cii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks reasonable to me, @maxbrunsfeld. 👍

@as-cii as-cii self-assigned this Jul 22, 2019
@maxbrunsfeld
maxbrunsfeld merged commit 59c92f4 into master Jul 22, 2019
@maxbrunsfeld
maxbrunsfeld deleted the mb-node-12-compat branch July 22, 2019 16:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants