1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-25 03:20:23 +01:00
metamask-extension/patches/@babel+runtime+7.18.9.patch
2022-08-05 10:04:44 -05:00

105 lines
4.3 KiB
Diff

diff --git a/node_modules/@babel/runtime/helpers/construct.js b/node_modules/@babel/runtime/helpers/construct.js
index ecc013d..092b29b 100644
--- a/node_modules/@babel/runtime/helpers/construct.js
+++ b/node_modules/@babel/runtime/helpers/construct.js
@@ -1,22 +1,21 @@
-var setPrototypeOf = require("./setPrototypeOf.js");
+// All of MetaMask's supported browsers include `Reflect.construct` support, so
+// we don't need this polyfill.
-var isNativeReflectConstruct = require("./isNativeReflectConstruct.js");
-
-function _construct(Parent, args, Class) {
- if (isNativeReflectConstruct()) {
- module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
- } else {
- module.exports = _construct = function _construct(Parent, args, Class) {
- var a = [null];
- a.push.apply(a, args);
- var Constructor = Function.bind.apply(Parent, a);
- var instance = new Constructor();
- if (Class) setPrototypeOf(instance, Class.prototype);
- return instance;
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
+// This Proxy preseves the two properties that were added by `@babel/runtime`.
+// I am not entire sure what these properties are for (maybe ES5/ES6
+// interoperability?) but they have been preserved just in case.
+const reflectProxy = new Proxy(
+ Reflect.construct,
+ {
+ get: function (target, property) {
+ if (property === 'default') {
+ return target;
+ } else if (property === '__esModule') {
+ return true;
+ }
+ return Reflect.get(...arguments);
+ }
}
+);
- return _construct.apply(null, arguments);
-}
-
-module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
\ No newline at end of file
+module.exports = reflectProxy;
\ No newline at end of file
diff --git a/node_modules/@babel/runtime/helpers/extends.js b/node_modules/@babel/runtime/helpers/extends.js
index b76a654..561a078 100644
--- a/node_modules/@babel/runtime/helpers/extends.js
+++ b/node_modules/@babel/runtime/helpers/extends.js
@@ -1,18 +1,5 @@
function _extends() {
- module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
-
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
-
- return target;
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
- return _extends.apply(this, arguments);
+ return Object.assign(...arguments);
}
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
\ No newline at end of file
diff --git a/node_modules/@babel/runtime/helpers/getPrototypeOf.js b/node_modules/@babel/runtime/helpers/getPrototypeOf.js
index 259ed27..07bb963 100644
--- a/node_modules/@babel/runtime/helpers/getPrototypeOf.js
+++ b/node_modules/@babel/runtime/helpers/getPrototypeOf.js
@@ -1,8 +1,5 @@
function _getPrototypeOf(o) {
- module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
- return o.__proto__ || Object.getPrototypeOf(o);
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
- return _getPrototypeOf(o);
+ return Object.getPrototypeOf(o);
}
module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
\ No newline at end of file
diff --git a/node_modules/@babel/runtime/helpers/setPrototypeOf.js b/node_modules/@babel/runtime/helpers/setPrototypeOf.js
index ed2c1eb..da8ef36 100644
--- a/node_modules/@babel/runtime/helpers/setPrototypeOf.js
+++ b/node_modules/@babel/runtime/helpers/setPrototypeOf.js
@@ -1,9 +1,6 @@
function _setPrototypeOf(o, p) {
- module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
- o.__proto__ = p;
- return o;
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
- return _setPrototypeOf(o, p);
+ o.__proto__ = p;
+ return o;
}
module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
\ No newline at end of file