Avoid hitting __proto__ in _inheritsLoose (#12693)

This commit is contained in:
Сковорода Никита Андреевич
2021-01-26 22:15:41 +03:00
committed by GitHub
parent f7f0560bda
commit 9907bd86c9
20 changed files with 58 additions and 20 deletions

View File

@@ -474,10 +474,12 @@ helpers.inherits = helper("7.0.0-beta.0")`
`;
helpers.inheritsLoose = helper("7.0.0-beta.0")`
import setPrototypeOf from "setPrototypeOf";
export default function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
subClass.__proto__ = superClass;
setPrototypeOf(subClass, superClass);
}
`;