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

Add support for Node.js v16.3.0+ #335

Merged
merged 5 commits into from
Sep 17, 2021
Merged

Conversation

Rugvip
Copy link
Contributor

@Rugvip Rugvip commented Sep 15, 2021

Hoping to fix #332 with this

Large parts of the implementation in readfilecontext.js are copied straight from the Node.js internals. I'm assuming that is all fine as it's already called out in the licence file that parts of this project are copied from there.

let offset;
let length;

if (this.signal?.aborted) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please change the syntax to support old Nodejs v12.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, ofc! 😁, checked that tests are passing locally for me on v12 now too

Copy link
Collaborator

@3cp 3cp left a comment

Choose a reason for hiding this comment

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

LGTM.
@tschaub please have a look.

@3cp
Copy link
Collaborator

3cp commented Sep 17, 2021

Awesome trick! Thank you very much for stretching the life of mock-fs.

@tschaub
Copy link
Owner

tschaub commented Sep 17, 2021

Thanks for the work on this, @Rugvip.

Is there a test that could be added that would cover this? I haven't been experiencing the issue myself, so am not 100% clear on the specifics.

@3cp
Copy link
Collaborator

3cp commented Sep 17, 2021

@tschaub the existing mock-fs main branch fails test on latest Nodejs v16.

@Rugvip
Copy link
Contributor Author

Rugvip commented Sep 17, 2021

@3cp @tschaub No worries, glad to help!

I added in a couple of tests, so the coverage of readfilecontext.js is now pretty good. Discovered some bugs too 😁

@tschaub tschaub merged commit ca4cfa2 into tschaub:main Sep 17, 2021
@tschaub
Copy link
Owner

tschaub commented Sep 17, 2021

Thank you for the contribution, @Rugvip.

@Rugvip Rugvip deleted the readfilecontext branch September 17, 2021 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EINVAL on Node 16.3.0
3 participants