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

Remove the non-deterministic module export modification in native.ts #391

Merged
merged 15 commits into from
Sep 8, 2022

Conversation

Eximius
Copy link
Contributor

@Eximius Eximius commented Apr 3, 2020

In rare cases (notably jest), if it reloads the module cache for every test-suite, all test-suites that are run after the first one will have the methods dict have the values {send: undefined, received: undefined, ...}, because the ./native module itself is reloaded, however the node-gyp-build module is not (hence has the aforementioned dict keys of Socket.prototype deleted => undefined).

Instead of spelunking into figuring out how to make the previous very-non-standard semantics work, the changes I introduce seem like a simpler and more robust solution.

Eximius added 7 commits April 3, 2020 21:29
In rare cases (notably jest), if it reloads the module cache for every test-suite, all test-suites that are run after the first one will have the `methods` dict have the values {send: undefined, received: undefined, ...}, because the ./native module itself is reloaded, however the node-gyp-build module is not (hence has the aforementioned dict keys of Socket.prototype deleted => undefined).

Instead of spelunking into figuring out how to make the previous very-non-standard semantics work, this seems like a simpler and more robust solution.
@lesmoutonssauvages
Copy link

Thanks @Eximius , i wasn't crazy

@rolftimmermans
Copy link
Member

I'd be happy to merge this; but there seem to be some unrelated changes included. Could you update the PR so only the relevant code bits are modified?

@Eximius
Copy link
Contributor Author

Eximius commented Jun 9, 2020

I can remove the bumps, but the other changes would seemingly help in general?

@rolftimmermans
Copy link
Member

If there are any other issues you want to address feel free to open a separate pull request for them. Without any description it's not obvious why the other changes are needed.

@lesmoutonssauvages
Copy link

Hi @rolftimmermans and @Eximius, any new on this PR ? May i help to split commits?

package.json Outdated Show resolved Hide resolved
script/build.sh Show resolved Hide resolved
src/socket.cc Outdated Show resolved Hide resolved
src/util.ts Outdated Show resolved Hide resolved
src/socket.cc Outdated Show resolved Hide resolved
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.

4 participants