Commit 762b95bc authored by Cholgrrr's avatar Cholgrrr
Browse files

Merge branch 'New_Structure' of https://gitlab.com/Cholgrrr/m4labplatform into New_Structure

parents 613a2f33 a2e8cafb
...@@ -3,20 +3,24 @@ ...@@ -3,20 +3,24 @@
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
value: true value: true
}); });
exports.default = _default; exports.default = optimiseCallExpression;
var t = _interopRequireWildcard(require("@babel/types")); var t = require("@babel/types");
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } function optimiseCallExpression(callee, thisNode, args, optional) {
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _default(callee, thisNode, args) {
if (args.length === 1 && t.isSpreadElement(args[0]) && t.isIdentifier(args[0].argument, { if (args.length === 1 && t.isSpreadElement(args[0]) && t.isIdentifier(args[0].argument, {
name: "arguments" name: "arguments"
})) { })) {
if (optional) {
return t.optionalCallExpression(t.optionalMemberExpression(callee, t.identifier("apply"), false, true), [thisNode, args[0].argument], false);
}
return t.callExpression(t.memberExpression(callee, t.identifier("apply")), [thisNode, args[0].argument]); return t.callExpression(t.memberExpression(callee, t.identifier("apply")), [thisNode, args[0].argument]);
} else { } else {
if (optional) {
return t.optionalCallExpression(t.optionalMemberExpression(callee, t.identifier("call"), false, true), [thisNode, ...args], false);
}
return t.callExpression(t.memberExpression(callee, t.identifier("call")), [thisNode, ...args]); return t.callExpression(t.memberExpression(callee, t.identifier("call")), [thisNode, ...args]);
} }
} }
\ No newline at end of file
{ {
"_from": "@babel/helper-optimise-call-expression@^7.7.0", "name": "@babel/helper-optimise-call-expression",
"_id": "@babel/helper-optimise-call-expression@7.7.0", "version": "7.14.5",
"_inBundle": false,
"_integrity": "sha512-48TeqmbazjNU/65niiiJIJRc5JozB8acui1OS7bSd6PgxfuovWsvjfWSzlgx+gPFdVveNzUdpdIg5l56Pl5jqg==",
"_location": "/@babel/helper-optimise-call-expression",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@babel/helper-optimise-call-expression@^7.7.0",
"name": "@babel/helper-optimise-call-expression",
"escapedName": "@babel%2fhelper-optimise-call-expression",
"scope": "@babel",
"rawSpec": "^7.7.0",
"saveSpec": null,
"fetchSpec": "^7.7.0"
},
"_requiredBy": [
"/@babel/helper-create-class-features-plugin",
"/@babel/helper-replace-supers",
"/@babel/plugin-transform-classes"
],
"_resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.0.tgz",
"_shasum": "4f66a216116a66164135dc618c5d8b7a959f9365",
"_spec": "@babel/helper-optimise-call-expression@^7.7.0",
"_where": "C:\\Work\\OneDrive - bwstaff\\M4_Lab\\TV3\\NewVersion01\\LAFJLBmf939XYm5gj\\dev\\node_modules\\@babel\\helper-create-class-features-plugin",
"bundleDependencies": false,
"dependencies": {
"@babel/types": "^7.7.0"
},
"deprecated": false,
"description": "Helper function to optimise call expression", "description": "Helper function to optimise call expression",
"gitHead": "97faa83953cb87e332554fa559a4956d202343ea", "repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-helper-optimise-call-expression"
},
"homepage": "https://babel.dev/docs/en/next/babel-helper-optimise-call-expression",
"license": "MIT", "license": "MIT",
"main": "lib/index.js",
"name": "@babel/helper-optimise-call-expression",
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },
"repository": { "main": "./lib/index.js",
"type": "git", "dependencies": {
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-optimise-call-expression" "@babel/types": "^7.14.5"
},
"devDependencies": {
"@babel/generator": "7.14.5",
"@babel/parser": "7.14.5"
},
"engines": {
"node": ">=6.9.0"
}, },
"version": "7.7.0" "author": "The Babel Team (https://babel.dev/team)"
} }
\ No newline at end of file
{ {
"_from": "@babel/helper-plugin-utils@^7.0.0", "name": "@babel/helper-plugin-utils",
"_id": "@babel/helper-plugin-utils@7.0.0", "version": "7.0.0",
"_inBundle": false,
"_integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==",
"_location": "/@babel/helper-plugin-utils",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@babel/helper-plugin-utils@^7.0.0",
"name": "@babel/helper-plugin-utils",
"escapedName": "@babel%2fhelper-plugin-utils",
"scope": "@babel",
"rawSpec": "^7.0.0",
"saveSpec": null,
"fetchSpec": "^7.0.0"
},
"_requiredBy": [
"/@babel/helper-create-class-features-plugin",
"/@babel/plugin-proposal-async-generator-functions",
"/@babel/plugin-proposal-class-properties",
"/@babel/plugin-proposal-decorators",
"/@babel/plugin-proposal-json-strings",
"/@babel/plugin-proposal-object-rest-spread",
"/@babel/plugin-proposal-optional-catch-binding",
"/@babel/plugin-proposal-unicode-property-regex",
"/@babel/plugin-syntax-async-generators",
"/@babel/plugin-syntax-decorators",
"/@babel/plugin-syntax-dynamic-import",
"/@babel/plugin-syntax-json-strings",
"/@babel/plugin-syntax-jsx",
"/@babel/plugin-syntax-object-rest-spread",
"/@babel/plugin-syntax-optional-catch-binding",
"/@babel/plugin-transform-arrow-functions",
"/@babel/plugin-transform-async-to-generator",
"/@babel/plugin-transform-block-scoped-functions",
"/@babel/plugin-transform-block-scoping",
"/@babel/plugin-transform-classes",
"/@babel/plugin-transform-computed-properties",
"/@babel/plugin-transform-destructuring",
"/@babel/plugin-transform-dotall-regex",
"/@babel/plugin-transform-duplicate-keys",
"/@babel/plugin-transform-exponentiation-operator",
"/@babel/plugin-transform-for-of",
"/@babel/plugin-transform-function-name",
"/@babel/plugin-transform-literals",
"/@babel/plugin-transform-modules-amd",
"/@babel/plugin-transform-modules-commonjs",
"/@babel/plugin-transform-modules-systemjs",
"/@babel/plugin-transform-modules-umd",
"/@babel/plugin-transform-new-target",
"/@babel/plugin-transform-object-super",
"/@babel/plugin-transform-parameters",
"/@babel/plugin-transform-runtime",
"/@babel/plugin-transform-shorthand-properties",
"/@babel/plugin-transform-spread",
"/@babel/plugin-transform-sticky-regex",
"/@babel/plugin-transform-template-literals",
"/@babel/plugin-transform-typeof-symbol",
"/@babel/plugin-transform-unicode-regex",
"/@babel/preset-env"
],
"_resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz",
"_shasum": "bbb3fbee98661c569034237cc03967ba99b4f250",
"_spec": "@babel/helper-plugin-utils@^7.0.0",
"_where": "C:\\Work\\OneDrive - bwstaff\\M4_Lab\\TV3\\NewVersion01\\LAFJLBmf939XYm5gj\\dev\\node_modules\\@babel\\plugin-proposal-class-properties",
"author": {
"name": "Logan Smyth",
"email": "loganfsmyth@gmail.com"
},
"bundleDependencies": false,
"deprecated": false,
"description": "General utilities for plugins to use", "description": "General utilities for plugins to use",
"author": "Logan Smyth <loganfsmyth@gmail.com>",
"homepage": "https://babeljs.io/", "homepage": "https://babeljs.io/",
"license": "MIT", "license": "MIT",
"main": "lib/index.js", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-plugin-utils",
"name": "@babel/helper-plugin-utils", "main": "lib/index.js"
"repository": {
"type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-plugin-utils"
},
"version": "7.0.0"
} }
{ {
"_from": "@babel/helper-regex@^7.4.4", "name": "@babel/helper-regex",
"_id": "@babel/helper-regex@7.5.5", "version": "7.5.5",
"_inBundle": false,
"_integrity": "sha512-CkCYQLkfkiugbRDO8eZn6lRuR8kzZoGXCg3149iTk5se7g6qykSpy3+hELSwquhu+TgHn8nkLiBwHvNX8Hofcw==",
"_location": "/@babel/helper-regex",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@babel/helper-regex@^7.4.4",
"name": "@babel/helper-regex",
"escapedName": "@babel%2fhelper-regex",
"scope": "@babel",
"rawSpec": "^7.4.4",
"saveSpec": null,
"fetchSpec": "^7.4.4"
},
"_requiredBy": [
"/@babel/helper-create-regexp-features-plugin",
"/@babel/plugin-transform-sticky-regex"
],
"_resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.5.5.tgz",
"_shasum": "0aa6824f7100a2e0e89c1527c23936c152cab351",
"_spec": "@babel/helper-regex@^7.4.4",
"_where": "C:\\Work\\OneDrive - bwstaff\\M4_Lab\\TV3\\NewVersion01\\LAFJLBmf939XYm5gj\\dev\\node_modules\\@babel\\helper-create-regexp-features-plugin",
"bundleDependencies": false,
"dependencies": {
"lodash": "^4.17.13"
},
"deprecated": false,
"description": "Helper function to check for literal RegEx", "description": "Helper function to check for literal RegEx",
"gitHead": "0407f034f09381b95e9cabefbf6b176c76485a43", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-regex",
"license": "MIT", "license": "MIT",
"main": "lib/index.js",
"name": "@babel/helper-regex",
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },
"repository": { "main": "lib/index.js",
"type": "git", "dependencies": {
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-regex" "lodash": "^4.17.13"
}, },
"version": "7.5.5" "gitHead": "0407f034f09381b95e9cabefbf6b176c76485a43"
} }
{ {
"_from": "@babel/helper-remap-async-to-generator@^7.7.0", "name": "@babel/helper-remap-async-to-generator",
"_id": "@babel/helper-remap-async-to-generator@7.7.0", "version": "7.7.0",
"_inBundle": false, "description": "Helper function to remap async functions to generators",
"_integrity": "sha512-pHx7RN8X0UNHPB/fnuDnRXVZ316ZigkO8y8D835JlZ2SSdFKb6yH9MIYRU4fy/KPe5sPHDFOPvf8QLdbAGGiyw==", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-remap-async-to-generator",
"_location": "/@babel/helper-remap-async-to-generator", "license": "MIT",
"_phantomChildren": {}, "publishConfig": {
"_requested": { "access": "public"
"type": "range",
"registry": true,
"raw": "@babel/helper-remap-async-to-generator@^7.7.0",
"name": "@babel/helper-remap-async-to-generator",
"escapedName": "@babel%2fhelper-remap-async-to-generator",
"scope": "@babel",
"rawSpec": "^7.7.0",
"saveSpec": null,
"fetchSpec": "^7.7.0"
}, },
"_requiredBy": [ "main": "lib/index.js",
"/@babel/plugin-proposal-async-generator-functions",
"/@babel/plugin-transform-async-to-generator"
],
"_resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.7.0.tgz",
"_shasum": "4d69ec653e8bff5bce62f5d33fc1508f223c75a7",
"_spec": "@babel/helper-remap-async-to-generator@^7.7.0",
"_where": "C:\\Work\\OneDrive - bwstaff\\M4_Lab\\TV3\\NewVersion01\\LAFJLBmf939XYm5gj\\dev\\node_modules\\@babel\\plugin-proposal-async-generator-functions",
"bundleDependencies": false,
"dependencies": { "dependencies": {
"@babel/helper-annotate-as-pure": "^7.7.0", "@babel/helper-annotate-as-pure": "^7.7.0",
"@babel/helper-wrap-function": "^7.7.0", "@babel/helper-wrap-function": "^7.7.0",
...@@ -32,18 +15,5 @@ ...@@ -32,18 +15,5 @@
"@babel/traverse": "^7.7.0", "@babel/traverse": "^7.7.0",
"@babel/types": "^7.7.0" "@babel/types": "^7.7.0"
}, },
"deprecated": false, "gitHead": "97faa83953cb87e332554fa559a4956d202343ea"
"description": "Helper function to remap async functions to generators",
"gitHead": "97faa83953cb87e332554fa559a4956d202343ea",
"license": "MIT",
"main": "lib/index.js",
"name": "@babel/helper-remap-async-to-generator",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-remap-async-to-generator"
},
"version": "7.7.0"
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
> Helper function to replace supers > Helper function to replace supers
See our website [@babel/helper-replace-supers](https://babeljs.io/docs/en/next/babel-helper-replace-supers.html) for more information. See our website [@babel/helper-replace-supers](https://babeljs.io/docs/en/babel-helper-replace-supers) for more information.
## Install ## Install
......
...@@ -3,21 +3,16 @@ ...@@ -3,21 +3,16 @@
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
value: true value: true
}); });
exports.skipAllButComputedKey = skipAllButComputedKey;
exports.default = exports.environmentVisitor = void 0; exports.default = exports.environmentVisitor = void 0;
var _traverse = _interopRequireDefault(require("@babel/traverse")); var _traverse = require("@babel/traverse");
var _helperMemberExpressionToFunctions = _interopRequireDefault(require("@babel/helper-member-expression-to-functions")); var _helperMemberExpressionToFunctions = require("@babel/helper-member-expression-to-functions");
var _helperOptimiseCallExpression = _interopRequireDefault(require("@babel/helper-optimise-call-expression")); var _helperOptimiseCallExpression = require("@babel/helper-optimise-call-expression");
var t = _interopRequireWildcard(require("@babel/types")); var t = require("@babel/types");
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function getPrototypeOfExpression(objectRef, isStatic, file, isPrivateMethod) { function getPrototypeOfExpression(objectRef, isStatic, file, isPrivateMethod) {
objectRef = t.cloneNode(objectRef); objectRef = t.cloneNode(objectRef);
...@@ -39,7 +34,7 @@ function skipAllButComputedKey(path) { ...@@ -39,7 +34,7 @@ function skipAllButComputedKey(path) {
} }
const environmentVisitor = { const environmentVisitor = {
TypeAnnotation(path) { [`${t.staticBlock ? "StaticBlock|" : ""}ClassPrivateProperty|TypeAnnotation`](path) {
path.skip(); path.skip();
}, },
...@@ -49,7 +44,7 @@ const environmentVisitor = { ...@@ -49,7 +44,7 @@ const environmentVisitor = {
path.skip(); path.skip();
}, },
"Method|ClassProperty|ClassPrivateProperty"(path) { "Method|ClassProperty"(path) {
skipAllButComputedKey(path); skipAllButComputedKey(path);
} }
...@@ -70,6 +65,19 @@ const visitor = _traverse.default.visitors.merge([environmentVisitor, { ...@@ -70,6 +65,19 @@ const visitor = _traverse.default.visitors.merge([environmentVisitor, {
}]); }]);
const unshadowSuperBindingVisitor = _traverse.default.visitors.merge([environmentVisitor, {
Scopable(path, {
refName
}) {
const binding = path.scope.getOwnBinding(refName);
if (binding && binding.identifier.name === refName) {
path.scope.rename(refName);
}
}
}]);
const specHandlers = { const specHandlers = {
memoise(superMember, count) { memoise(superMember, count) {
const { const {
...@@ -112,11 +120,33 @@ const specHandlers = { ...@@ -112,11 +120,33 @@ const specHandlers = {
}, },
get(superMember) { get(superMember) {
return t.callExpression(this.file.addHelper("get"), [getPrototypeOfExpression(this.getObjectRef(), this.isStatic, this.file, this.isPrivateMethod), this.prop(superMember), t.thisExpression()]); return this._get(superMember, this._getThisRefs());
},
_get(superMember, thisRefs) {
const proto = getPrototypeOfExpression(this.getObjectRef(), this.isStatic, this.file, this.isPrivateMethod);
return t.callExpression(this.file.addHelper("get"), [thisRefs.memo ? t.sequenceExpression([thisRefs.memo, proto]) : proto, this.prop(superMember), thisRefs.this]);
},
_getThisRefs() {
if (!this.isDerivedConstructor) {
return {
this: t.thisExpression()
};
}
const thisRef = this.scope.generateDeclaredUidIdentifier("thisSuper");
return {
memo: t.assignmentExpression("=", thisRef, t.thisExpression()),
this: t.cloneNode(thisRef)
};
}, },
set(superMember, value) { set(superMember, value) {
return t.callExpression(this.file.addHelper("set"), [getPrototypeOfExpression(this.getObjectRef(), this.isStatic, this.file, this.isPrivateMethod), this.prop(superMember), value, t.thisExpression(), t.booleanLiteral(superMember.isInStrictMode())]); const thisRefs = this._getThisRefs();
const proto = getPrototypeOfExpression(this.getObjectRef(), this.isStatic, this.file, this.isPrivateMethod);
return t.callExpression(this.file.addHelper("set"), [thisRefs.memo ? t.sequenceExpression([thisRefs.memo, proto]) : proto, this.prop(superMember), value, thisRefs.this, t.booleanLiteral(superMember.isInStrictMode())]);
}, },
destructureSet(superMember) { destructureSet(superMember) {
...@@ -124,7 +154,15 @@ const specHandlers = { ...@@ -124,7 +154,15 @@ const specHandlers = {
}, },
call(superMember, args) { call(superMember, args) {
return (0, _helperOptimiseCallExpression.default)(this.get(superMember), t.thisExpression(), args); const thisRefs = this._getThisRefs();
return (0, _helperOptimiseCallExpression.default)(this._get(superMember, thisRefs), t.cloneNode(thisRefs.this), args, false);
},
optionalCall(superMember, args) {
const thisRefs = this._getThisRefs();
return (0, _helperOptimiseCallExpression.default)(this._get(superMember, thisRefs), t.cloneNode(thisRefs.this), args, true);
} }
}; };
...@@ -144,7 +182,7 @@ const looseHandlers = Object.assign({}, specHandlers, { ...@@ -144,7 +182,7 @@ const looseHandlers = Object.assign({}, specHandlers, {
get(superMember) { get(superMember) {
const { const {
isStatic, isStatic,
superRef getSuperRef
} = this; } = this;
const { const {
computed computed
...@@ -153,9 +191,13 @@ const looseHandlers = Object.assign({}, specHandlers, { ...@@ -153,9 +191,13 @@ const looseHandlers = Object.assign({}, specHandlers, {
let object; let object;
if (isStatic) { if (isStatic) {
object = superRef ? t.cloneNode(superRef) : t.memberExpression(t.identifier("Function"), t.identifier("prototype")); var _getSuperRef;
object = (_getSuperRef = getSuperRef()) != null ? _getSuperRef : t.memberExpression(t.identifier("Function"), t.identifier("prototype"));
} else { } else {
object = superRef ? t.memberExpression(t.cloneNode(superRef), t.identifier("prototype")) : t.memberExpression(t.identifier("Object"), t.identifier("prototype")); var _getSuperRef2;
object = t.memberExpression((_getSuperRef2 = getSuperRef()) != null ? _getSuperRef2 : t.identifier("Object"), t.identifier("prototype"));
} }
return t.memberExpression(object, prop, computed); return t.memberExpression(object, prop, computed);
...@@ -175,19 +217,31 @@ const looseHandlers = Object.assign({}, specHandlers, { ...@@ -175,19 +217,31 @@ const looseHandlers = Object.assign({}, specHandlers, {
} = superMember.node; } = superMember.node;
const prop = this.prop(superMember); const prop = this.prop(superMember);
return t.memberExpression(t.thisExpression(), prop, computed); return t.memberExpression(t.thisExpression(), prop, computed);
},
call(superMember, args) {
return (0, _helperOptimiseCallExpression.default)(this.get(superMember), t.thisExpression(), args, false);
},
optionalCall(superMember, args) {
return (0, _helperOptimiseCallExpression.default)(this.get(superMember), t.thisExpression(), args, true);
} }
}); });
class ReplaceSupers { class ReplaceSupers {
constructor(opts) { constructor(opts) {
var _opts$constantSuper;
const path = opts.methodPath; const path = opts.methodPath;
this.methodPath = path; this.methodPath = path;
this.isStatic = path.isObjectMethod() || path.node.static; this.isDerivedConstructor = path.isClassMethod({
kind: "constructor"
}) && !!opts.superRef;
this.isStatic = path.isObjectMethod() || path.node.static || (path.isStaticBlock == null ? void 0 : path.isStaticBlock());
this.isPrivateMethod = path.isPrivate() && path.isMethod(); this.isPrivateMethod = path.isPrivate() && path.isMethod();
this.file = opts.file; this.file = opts.file;
this.superRef = opts.superRef; this.constantSuper = (_opts$constantSuper = opts.constantSuper) != null ? _opts$constantSuper : opts.isLoose;
this.isLoose = opts.isLoose;
this.opts = opts; this.opts = opts;
} }
...@@ -195,14 +249,27 @@ class ReplaceSupers { ...@@ -195,14 +249,27 @@ class ReplaceSupers {
return t.cloneNode(this.opts.objectRef || this.opts.getObjectRef()); return t.cloneNode(this.opts.objectRef || this.opts.getObjectRef());
} }
getSuperRef() {
if (this.opts.superRef) return t.cloneNode(this.opts.superRef);
if (this.opts.getSuperRef) return t.cloneNode(this.opts.getSuperRef());
}
replace() { replace() {
const handler = this.isLoose ? looseHandlers : specHandlers; if (this.opts.refToPreserve) {
this.methodPath.traverse(unshadowSuperBindingVisitor, {
refName: this.opts.refToPreserve.name
});
}
const handler = this.constantSuper ? looseHandlers : specHandlers;
(0, _helperMemberExpressionToFunctions.default)(this.methodPath, visitor, Object.assign({ (0, _helperMemberExpressionToFunctions.default)(this.methodPath, visitor, Object.assign({
file: this.file, file: this.file,
scope: this.methodPath.scope,
isDerivedConstructor: this.isDerivedConstructor,
isStatic: this.isStatic, isStatic: this.isStatic,
isPrivateMethod: this.isPrivateMethod, isPrivateMethod: this.isPrivateMethod,
getObjectRef: this.getObjectRef.bind(this), getObjectRef: this.getObjectRef.bind(this),
superRef: this.superRef getSuperRef: this.getSuperRef.bind(this)
}, handler)); }, handler));
} }
......
{ {
"_from": "@babel/helper-replace-supers@^7.7.0", "name": "@babel/helper-replace-supers",
"_id": "@babel/helper-replace-supers@7.7.0", "version": "7.14.5",
"_inBundle": false,
"_integrity": "sha512-5ALYEul5V8xNdxEeWvRsBzLMxQksT7MaStpxjJf9KsnLxpAKBtfw5NeMKZJSYDa0lKdOcy0g+JT/f5mPSulUgg==",
"_location": "/@babel/helper-replace-supers",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@babel/helper-replace-supers@^7.7.0",
"name": "@babel/helper-replace-supers",
"escapedName": "@babel%2fhelper-replace-supers",
"scope": "@babel",
"rawSpec": "^7.7.0",
"saveSpec": null,
"fetchSpec": "^7.7.0"
},
"_requiredBy": [
"/@babel/helper-create-class-features-plugin",
"/@babel/plugin-transform-classes",
"/@babel/plugin-transform-object-super"
],
"_resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.7.0.tgz",
"_shasum": "d5365c8667fe7cbd13b8ddddceb9bd7f2b387512",
"_spec": "@babel/helper-replace-supers@^7.7.0",
"_where": "C:\\Work\\OneDrive - bwstaff\\M4_Lab\\TV3\\NewVersion01\\LAFJLBmf939XYm5gj\\dev\\node_modules\\@babel\\helper-create-class-features-plugin",
"bundleDependencies": false,
"dependencies": {
"@babel/helper-member-expression-to-functions": "^7.7.0",
"@babel/helper-optimise-call-expression": "^7.7.0",
"@babel/traverse": "^7.7.0",
"@babel/types": "^7.7.0"
},
"deprecated": false,
"description": "Helper function to replace supers", "description": "Helper function to replace supers",
"gitHead": "97faa83953cb87e332554fa559a4956d202343ea", "repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-helper-replace-supers"
},
"homepage": "https://babel.dev/docs/en/next/babel-helper-replace-supers",
"license": "MIT", "license": "MIT",
"main": "lib/index.js",
"name": "@babel/helper-replace-supers",
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },
"repository": { "main": "./lib/index.js",
"type": "git", "dependencies": {
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-replace-supers" "@babel/helper-member-expression-to-functions": "^7.14.5",
"@babel/helper-optimise-call-expression": "^7.14.5",
"@babel/traverse": "^7.14.5",
"@babel/types": "^7.14.5"
},
"engines": {
"node": ">=6.9.0"
}, },
"version": "7.7.0" "author": "The Babel Team (https://babel.dev/team)"
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
> Babel helper for ensuring that access to a given value is performed through simple accesses > Babel helper for ensuring that access to a given value is performed through simple accesses
See our website [@babel/helper-simple-access](https://babeljs.io/docs/en/next/babel-helper-simple-access.html) for more information. See our website [@babel/helper-simple-access](https://babeljs.io/docs/en/babel-helper-simple-access) for more information.
## Install ## Install
......
...@@ -5,11 +5,7 @@ Object.defineProperty(exports, "__esModule", { ...@@ -5,11 +5,7 @@ Object.defineProperty(exports, "__esModule", {
}); });
exports.default = simplifyAccess; exports.default = simplifyAccess;
var t = _interopRequireWildcard(require("@babel/types")); var t = require("@babel/types");
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function simplifyAccess(path, bindingNames) { function simplifyAccess(path, bindingNames) {
path.traverse(simpleAssignmentVisitor, { path.traverse(simpleAssignmentVisitor, {
......
{ {
"_from": "@babel/helper-simple-access@^7.7.0", "name": "@babel/helper-simple-access",
"_id": "@babel/helper-simple-access@7.7.0", "version": "7.14.5",
"_inBundle": false,
"_integrity": "sha512-AJ7IZD7Eem3zZRuj5JtzFAptBw7pMlS3y8Qv09vaBWoFsle0d1kAn5Wq6Q9MyBXITPOKnxwkZKoAm4bopmv26g==",
"_location": "/@babel/helper-simple-access",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@babel/helper-simple-access@^7.7.0",
"name": "@babel/helper-simple-access",
"escapedName": "@babel%2fhelper-simple-access",
"scope": "@babel",
"rawSpec": "^7.7.0",
"saveSpec": null,
"fetchSpec": "^7.7.0"
},
"_requiredBy": [
"/@babel/helper-module-transforms",
"/@babel/plugin-transform-modules-commonjs"
],
"_resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.7.0.tgz",
"_shasum": "97a8b6c52105d76031b86237dc1852b44837243d",
"_spec": "@babel/helper-simple-access@^7.7.0",
"_where": "C:\\Work\\OneDrive - bwstaff\\M4_Lab\\TV3\\NewVersion01\\LAFJLBmf939XYm5gj\\dev\\node_modules\\@babel\\helper-module-transforms",
"author": {
"name": "Logan Smyth",
"email": "loganfsmyth@gmail.com"
},
"bundleDependencies": false,
"dependencies": {
"@babel/template": "^7.7.0",
"@babel/types": "^7.7.0"
},
"deprecated": false,
"description": "Babel helper for ensuring that access to a given value is performed through simple accesses", "description": "Babel helper for ensuring that access to a given value is performed through simple accesses",
"gitHead": "97faa83953cb87e332554fa559a4956d202343ea", "author": "The Babel Team (https://babel.dev/team)",
"homepage": "https://babeljs.io/", "homepage": "https://babel.dev/docs/en/next/babel-helper-simple-access",
"license": "MIT", "license": "MIT",
"main": "lib/index.js",
"name": "@babel/helper-simple-access",
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-simple-access" "url": "https://github.com/babel/babel.git",
"directory": "packages/babel-helper-simple-access"
},
"main": "./lib/index.js",
"dependencies": {
"@babel/types": "^7.14.5"
},
"devDependencies": {
"@babel/traverse": "7.14.5"
}, },
"version": "7.7.0" "engines": {
} "node": ">=6.9.0"
}
}
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
> >
See our website [@babel/helper-split-export-declaration](https://babeljs.io/docs/en/next/babel-helper-split-export-declaration.html) for more information. See our website [@babel/helper-split-export-declaration](https://babeljs.io/docs/en/babel-helper-split-export-declaration) for more information.
## Install ## Install
......
...@@ -5,15 +5,11 @@ Object.defineProperty(exports, "__esModule", { ...@@ -5,15 +5,11 @@ Object.defineProperty(exports, "__esModule", {
}); });
exports.default = splitExportDeclaration; exports.default = splitExportDeclaration;
var t = _interopRequireWildcard(require("@babel/types")); var t = require("@babel/types");
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function splitExportDeclaration(exportDeclaration) { function splitExportDeclaration(exportDeclaration) {
if (!exportDeclaration.isExportDeclaration()) { if (!exportDeclaration.isExportDeclaration()) {
throw new Error("Only export declarations can be splitted."); throw new Error("Only export declarations can be split.");
} }
const isDefault = exportDeclaration.isExportDefaultDeclaration(); const isDefault = exportDeclaration.isExportDefaultDeclaration();
......
{ {
"_from": "@babel/helper-split-export-declaration@^7.7.0", "name": "@babel/helper-split-export-declaration",
"_id": "@babel/helper-split-export-declaration@7.7.0", "version": "7.14.5",
"_inBundle": false, "description": "",
"_integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==", "repository": {
"_location": "/@babel/helper-split-export-declaration", "type": "git",
"_phantomChildren": {}, "url": "https://github.com/babel/babel.git",
"_requested": { "directory": "packages/babel-helper-split-export-declaration"
"type": "range",
"registry": true,
"raw": "@babel/helper-split-export-declaration@^7.7.0",
"name": "@babel/helper-split-export-declaration",
"escapedName": "@babel%2fhelper-split-export-declaration",
"scope": "@babel",
"rawSpec": "^7.7.0",
"saveSpec": null,
"fetchSpec": "^7.7.0"
},
"_requiredBy": [
"/@babel/helper-create-class-features-plugin",
"/@babel/helper-module-transforms",
"/@babel/plugin-transform-classes",
"/@babel/traverse"
],
"_resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz",
"_shasum": "1365e74ea6c614deeb56ebffabd71006a0eb2300",
"_spec": "@babel/helper-split-export-declaration@^7.7.0",
"_where": "C:\\Work\\OneDrive - bwstaff\\M4_Lab\\TV3\\NewVersion01\\LAFJLBmf939XYm5gj\\dev\\node_modules\\@babel\\traverse",
"bundleDependencies": false,
"dependencies": {
"@babel/types": "^7.7.0"
}, },
"deprecated": false, "homepage": "https://babel.dev/docs/en/next/babel-helper-split-export-declaration",
"description": ">",
"gitHead": "97faa83953cb87e332554fa559a4956d202343ea",
"license": "MIT", "license": "MIT",
"main": "lib/index.js",
"name": "@babel/helper-split-export-declaration",
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },
"repository": { "main": "./lib/index.js",
"type": "git", "dependencies": {
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-split-export-declaration" "@babel/types": "^7.14.5"
},
"engines": {
"node": ">=6.9.0"
}, },
"version": "7.7.0" "author": "The Babel Team (https://babel.dev/team)"
} }
\ No newline at end of file
{ {
"_from": "@babel/helper-wrap-function@^7.7.0", "name": "@babel/helper-wrap-function",
"_id": "@babel/helper-wrap-function@7.7.0", "version": "7.7.0",
"_inBundle": false, "description": "Helper to wrap functions inside a function call.",
"_integrity": "sha512-sd4QjeMgQqzshSjecZjOp8uKfUtnpmCyQhKQrVJBBgeHAB/0FPi33h3AbVlVp07qQtMD4QgYSzaMI7VwncNK/w==", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-wrap-function",
"_location": "/@babel/helper-wrap-function", "license": "MIT",
"_phantomChildren": {}, "publishConfig": {
"_requested": { "access": "public"
"type": "range",
"registry": true,
"raw": "@babel/helper-wrap-function@^7.7.0",
"name": "@babel/helper-wrap-function",
"escapedName": "@babel%2fhelper-wrap-function",
"scope": "@babel",
"rawSpec": "^7.7.0",
"saveSpec": null,
"fetchSpec": "^7.7.0"
}, },
"_requiredBy": [ "main": "lib/index.js",
"/@babel/helper-remap-async-to-generator"
],
"_resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.7.0.tgz",
"_shasum": "15af3d3e98f8417a60554acbb6c14e75e0b33b74",
"_spec": "@babel/helper-wrap-function@^7.7.0",
"_where": "C:\\Work\\OneDrive - bwstaff\\M4_Lab\\TV3\\NewVersion01\\LAFJLBmf939XYm5gj\\dev\\node_modules\\@babel\\helper-remap-async-to-generator",
"bundleDependencies": false,
"dependencies": { "dependencies": {
"@babel/helper-function-name": "^7.7.0", "@babel/helper-function-name": "^7.7.0",
"@babel/template": "^7.7.0", "@babel/template": "^7.7.0",
"@babel/traverse": "^7.7.0", "@babel/traverse": "^7.7.0",
"@babel/types": "^7.7.0" "@babel/types": "^7.7.0"
}, },
"deprecated": false, "gitHead": "97faa83953cb87e332554fa559a4956d202343ea"
"description": "Helper to wrap functions inside a function call.",
"gitHead": "97faa83953cb87e332554fa559a4956d202343ea",
"license": "MIT",
"main": "lib/index.js",
"name": "@babel/helper-wrap-function",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-wrap-function"
},
"version": "7.7.0"
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
> Collection of helper functions used by Babel transforms. > Collection of helper functions used by Babel transforms.
See our website [@babel/helpers](https://babeljs.io/docs/en/next/babel-helpers.html) for more information. See our website [@babel/helpers](https://babeljs.io/docs/en/babel-helpers) for more information.
## Install ## Install
......
...@@ -5,11 +5,13 @@ Object.defineProperty(exports, "__esModule", { ...@@ -5,11 +5,13 @@ Object.defineProperty(exports, "__esModule", {
}); });
exports.default = void 0; exports.default = void 0;
var _template = _interopRequireDefault(require("@babel/template")); var _template = require("@babel/template");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var generated = require("./helpers-generated");
const helpers = Object.create(null); const helpers = Object.assign({
__proto__: null
}, generated);
var _default = helpers; var _default = helpers;
exports.default = _default; exports.default = _default;
...@@ -18,86 +20,17 @@ const helper = minVersion => tpl => ({ ...@@ -18,86 +20,17 @@ const helper = minVersion => tpl => ({
ast: () => _template.default.program.ast(tpl) ast: () => _template.default.program.ast(tpl)
}); });
helpers.typeof = helper("7.0.0-beta.0")`
export default function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) { return typeof obj; };
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype
? "symbol"
: typeof obj;
};
}
return _typeof(obj);
}
`;
helpers.jsx = helper("7.0.0-beta.0")`
var REACT_ELEMENT_TYPE;
export default function _createRawReactElement(type, props, key, children) {
if (!REACT_ELEMENT_TYPE) {
REACT_ELEMENT_TYPE = (
typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element")
) || 0xeac7;
}
var defaultProps = type && type.defaultProps;
var childrenLength = arguments.length - 3;
if (!props && childrenLength !== 0) {
// If we're going to assign props.children, we create a new object now
// to avoid mutating defaultProps.
props = {
children: void 0,
};
}
if (childrenLength === 1) {
props.children = children;
} else if (childrenLength > 1) {
var childArray = new Array(childrenLength);
for (var i = 0; i < childrenLength; i++) {
childArray[i] = arguments[i + 3];
}
props.children = childArray;
}
if (props && defaultProps) {
for (var propName in defaultProps) {
if (props[propName] === void 0) {
props[propName] = defaultProps[propName];
}
}
} else if (!props) {
props = defaultProps || {};
}
return {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key === undefined ? null : '' + key,
ref: null,
props: props,
_owner: null,
};
}
`;
helpers.asyncIterator = helper("7.0.0-beta.0")` helpers.asyncIterator = helper("7.0.0-beta.0")`
export default function _asyncIterator(iterable) { export default function _asyncIterator(iterable) {
var method var method;
if (typeof Symbol !== "undefined") { if (typeof Symbol !== "undefined") {
if (Symbol.asyncIterator) { if (Symbol.asyncIterator) method = iterable[Symbol.asyncIterator];
method = iterable[Symbol.asyncIterator] if (method == null && Symbol.iterator) method = iterable[Symbol.iterator];
if (method != null) return method.call(iterable);
}
if (Symbol.iterator) {
method = iterable[Symbol.iterator]
if (method != null) return method.call(iterable);
}
} }
throw new TypeError("Object is not async iterable"); if (method == null) method = iterable["@@asyncIterator"];
if (method == null) method = iterable["@@iterator"]
if (method == null) throw new TypeError("Object is not async iterable");
return method.call(iterable);
} }
`; `;
helpers.AwaitValue = helper("7.0.0-beta.0")` helpers.AwaitValue = helper("7.0.0-beta.0")`
...@@ -180,9 +113,7 @@ helpers.AsyncGenerator = helper("7.0.0-beta.0")` ...@@ -180,9 +113,7 @@ helpers.AsyncGenerator = helper("7.0.0-beta.0")`
} }
} }
if (typeof Symbol === "function" && Symbol.asyncIterator) { AsyncGenerator.prototype[typeof Symbol === "function" && Symbol.asyncIterator || "@@asyncIterator"] = function () { return this; };
AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; };
}
AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); }; AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); };
AsyncGenerator.prototype.throw = function (arg) { return this._invoke("throw", arg); }; AsyncGenerator.prototype.throw = function (arg) { return this._invoke("throw", arg); };
...@@ -214,9 +145,7 @@ helpers.asyncGeneratorDelegate = helper("7.0.0-beta.0")` ...@@ -214,9 +145,7 @@ helpers.asyncGeneratorDelegate = helper("7.0.0-beta.0")`
return { done: false, value: awaitWrap(value) }; return { done: false, value: awaitWrap(value) };
}; };
if (typeof Symbol === "function" && Symbol.iterator) { iter[typeof Symbol !== "undefined" && Symbol.iterator || "@@iterator"] = function () { return this; };
iter[Symbol.iterator] = function () { return this; };
}
iter.next = function (value) { iter.next = function (value) {
if (waiting) { if (waiting) {
...@@ -387,7 +316,7 @@ helpers.objectSpread = helper("7.0.0-beta.0")` ...@@ -387,7 +316,7 @@ helpers.objectSpread = helper("7.0.0-beta.0")`
export default function _objectSpread(target) { export default function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) { for (var i = 1; i < arguments.length; i++) {
var source = (arguments[i] != null) ? arguments[i] : {}; var source = (arguments[i] != null) ? Object(arguments[i]) : {};
var ownKeys = Object.keys(source); var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') { if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
...@@ -401,47 +330,6 @@ helpers.objectSpread = helper("7.0.0-beta.0")` ...@@ -401,47 +330,6 @@ helpers.objectSpread = helper("7.0.0-beta.0")`
return target; return target;
} }
`; `;
helpers.objectSpread2 = helper("7.5.0")`
import defineProperty from "defineProperty";
// This function is different to "Reflect.ownKeys". The enumerableOnly
// filters on symbol properties only. Returned string properties are always
// enumerable. It is good to use in objectSpread.
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
export default function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = (arguments[i] != null) ? arguments[i] : {};
if (i % 2) {
ownKeys(source, true).forEach(function (key) {
defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(source).forEach(function (key) {
Object.defineProperty(
target,
key,
Object.getOwnPropertyDescriptor(source, key)
);
});
}
}
return target;
}
`;
helpers.inherits = helper("7.0.0-beta.0")` helpers.inherits = helper("7.0.0-beta.0")`
import setPrototypeOf from "setPrototypeOf"; import setPrototypeOf from "setPrototypeOf";
...@@ -460,10 +348,12 @@ helpers.inherits = helper("7.0.0-beta.0")` ...@@ -460,10 +348,12 @@ helpers.inherits = helper("7.0.0-beta.0")`
} }
`; `;
helpers.inheritsLoose = helper("7.0.0-beta.0")` helpers.inheritsLoose = helper("7.0.0-beta.0")`
import setPrototypeOf from "setPrototypeOf";
export default function _inheritsLoose(subClass, superClass) { export default function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype); subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass; subClass.prototype.constructor = subClass;
subClass.__proto__ = superClass; setPrototypeOf(subClass, superClass);
} }
`; `;
helpers.getPrototypeOf = helper("7.0.0-beta.0")` helpers.getPrototypeOf = helper("7.0.0-beta.0")`
...@@ -485,10 +375,8 @@ helpers.setPrototypeOf = helper("7.0.0-beta.0")` ...@@ -485,10 +375,8 @@ helpers.setPrototypeOf = helper("7.0.0-beta.0")`
return _setPrototypeOf(o, p); return _setPrototypeOf(o, p);
} }
`; `;
helpers.construct = helper("7.0.0-beta.0")` helpers.isNativeReflectConstruct = helper("7.9.0")`
import setPrototypeOf from "setPrototypeOf"; export default function _isNativeReflectConstruct() {
function isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (typeof Reflect === "undefined" || !Reflect.construct) return false;
// core-js@3 // core-js@3
...@@ -505,13 +393,18 @@ helpers.construct = helper("7.0.0-beta.0")` ...@@ -505,13 +393,18 @@ helpers.construct = helper("7.0.0-beta.0")`
// use our fallback implementation. // use our fallback implementation.
try { try {
// If the internal slots aren't set, this throws an error similar to // If the internal slots aren't set, this throws an error similar to
// TypeError: this is not a Date object. // TypeError: this is not a Boolean object.
Date.prototype.toString.call(Reflect.construct(Date, [], function() {}));
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
return true; return true;
} catch (e) { } catch (e) {
return false; return false;
} }
} }
`;
helpers.construct = helper("7.0.0-beta.0")`
import setPrototypeOf from "setPrototypeOf";
import isNativeReflectConstruct from "isNativeReflectConstruct";
export default function _construct(Parent, args, Class) { export default function _construct(Parent, args, Class) {
if (isNativeReflectConstruct()) { if (isNativeReflectConstruct()) {
...@@ -589,17 +482,19 @@ helpers.interopRequireDefault = helper("7.0.0-beta.0")` ...@@ -589,17 +482,19 @@ helpers.interopRequireDefault = helper("7.0.0-beta.0")`
return obj && obj.__esModule ? obj : { default: obj }; return obj && obj.__esModule ? obj : { default: obj };
} }
`; `;
helpers.interopRequireWildcard = helper("7.0.0-beta.0")` helpers.interopRequireWildcard = helper("7.14.0")`
function _getRequireWildcardCache() { function _getRequireWildcardCache(nodeInterop) {
if (typeof WeakMap !== "function") return null; if (typeof WeakMap !== "function") return null;
var cache = new WeakMap(); var cacheBabelInterop = new WeakMap();
_getRequireWildcardCache = function () { return cache; }; var cacheNodeInterop = new WeakMap();
return cache; return (_getRequireWildcardCache = function (nodeInterop) {
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
})(nodeInterop);
} }
export default function _interopRequireWildcard(obj) { export default function _interopRequireWildcard(obj, nodeInterop) {
if (obj && obj.__esModule) { if (!nodeInterop && obj && obj.__esModule) {
return obj; return obj;
} }
...@@ -607,7 +502,7 @@ helpers.interopRequireWildcard = helper("7.0.0-beta.0")` ...@@ -607,7 +502,7 @@ helpers.interopRequireWildcard = helper("7.0.0-beta.0")`
return { default: obj } return { default: obj }
} }
var cache = _getRequireWildcardCache(); var cache = _getRequireWildcardCache(nodeInterop);
if (cache && cache.has(obj)) { if (cache && cache.has(obj)) {
return cache.get(obj); return cache.get(obj);
} }
...@@ -615,7 +510,7 @@ helpers.interopRequireWildcard = helper("7.0.0-beta.0")` ...@@ -615,7 +510,7 @@ helpers.interopRequireWildcard = helper("7.0.0-beta.0")`
var newObj = {}; var newObj = {};
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var key in obj) { for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = hasPropertyDescriptor var desc = hasPropertyDescriptor
? Object.getOwnPropertyDescriptor(obj, key) ? Object.getOwnPropertyDescriptor(obj, key)
: null; : null;
...@@ -702,6 +597,27 @@ helpers.possibleConstructorReturn = helper("7.0.0-beta.0")` ...@@ -702,6 +597,27 @@ helpers.possibleConstructorReturn = helper("7.0.0-beta.0")`
return assertThisInitialized(self); return assertThisInitialized(self);
} }
`; `;
helpers.createSuper = helper("7.9.0")`
import getPrototypeOf from "getPrototypeOf";
import isNativeReflectConstruct from "isNativeReflectConstruct";
import possibleConstructorReturn from "possibleConstructorReturn";
export default function _createSuper(Derived) {
var hasNativeReflectConstruct = isNativeReflectConstruct();
return function _createSuperInternal() {
var Super = getPrototypeOf(Derived), result;
if (hasNativeReflectConstruct) {
// NOTE: This doesn't work if this.__proto__.constructor has been modified.
var NewTarget = getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return possibleConstructorReturn(this, result);
}
}
`;
helpers.superPropBase = helper("7.0.0-beta.0")` helpers.superPropBase = helper("7.0.0-beta.0")`
import getPrototypeOf from "getPrototypeOf"; import getPrototypeOf from "getPrototypeOf";
...@@ -810,7 +726,12 @@ helpers.taggedTemplateLiteralLoose = helper("7.0.0-beta.0")` ...@@ -810,7 +726,12 @@ helpers.taggedTemplateLiteralLoose = helper("7.0.0-beta.0")`
`; `;
helpers.readOnlyError = helper("7.0.0-beta.0")` helpers.readOnlyError = helper("7.0.0-beta.0")`
export default function _readOnlyError(name) { export default function _readOnlyError(name) {
throw new Error("\\"" + name + "\\" is read-only"); throw new TypeError("\\"" + name + "\\" is read-only");
}
`;
helpers.writeOnlyError = helper("7.12.13")`
export default function _writeOnlyError(name) {
throw new TypeError("\\"" + name + "\\" is write-only");
} }
`; `;
helpers.classNameTDZError = helper("7.0.0-beta.0")` helpers.classNameTDZError = helper("7.0.0-beta.0")`
...@@ -839,45 +760,68 @@ helpers.temporalRef = helper("7.0.0-beta.0")` ...@@ -839,45 +760,68 @@ helpers.temporalRef = helper("7.0.0-beta.0")`
helpers.slicedToArray = helper("7.0.0-beta.0")` helpers.slicedToArray = helper("7.0.0-beta.0")`
import arrayWithHoles from "arrayWithHoles"; import arrayWithHoles from "arrayWithHoles";
import iterableToArrayLimit from "iterableToArrayLimit"; import iterableToArrayLimit from "iterableToArrayLimit";
import unsupportedIterableToArray from "unsupportedIterableToArray";
import nonIterableRest from "nonIterableRest"; import nonIterableRest from "nonIterableRest";
export default function _slicedToArray(arr, i) { export default function _slicedToArray(arr, i) {
return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest(); return (
arrayWithHoles(arr) ||
iterableToArrayLimit(arr, i) ||
unsupportedIterableToArray(arr, i) ||
nonIterableRest()
);
} }
`; `;
helpers.slicedToArrayLoose = helper("7.0.0-beta.0")` helpers.slicedToArrayLoose = helper("7.0.0-beta.0")`
import arrayWithHoles from "arrayWithHoles"; import arrayWithHoles from "arrayWithHoles";
import iterableToArrayLimitLoose from "iterableToArrayLimitLoose"; import iterableToArrayLimitLoose from "iterableToArrayLimitLoose";
import unsupportedIterableToArray from "unsupportedIterableToArray";
import nonIterableRest from "nonIterableRest"; import nonIterableRest from "nonIterableRest";
export default function _slicedToArrayLoose(arr, i) { export default function _slicedToArrayLoose(arr, i) {
return arrayWithHoles(arr) || iterableToArrayLimitLoose(arr, i) || nonIterableRest(); return (
arrayWithHoles(arr) ||
iterableToArrayLimitLoose(arr, i) ||
unsupportedIterableToArray(arr, i) ||
nonIterableRest()
);
} }
`; `;
helpers.toArray = helper("7.0.0-beta.0")` helpers.toArray = helper("7.0.0-beta.0")`
import arrayWithHoles from "arrayWithHoles"; import arrayWithHoles from "arrayWithHoles";
import iterableToArray from "iterableToArray"; import iterableToArray from "iterableToArray";
import unsupportedIterableToArray from "unsupportedIterableToArray";
import nonIterableRest from "nonIterableRest"; import nonIterableRest from "nonIterableRest";
export default function _toArray(arr) { export default function _toArray(arr) {
return arrayWithHoles(arr) || iterableToArray(arr) || nonIterableRest(); return (
arrayWithHoles(arr) ||
iterableToArray(arr) ||
unsupportedIterableToArray(arr) ||
nonIterableRest()
);
} }
`; `;
helpers.toConsumableArray = helper("7.0.0-beta.0")` helpers.toConsumableArray = helper("7.0.0-beta.0")`
import arrayWithoutHoles from "arrayWithoutHoles"; import arrayWithoutHoles from "arrayWithoutHoles";
import iterableToArray from "iterableToArray"; import iterableToArray from "iterableToArray";
import unsupportedIterableToArray from "unsupportedIterableToArray";
import nonIterableSpread from "nonIterableSpread"; import nonIterableSpread from "nonIterableSpread";
export default function _toConsumableArray(arr) { export default function _toConsumableArray(arr) {
return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread(); return (
arrayWithoutHoles(arr) ||
iterableToArray(arr) ||
unsupportedIterableToArray(arr) ||
nonIterableSpread()
);
} }
`; `;
helpers.arrayWithoutHoles = helper("7.0.0-beta.0")` helpers.arrayWithoutHoles = helper("7.0.0-beta.0")`
import arrayLikeToArray from "arrayLikeToArray";
export default function _arrayWithoutHoles(arr) { export default function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) { if (Array.isArray(arr)) return arrayLikeToArray(arr);
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
return arr2;
}
} }
`; `;
helpers.arrayWithHoles = helper("7.0.0-beta.0")` helpers.arrayWithHoles = helper("7.0.0-beta.0")`
...@@ -885,12 +829,20 @@ helpers.arrayWithHoles = helper("7.0.0-beta.0")` ...@@ -885,12 +829,20 @@ helpers.arrayWithHoles = helper("7.0.0-beta.0")`
if (Array.isArray(arr)) return arr; if (Array.isArray(arr)) return arr;
} }
`; `;
helpers.maybeArrayLike = helper("7.9.0")`
import arrayLikeToArray from "arrayLikeToArray";
export default function _maybeArrayLike(next, arr, i) {
if (arr && !Array.isArray(arr) && typeof arr.length === "number") {
var len = arr.length;
return arrayLikeToArray(arr, i !== void 0 && i < len ? i : len);
}
return next(arr, i);
}
`;
helpers.iterableToArray = helper("7.0.0-beta.0")` helpers.iterableToArray = helper("7.0.0-beta.0")`
export default function _iterableToArray(iter) { export default function _iterableToArray(iter) {
if ( if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
Symbol.iterator in Object(iter) ||
Object.prototype.toString.call(iter) === "[object Arguments]"
) return Array.from(iter);
} }
`; `;
helpers.iterableToArrayLimit = helper("7.0.0-beta.0")` helpers.iterableToArrayLimit = helper("7.0.0-beta.0")`
...@@ -904,15 +856,16 @@ helpers.iterableToArrayLimit = helper("7.0.0-beta.0")` ...@@ -904,15 +856,16 @@ helpers.iterableToArrayLimit = helper("7.0.0-beta.0")`
// _e = _iteratorError // _e = _iteratorError
// _i = _iterator // _i = _iterator
// _s = _step // _s = _step
if (!(
Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]" var _i = arr == null ? null : (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);
)) { return } if (_i == null) return;
var _arr = []; var _arr = [];
var _n = true; var _n = true;
var _d = false; var _d = false;
var _e = undefined; var _s, _e;
try { try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value); _arr.push(_s.value);
if (i && _arr.length === i) break; if (i && _arr.length === i) break;
} }
...@@ -931,25 +884,134 @@ helpers.iterableToArrayLimit = helper("7.0.0-beta.0")` ...@@ -931,25 +884,134 @@ helpers.iterableToArrayLimit = helper("7.0.0-beta.0")`
`; `;
helpers.iterableToArrayLimitLoose = helper("7.0.0-beta.0")` helpers.iterableToArrayLimitLoose = helper("7.0.0-beta.0")`
export default function _iterableToArrayLimitLoose(arr, i) { export default function _iterableToArrayLimitLoose(arr, i) {
if (!( var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);
Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]" if (_i == null) return;
)) { return }
var _arr = []; var _arr = [];
for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { for (_i = _i.call(arr), _step; !(_step = _i.next()).done;) {
_arr.push(_step.value); _arr.push(_step.value);
if (i && _arr.length === i) break; if (i && _arr.length === i) break;
} }
return _arr; return _arr;
} }
`; `;
helpers.unsupportedIterableToArray = helper("7.9.0")`
import arrayLikeToArray from "arrayLikeToArray";
export default function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
return arrayLikeToArray(o, minLen);
}
`;
helpers.arrayLikeToArray = helper("7.9.0")`
export default function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
`;
helpers.nonIterableSpread = helper("7.0.0-beta.0")` helpers.nonIterableSpread = helper("7.0.0-beta.0")`
export default function _nonIterableSpread() { export default function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance"); throw new TypeError(
"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."
);
} }
`; `;
helpers.nonIterableRest = helper("7.0.0-beta.0")` helpers.nonIterableRest = helper("7.0.0-beta.0")`
export default function _nonIterableRest() { export default function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance"); throw new TypeError(
"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."
);
}
`;
helpers.createForOfIteratorHelper = helper("7.9.0")`
import unsupportedIterableToArray from "unsupportedIterableToArray";
// s: start (create the iterator)
// n: next
// e: error (called whenever something throws)
// f: finish (always called at the end)
export default function _createForOfIteratorHelper(o, allowArrayLike) {
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
if (!it) {
// Fallback for engines without symbol support
if (
Array.isArray(o) ||
(it = unsupportedIterableToArray(o)) ||
(allowArrayLike && o && typeof o.length === "number")
) {
if (it) o = it;
var i = 0;
var F = function(){};
return {
s: F,
n: function() {
if (i >= o.length) return { done: true };
return { done: false, value: o[i++] };
},
e: function(e) { throw e; },
f: F,
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
var normalCompletion = true, didErr = false, err;
return {
s: function() {
it = it.call(o);
},
n: function() {
var step = it.next();
normalCompletion = step.done;
return step;
},
e: function(e) {
didErr = true;
err = e;
},
f: function() {
try {
if (!normalCompletion && it.return != null) it.return();
} finally {
if (didErr) throw err;
}
}
};
}
`;
helpers.createForOfIteratorHelperLoose = helper("7.9.0")`
import unsupportedIterableToArray from "unsupportedIterableToArray";
export default function _createForOfIteratorHelperLoose(o, allowArrayLike) {
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
if (it) return (it = it.call(o)).next.bind(it);
// Fallback for engines without symbol support
if (
Array.isArray(o) ||
(it = unsupportedIterableToArray(o)) ||
(allowArrayLike && o && typeof o.length === "number")
) {
if (it) o = it;
var i = 0;
return function() {
if (i >= o.length) return { done: true };
return { done: false, value: o[i++] };
}
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
} }
`; `;
helpers.skipFirstGeneratorNext = helper("7.0.0-beta.0")` helpers.skipFirstGeneratorNext = helper("7.0.0-beta.0")`
...@@ -1026,8 +1088,6 @@ helpers.applyDecoratedDescriptor = helper("7.0.0-beta.0")` ...@@ -1026,8 +1088,6 @@ helpers.applyDecoratedDescriptor = helper("7.0.0-beta.0")`
} }
if (desc.initializer === void 0){ if (desc.initializer === void 0){
// This is a hack to avoid this being processed by 'transform-runtime'.
// See issue #9.
Object.defineProperty(target, property, desc); Object.defineProperty(target, property, desc);
desc = null; desc = null;
} }
...@@ -1050,23 +1110,81 @@ helpers.classPrivateFieldLooseBase = helper("7.0.0-beta.0")` ...@@ -1050,23 +1110,81 @@ helpers.classPrivateFieldLooseBase = helper("7.0.0-beta.0")`
} }
`; `;
helpers.classPrivateFieldGet = helper("7.0.0-beta.0")` helpers.classPrivateFieldGet = helper("7.0.0-beta.0")`
import classApplyDescriptorGet from "classApplyDescriptorGet";
import classExtractFieldDescriptor from "classExtractFieldDescriptor";
export default function _classPrivateFieldGet(receiver, privateMap) { export default function _classPrivateFieldGet(receiver, privateMap) {
var descriptor = privateMap.get(receiver); var descriptor = classExtractFieldDescriptor(receiver, privateMap, "get");
if (!descriptor) { return classApplyDescriptorGet(receiver, descriptor);
throw new TypeError("attempted to get private field on non-instance"); }
`;
helpers.classPrivateFieldSet = helper("7.0.0-beta.0")`
import classApplyDescriptorSet from "classApplyDescriptorSet";
import classExtractFieldDescriptor from "classExtractFieldDescriptor";
export default function _classPrivateFieldSet(receiver, privateMap, value) {
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set");
classApplyDescriptorSet(receiver, descriptor, value);
return value;
}
`;
helpers.classPrivateFieldDestructureSet = helper("7.4.4")`
import classApplyDescriptorDestructureSet from "classApplyDescriptorDestructureSet";
import classExtractFieldDescriptor from "classExtractFieldDescriptor";
export default function _classPrivateFieldDestructureSet(receiver, privateMap) {
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set");
return classApplyDescriptorDestructureSet(receiver, descriptor);
}
`;
helpers.classExtractFieldDescriptor = helper("7.13.10")`
export default function _classExtractFieldDescriptor(receiver, privateMap, action) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to " + action + " private field on non-instance");
} }
return privateMap.get(receiver);
}
`;
helpers.classStaticPrivateFieldSpecGet = helper("7.0.2")`
import classApplyDescriptorGet from "classApplyDescriptorGet";
import classCheckPrivateStaticAccess from "classCheckPrivateStaticAccess";
import classCheckPrivateStaticFieldDescriptor from "classCheckPrivateStaticFieldDescriptor";
export default function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) {
classCheckPrivateStaticAccess(receiver, classConstructor);
classCheckPrivateStaticFieldDescriptor(descriptor, "get");
return classApplyDescriptorGet(receiver, descriptor);
}
`;
helpers.classStaticPrivateFieldSpecSet = helper("7.0.2")`
import classApplyDescriptorSet from "classApplyDescriptorSet";
import classCheckPrivateStaticAccess from "classCheckPrivateStaticAccess";
import classCheckPrivateStaticFieldDescriptor from "classCheckPrivateStaticFieldDescriptor";
export default function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) {
classCheckPrivateStaticAccess(receiver, classConstructor);
classCheckPrivateStaticFieldDescriptor(descriptor, "set");
classApplyDescriptorSet(receiver, descriptor, value);
return value;
}
`;
helpers.classStaticPrivateMethodGet = helper("7.3.2")`
import classCheckPrivateStaticAccess from "classCheckPrivateStaticAccess";
export default function _classStaticPrivateMethodGet(receiver, classConstructor, method) {
classCheckPrivateStaticAccess(receiver, classConstructor);
return method;
}
`;
helpers.classStaticPrivateMethodSet = helper("7.3.2")`
export default function _classStaticPrivateMethodSet() {
throw new TypeError("attempted to set read only static private field");
}
`;
helpers.classApplyDescriptorGet = helper("7.13.10")`
export default function _classApplyDescriptorGet(receiver, descriptor) {
if (descriptor.get) { if (descriptor.get) {
return descriptor.get.call(receiver); return descriptor.get.call(receiver);
} }
return descriptor.value; return descriptor.value;
} }
`; `;
helpers.classPrivateFieldSet = helper("7.0.0-beta.0")` helpers.classApplyDescriptorSet = helper("7.13.10")`
export default function _classPrivateFieldSet(receiver, privateMap, value) { export default function _classApplyDescriptorSet(receiver, descriptor, value) {
var descriptor = privateMap.get(receiver);
if (!descriptor) {
throw new TypeError("attempted to set private field on non-instance");
}
if (descriptor.set) { if (descriptor.set) {
descriptor.set.call(receiver, value); descriptor.set.call(receiver, value);
} else { } else {
...@@ -1076,19 +1194,12 @@ helpers.classPrivateFieldSet = helper("7.0.0-beta.0")` ...@@ -1076,19 +1194,12 @@ helpers.classPrivateFieldSet = helper("7.0.0-beta.0")`
// class bodies. // class bodies.
throw new TypeError("attempted to set read only private field"); throw new TypeError("attempted to set read only private field");
} }
descriptor.value = value; descriptor.value = value;
} }
return value;
} }
`; `;
helpers.classPrivateFieldDestructureSet = helper("7.4.4")` helpers.classApplyDescriptorDestructureSet = helper("7.13.10")`
export default function _classPrivateFieldDestructureSet(receiver, privateMap) { export default function _classApplyDescriptorDestructureSet(receiver, descriptor) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to set private field on non-instance");
}
var descriptor = privateMap.get(receiver);
if (descriptor.set) { if (descriptor.set) {
if (!("__destrObj" in descriptor)) { if (!("__destrObj" in descriptor)) {
descriptor.__destrObj = { descriptor.__destrObj = {
...@@ -1110,48 +1221,28 @@ helpers.classPrivateFieldDestructureSet = helper("7.4.4")` ...@@ -1110,48 +1221,28 @@ helpers.classPrivateFieldDestructureSet = helper("7.4.4")`
} }
} }
`; `;
helpers.classStaticPrivateFieldSpecGet = helper("7.0.2")` helpers.classStaticPrivateFieldDestructureSet = helper("7.13.10")`
export default function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { import classApplyDescriptorDestructureSet from "classApplyDescriptorDestructureSet";
if (receiver !== classConstructor) { import classCheckPrivateStaticAccess from "classCheckPrivateStaticAccess";
throw new TypeError("Private static access of wrong provenance"); import classCheckPrivateStaticFieldDescriptor from "classCheckPrivateStaticFieldDescriptor";
} export default function _classStaticPrivateFieldDestructureSet(receiver, classConstructor, descriptor) {
if (descriptor.get) { classCheckPrivateStaticAccess(receiver, classConstructor);
return descriptor.get.call(receiver); classCheckPrivateStaticFieldDescriptor(descriptor, "set");
} return classApplyDescriptorDestructureSet(receiver, descriptor);
return descriptor.value;
} }
`; `;
helpers.classStaticPrivateFieldSpecSet = helper("7.0.2")` helpers.classCheckPrivateStaticAccess = helper("7.13.10")`
export default function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) { export default function _classCheckPrivateStaticAccess(receiver, classConstructor) {
if (receiver !== classConstructor) { if (receiver !== classConstructor) {
throw new TypeError("Private static access of wrong provenance"); throw new TypeError("Private static access of wrong provenance");
} }
if (descriptor.set) {
descriptor.set.call(receiver, value);
} else {
if (!descriptor.writable) {
// This should only throw in strict mode, but class bodies are
// always strict and private fields can only be used inside
// class bodies.
throw new TypeError("attempted to set read only private field");
}
descriptor.value = value;
}
return value;
} }
`; `;
helpers.classStaticPrivateMethodGet = helper("7.3.2")` helpers.classCheckPrivateStaticFieldDescriptor = helper("7.13.10")`
export default function _classStaticPrivateMethodGet(receiver, classConstructor, method) { export default function _classCheckPrivateStaticFieldDescriptor(descriptor, action) {
if (receiver !== classConstructor) { if (descriptor === undefined) {
throw new TypeError("Private static access of wrong provenance"); throw new TypeError("attempted to " + action + " private static field before its declaration");
} }
return method;
}
`;
helpers.classStaticPrivateMethodSet = helper("7.3.2")`
export default function _classStaticPrivateMethodSet() {
throw new TypeError("attempted to set read only static private field");
} }
`; `;
helpers.decorate = helper("7.1.5")` helpers.decorate = helper("7.1.5")`
...@@ -1835,80 +1926,10 @@ helpers.classPrivateMethodGet = helper("7.1.6")` ...@@ -1835,80 +1926,10 @@ helpers.classPrivateMethodGet = helper("7.1.6")`
return fn; return fn;
} }
`; `;
helpers.classPrivateMethodSet = helper("7.1.6")` {
export default function _classPrivateMethodSet() { helpers.classPrivateMethodSet = helper("7.1.6")`
throw new TypeError("attempted to reassign private method"); export default function _classPrivateMethodSet() {
} throw new TypeError("attempted to reassign private method");
`;
helpers.wrapRegExp = helper("7.2.6")`
import wrapNativeSuper from "wrapNativeSuper";
import getPrototypeOf from "getPrototypeOf";
import possibleConstructorReturn from "possibleConstructorReturn";
import inherits from "inherits";
export default function _wrapRegExp(re, groups) {
_wrapRegExp = function(re, groups) {
return new BabelRegExp(re, undefined, groups);
};
var _RegExp = wrapNativeSuper(RegExp);
var _super = RegExp.prototype;
var _groups = new WeakMap();
function BabelRegExp(re, flags, groups) {
var _this = _RegExp.call(this, re, flags);
// if the regex is recreated with 'g' flag
_groups.set(_this, groups || _groups.get(re));
return _this;
} }
inherits(BabelRegExp, _RegExp); `;
}
BabelRegExp.prototype.exec = function(str) { \ No newline at end of file
var result = _super.exec.call(this, str);
if (result) result.groups = buildGroups(result, this);
return result;
};
BabelRegExp.prototype[Symbol.replace] = function(str, substitution) {
if (typeof substitution === "string") {
var groups = _groups.get(this);
return _super[Symbol.replace].call(
this,
str,
substitution.replace(/\\$<([^>]+)>/g, function(_, name) {
return "$" + groups[name];
})
);
} else if (typeof substitution === "function") {
var _this = this;
return _super[Symbol.replace].call(
this,
str,
function() {
var args = [];
args.push.apply(args, arguments);
if (typeof args[args.length - 1] !== "object") {
// Modern engines already pass result.groups as the last arg.
args.push(buildGroups(args, _this));
}
return substitution.apply(this, args);
}
);
} else {
return _super[Symbol.replace].call(this, str, substitution);
}
}
function buildGroups(result, re) {
// NOTE: This function should return undefined if there are no groups,
// but in that case Babel doesn't add the wrapper anyway.
var g = _groups.get(re);
return Object.keys(g).reduce(function(groups, name) {
groups[name] = result[g[name]];
return groups;
}, Object.create(null));
}
return _wrapRegExp.apply(this, arguments);
}
`;
\ No newline at end of file
...@@ -9,17 +9,11 @@ exports.getDependencies = getDependencies; ...@@ -9,17 +9,11 @@ exports.getDependencies = getDependencies;
exports.ensure = ensure; exports.ensure = ensure;
exports.default = exports.list = void 0; exports.default = exports.list = void 0;
var _traverse = _interopRequireDefault(require("@babel/traverse")); var _traverse = require("@babel/traverse");
var t = _interopRequireWildcard(require("@babel/types")); var t = require("@babel/types");
var _helpers = _interopRequireDefault(require("./helpers")); var _helpers = require("./helpers");
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function makePath(path) { function makePath(path) {
const parts = []; const parts = [];
...@@ -32,6 +26,8 @@ function makePath(path) { ...@@ -32,6 +26,8 @@ function makePath(path) {
return parts.reverse().join("."); return parts.reverse().join(".");
} }
let fileClass = undefined;
function getHelperMetadata(file) { function getHelperMetadata(file) {
const globals = new Set(); const globals = new Set();
const localBindingNames = new Set(); const localBindingNames = new Set();
...@@ -41,7 +37,7 @@ function getHelperMetadata(file) { ...@@ -41,7 +37,7 @@ function getHelperMetadata(file) {
const exportBindingAssignments = []; const exportBindingAssignments = [];
const importPaths = []; const importPaths = [];
const importBindingsReferences = []; const importBindingsReferences = [];
(0, _traverse.default)(file, { const dependencyVisitor = {
ImportDeclaration(child) { ImportDeclaration(child) {
const name = child.node.source.value; const name = child.node.source.value;
...@@ -85,8 +81,8 @@ function getHelperMetadata(file) { ...@@ -85,8 +81,8 @@ function getHelperMetadata(file) {
child.skip(); child.skip();
} }
}); };
(0, _traverse.default)(file, { const referenceVisitor = {
Program(path) { Program(path) {
const bindings = path.scope.getAllBindings(); const bindings = path.scope.getAllBindings();
Object.keys(bindings).forEach(name => { Object.keys(bindings).forEach(name => {
...@@ -117,12 +113,14 @@ function getHelperMetadata(file) { ...@@ -117,12 +113,14 @@ function getHelperMetadata(file) {
const binding = child.scope.getBinding(exportName); const binding = child.scope.getBinding(exportName);
if (binding && binding.scope.path.isProgram()) { if (binding != null && binding.scope.path.isProgram()) {
exportBindingAssignments.push(makePath(child)); exportBindingAssignments.push(makePath(child));
} }
} }
}); };
(0, _traverse.default)(file.ast, dependencyVisitor, file.scope);
(0, _traverse.default)(file.ast, referenceVisitor, file.scope);
if (!exportPath) throw new Error("Helpers must default-export something."); if (!exportPath) throw new Error("Helpers must default-export something.");
exportBindingAssignments.reverse(); exportBindingAssignments.reverse();
return { return {
...@@ -170,7 +168,7 @@ function permuteHelperAST(file, metadata, id, localBindings, getDependency) { ...@@ -170,7 +168,7 @@ function permuteHelperAST(file, metadata, id, localBindings, getDependency) {
toRename[exportName] = id.name; toRename[exportName] = id.name;
} }
(0, _traverse.default)(file, { const visitor = {
Program(path) { Program(path) {
const exp = path.get(exportPath); const exp = path.get(exportPath);
const imps = importPaths.map(p => path.get(p)); const imps = importPaths.map(p => path.get(p));
...@@ -212,7 +210,8 @@ function permuteHelperAST(file, metadata, id, localBindings, getDependency) { ...@@ -212,7 +210,8 @@ function permuteHelperAST(file, metadata, id, localBindings, getDependency) {
path.stop(); path.stop();
} }
}); };
(0, _traverse.default)(file.ast, visitor, file.scope);
} }
const helperData = Object.create(null); const helperData = Object.create(null);
...@@ -229,7 +228,17 @@ function loadHelper(name) { ...@@ -229,7 +228,17 @@ function loadHelper(name) {
} }
const fn = () => { const fn = () => {
return t.file(helper.ast()); const file = {
ast: t.file(helper.ast())
};
if (fileClass) {
return new fileClass({
filename: `babel-helper://${name}`
}, file);
}
return file;
}; };
const metadata = getHelperMetadata(fn()); const metadata = getHelperMetadata(fn());
...@@ -238,7 +247,7 @@ function loadHelper(name) { ...@@ -238,7 +247,7 @@ function loadHelper(name) {
const file = fn(); const file = fn();
permuteHelperAST(file, metadata, id, localBindings, getDependency); permuteHelperAST(file, metadata, id, localBindings, getDependency);
return { return {
nodes: file.program.body, nodes: file.ast.program.body,
globals: metadata.globals globals: metadata.globals
}; };
}, },
...@@ -266,7 +275,11 @@ function getDependencies(name) { ...@@ -266,7 +275,11 @@ function getDependencies(name) {
return Array.from(loadHelper(name).dependencies.values()); return Array.from(loadHelper(name).dependencies.values());
} }
function ensure(name) { function ensure(name, newFileClass) {
if (!fileClass) {
fileClass = newFileClass;
}
loadHelper(name); loadHelper(name);
} }
......
{ {
"_from": "@babel/helpers@^7.7.0", "name": "@babel/helpers",
"_id": "@babel/helpers@7.7.0", "version": "7.14.6",
"_inBundle": false,
"_integrity": "sha512-VnNwL4YOhbejHb7x/b5F39Zdg5vIQpUUNzJwx0ww1EcVRt41bbGRZWhAURrfY32T5zTT3qwNOQFWpn+P0i0a2g==",
"_location": "/@babel/helpers",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@babel/helpers@^7.7.0",
"name": "@babel/helpers",
"escapedName": "@babel%2fhelpers",
"scope": "@babel",
"rawSpec": "^7.7.0",
"saveSpec": null,
"fetchSpec": "^7.7.0"
},
"_requiredBy": [
"/@babel/core"
],
"_resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.7.0.tgz",
"_shasum": "359bb5ac3b4726f7c1fde0ec75f64b3f4275d60b",
"_spec": "@babel/helpers@^7.7.0",
"_where": "C:\\Work\\OneDrive - bwstaff\\M4_Lab\\TV3\\NewVersion01\\LAFJLBmf939XYm5gj\\dev\\node_modules\\@babel\\core",
"author": {
"name": "Sebastian McKenzie",
"email": "sebmck@gmail.com"
},
"bundleDependencies": false,
"dependencies": {
"@babel/template": "^7.7.0",
"@babel/traverse": "^7.7.0",
"@babel/types": "^7.7.0"
},
"deprecated": false,
"description": "Collection of helper functions used by Babel transforms.", "description": "Collection of helper functions used by Babel transforms.",
"devDependencies": { "author": "The Babel Team (https://babel.dev/team)",
"@babel/helper-plugin-test-runner": "^7.0.0" "homepage": "https://babel.dev/docs/en/next/babel-helpers",
},
"gitHead": "97faa83953cb87e332554fa559a4956d202343ea",
"homepage": "https://babeljs.io/",
"license": "MIT", "license": "MIT",
"main": "lib/index.js",
"name": "@babel/helpers",
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-helpers" "url": "https://github.com/babel/babel.git",
"directory": "packages/babel-helpers"
},
"main": "./lib/index.js",
"dependencies": {
"@babel/template": "^7.14.5",
"@babel/traverse": "^7.14.5",
"@babel/types": "^7.14.5"
},
"devDependencies": {
"@babel/helper-plugin-test-runner": "7.14.5"
}, },
"version": "7.7.0" "engines": {
} "node": ">=6.9.0"
}
}
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
> Syntax highlight JavaScript strings for output in terminals. > Syntax highlight JavaScript strings for output in terminals.
See our website [@babel/highlight](https://babeljs.io/docs/en/next/babel-highlight.html) for more information. See our website [@babel/highlight](https://babeljs.io/docs/en/babel-highlight) for more information.
## Install ## Install
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment