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

[Bug]: please drop deprecated __proto__ use #13255

Closed
guimard opened this issue Sep 13, 2022 · 4 comments · Fixed by #13256
Closed

[Bug]: please drop deprecated __proto__ use #13255

guimard opened this issue Sep 13, 2022 · 4 comments · Fixed by #13256

Comments

@guimard
Copy link
Contributor

guimard commented Sep 13, 2022

Version

28.1.3

Steps to reproduce

jest can't be launched with node --disable-proto=throw

Expected behavior

Currently, jest-haste-map calls deprecated proto.

Actual behavior

Here is a proposed patch

--- a/packages/jest-haste-map/src/watchers/WatchmanWatcher.js
+++ b/packages/jest-haste-map/src/watchers/WatchmanWatcher.js
@@ -35,7 +35,7 @@
 }

 // eslint-disable-next-line no-proto
-WatchmanWatcher.prototype.__proto__ = EventEmitter.prototype;
+Object.setPrototypeOf(WatchmanWatcher.prototype, EventEmitter.prototype);

 /**
  * Run the watchman `watch` command on the root and subscribe to changes.

Additional context

No response

Environment

System:
    OS: Linux 5.19 Debian GNU/Linux bookworm/sid
    CPU: (4) x64 Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz
  Binaries:
    Node: 18.7.0 - /usr/bin/node
    npm: 8.18.0 - /usr/bin/npm
@SimenB
Copy link
Member

SimenB commented Sep 13, 2022

PR welcome! 🙂

@guimard
Copy link
Contributor Author

guimard commented Sep 13, 2022

@SimenB : thanks, PR pushed : #13256. And thanks for this awesome test framework !

Cheers,
Yadd

@guimard
Copy link
Contributor Author

guimard commented Sep 13, 2022

Note that I'm the jest maintainer for Debian : https://tracker.debian.org/pkg/node-jest

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants