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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: interopRequireWildcard
can trigger override mistake
#15995
Comments
Hey @mhofman! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite. |
For context, the "override mistake" in this case is that if you freeze Let's make |
**Related issue:** - babel/babel#15995
@nicolo-ribaudo thanks for implementing a fix for this issue. However as mentioned, the code triggering the override mistake was also published in |
馃捇
How are you using Babel?
Other (Next.js, Gatsby, vue-cli, ...)
Input code
REPL
Configuration file name
No response
Configuration
No response
Current and expected behavior
When copying props of
module.exports
tonewObj
,interopRequireWildcard
may use a simple assignment=
, which may trigger the override mistake for exported properties also present inObject.prototype
ifObject.prototype
had previously been frozen.In this case the
chalk
package used by@babel/code-frame
and@babel/highlights
in the latest 7.22.20 version of babel triggers this issue with itsconstructor
export.Environment
System:
OS: Linux 5.10 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
Binaries:
Node: 18.17.0 - /usr/local/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 9.8.1 - /usr/local/bin/npm
pnpm: 8.6.11 - /usr/local/share/npm-global/bin/pnpm
Monorepos:
Yarn Workspaces: 1.22.5
npmPackages:
eslint: ^8.36.0 => 8.50.0
Possible solution
In this case there may be different alternatives to avoid triggering the override mistake:
newObj
with anull
protoObject.defineProperty
in all cases (not just for accessors)Additional context
@nicolo-ribaudo will know the context :)
The text was updated successfully, but these errors were encountered: