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

Support frozen built-ins in @babel/runtime #14537

Merged
merged 5 commits into from May 25, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/babel-helpers/src/helpers.ts
Expand Up @@ -360,9 +360,10 @@ helpers.inheritsLoose = helper("7.0.0-beta.0")`
}
`;

// need a bind because https://github.com/babel/babel/issues/14527
helpers.getPrototypeOf = helper("7.0.0-beta.0")`
export default function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf
_getPrototypeOf = Object.setPrototypeOf.bind()
? Object.getPrototypeOf
: function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
Jack-Works marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -373,7 +374,7 @@ helpers.getPrototypeOf = helper("7.0.0-beta.0")`

helpers.setPrototypeOf = helper("7.0.0-beta.0")`
export default function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf.bind() || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
Expand Down