Fixed #1 - Fixed the whatsnew-** script for loading release notes into builds
Added test to ensure that release notes are parsed properly Updated to latest dependencies to fix security vulnerability Updated GH Actions Workflow to run test before updating tag Updated README.md to reflect proper whatsnew documentation.
This commit is contained in:
14
node_modules/@babel/traverse/lib/context.js
generated
vendored
14
node_modules/@babel/traverse/lib/context.js
generated
vendored
@@ -7,17 +7,11 @@ exports.default = void 0;
|
||||
|
||||
var _path = _interopRequireDefault(require("./path"));
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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 }; }
|
||||
|
||||
@@ -36,7 +30,7 @@ class TraversalContext {
|
||||
const opts = this.opts;
|
||||
if (opts.enter || opts.exit) return true;
|
||||
if (opts[node.type]) return true;
|
||||
const keys = t().VISITOR_KEYS[node.type];
|
||||
const keys = t.VISITOR_KEYS[node.type];
|
||||
if (!keys || !keys.length) return false;
|
||||
|
||||
for (const key of keys) {
|
||||
|
||||
38
node_modules/@babel/traverse/lib/index.js
generated
vendored
38
node_modules/@babel/traverse/lib/index.js
generated
vendored
@@ -30,25 +30,9 @@ var visitors = _interopRequireWildcard(require("./visitors"));
|
||||
|
||||
exports.visitors = visitors;
|
||||
|
||||
function _includes() {
|
||||
const data = _interopRequireDefault(require("lodash/includes"));
|
||||
var _includes = _interopRequireDefault(require("lodash/includes"));
|
||||
|
||||
_includes = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
var cache = _interopRequireWildcard(require("./cache"));
|
||||
|
||||
@@ -58,7 +42,9 @@ var _scope = _interopRequireDefault(require("./scope"));
|
||||
|
||||
var _hub = _interopRequireDefault(require("./hub"));
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
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; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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 }; }
|
||||
|
||||
@@ -72,6 +58,10 @@ function traverse(parent, opts, scope, state, parentPath) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!t.VISITOR_KEYS[parent.type]) {
|
||||
return;
|
||||
}
|
||||
|
||||
visitors.explode(opts);
|
||||
traverse.node(parent, opts, scope, state, parentPath);
|
||||
}
|
||||
@@ -81,11 +71,11 @@ traverse.verify = visitors.verify;
|
||||
traverse.explode = visitors.explode;
|
||||
|
||||
traverse.cheap = function (node, enter) {
|
||||
return t().traverseFast(node, enter);
|
||||
return t.traverseFast(node, enter);
|
||||
};
|
||||
|
||||
traverse.node = function (node, opts, scope, state, parentPath, skipKeys) {
|
||||
const keys = t().VISITOR_KEYS[node.type];
|
||||
const keys = t.VISITOR_KEYS[node.type];
|
||||
if (!keys) return;
|
||||
const context = new _context.default(scope, opts, state, parentPath);
|
||||
|
||||
@@ -96,12 +86,12 @@ traverse.node = function (node, opts, scope, state, parentPath, skipKeys) {
|
||||
};
|
||||
|
||||
traverse.clearNode = function (node, opts) {
|
||||
t().removeProperties(node, opts);
|
||||
t.removeProperties(node, opts);
|
||||
cache.path.delete(node);
|
||||
};
|
||||
|
||||
traverse.removeProperties = function (tree, opts) {
|
||||
t().traverseFast(tree, traverse.clearNode, opts);
|
||||
t.traverseFast(tree, traverse.clearNode, opts);
|
||||
return tree;
|
||||
};
|
||||
|
||||
@@ -113,7 +103,7 @@ function hasBlacklistedType(path, state) {
|
||||
}
|
||||
|
||||
traverse.hasType = function (tree, type, blacklistTypes) {
|
||||
if ((0, _includes().default)(blacklistTypes, tree.type)) return false;
|
||||
if ((0, _includes.default)(blacklistTypes, tree.type)) return false;
|
||||
if (tree.type === type) return true;
|
||||
const state = {
|
||||
has: false,
|
||||
|
||||
16
node_modules/@babel/traverse/lib/path/ancestry.js
generated
vendored
16
node_modules/@babel/traverse/lib/path/ancestry.js
generated
vendored
@@ -14,21 +14,15 @@ exports.isAncestor = isAncestor;
|
||||
exports.isDescendant = isDescendant;
|
||||
exports.inType = inType;
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
var _index = _interopRequireDefault(require("./index"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
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; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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 findParent(callback) {
|
||||
let path = this;
|
||||
@@ -75,7 +69,7 @@ function getStatementParent() {
|
||||
function getEarliestCommonAncestorFrom(paths) {
|
||||
return this.getDeepestCommonAncestorFrom(paths, function (deepest, i, ancestries) {
|
||||
let earliest;
|
||||
const keys = t().VISITOR_KEYS[deepest.type];
|
||||
const keys = t.VISITOR_KEYS[deepest.type];
|
||||
|
||||
for (const ancestry of ancestries) {
|
||||
const path = ancestry[i + 1];
|
||||
|
||||
16
node_modules/@babel/traverse/lib/path/comments.js
generated
vendored
16
node_modules/@babel/traverse/lib/path/comments.js
generated
vendored
@@ -7,17 +7,11 @@ exports.shareCommentsWithSiblings = shareCommentsWithSiblings;
|
||||
exports.addComment = addComment;
|
||||
exports.addComments = addComments;
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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 shareCommentsWithSiblings() {
|
||||
if (typeof this.key === "string") return;
|
||||
@@ -39,9 +33,9 @@ function shareCommentsWithSiblings() {
|
||||
}
|
||||
|
||||
function addComment(type, content, line) {
|
||||
t().addComment(this.node, type, content, line);
|
||||
t.addComment(this.node, type, content, line);
|
||||
}
|
||||
|
||||
function addComments(type, comments) {
|
||||
t().addComments(this.node, type, comments);
|
||||
t.addComments(this.node, type, comments);
|
||||
}
|
||||
24
node_modules/@babel/traverse/lib/path/context.js
generated
vendored
24
node_modules/@babel/traverse/lib/path/context.js
generated
vendored
@@ -26,6 +26,8 @@ exports._getQueueContexts = _getQueueContexts;
|
||||
|
||||
var _index = _interopRequireDefault(require("../index"));
|
||||
|
||||
var _index2 = require("./index");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function call(key) {
|
||||
@@ -61,7 +63,7 @@ function _call(fns) {
|
||||
}
|
||||
|
||||
if (this.node !== node) return true;
|
||||
if (this.shouldStop || this.shouldSkip || this.removed) return true;
|
||||
if (this._traverseFlags > 0) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -85,7 +87,7 @@ function visit() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.call("enter") || this.shouldSkip) {
|
||||
if (this.shouldSkip || this.call("enter") || this.shouldSkip) {
|
||||
this.debug("Skip...");
|
||||
return this.shouldStop;
|
||||
}
|
||||
@@ -103,12 +105,15 @@ function skip() {
|
||||
}
|
||||
|
||||
function skipKey(key) {
|
||||
if (this.skipKeys == null) {
|
||||
this.skipKeys = {};
|
||||
}
|
||||
|
||||
this.skipKeys[key] = true;
|
||||
}
|
||||
|
||||
function stop() {
|
||||
this.shouldStop = true;
|
||||
this.shouldSkip = true;
|
||||
this._traverseFlags |= _index2.SHOULD_SKIP | _index2.SHOULD_STOP;
|
||||
}
|
||||
|
||||
function setScope() {
|
||||
@@ -127,10 +132,11 @@ function setScope() {
|
||||
}
|
||||
|
||||
function setContext(context) {
|
||||
this.shouldSkip = false;
|
||||
this.shouldStop = false;
|
||||
this.removed = false;
|
||||
this.skipKeys = {};
|
||||
if (this.skipKeys != null) {
|
||||
this.skipKeys = {};
|
||||
}
|
||||
|
||||
this._traverseFlags = 0;
|
||||
|
||||
if (context) {
|
||||
this.context = context;
|
||||
@@ -208,9 +214,7 @@ function pushContext(context) {
|
||||
}
|
||||
|
||||
function setup(parentPath, container, listKey, key) {
|
||||
this.inList = !!listKey;
|
||||
this.listKey = listKey;
|
||||
this.parentKey = listKey || key;
|
||||
this.container = container;
|
||||
this.parentPath = parentPath || this.parentPath;
|
||||
this.setKey(key);
|
||||
|
||||
177
node_modules/@babel/traverse/lib/path/conversion.js
generated
vendored
177
node_modules/@babel/traverse/lib/path/conversion.js
generated
vendored
@@ -9,29 +9,15 @@ exports.arrowFunctionToShadowed = arrowFunctionToShadowed;
|
||||
exports.unwrapFunctionEnvironment = unwrapFunctionEnvironment;
|
||||
exports.arrowFunctionToExpression = arrowFunctionToExpression;
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _helperFunctionName() {
|
||||
const data = _interopRequireDefault(require("@babel/helper-function-name"));
|
||||
|
||||
_helperFunctionName = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
var _helperFunctionName = _interopRequireDefault(require("@babel/helper-function-name"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
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; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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 toComputedKey() {
|
||||
const node = this.node;
|
||||
@@ -46,7 +32,7 @@ function toComputedKey() {
|
||||
}
|
||||
|
||||
if (!node.computed) {
|
||||
if (t().isIdentifier(key)) key = t().stringLiteral(key.name);
|
||||
if (t.isIdentifier(key)) key = t.stringLiteral(key.name);
|
||||
}
|
||||
|
||||
return key;
|
||||
@@ -82,14 +68,14 @@ function ensureBlock() {
|
||||
|
||||
if (this.isFunction()) {
|
||||
key = "argument";
|
||||
statements.push(t().returnStatement(body.node));
|
||||
statements.push(t.returnStatement(body.node));
|
||||
} else {
|
||||
key = "expression";
|
||||
statements.push(t().expressionStatement(body.node));
|
||||
statements.push(t.expressionStatement(body.node));
|
||||
}
|
||||
}
|
||||
|
||||
this.node.body = t().blockStatement(statements);
|
||||
this.node.body = t.blockStatement(statements);
|
||||
const parentPath = this.get(stringPath);
|
||||
body.setup(parentPath, listKey ? parentPath.node[listKey] : parentPath.node, listKey, key);
|
||||
return this.node;
|
||||
@@ -126,12 +112,12 @@ function arrowFunctionToExpression({
|
||||
if (checkBinding) {
|
||||
this.parentPath.scope.push({
|
||||
id: checkBinding,
|
||||
init: t().objectExpression([])
|
||||
init: t.objectExpression([])
|
||||
});
|
||||
}
|
||||
|
||||
this.get("body").unshiftContainer("body", t().expressionStatement(t().callExpression(this.hub.addHelper("newArrowCheck"), [t().thisExpression(), checkBinding ? t().identifier(checkBinding.name) : t().identifier(thisBinding)])));
|
||||
this.replaceWith(t().callExpression(t().memberExpression((0, _helperFunctionName().default)(this, true) || this.node, t().identifier("bind")), [checkBinding ? t().identifier(checkBinding.name) : t().thisExpression()]));
|
||||
this.get("body").unshiftContainer("body", t.expressionStatement(t.callExpression(this.hub.addHelper("newArrowCheck"), [t.thisExpression(), checkBinding ? t.identifier(checkBinding.name) : t.identifier(thisBinding)])));
|
||||
this.replaceWith(t.callExpression(t.memberExpression((0, _helperFunctionName.default)(this, true) || this.node, t.identifier("bind")), [checkBinding ? t.identifier(checkBinding.name) : t.thisExpression()]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,40 +165,25 @@ function hoistFunctionEnvironment(fnPath, specCompliant = false, allowInsertArro
|
||||
});
|
||||
const superBinding = getSuperBinding(thisEnvFn);
|
||||
allSuperCalls.forEach(superCall => {
|
||||
const callee = t().identifier(superBinding);
|
||||
const callee = t.identifier(superBinding);
|
||||
callee.loc = superCall.node.callee.loc;
|
||||
superCall.get("callee").replaceWith(callee);
|
||||
});
|
||||
}
|
||||
|
||||
let thisBinding;
|
||||
|
||||
if (thisPaths.length > 0 || specCompliant) {
|
||||
thisBinding = getThisBinding(thisEnvFn, inConstructor);
|
||||
|
||||
if (!specCompliant || inConstructor && hasSuperClass(thisEnvFn)) {
|
||||
thisPaths.forEach(thisChild => {
|
||||
const thisRef = thisChild.isJSX() ? t().jsxIdentifier(thisBinding) : t().identifier(thisBinding);
|
||||
thisRef.loc = thisChild.node.loc;
|
||||
thisChild.replaceWith(thisRef);
|
||||
});
|
||||
if (specCompliant) thisBinding = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (argumentsPaths.length > 0) {
|
||||
const argumentsBinding = getBinding(thisEnvFn, "arguments", () => t().identifier("arguments"));
|
||||
const argumentsBinding = getBinding(thisEnvFn, "arguments", () => t.identifier("arguments"));
|
||||
argumentsPaths.forEach(argumentsChild => {
|
||||
const argsRef = t().identifier(argumentsBinding);
|
||||
const argsRef = t.identifier(argumentsBinding);
|
||||
argsRef.loc = argumentsChild.node.loc;
|
||||
argumentsChild.replaceWith(argsRef);
|
||||
});
|
||||
}
|
||||
|
||||
if (newTargetPaths.length > 0) {
|
||||
const newTargetBinding = getBinding(thisEnvFn, "newtarget", () => t().metaProperty(t().identifier("new"), t().identifier("target")));
|
||||
const newTargetBinding = getBinding(thisEnvFn, "newtarget", () => t.metaProperty(t.identifier("new"), t.identifier("target")));
|
||||
newTargetPaths.forEach(targetChild => {
|
||||
const targetRef = t().identifier(newTargetBinding);
|
||||
const targetRef = t.identifier(newTargetBinding);
|
||||
targetRef.loc = targetChild.node.loc;
|
||||
targetChild.replaceWith(targetRef);
|
||||
});
|
||||
@@ -226,41 +197,53 @@ function hoistFunctionEnvironment(fnPath, specCompliant = false, allowInsertArro
|
||||
const flatSuperProps = superProps.reduce((acc, superProp) => acc.concat(standardizeSuperProperty(superProp)), []);
|
||||
flatSuperProps.forEach(superProp => {
|
||||
const key = superProp.node.computed ? "" : superProp.get("property").node.name;
|
||||
|
||||
if (superProp.parentPath.isCallExpression({
|
||||
const isAssignment = superProp.parentPath.isAssignmentExpression({
|
||||
left: superProp.node
|
||||
});
|
||||
const isCall = superProp.parentPath.isCallExpression({
|
||||
callee: superProp.node
|
||||
})) {
|
||||
const superBinding = getSuperPropCallBinding(thisEnvFn, key);
|
||||
});
|
||||
const superBinding = getSuperPropBinding(thisEnvFn, isAssignment, key);
|
||||
const args = [];
|
||||
|
||||
if (superProp.node.computed) {
|
||||
const prop = superProp.get("property").node;
|
||||
superProp.replaceWith(t().identifier(superBinding));
|
||||
superProp.parentPath.node.arguments.unshift(prop);
|
||||
} else {
|
||||
superProp.replaceWith(t().identifier(superBinding));
|
||||
}
|
||||
if (superProp.node.computed) {
|
||||
args.push(superProp.get("property").node);
|
||||
}
|
||||
|
||||
if (isAssignment) {
|
||||
const value = superProp.parentPath.node.right;
|
||||
args.push(value);
|
||||
}
|
||||
|
||||
const call = t.callExpression(t.identifier(superBinding), args);
|
||||
|
||||
if (isCall) {
|
||||
superProp.parentPath.unshiftContainer("arguments", t.thisExpression());
|
||||
superProp.replaceWith(t.memberExpression(call, t.identifier("call")));
|
||||
thisPaths.push(superProp.parentPath.get("arguments.0"));
|
||||
} else if (isAssignment) {
|
||||
superProp.parentPath.replaceWith(call);
|
||||
} else {
|
||||
const isAssignment = superProp.parentPath.isAssignmentExpression({
|
||||
left: superProp.node
|
||||
});
|
||||
const superBinding = getSuperPropBinding(thisEnvFn, isAssignment, key);
|
||||
const args = [];
|
||||
|
||||
if (superProp.node.computed) {
|
||||
args.push(superProp.get("property").node);
|
||||
}
|
||||
|
||||
if (isAssignment) {
|
||||
const value = superProp.parentPath.node.right;
|
||||
args.push(value);
|
||||
superProp.parentPath.replaceWith(t().callExpression(t().identifier(superBinding), args));
|
||||
} else {
|
||||
superProp.replaceWith(t().callExpression(t().identifier(superBinding), args));
|
||||
}
|
||||
superProp.replaceWith(call);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
let thisBinding;
|
||||
|
||||
if (thisPaths.length > 0 || specCompliant) {
|
||||
thisBinding = getThisBinding(thisEnvFn, inConstructor);
|
||||
|
||||
if (!specCompliant || inConstructor && hasSuperClass(thisEnvFn)) {
|
||||
thisPaths.forEach(thisChild => {
|
||||
const thisRef = thisChild.isJSX() ? t.jsxIdentifier(thisBinding) : t.identifier(thisBinding);
|
||||
thisRef.loc = thisChild.node.loc;
|
||||
thisChild.replaceWith(thisRef);
|
||||
});
|
||||
if (specCompliant) thisBinding = null;
|
||||
}
|
||||
}
|
||||
|
||||
return thisBinding;
|
||||
}
|
||||
|
||||
@@ -273,11 +256,11 @@ function standardizeSuperProperty(superProp) {
|
||||
|
||||
if (superProp.node.computed) {
|
||||
const tmp = superProp.scope.generateDeclaredUidIdentifier("tmp");
|
||||
assignmentPath.get("left").replaceWith(t().memberExpression(superProp.node.object, t().assignmentExpression("=", tmp, superProp.node.property), true));
|
||||
assignmentPath.get("right").replaceWith(t().binaryExpression(op, t().memberExpression(superProp.node.object, t().identifier(tmp.name), true), value));
|
||||
assignmentPath.get("left").replaceWith(t.memberExpression(superProp.node.object, t.assignmentExpression("=", tmp, superProp.node.property), true));
|
||||
assignmentPath.get("right").replaceWith(t.binaryExpression(op, t.memberExpression(superProp.node.object, t.identifier(tmp.name), true), value));
|
||||
} else {
|
||||
assignmentPath.get("left").replaceWith(t().memberExpression(superProp.node.object, superProp.node.property));
|
||||
assignmentPath.get("right").replaceWith(t().binaryExpression(op, t().memberExpression(superProp.node.object, t().identifier(superProp.node.property.name)), value));
|
||||
assignmentPath.get("left").replaceWith(t.memberExpression(superProp.node.object, superProp.node.property));
|
||||
assignmentPath.get("right").replaceWith(t.binaryExpression(op, t.memberExpression(superProp.node.object, t.identifier(superProp.node.property.name)), value));
|
||||
}
|
||||
|
||||
return [assignmentPath.get("left"), assignmentPath.get("right").get("left")];
|
||||
@@ -285,13 +268,13 @@ function standardizeSuperProperty(superProp) {
|
||||
const updateExpr = superProp.parentPath;
|
||||
const tmp = superProp.scope.generateDeclaredUidIdentifier("tmp");
|
||||
const computedKey = superProp.node.computed ? superProp.scope.generateDeclaredUidIdentifier("prop") : null;
|
||||
const parts = [t().assignmentExpression("=", tmp, t().memberExpression(superProp.node.object, computedKey ? t().assignmentExpression("=", computedKey, superProp.node.property) : superProp.node.property, superProp.node.computed)), t().assignmentExpression("=", t().memberExpression(superProp.node.object, computedKey ? t().identifier(computedKey.name) : superProp.node.property, superProp.node.computed), t().binaryExpression("+", t().identifier(tmp.name), t().numericLiteral(1)))];
|
||||
const parts = [t.assignmentExpression("=", tmp, t.memberExpression(superProp.node.object, computedKey ? t.assignmentExpression("=", computedKey, superProp.node.property) : superProp.node.property, superProp.node.computed)), t.assignmentExpression("=", t.memberExpression(superProp.node.object, computedKey ? t.identifier(computedKey.name) : superProp.node.property, superProp.node.computed), t.binaryExpression("+", t.identifier(tmp.name), t.numericLiteral(1)))];
|
||||
|
||||
if (!superProp.parentPath.node.prefix) {
|
||||
parts.push(t().identifier(tmp.name));
|
||||
parts.push(t.identifier(tmp.name));
|
||||
}
|
||||
|
||||
updateExpr.replaceWith(t().sequenceExpression(parts));
|
||||
updateExpr.replaceWith(t.sequenceExpression(parts));
|
||||
const left = updateExpr.get("expressions.0.right");
|
||||
const right = updateExpr.get("expressions.1.left");
|
||||
return [left, right];
|
||||
@@ -306,7 +289,7 @@ function hasSuperClass(thisEnvFn) {
|
||||
|
||||
function getThisBinding(thisEnvFn, inConstructor) {
|
||||
return getBinding(thisEnvFn, "this", thisBinding => {
|
||||
if (!inConstructor || !hasSuperClass(thisEnvFn)) return t().thisExpression();
|
||||
if (!inConstructor || !hasSuperClass(thisEnvFn)) return t.thisExpression();
|
||||
const supers = new WeakSet();
|
||||
thisEnvFn.traverse({
|
||||
Function(child) {
|
||||
@@ -322,7 +305,7 @@ function getThisBinding(thisEnvFn, inConstructor) {
|
||||
if (!child.get("callee").isSuper()) return;
|
||||
if (supers.has(child.node)) return;
|
||||
supers.add(child.node);
|
||||
child.replaceWithMultiple([child.node, t().assignmentExpression("=", t().identifier(thisBinding), t().identifier("this"))]);
|
||||
child.replaceWithMultiple([child.node, t.assignmentExpression("=", t.identifier(thisBinding), t.identifier("this"))]);
|
||||
}
|
||||
|
||||
});
|
||||
@@ -332,25 +315,7 @@ function getThisBinding(thisEnvFn, inConstructor) {
|
||||
function getSuperBinding(thisEnvFn) {
|
||||
return getBinding(thisEnvFn, "supercall", () => {
|
||||
const argsBinding = thisEnvFn.scope.generateUidIdentifier("args");
|
||||
return t().arrowFunctionExpression([t().restElement(argsBinding)], t().callExpression(t().super(), [t().spreadElement(t().identifier(argsBinding.name))]));
|
||||
});
|
||||
}
|
||||
|
||||
function getSuperPropCallBinding(thisEnvFn, propName) {
|
||||
return getBinding(thisEnvFn, `superprop_call:${propName || ""}`, () => {
|
||||
const argsBinding = thisEnvFn.scope.generateUidIdentifier("args");
|
||||
const argsList = [t().restElement(argsBinding)];
|
||||
let fnBody;
|
||||
|
||||
if (propName) {
|
||||
fnBody = t().callExpression(t().memberExpression(t().super(), t().identifier(propName)), [t().spreadElement(t().identifier(argsBinding.name))]);
|
||||
} else {
|
||||
const method = thisEnvFn.scope.generateUidIdentifier("prop");
|
||||
argsList.unshift(method);
|
||||
fnBody = t().callExpression(t().memberExpression(t().super(), t().identifier(method.name), true), [t().spreadElement(t().identifier(argsBinding.name))]);
|
||||
}
|
||||
|
||||
return t().arrowFunctionExpression(argsList, fnBody);
|
||||
return t.arrowFunctionExpression([t.restElement(argsBinding)], t.callExpression(t.super(), [t.spreadElement(t.identifier(argsBinding.name))]));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -361,20 +326,20 @@ function getSuperPropBinding(thisEnvFn, isAssignment, propName) {
|
||||
let fnBody;
|
||||
|
||||
if (propName) {
|
||||
fnBody = t().memberExpression(t().super(), t().identifier(propName));
|
||||
fnBody = t.memberExpression(t.super(), t.identifier(propName));
|
||||
} else {
|
||||
const method = thisEnvFn.scope.generateUidIdentifier("prop");
|
||||
argsList.unshift(method);
|
||||
fnBody = t().memberExpression(t().super(), t().identifier(method.name), true);
|
||||
fnBody = t.memberExpression(t.super(), t.identifier(method.name), true);
|
||||
}
|
||||
|
||||
if (isAssignment) {
|
||||
const valueIdent = thisEnvFn.scope.generateUidIdentifier("value");
|
||||
argsList.push(valueIdent);
|
||||
fnBody = t().assignmentExpression("=", fnBody, t().identifier(valueIdent.name));
|
||||
fnBody = t.assignmentExpression("=", fnBody, t.identifier(valueIdent.name));
|
||||
}
|
||||
|
||||
return t().arrowFunctionExpression(argsList, fnBody);
|
||||
return t.arrowFunctionExpression(argsList, fnBody);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
72
node_modules/@babel/traverse/lib/path/family.js
generated
vendored
72
node_modules/@babel/traverse/lib/path/family.js
generated
vendored
@@ -20,17 +20,11 @@ exports.getOuterBindingIdentifierPaths = getOuterBindingIdentifierPaths;
|
||||
|
||||
var _index = _interopRequireDefault(require("./index"));
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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 }; }
|
||||
|
||||
@@ -47,6 +41,57 @@ function addCompletionRecords(path, paths) {
|
||||
return paths;
|
||||
}
|
||||
|
||||
function completionRecordForSwitch(cases, paths) {
|
||||
let isLastCaseWithConsequent = true;
|
||||
|
||||
for (let i = cases.length - 1; i >= 0; i--) {
|
||||
const switchCase = cases[i];
|
||||
const consequent = switchCase.get("consequent");
|
||||
let breakStatement;
|
||||
|
||||
findBreak: for (const statement of consequent) {
|
||||
if (statement.isBlockStatement()) {
|
||||
for (const statementInBlock of statement.get("body")) {
|
||||
if (statementInBlock.isBreakStatement()) {
|
||||
breakStatement = statementInBlock;
|
||||
break findBreak;
|
||||
}
|
||||
}
|
||||
} else if (statement.isBreakStatement()) {
|
||||
breakStatement = statement;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (breakStatement) {
|
||||
while (breakStatement.key === 0 && breakStatement.parentPath.isBlockStatement()) {
|
||||
breakStatement = breakStatement.parentPath;
|
||||
}
|
||||
|
||||
const prevSibling = breakStatement.getPrevSibling();
|
||||
|
||||
if (breakStatement.key > 0 && (prevSibling.isExpressionStatement() || prevSibling.isBlockStatement())) {
|
||||
paths = addCompletionRecords(prevSibling, paths);
|
||||
breakStatement.remove();
|
||||
} else {
|
||||
breakStatement.replaceWith(breakStatement.scope.buildUndefinedNode());
|
||||
paths = addCompletionRecords(breakStatement, paths);
|
||||
}
|
||||
} else if (isLastCaseWithConsequent) {
|
||||
const statementFinder = statement => !statement.isBlockStatement() || statement.get("body").some(statementFinder);
|
||||
|
||||
const hasConsequent = consequent.some(statementFinder);
|
||||
|
||||
if (hasConsequent) {
|
||||
paths = addCompletionRecords(consequent[consequent.length - 1], paths);
|
||||
isLastCaseWithConsequent = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
||||
function getCompletionRecords() {
|
||||
let paths = [];
|
||||
|
||||
@@ -62,9 +107,10 @@ function getCompletionRecords() {
|
||||
} else if (this.isTryStatement()) {
|
||||
paths = addCompletionRecords(this.get("block"), paths);
|
||||
paths = addCompletionRecords(this.get("handler"), paths);
|
||||
paths = addCompletionRecords(this.get("finalizer"), paths);
|
||||
} else if (this.isCatchClause()) {
|
||||
paths = addCompletionRecords(this.get("body"), paths);
|
||||
} else if (this.isSwitchStatement()) {
|
||||
paths = completionRecordForSwitch(this.get("cases"), paths);
|
||||
} else {
|
||||
paths.push(this);
|
||||
}
|
||||
@@ -170,11 +216,11 @@ function _getPattern(parts, context) {
|
||||
}
|
||||
|
||||
function getBindingIdentifiers(duplicates) {
|
||||
return t().getBindingIdentifiers(this.node, duplicates);
|
||||
return t.getBindingIdentifiers(this.node, duplicates);
|
||||
}
|
||||
|
||||
function getOuterBindingIdentifiers(duplicates) {
|
||||
return t().getOuterBindingIdentifiers(this.node, duplicates);
|
||||
return t.getOuterBindingIdentifiers(this.node, duplicates);
|
||||
}
|
||||
|
||||
function getBindingIdentifierPaths(duplicates = false, outerOnly = false) {
|
||||
@@ -186,7 +232,7 @@ function getBindingIdentifierPaths(duplicates = false, outerOnly = false) {
|
||||
const id = search.shift();
|
||||
if (!id) continue;
|
||||
if (!id.node) continue;
|
||||
const keys = t().getBindingIdentifiers.keys[id.node.type];
|
||||
const keys = t.getBindingIdentifiers.keys[id.node.type];
|
||||
|
||||
if (id.isIdentifier()) {
|
||||
if (duplicates) {
|
||||
|
||||
121
node_modules/@babel/traverse/lib/path/index.js
generated
vendored
121
node_modules/@babel/traverse/lib/path/index.js
generated
vendored
@@ -3,45 +3,21 @@
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
exports.default = exports.SHOULD_SKIP = exports.SHOULD_STOP = exports.REMOVED = void 0;
|
||||
|
||||
var virtualTypes = _interopRequireWildcard(require("./lib/virtual-types"));
|
||||
|
||||
function _debug() {
|
||||
const data = _interopRequireDefault(require("debug"));
|
||||
|
||||
_debug = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
var _debug = _interopRequireDefault(require("debug"));
|
||||
|
||||
var _index = _interopRequireDefault(require("../index"));
|
||||
|
||||
var _scope = _interopRequireDefault(require("../scope"));
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
var _cache = require("../cache");
|
||||
|
||||
function _generator() {
|
||||
const data = _interopRequireDefault(require("@babel/generator"));
|
||||
|
||||
_generator = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
var _generator = _interopRequireDefault(require("@babel/generator"));
|
||||
|
||||
var NodePath_ancestry = _interopRequireWildcard(require("./ancestry"));
|
||||
|
||||
@@ -67,19 +43,25 @@ var NodePath_comments = _interopRequireWildcard(require("./comments"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
const debug = (0, _debug().default)("babel");
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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; }
|
||||
|
||||
const debug = (0, _debug.default)("babel");
|
||||
const REMOVED = 1 << 0;
|
||||
exports.REMOVED = REMOVED;
|
||||
const SHOULD_STOP = 1 << 1;
|
||||
exports.SHOULD_STOP = SHOULD_STOP;
|
||||
const SHOULD_SKIP = 1 << 2;
|
||||
exports.SHOULD_SKIP = SHOULD_SKIP;
|
||||
|
||||
class NodePath {
|
||||
constructor(hub, parent) {
|
||||
this.parent = parent;
|
||||
this.hub = hub;
|
||||
this.contexts = [];
|
||||
this.data = Object.create(null);
|
||||
this.shouldSkip = false;
|
||||
this.shouldStop = false;
|
||||
this.removed = false;
|
||||
this.data = null;
|
||||
this._traverseFlags = 0;
|
||||
this.state = null;
|
||||
this.opts = null;
|
||||
this.skipKeys = null;
|
||||
@@ -87,13 +69,10 @@ class NodePath {
|
||||
this.context = null;
|
||||
this.container = null;
|
||||
this.listKey = null;
|
||||
this.inList = false;
|
||||
this.parentKey = null;
|
||||
this.key = null;
|
||||
this.node = null;
|
||||
this.scope = null;
|
||||
this.type = null;
|
||||
this.typeAnnotation = null;
|
||||
}
|
||||
|
||||
static get({
|
||||
@@ -144,10 +123,18 @@ class NodePath {
|
||||
}
|
||||
|
||||
setData(key, val) {
|
||||
if (this.data == null) {
|
||||
this.data = Object.create(null);
|
||||
}
|
||||
|
||||
return this.data[key] = val;
|
||||
}
|
||||
|
||||
getData(key, def) {
|
||||
if (this.data == null) {
|
||||
this.data = Object.create(null);
|
||||
}
|
||||
|
||||
let val = this.data[key];
|
||||
if (val === undefined && def !== undefined) val = this.data[key] = def;
|
||||
return val;
|
||||
@@ -162,7 +149,7 @@ class NodePath {
|
||||
}
|
||||
|
||||
set(key, node) {
|
||||
t().validate(this.node, key, node);
|
||||
t.validate(this.node, key, node);
|
||||
this.node[key] = node;
|
||||
}
|
||||
|
||||
@@ -185,7 +172,57 @@ class NodePath {
|
||||
}
|
||||
|
||||
toString() {
|
||||
return (0, _generator().default)(this.node).code;
|
||||
return (0, _generator.default)(this.node).code;
|
||||
}
|
||||
|
||||
get inList() {
|
||||
return !!this.listKey;
|
||||
}
|
||||
|
||||
set inList(inList) {
|
||||
if (!inList) {
|
||||
this.listKey = null;
|
||||
}
|
||||
}
|
||||
|
||||
get parentKey() {
|
||||
return this.listKey || this.key;
|
||||
}
|
||||
|
||||
get shouldSkip() {
|
||||
return !!(this._traverseFlags & SHOULD_SKIP);
|
||||
}
|
||||
|
||||
set shouldSkip(v) {
|
||||
if (v) {
|
||||
this._traverseFlags |= SHOULD_SKIP;
|
||||
} else {
|
||||
this._traverseFlags &= ~SHOULD_SKIP;
|
||||
}
|
||||
}
|
||||
|
||||
get shouldStop() {
|
||||
return !!(this._traverseFlags & SHOULD_STOP);
|
||||
}
|
||||
|
||||
set shouldStop(v) {
|
||||
if (v) {
|
||||
this._traverseFlags |= SHOULD_STOP;
|
||||
} else {
|
||||
this._traverseFlags &= ~SHOULD_STOP;
|
||||
}
|
||||
}
|
||||
|
||||
get removed() {
|
||||
return !!(this._traverseFlags & REMOVED);
|
||||
}
|
||||
|
||||
set removed(v) {
|
||||
if (v) {
|
||||
this._traverseFlags |= REMOVED;
|
||||
} else {
|
||||
this._traverseFlags &= ~REMOVED;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -193,9 +230,9 @@ class NodePath {
|
||||
exports.default = NodePath;
|
||||
Object.assign(NodePath.prototype, NodePath_ancestry, NodePath_inference, NodePath_replacement, NodePath_evaluation, NodePath_conversion, NodePath_introspection, NodePath_context, NodePath_removal, NodePath_modification, NodePath_family, NodePath_comments);
|
||||
|
||||
for (const type of t().TYPES) {
|
||||
for (const type of t.TYPES) {
|
||||
const typeKey = `is${type}`;
|
||||
const fn = t()[typeKey];
|
||||
const fn = t[typeKey];
|
||||
|
||||
NodePath.prototype[typeKey] = function (opts) {
|
||||
return fn(this.node, opts);
|
||||
@@ -210,7 +247,7 @@ for (const type of t().TYPES) {
|
||||
|
||||
for (const type of Object.keys(virtualTypes)) {
|
||||
if (type[0] === "_") continue;
|
||||
if (t().TYPES.indexOf(type) < 0) t().TYPES.push(type);
|
||||
if (t.TYPES.indexOf(type) < 0) t.TYPES.push(type);
|
||||
const virtualType = virtualTypes[type];
|
||||
|
||||
NodePath.prototype[`is${type}`] = function (opts) {
|
||||
|
||||
46
node_modules/@babel/traverse/lib/path/inference/index.js
generated
vendored
46
node_modules/@babel/traverse/lib/path/inference/index.js
generated
vendored
@@ -12,22 +12,16 @@ exports.isGenericType = isGenericType;
|
||||
|
||||
var inferers = _interopRequireWildcard(require("./inferers"));
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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 getTypeAnnotation() {
|
||||
if (this.typeAnnotation) return this.typeAnnotation;
|
||||
let type = this._getTypeAnnotation() || t().anyTypeAnnotation();
|
||||
if (t().isTypeAnnotation(type)) type = type.typeAnnotation;
|
||||
let type = this._getTypeAnnotation() || t.anyTypeAnnotation();
|
||||
if (t.isTypeAnnotation(type)) type = type.typeAnnotation;
|
||||
return this.typeAnnotation = type;
|
||||
}
|
||||
|
||||
@@ -40,14 +34,14 @@ function _getTypeAnnotation() {
|
||||
const declarParent = declar.parentPath;
|
||||
|
||||
if (declar.key === "left" && declarParent.isForInStatement()) {
|
||||
return t().stringTypeAnnotation();
|
||||
return t.stringTypeAnnotation();
|
||||
}
|
||||
|
||||
if (declar.key === "left" && declarParent.isForOfStatement()) {
|
||||
return t().anyTypeAnnotation();
|
||||
return t.anyTypeAnnotation();
|
||||
}
|
||||
|
||||
return t().voidTypeAnnotation();
|
||||
return t.voidTypeAnnotation();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
@@ -76,19 +70,19 @@ function isBaseType(baseName, soft) {
|
||||
|
||||
function _isBaseType(baseName, type, soft) {
|
||||
if (baseName === "string") {
|
||||
return t().isStringTypeAnnotation(type);
|
||||
return t.isStringTypeAnnotation(type);
|
||||
} else if (baseName === "number") {
|
||||
return t().isNumberTypeAnnotation(type);
|
||||
return t.isNumberTypeAnnotation(type);
|
||||
} else if (baseName === "boolean") {
|
||||
return t().isBooleanTypeAnnotation(type);
|
||||
return t.isBooleanTypeAnnotation(type);
|
||||
} else if (baseName === "any") {
|
||||
return t().isAnyTypeAnnotation(type);
|
||||
return t.isAnyTypeAnnotation(type);
|
||||
} else if (baseName === "mixed") {
|
||||
return t().isMixedTypeAnnotation(type);
|
||||
return t.isMixedTypeAnnotation(type);
|
||||
} else if (baseName === "empty") {
|
||||
return t().isEmptyTypeAnnotation(type);
|
||||
return t.isEmptyTypeAnnotation(type);
|
||||
} else if (baseName === "void") {
|
||||
return t().isVoidTypeAnnotation(type);
|
||||
return t.isVoidTypeAnnotation(type);
|
||||
} else {
|
||||
if (soft) {
|
||||
return false;
|
||||
@@ -100,11 +94,11 @@ function _isBaseType(baseName, type, soft) {
|
||||
|
||||
function couldBeBaseType(name) {
|
||||
const type = this.getTypeAnnotation();
|
||||
if (t().isAnyTypeAnnotation(type)) return true;
|
||||
if (t.isAnyTypeAnnotation(type)) return true;
|
||||
|
||||
if (t().isUnionTypeAnnotation(type)) {
|
||||
if (t.isUnionTypeAnnotation(type)) {
|
||||
for (const type2 of type.types) {
|
||||
if (t().isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) {
|
||||
if (t.isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -119,14 +113,14 @@ function baseTypeStrictlyMatches(right) {
|
||||
const left = this.getTypeAnnotation();
|
||||
right = right.getTypeAnnotation();
|
||||
|
||||
if (!t().isAnyTypeAnnotation(left) && t().isFlowBaseAnnotation(left)) {
|
||||
if (!t.isAnyTypeAnnotation(left) && t.isFlowBaseAnnotation(left)) {
|
||||
return right.type === left.type;
|
||||
}
|
||||
}
|
||||
|
||||
function isGenericType(genericName) {
|
||||
const type = this.getTypeAnnotation();
|
||||
return t().isGenericTypeAnnotation(type) && t().isIdentifier(type.id, {
|
||||
return t.isGenericTypeAnnotation(type) && t.isIdentifier(type.id, {
|
||||
name: genericName
|
||||
});
|
||||
}
|
||||
28
node_modules/@babel/traverse/lib/path/inference/inferer-reference.js
generated
vendored
28
node_modules/@babel/traverse/lib/path/inference/inferer-reference.js
generated
vendored
@@ -5,17 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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(node) {
|
||||
if (!this.isReferenced()) return;
|
||||
@@ -30,9 +24,9 @@ function _default(node) {
|
||||
}
|
||||
|
||||
if (node.name === "undefined") {
|
||||
return t().voidTypeAnnotation();
|
||||
return t.voidTypeAnnotation();
|
||||
} else if (node.name === "NaN" || node.name === "Infinity") {
|
||||
return t().numberTypeAnnotation();
|
||||
return t.numberTypeAnnotation();
|
||||
} else if (node.name === "arguments") {}
|
||||
}
|
||||
|
||||
@@ -57,7 +51,7 @@ function getTypeAnnotationBindingConstantViolations(binding, path, name) {
|
||||
}
|
||||
|
||||
if (types.length) {
|
||||
return t().createUnionTypeAnnotation(types);
|
||||
return t.createUnionTypeAnnotation(types);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +63,7 @@ function getConstantViolationsBefore(binding, path, functions) {
|
||||
|
||||
const status = violation._guessExecutionStatusRelativeTo(path);
|
||||
|
||||
if (functions && status === "function") functions.push(violation);
|
||||
if (functions && status === "unknown") functions.push(violation);
|
||||
return status === "before";
|
||||
});
|
||||
}
|
||||
@@ -95,8 +89,8 @@ function inferAnnotationFromBinaryExpression(name, path) {
|
||||
return target.getTypeAnnotation();
|
||||
}
|
||||
|
||||
if (t().BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t().numberTypeAnnotation();
|
||||
if (t.BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t.numberTypeAnnotation();
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -126,7 +120,7 @@ function inferAnnotationFromBinaryExpression(name, path) {
|
||||
if (!typePath.isLiteral()) return;
|
||||
const typeValue = typePath.node.value;
|
||||
if (typeof typeValue !== "string") return;
|
||||
return t().createTypeAnnotationBasedOnTypeof(typeValue);
|
||||
return t.createTypeAnnotationBasedOnTypeof(typeValue);
|
||||
}
|
||||
|
||||
function getParentConditionalPath(binding, path, name) {
|
||||
@@ -172,7 +166,7 @@ function getConditionalAnnotation(binding, path, name) {
|
||||
|
||||
if (types.length) {
|
||||
return {
|
||||
typeAnnotation: t().createUnionTypeAnnotation(types),
|
||||
typeAnnotation: t.createUnionTypeAnnotation(types),
|
||||
ifStatement
|
||||
};
|
||||
}
|
||||
|
||||
86
node_modules/@babel/traverse/lib/path/inference/inferers.js
generated
vendored
86
node_modules/@babel/traverse/lib/path/inference/inferers.js
generated
vendored
@@ -33,21 +33,15 @@ Object.defineProperty(exports, "Identifier", {
|
||||
}
|
||||
});
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
var _infererReference = _interopRequireDefault(require("./inferer-reference"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
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; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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 VariableDeclarator() {
|
||||
const id = this.get("id");
|
||||
@@ -74,55 +68,55 @@ TypeCastExpression.validParent = true;
|
||||
|
||||
function NewExpression(node) {
|
||||
if (this.get("callee").isIdentifier()) {
|
||||
return t().genericTypeAnnotation(node.callee);
|
||||
return t.genericTypeAnnotation(node.callee);
|
||||
}
|
||||
}
|
||||
|
||||
function TemplateLiteral() {
|
||||
return t().stringTypeAnnotation();
|
||||
return t.stringTypeAnnotation();
|
||||
}
|
||||
|
||||
function UnaryExpression(node) {
|
||||
const operator = node.operator;
|
||||
|
||||
if (operator === "void") {
|
||||
return t().voidTypeAnnotation();
|
||||
} else if (t().NUMBER_UNARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t().numberTypeAnnotation();
|
||||
} else if (t().STRING_UNARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t().stringTypeAnnotation();
|
||||
} else if (t().BOOLEAN_UNARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t().booleanTypeAnnotation();
|
||||
return t.voidTypeAnnotation();
|
||||
} else if (t.NUMBER_UNARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t.numberTypeAnnotation();
|
||||
} else if (t.STRING_UNARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t.stringTypeAnnotation();
|
||||
} else if (t.BOOLEAN_UNARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t.booleanTypeAnnotation();
|
||||
}
|
||||
}
|
||||
|
||||
function BinaryExpression(node) {
|
||||
const operator = node.operator;
|
||||
|
||||
if (t().NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t().numberTypeAnnotation();
|
||||
} else if (t().BOOLEAN_BINARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t().booleanTypeAnnotation();
|
||||
if (t.NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t.numberTypeAnnotation();
|
||||
} else if (t.BOOLEAN_BINARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t.booleanTypeAnnotation();
|
||||
} else if (operator === "+") {
|
||||
const right = this.get("right");
|
||||
const left = this.get("left");
|
||||
|
||||
if (left.isBaseType("number") && right.isBaseType("number")) {
|
||||
return t().numberTypeAnnotation();
|
||||
return t.numberTypeAnnotation();
|
||||
} else if (left.isBaseType("string") || right.isBaseType("string")) {
|
||||
return t().stringTypeAnnotation();
|
||||
return t.stringTypeAnnotation();
|
||||
}
|
||||
|
||||
return t().unionTypeAnnotation([t().stringTypeAnnotation(), t().numberTypeAnnotation()]);
|
||||
return t.unionTypeAnnotation([t.stringTypeAnnotation(), t.numberTypeAnnotation()]);
|
||||
}
|
||||
}
|
||||
|
||||
function LogicalExpression() {
|
||||
return t().createUnionTypeAnnotation([this.get("left").getTypeAnnotation(), this.get("right").getTypeAnnotation()]);
|
||||
return t.createUnionTypeAnnotation([this.get("left").getTypeAnnotation(), this.get("right").getTypeAnnotation()]);
|
||||
}
|
||||
|
||||
function ConditionalExpression() {
|
||||
return t().createUnionTypeAnnotation([this.get("consequent").getTypeAnnotation(), this.get("alternate").getTypeAnnotation()]);
|
||||
return t.createUnionTypeAnnotation([this.get("consequent").getTypeAnnotation(), this.get("alternate").getTypeAnnotation()]);
|
||||
}
|
||||
|
||||
function SequenceExpression() {
|
||||
@@ -141,36 +135,36 @@ function UpdateExpression(node) {
|
||||
const operator = node.operator;
|
||||
|
||||
if (operator === "++" || operator === "--") {
|
||||
return t().numberTypeAnnotation();
|
||||
return t.numberTypeAnnotation();
|
||||
}
|
||||
}
|
||||
|
||||
function StringLiteral() {
|
||||
return t().stringTypeAnnotation();
|
||||
return t.stringTypeAnnotation();
|
||||
}
|
||||
|
||||
function NumericLiteral() {
|
||||
return t().numberTypeAnnotation();
|
||||
return t.numberTypeAnnotation();
|
||||
}
|
||||
|
||||
function BooleanLiteral() {
|
||||
return t().booleanTypeAnnotation();
|
||||
return t.booleanTypeAnnotation();
|
||||
}
|
||||
|
||||
function NullLiteral() {
|
||||
return t().nullLiteralTypeAnnotation();
|
||||
return t.nullLiteralTypeAnnotation();
|
||||
}
|
||||
|
||||
function RegExpLiteral() {
|
||||
return t().genericTypeAnnotation(t().identifier("RegExp"));
|
||||
return t.genericTypeAnnotation(t.identifier("RegExp"));
|
||||
}
|
||||
|
||||
function ObjectExpression() {
|
||||
return t().genericTypeAnnotation(t().identifier("Object"));
|
||||
return t.genericTypeAnnotation(t.identifier("Object"));
|
||||
}
|
||||
|
||||
function ArrayExpression() {
|
||||
return t().genericTypeAnnotation(t().identifier("Array"));
|
||||
return t.genericTypeAnnotation(t.identifier("Array"));
|
||||
}
|
||||
|
||||
function RestElement() {
|
||||
@@ -180,13 +174,13 @@ function RestElement() {
|
||||
RestElement.validParent = true;
|
||||
|
||||
function Func() {
|
||||
return t().genericTypeAnnotation(t().identifier("Function"));
|
||||
return t.genericTypeAnnotation(t.identifier("Function"));
|
||||
}
|
||||
|
||||
const isArrayFrom = t().buildMatchMemberExpression("Array.from");
|
||||
const isObjectKeys = t().buildMatchMemberExpression("Object.keys");
|
||||
const isObjectValues = t().buildMatchMemberExpression("Object.values");
|
||||
const isObjectEntries = t().buildMatchMemberExpression("Object.entries");
|
||||
const isArrayFrom = t.buildMatchMemberExpression("Array.from");
|
||||
const isObjectKeys = t.buildMatchMemberExpression("Object.keys");
|
||||
const isObjectValues = t.buildMatchMemberExpression("Object.values");
|
||||
const isObjectEntries = t.buildMatchMemberExpression("Object.entries");
|
||||
|
||||
function CallExpression() {
|
||||
const {
|
||||
@@ -194,11 +188,11 @@ function CallExpression() {
|
||||
} = this.node;
|
||||
|
||||
if (isObjectKeys(callee)) {
|
||||
return t().arrayTypeAnnotation(t().stringTypeAnnotation());
|
||||
return t.arrayTypeAnnotation(t.stringTypeAnnotation());
|
||||
} else if (isArrayFrom(callee) || isObjectValues(callee)) {
|
||||
return t().arrayTypeAnnotation(t().anyTypeAnnotation());
|
||||
return t.arrayTypeAnnotation(t.anyTypeAnnotation());
|
||||
} else if (isObjectEntries(callee)) {
|
||||
return t().arrayTypeAnnotation(t().tupleTypeAnnotation([t().stringTypeAnnotation(), t().anyTypeAnnotation()]));
|
||||
return t.arrayTypeAnnotation(t.tupleTypeAnnotation([t.stringTypeAnnotation(), t.anyTypeAnnotation()]));
|
||||
}
|
||||
|
||||
return resolveCall(this.get("callee"));
|
||||
@@ -214,9 +208,9 @@ function resolveCall(callee) {
|
||||
if (callee.isFunction()) {
|
||||
if (callee.is("async")) {
|
||||
if (callee.is("generator")) {
|
||||
return t().genericTypeAnnotation(t().identifier("AsyncIterator"));
|
||||
return t.genericTypeAnnotation(t.identifier("AsyncIterator"));
|
||||
} else {
|
||||
return t().genericTypeAnnotation(t().identifier("Promise"));
|
||||
return t.genericTypeAnnotation(t.identifier("Promise"));
|
||||
}
|
||||
} else {
|
||||
if (callee.node.returnType) {
|
||||
|
||||
192
node_modules/@babel/traverse/lib/path/introspection.js
generated
vendored
192
node_modules/@babel/traverse/lib/path/introspection.js
generated
vendored
@@ -24,32 +24,18 @@ exports.isConstantExpression = isConstantExpression;
|
||||
exports.isInStrictMode = isInStrictMode;
|
||||
exports.is = void 0;
|
||||
|
||||
function _includes() {
|
||||
const data = _interopRequireDefault(require("lodash/includes"));
|
||||
var _includes = _interopRequireDefault(require("lodash/includes"));
|
||||
|
||||
_includes = function () {
|
||||
return data;
|
||||
};
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
return data;
|
||||
}
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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 matchesPattern(pattern, allowPartial) {
|
||||
return t().matchesPattern(this.node, pattern, allowPartial);
|
||||
return t.matchesPattern(this.node, pattern, allowPartial);
|
||||
}
|
||||
|
||||
function has(key) {
|
||||
@@ -78,7 +64,7 @@ function equals(key, value) {
|
||||
}
|
||||
|
||||
function isNodeType(type) {
|
||||
return t().isType(this.type, type);
|
||||
return t.isType(this.type, type);
|
||||
}
|
||||
|
||||
function canHaveVariableDeclarationOrExpression() {
|
||||
@@ -91,9 +77,9 @@ function canSwapBetweenExpressionAndStatement(replacement) {
|
||||
}
|
||||
|
||||
if (this.isExpression()) {
|
||||
return t().isBlockStatement(replacement);
|
||||
return t.isBlockStatement(replacement);
|
||||
} else if (this.isBlockStatement()) {
|
||||
return t().isExpression(replacement);
|
||||
return t.isExpression(replacement);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -121,10 +107,10 @@ function isCompletionRecord(allowInsideFunction) {
|
||||
}
|
||||
|
||||
function isStatementOrBlock() {
|
||||
if (this.parentPath.isLabeledStatement() || t().isBlockStatement(this.container)) {
|
||||
if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) {
|
||||
return false;
|
||||
} else {
|
||||
return (0, _includes().default)(t().STATEMENT_OR_BLOCK_KEYS, this.key);
|
||||
return (0, _includes.default)(t.STATEMENT_OR_BLOCK_KEYS, this.key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,81 +158,147 @@ function willIMaybeExecuteBefore(target) {
|
||||
return this._guessExecutionStatusRelativeTo(target) !== "after";
|
||||
}
|
||||
|
||||
function _guessExecutionStatusRelativeTo(target) {
|
||||
const targetFuncParent = target.scope.getFunctionParent() || target.scope.getProgramParent();
|
||||
const selfFuncParent = this.scope.getFunctionParent() || target.scope.getProgramParent();
|
||||
function getOuterFunction(path) {
|
||||
return (path.scope.getFunctionParent() || path.scope.getProgramParent()).path;
|
||||
}
|
||||
|
||||
if (targetFuncParent.node !== selfFuncParent.node) {
|
||||
const status = this._guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent);
|
||||
function isExecutionUncertain(type, key) {
|
||||
switch (type) {
|
||||
case "LogicalExpression":
|
||||
return key === "right";
|
||||
|
||||
if (status) {
|
||||
return status;
|
||||
} else {
|
||||
target = targetFuncParent.path;
|
||||
case "ConditionalExpression":
|
||||
case "IfStatement":
|
||||
return key === "consequent" || key === "alternate";
|
||||
|
||||
case "WhileStatement":
|
||||
case "DoWhileStatement":
|
||||
case "ForInStatement":
|
||||
case "ForOfStatement":
|
||||
return key === "body";
|
||||
|
||||
case "ForStatement":
|
||||
return key === "body" || key === "update";
|
||||
|
||||
case "SwitchStatement":
|
||||
return key === "cases";
|
||||
|
||||
case "TryStatement":
|
||||
return key === "handler";
|
||||
|
||||
case "AssignmentPattern":
|
||||
return key === "right";
|
||||
|
||||
case "OptionalMemberExpression":
|
||||
return key === "property";
|
||||
|
||||
case "OptionalCallExpression":
|
||||
return key === "arguments";
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isExecutionUncertainInList(paths, maxIndex) {
|
||||
for (let i = 0; i < maxIndex; i++) {
|
||||
const path = paths[i];
|
||||
|
||||
if (isExecutionUncertain(path.parent.type, path.parentKey)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
const targetPaths = target.getAncestry();
|
||||
if (targetPaths.indexOf(this) >= 0) return "after";
|
||||
const selfPaths = this.getAncestry();
|
||||
return false;
|
||||
}
|
||||
|
||||
function _guessExecutionStatusRelativeTo(target) {
|
||||
const funcParent = {
|
||||
this: getOuterFunction(this),
|
||||
target: getOuterFunction(target)
|
||||
};
|
||||
|
||||
if (funcParent.target.node !== funcParent.this.node) {
|
||||
return this._guessExecutionStatusRelativeToDifferentFunctions(funcParent.target);
|
||||
}
|
||||
|
||||
const paths = {
|
||||
target: target.getAncestry(),
|
||||
this: this.getAncestry()
|
||||
};
|
||||
if (paths.target.indexOf(this) >= 0) return "after";
|
||||
if (paths.this.indexOf(target) >= 0) return "before";
|
||||
let commonPath;
|
||||
let targetIndex;
|
||||
let selfIndex;
|
||||
const commonIndex = {
|
||||
target: 0,
|
||||
this: 0
|
||||
};
|
||||
|
||||
for (selfIndex = 0; selfIndex < selfPaths.length; selfIndex++) {
|
||||
const selfPath = selfPaths[selfIndex];
|
||||
targetIndex = targetPaths.indexOf(selfPath);
|
||||
while (!commonPath && commonIndex.this < paths.this.length) {
|
||||
const path = paths.this[commonIndex.this];
|
||||
commonIndex.target = paths.target.indexOf(path);
|
||||
|
||||
if (targetIndex >= 0) {
|
||||
commonPath = selfPath;
|
||||
break;
|
||||
if (commonIndex.target >= 0) {
|
||||
commonPath = path;
|
||||
} else {
|
||||
commonIndex.this++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!commonPath) {
|
||||
return "before";
|
||||
throw new Error("Internal Babel error - The two compared nodes" + " don't appear to belong to the same program.");
|
||||
}
|
||||
|
||||
const targetRelationship = targetPaths[targetIndex - 1];
|
||||
const selfRelationship = selfPaths[selfIndex - 1];
|
||||
|
||||
if (!targetRelationship || !selfRelationship) {
|
||||
return "before";
|
||||
if (isExecutionUncertainInList(paths.this, commonIndex.this - 1) || isExecutionUncertainInList(paths.target, commonIndex.target - 1)) {
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
if (targetRelationship.listKey && targetRelationship.container === selfRelationship.container) {
|
||||
return targetRelationship.key > selfRelationship.key ? "before" : "after";
|
||||
const divergence = {
|
||||
this: paths.this[commonIndex.this - 1],
|
||||
target: paths.target[commonIndex.target - 1]
|
||||
};
|
||||
|
||||
if (divergence.target.listKey && divergence.this.listKey && divergence.target.container === divergence.this.container) {
|
||||
return divergence.target.key > divergence.this.key ? "before" : "after";
|
||||
}
|
||||
|
||||
const keys = t().VISITOR_KEYS[commonPath.type];
|
||||
const targetKeyPosition = keys.indexOf(targetRelationship.key);
|
||||
const selfKeyPosition = keys.indexOf(selfRelationship.key);
|
||||
return targetKeyPosition > selfKeyPosition ? "before" : "after";
|
||||
const keys = t.VISITOR_KEYS[commonPath.type];
|
||||
const keyPosition = {
|
||||
this: keys.indexOf(divergence.this.parentKey),
|
||||
target: keys.indexOf(divergence.target.parentKey)
|
||||
};
|
||||
return keyPosition.target > keyPosition.this ? "before" : "after";
|
||||
}
|
||||
|
||||
function _guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent) {
|
||||
const targetFuncPath = targetFuncParent.path;
|
||||
if (!targetFuncPath.isFunctionDeclaration()) return;
|
||||
const binding = targetFuncPath.scope.getBinding(targetFuncPath.node.id.name);
|
||||
if (!binding.references) return "before";
|
||||
const referencePaths = binding.referencePaths;
|
||||
const executionOrderCheckedNodes = new WeakSet();
|
||||
|
||||
for (const path of referencePaths) {
|
||||
if (path.key !== "callee" || !path.parentPath.isCallExpression()) {
|
||||
return;
|
||||
}
|
||||
function _guessExecutionStatusRelativeToDifferentFunctions(target) {
|
||||
if (!target.isFunctionDeclaration() || target.parentPath.isExportDeclaration()) {
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
const binding = target.scope.getBinding(target.node.id.name);
|
||||
if (!binding.references) return "before";
|
||||
const referencePaths = binding.referencePaths;
|
||||
let allStatus;
|
||||
|
||||
for (const path of referencePaths) {
|
||||
const childOfFunction = !!path.find(path => path.node === targetFuncPath.node);
|
||||
const childOfFunction = !!path.find(path => path.node === target.node);
|
||||
if (childOfFunction) continue;
|
||||
|
||||
if (path.key !== "callee" || !path.parentPath.isCallExpression()) {
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
if (executionOrderCheckedNodes.has(path.node)) continue;
|
||||
executionOrderCheckedNodes.add(path.node);
|
||||
|
||||
const status = this._guessExecutionStatusRelativeTo(path);
|
||||
|
||||
if (allStatus) {
|
||||
if (allStatus !== status) return;
|
||||
executionOrderCheckedNodes.delete(path.node);
|
||||
|
||||
if (allStatus && allStatus !== status) {
|
||||
return "unknown";
|
||||
} else {
|
||||
allStatus = status;
|
||||
}
|
||||
@@ -283,7 +335,7 @@ function _resolve(dangerous, resolved) {
|
||||
return this.get("expression").resolve(dangerous, resolved);
|
||||
} else if (dangerous && this.isMemberExpression()) {
|
||||
const targetKey = this.toComputedKey();
|
||||
if (!t().isLiteral(targetKey)) return;
|
||||
if (!t.isLiteral(targetKey)) return;
|
||||
const targetName = targetKey.value;
|
||||
const target = this.get("object").resolve(dangerous, resolved);
|
||||
|
||||
|
||||
33
node_modules/@babel/traverse/lib/path/lib/hoister.js
generated
vendored
33
node_modules/@babel/traverse/lib/path/lib/hoister.js
generated
vendored
@@ -5,21 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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; }
|
||||
|
||||
const referenceVisitor = {
|
||||
ReferencedIdentifier(path, state) {
|
||||
if (path.isJSXIdentifier() && t().react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) {
|
||||
if (path.isJSXIdentifier() && t.react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -37,6 +31,15 @@ const referenceVisitor = {
|
||||
|
||||
const binding = path.scope.getBinding(path.node.name);
|
||||
if (!binding) return;
|
||||
|
||||
for (const violation of binding.constantViolations) {
|
||||
if (violation.scope !== binding.path.scope) {
|
||||
state.mutableBinding = true;
|
||||
path.stop();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (binding !== state.scope.getBinding(path.node.name)) return;
|
||||
state.bindings[path.node.name] = binding;
|
||||
}
|
||||
@@ -47,6 +50,7 @@ class PathHoister {
|
||||
constructor(path, scope) {
|
||||
this.breakOnScopePaths = [];
|
||||
this.bindings = {};
|
||||
this.mutableBinding = false;
|
||||
this.scopes = [];
|
||||
this.scope = scope;
|
||||
this.path = path;
|
||||
@@ -165,21 +169,22 @@ class PathHoister {
|
||||
|
||||
run() {
|
||||
this.path.traverse(referenceVisitor, this);
|
||||
if (this.mutableBinding) return;
|
||||
this.getCompatibleScopes();
|
||||
const attachTo = this.getAttachmentPath();
|
||||
if (!attachTo) return;
|
||||
if (attachTo.getFunctionParent() === this.path.getFunctionParent()) return;
|
||||
let uid = attachTo.scope.generateUidIdentifier("ref");
|
||||
const declarator = t().variableDeclarator(uid, this.path.node);
|
||||
const declarator = t.variableDeclarator(uid, this.path.node);
|
||||
const insertFn = this.attachAfter ? "insertAfter" : "insertBefore";
|
||||
const [attached] = attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : t().variableDeclaration("var", [declarator])]);
|
||||
const [attached] = attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : t.variableDeclaration("var", [declarator])]);
|
||||
const parent = this.path.parentPath;
|
||||
|
||||
if (parent.isJSXElement() && this.path.container === parent.node.children) {
|
||||
uid = t().JSXExpressionContainer(uid);
|
||||
uid = t.JSXExpressionContainer(uid);
|
||||
}
|
||||
|
||||
this.path.replaceWith(t().cloneNode(uid));
|
||||
this.path.replaceWith(t.cloneNode(uid));
|
||||
return attachTo.isVariableDeclarator() ? attached.get("init") : attached.get("declarations.0.init");
|
||||
}
|
||||
|
||||
|
||||
52
node_modules/@babel/traverse/lib/path/lib/virtual-types.js
generated
vendored
52
node_modules/@babel/traverse/lib/path/lib/virtual-types.js
generated
vendored
@@ -5,17 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.ForAwaitStatement = exports.NumericLiteralTypeAnnotation = exports.ExistentialTypeParam = exports.SpreadProperty = exports.RestProperty = exports.Flow = exports.Pure = exports.Generated = exports.User = exports.Var = exports.BlockScoped = exports.Referenced = exports.Scope = exports.Expression = exports.Statement = exports.BindingIdentifier = exports.ReferencedMemberExpression = exports.ReferencedIdentifier = void 0;
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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; }
|
||||
|
||||
const ReferencedIdentifier = {
|
||||
types: ["Identifier", "JSXIdentifier"],
|
||||
@@ -26,15 +20,15 @@ const ReferencedIdentifier = {
|
||||
parent
|
||||
} = path;
|
||||
|
||||
if (!t().isIdentifier(node, opts) && !t().isJSXMemberExpression(parent, opts)) {
|
||||
if (t().isJSXIdentifier(node, opts)) {
|
||||
if (t().react.isCompatTag(node.name)) return false;
|
||||
if (!t.isIdentifier(node, opts) && !t.isJSXMemberExpression(parent, opts)) {
|
||||
if (t.isJSXIdentifier(node, opts)) {
|
||||
if (t.react.isCompatTag(node.name)) return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return t().isReferenced(node, parent, path.parentPath.parent);
|
||||
return t.isReferenced(node, parent, path.parentPath.parent);
|
||||
}
|
||||
|
||||
};
|
||||
@@ -46,7 +40,7 @@ const ReferencedMemberExpression = {
|
||||
node,
|
||||
parent
|
||||
}) {
|
||||
return t().isMemberExpression(node) && t().isReferenced(node, parent);
|
||||
return t.isMemberExpression(node) && t.isReferenced(node, parent);
|
||||
}
|
||||
|
||||
};
|
||||
@@ -60,7 +54,7 @@ const BindingIdentifier = {
|
||||
parent
|
||||
} = path;
|
||||
const grandparent = path.parentPath.parent;
|
||||
return t().isIdentifier(node) && t().isBinding(node, parent, grandparent);
|
||||
return t.isIdentifier(node) && t.isBinding(node, parent, grandparent);
|
||||
}
|
||||
|
||||
};
|
||||
@@ -72,12 +66,12 @@ const Statement = {
|
||||
node,
|
||||
parent
|
||||
}) {
|
||||
if (t().isStatement(node)) {
|
||||
if (t().isVariableDeclaration(node)) {
|
||||
if (t().isForXStatement(parent, {
|
||||
if (t.isStatement(node)) {
|
||||
if (t.isVariableDeclaration(node)) {
|
||||
if (t.isForXStatement(parent, {
|
||||
left: node
|
||||
})) return false;
|
||||
if (t().isForStatement(parent, {
|
||||
if (t.isForStatement(parent, {
|
||||
init: node
|
||||
})) return false;
|
||||
}
|
||||
@@ -97,31 +91,31 @@ const Expression = {
|
||||
if (path.isIdentifier()) {
|
||||
return path.isReferencedIdentifier();
|
||||
} else {
|
||||
return t().isExpression(path.node);
|
||||
return t.isExpression(path.node);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
exports.Expression = Expression;
|
||||
const Scope = {
|
||||
types: ["Scopable"],
|
||||
types: ["Scopable", "Pattern"],
|
||||
|
||||
checkPath(path) {
|
||||
return t().isScope(path.node, path.parent);
|
||||
return t.isScope(path.node, path.parent);
|
||||
}
|
||||
|
||||
};
|
||||
exports.Scope = Scope;
|
||||
const Referenced = {
|
||||
checkPath(path) {
|
||||
return t().isReferenced(path.node, path.parent);
|
||||
return t.isReferenced(path.node, path.parent);
|
||||
}
|
||||
|
||||
};
|
||||
exports.Referenced = Referenced;
|
||||
const BlockScoped = {
|
||||
checkPath(path) {
|
||||
return t().isBlockScoped(path.node);
|
||||
return t.isBlockScoped(path.node);
|
||||
}
|
||||
|
||||
};
|
||||
@@ -130,7 +124,7 @@ const Var = {
|
||||
types: ["VariableDeclaration"],
|
||||
|
||||
checkPath(path) {
|
||||
return t().isVar(path.node);
|
||||
return t.isVar(path.node);
|
||||
}
|
||||
|
||||
};
|
||||
@@ -162,13 +156,13 @@ const Flow = {
|
||||
checkPath({
|
||||
node
|
||||
}) {
|
||||
if (t().isFlow(node)) {
|
||||
if (t.isFlow(node)) {
|
||||
return true;
|
||||
} else if (t().isImportDeclaration(node)) {
|
||||
} else if (t.isImportDeclaration(node)) {
|
||||
return node.importKind === "type" || node.importKind === "typeof";
|
||||
} else if (t().isExportDeclaration(node)) {
|
||||
} else if (t.isExportDeclaration(node)) {
|
||||
return node.exportKind === "type";
|
||||
} else if (t().isImportSpecifier(node)) {
|
||||
} else if (t.isImportSpecifier(node)) {
|
||||
return node.importKind === "type" || node.importKind === "typeof";
|
||||
} else {
|
||||
return false;
|
||||
|
||||
24
node_modules/@babel/traverse/lib/path/modification.js
generated
vendored
24
node_modules/@babel/traverse/lib/path/modification.js
generated
vendored
@@ -20,17 +20,11 @@ var _hoister = _interopRequireDefault(require("./lib/hoister"));
|
||||
|
||||
var _index = _interopRequireDefault(require("./index"));
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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 }; }
|
||||
|
||||
@@ -51,7 +45,7 @@ function insertBefore(nodes) {
|
||||
return this._containerInsertBefore(nodes);
|
||||
} else if (this.isStatementOrBlock()) {
|
||||
const shouldInsertCurrentNode = this.node && (!this.isExpressionStatement() || this.node.expression != null);
|
||||
this.replaceWith(t().blockStatement(shouldInsertCurrentNode ? [this.node] : []));
|
||||
this.replaceWith(t.blockStatement(shouldInsertCurrentNode ? [this.node] : []));
|
||||
return this.unshiftContainer("body", nodes);
|
||||
} else {
|
||||
throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?");
|
||||
@@ -105,9 +99,9 @@ function insertAfter(nodes) {
|
||||
|
||||
if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || parentPath.isExportNamedDeclaration() || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {
|
||||
return parentPath.insertAfter(nodes.map(node => {
|
||||
return t().isExpression(node) ? t().expressionStatement(node) : node;
|
||||
return t.isExpression(node) ? t.expressionStatement(node) : node;
|
||||
}));
|
||||
} else if (this.isNodeType("Expression") && !this.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
|
||||
} else if (this.isNodeType("Expression") && !this.isJSXElement() && !parentPath.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
|
||||
if (this.node) {
|
||||
let {
|
||||
scope
|
||||
@@ -121,8 +115,8 @@ function insertAfter(nodes) {
|
||||
}
|
||||
|
||||
const temp = scope.generateDeclaredUidIdentifier();
|
||||
nodes.unshift(t().expressionStatement(t().assignmentExpression("=", t().cloneNode(temp), this.node)));
|
||||
nodes.push(t().expressionStatement(t().cloneNode(temp)));
|
||||
nodes.unshift(t.expressionStatement(t.assignmentExpression("=", t.cloneNode(temp), this.node)));
|
||||
nodes.push(t.expressionStatement(t.cloneNode(temp)));
|
||||
}
|
||||
|
||||
return this.replaceExpressionWithStatements(nodes);
|
||||
@@ -130,7 +124,7 @@ function insertAfter(nodes) {
|
||||
return this._containerInsertAfter(nodes);
|
||||
} else if (this.isStatementOrBlock()) {
|
||||
const shouldInsertCurrentNode = this.node && (!this.isExpressionStatement() || this.node.expression != null);
|
||||
this.replaceWith(t().blockStatement(shouldInsertCurrentNode ? [this.node] : []));
|
||||
this.replaceWith(t.blockStatement(shouldInsertCurrentNode ? [this.node] : []));
|
||||
return this.pushContainer("body", nodes);
|
||||
} else {
|
||||
throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?");
|
||||
|
||||
5
node_modules/@babel/traverse/lib/path/removal.js
generated
vendored
5
node_modules/@babel/traverse/lib/path/removal.js
generated
vendored
@@ -12,6 +12,8 @@ exports._assertUnremoved = _assertUnremoved;
|
||||
|
||||
var _removalHooks = require("./lib/removal-hooks");
|
||||
|
||||
var _index = require("./index");
|
||||
|
||||
function remove() {
|
||||
this._assertUnremoved();
|
||||
|
||||
@@ -53,8 +55,7 @@ function _remove() {
|
||||
}
|
||||
|
||||
function _markRemoved() {
|
||||
this.shouldSkip = true;
|
||||
this.removed = true;
|
||||
this._traverseFlags |= _index.SHOULD_SKIP | _index.REMOVED;
|
||||
this.node = null;
|
||||
}
|
||||
|
||||
|
||||
76
node_modules/@babel/traverse/lib/path/replacement.js
generated
vendored
76
node_modules/@babel/traverse/lib/path/replacement.js
generated
vendored
@@ -10,41 +10,19 @@ exports._replaceWith = _replaceWith;
|
||||
exports.replaceExpressionWithStatements = replaceExpressionWithStatements;
|
||||
exports.replaceInline = replaceInline;
|
||||
|
||||
function _codeFrame() {
|
||||
const data = require("@babel/code-frame");
|
||||
|
||||
_codeFrame = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
var _codeFrame = require("@babel/code-frame");
|
||||
|
||||
var _index = _interopRequireDefault(require("../index"));
|
||||
|
||||
var _index2 = _interopRequireDefault(require("./index"));
|
||||
|
||||
function _parser() {
|
||||
const data = require("@babel/parser");
|
||||
var _parser = require("@babel/parser");
|
||||
|
||||
_parser = function () {
|
||||
return data;
|
||||
};
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
return data;
|
||||
}
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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 }; }
|
||||
|
||||
@@ -67,7 +45,7 @@ const hoistVariablesVisitor = {
|
||||
|
||||
for (const declar of path.node.declarations) {
|
||||
if (declar.init) {
|
||||
exprs.push(t().expressionStatement(t().assignmentExpression("=", declar.id, declar.init)));
|
||||
exprs.push(t.expressionStatement(t.assignmentExpression("=", declar.id, declar.init)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,8 +57,8 @@ const hoistVariablesVisitor = {
|
||||
function replaceWithMultiple(nodes) {
|
||||
this.resync();
|
||||
nodes = this._verifyNodeList(nodes);
|
||||
t().inheritLeadingComments(nodes[0], this.node);
|
||||
t().inheritTrailingComments(nodes[nodes.length - 1], this.node);
|
||||
t.inheritLeadingComments(nodes[0], this.node);
|
||||
t.inheritTrailingComments(nodes[nodes.length - 1], this.node);
|
||||
this.node = this.container[this.key] = null;
|
||||
const paths = this.insertAfter(nodes);
|
||||
|
||||
@@ -98,12 +76,12 @@ function replaceWithSourceString(replacement) {
|
||||
|
||||
try {
|
||||
replacement = `(${replacement})`;
|
||||
replacement = (0, _parser().parse)(replacement);
|
||||
replacement = (0, _parser.parse)(replacement);
|
||||
} catch (err) {
|
||||
const loc = err.loc;
|
||||
|
||||
if (loc) {
|
||||
err.message += " - make sure this is an expression.\n" + (0, _codeFrame().codeFrameColumns)(replacement, {
|
||||
err.message += " - make sure this is an expression.\n" + (0, _codeFrame.codeFrameColumns)(replacement, {
|
||||
start: {
|
||||
line: loc.line,
|
||||
column: loc.column + 1
|
||||
@@ -141,7 +119,7 @@ function replaceWith(replacement) {
|
||||
return [this];
|
||||
}
|
||||
|
||||
if (this.isProgram() && !t().isProgram(replacement)) {
|
||||
if (this.isProgram() && !t.isProgram(replacement)) {
|
||||
throw new Error("You can only replace a Program root node with another Program node");
|
||||
}
|
||||
|
||||
@@ -155,14 +133,14 @@ function replaceWith(replacement) {
|
||||
|
||||
let nodePath = "";
|
||||
|
||||
if (this.isNodeType("Statement") && t().isExpression(replacement)) {
|
||||
if (this.isNodeType("Statement") && t.isExpression(replacement)) {
|
||||
if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement) && !this.parentPath.isExportDefaultDeclaration()) {
|
||||
replacement = t().expressionStatement(replacement);
|
||||
replacement = t.expressionStatement(replacement);
|
||||
nodePath = "expression";
|
||||
}
|
||||
}
|
||||
|
||||
if (this.isNodeType("Expression") && t().isStatement(replacement)) {
|
||||
if (this.isNodeType("Expression") && t.isStatement(replacement)) {
|
||||
if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) {
|
||||
return this.replaceExpressionWithStatements([replacement]);
|
||||
}
|
||||
@@ -171,8 +149,8 @@ function replaceWith(replacement) {
|
||||
const oldNode = this.node;
|
||||
|
||||
if (oldNode) {
|
||||
t().inheritsComments(replacement, oldNode);
|
||||
t().removeComments(oldNode);
|
||||
t.inheritsComments(replacement, oldNode);
|
||||
t.removeComments(oldNode);
|
||||
}
|
||||
|
||||
this._replaceWith(replacement);
|
||||
@@ -189,9 +167,9 @@ function _replaceWith(node) {
|
||||
}
|
||||
|
||||
if (this.inList) {
|
||||
t().validate(this.parent, this.key, [node]);
|
||||
t.validate(this.parent, this.key, [node]);
|
||||
} else {
|
||||
t().validate(this.parent, this.key, node);
|
||||
t.validate(this.parent, this.key, node);
|
||||
}
|
||||
|
||||
this.debug(`Replace with ${node && node.type}`);
|
||||
@@ -200,7 +178,7 @@ function _replaceWith(node) {
|
||||
|
||||
function replaceExpressionWithStatements(nodes) {
|
||||
this.resync();
|
||||
const toSequenceExpression = t().toSequenceExpression(nodes, this.scope);
|
||||
const toSequenceExpression = t.toSequenceExpression(nodes, this.scope);
|
||||
|
||||
if (toSequenceExpression) {
|
||||
return this.replaceWith(toSequenceExpression)[0].get("expressions");
|
||||
@@ -208,8 +186,8 @@ function replaceExpressionWithStatements(nodes) {
|
||||
|
||||
const functionParent = this.getFunctionParent();
|
||||
const isParentAsync = functionParent && functionParent.is("async");
|
||||
const container = t().arrowFunctionExpression([], t().blockStatement(nodes));
|
||||
this.replaceWith(t().callExpression(container, []));
|
||||
const container = t.arrowFunctionExpression([], t.blockStatement(nodes));
|
||||
this.replaceWith(t.callExpression(container, []));
|
||||
this.traverse(hoistVariablesVisitor);
|
||||
const completionRecords = this.get("callee").getCompletionRecords();
|
||||
|
||||
@@ -223,24 +201,24 @@ function replaceExpressionWithStatements(nodes) {
|
||||
if (!uid) {
|
||||
const callee = this.get("callee");
|
||||
uid = callee.scope.generateDeclaredUidIdentifier("ret");
|
||||
callee.get("body").pushContainer("body", t().returnStatement(t().cloneNode(uid)));
|
||||
callee.get("body").pushContainer("body", t.returnStatement(t.cloneNode(uid)));
|
||||
loop.setData("expressionReplacementReturnUid", uid);
|
||||
} else {
|
||||
uid = t().identifier(uid.name);
|
||||
uid = t.identifier(uid.name);
|
||||
}
|
||||
|
||||
path.get("expression").replaceWith(t().assignmentExpression("=", t().cloneNode(uid), path.node.expression));
|
||||
path.get("expression").replaceWith(t.assignmentExpression("=", t.cloneNode(uid), path.node.expression));
|
||||
} else {
|
||||
path.replaceWith(t().returnStatement(path.node.expression));
|
||||
path.replaceWith(t.returnStatement(path.node.expression));
|
||||
}
|
||||
}
|
||||
|
||||
const callee = this.get("callee");
|
||||
callee.arrowFunctionToExpression();
|
||||
|
||||
if (isParentAsync && _index.default.hasType(this.get("callee.body").node, "AwaitExpression", t().FUNCTION_TYPES)) {
|
||||
if (isParentAsync && _index.default.hasType(this.get("callee.body").node, "AwaitExpression", t.FUNCTION_TYPES)) {
|
||||
callee.set("async", true);
|
||||
this.replaceWith(t().awaitExpression(this.node));
|
||||
this.replaceWith(t.awaitExpression(this.node));
|
||||
}
|
||||
|
||||
return callee.get("body.body");
|
||||
|
||||
190
node_modules/@babel/traverse/lib/scope/index.js
generated
vendored
190
node_modules/@babel/traverse/lib/scope/index.js
generated
vendored
@@ -5,70 +5,32 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _includes() {
|
||||
const data = _interopRequireDefault(require("lodash/includes"));
|
||||
var _includes = _interopRequireDefault(require("lodash/includes"));
|
||||
|
||||
_includes = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _repeat() {
|
||||
const data = _interopRequireDefault(require("lodash/repeat"));
|
||||
|
||||
_repeat = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
var _repeat = _interopRequireDefault(require("lodash/repeat"));
|
||||
|
||||
var _renamer = _interopRequireDefault(require("./lib/renamer"));
|
||||
|
||||
var _index = _interopRequireDefault(require("../index"));
|
||||
|
||||
function _defaults() {
|
||||
const data = _interopRequireDefault(require("lodash/defaults"));
|
||||
|
||||
_defaults = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
var _defaults = _interopRequireDefault(require("lodash/defaults"));
|
||||
|
||||
var _binding = _interopRequireDefault(require("./binding"));
|
||||
|
||||
function _globals() {
|
||||
const data = _interopRequireDefault(require("globals"));
|
||||
var _globals = _interopRequireDefault(require("globals"));
|
||||
|
||||
_globals = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
var _cache = require("../cache");
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
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; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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 gatherNodeParts(node, parts) {
|
||||
if (t().isModuleDeclaration(node)) {
|
||||
if (t.isModuleDeclaration(node)) {
|
||||
if (node.source) {
|
||||
gatherNodeParts(node.source, parts);
|
||||
} else if (node.specifiers && node.specifiers.length) {
|
||||
@@ -78,33 +40,33 @@ function gatherNodeParts(node, parts) {
|
||||
} else if (node.declaration) {
|
||||
gatherNodeParts(node.declaration, parts);
|
||||
}
|
||||
} else if (t().isModuleSpecifier(node)) {
|
||||
} else if (t.isModuleSpecifier(node)) {
|
||||
gatherNodeParts(node.local, parts);
|
||||
} else if (t().isMemberExpression(node)) {
|
||||
} else if (t.isMemberExpression(node)) {
|
||||
gatherNodeParts(node.object, parts);
|
||||
gatherNodeParts(node.property, parts);
|
||||
} else if (t().isIdentifier(node)) {
|
||||
} else if (t.isIdentifier(node)) {
|
||||
parts.push(node.name);
|
||||
} else if (t().isLiteral(node)) {
|
||||
} else if (t.isLiteral(node)) {
|
||||
parts.push(node.value);
|
||||
} else if (t().isCallExpression(node)) {
|
||||
} else if (t.isCallExpression(node)) {
|
||||
gatherNodeParts(node.callee, parts);
|
||||
} else if (t().isObjectExpression(node) || t().isObjectPattern(node)) {
|
||||
} else if (t.isObjectExpression(node) || t.isObjectPattern(node)) {
|
||||
for (const prop of node.properties) {
|
||||
gatherNodeParts(prop.key || prop.argument, parts);
|
||||
}
|
||||
} else if (t().isPrivateName(node)) {
|
||||
} else if (t.isPrivateName(node)) {
|
||||
gatherNodeParts(node.id, parts);
|
||||
} else if (t().isThisExpression(node)) {
|
||||
} else if (t.isThisExpression(node)) {
|
||||
parts.push("this");
|
||||
} else if (t().isSuper(node)) {
|
||||
} else if (t.isSuper(node)) {
|
||||
parts.push("super");
|
||||
}
|
||||
}
|
||||
|
||||
const collectorVisitor = {
|
||||
For(path) {
|
||||
for (const key of t().FOR_INIT_KEYS) {
|
||||
for (const key of t.FOR_INIT_KEYS) {
|
||||
const declar = path.get(key);
|
||||
|
||||
if (declar.isVar()) {
|
||||
@@ -145,14 +107,14 @@ const collectorVisitor = {
|
||||
} = path;
|
||||
const declar = node.declaration;
|
||||
|
||||
if (t().isClassDeclaration(declar) || t().isFunctionDeclaration(declar)) {
|
||||
if (t.isClassDeclaration(declar) || t.isFunctionDeclaration(declar)) {
|
||||
const id = declar.id;
|
||||
if (!id) return;
|
||||
const binding = scope.getBinding(id.name);
|
||||
if (binding) binding.reference(path);
|
||||
} else if (t().isVariableDeclaration(declar)) {
|
||||
} else if (t.isVariableDeclaration(declar)) {
|
||||
for (const decl of declar.declarations) {
|
||||
for (const name of Object.keys(t().getBindingIdentifiers(decl))) {
|
||||
for (const name of Object.keys(t.getBindingIdentifiers(decl))) {
|
||||
const binding = scope.getBinding(name);
|
||||
if (binding) binding.reference(path);
|
||||
}
|
||||
@@ -184,14 +146,14 @@ const collectorVisitor = {
|
||||
BlockScoped(path) {
|
||||
let scope = path.scope;
|
||||
if (scope.path === path) scope = scope.parent;
|
||||
scope.getBlockParent().registerDeclaration(path);
|
||||
},
|
||||
const parent = scope.getBlockParent();
|
||||
parent.registerDeclaration(path);
|
||||
|
||||
ClassDeclaration(path) {
|
||||
const id = path.node.id;
|
||||
if (!id) return;
|
||||
const name = id.name;
|
||||
path.scope.bindings[name] = path.scope.getBinding(name);
|
||||
if (path.isClassDeclaration() && path.node.id) {
|
||||
const id = path.node.id;
|
||||
const name = id.name;
|
||||
path.scope.bindings[name] = path.scope.parent.getBinding(name);
|
||||
}
|
||||
},
|
||||
|
||||
Block(path) {
|
||||
@@ -249,15 +211,15 @@ class Scope {
|
||||
this.push({
|
||||
id
|
||||
});
|
||||
return t().cloneNode(id);
|
||||
return t.cloneNode(id);
|
||||
}
|
||||
|
||||
generateUidIdentifier(name) {
|
||||
return t().identifier(this.generateUid(name));
|
||||
return t.identifier(this.generateUid(name));
|
||||
}
|
||||
|
||||
generateUid(name = "temp") {
|
||||
name = t().toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, "");
|
||||
name = t.toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, "");
|
||||
let uid;
|
||||
let i = 0;
|
||||
|
||||
@@ -281,11 +243,11 @@ class Scope {
|
||||
generateUidBasedOnNode(parent, defaultName) {
|
||||
let node = parent;
|
||||
|
||||
if (t().isAssignmentExpression(parent)) {
|
||||
if (t.isAssignmentExpression(parent)) {
|
||||
node = parent.left;
|
||||
} else if (t().isVariableDeclarator(parent)) {
|
||||
} else if (t.isVariableDeclarator(parent)) {
|
||||
node = parent.id;
|
||||
} else if (t().isObjectProperty(node) || t().isObjectMethod(node)) {
|
||||
} else if (t.isObjectProperty(node) || t.isObjectMethod(node)) {
|
||||
node = node.key;
|
||||
}
|
||||
|
||||
@@ -297,15 +259,15 @@ class Scope {
|
||||
}
|
||||
|
||||
generateUidIdentifierBasedOnNode(parent, defaultName) {
|
||||
return t().identifier(this.generateUidBasedOnNode(parent, defaultName));
|
||||
return t.identifier(this.generateUidBasedOnNode(parent, defaultName));
|
||||
}
|
||||
|
||||
isStatic(node) {
|
||||
if (t().isThisExpression(node) || t().isSuper(node)) {
|
||||
if (t.isThisExpression(node) || t.isSuper(node)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (t().isIdentifier(node)) {
|
||||
if (t.isIdentifier(node)) {
|
||||
const binding = this.getBinding(node.name);
|
||||
|
||||
if (binding) {
|
||||
@@ -328,7 +290,7 @@ class Scope {
|
||||
this.push({
|
||||
id
|
||||
});
|
||||
return t().cloneNode(id);
|
||||
return t.cloneNode(id);
|
||||
}
|
||||
|
||||
return id;
|
||||
@@ -362,7 +324,7 @@ class Scope {
|
||||
}
|
||||
|
||||
dump() {
|
||||
const sep = (0, _repeat().default)("-", 60);
|
||||
const sep = (0, _repeat.default)("-", 60);
|
||||
console.log(sep);
|
||||
let scope = this;
|
||||
|
||||
@@ -384,7 +346,7 @@ class Scope {
|
||||
}
|
||||
|
||||
toArray(node, i) {
|
||||
if (t().isIdentifier(node)) {
|
||||
if (t.isIdentifier(node)) {
|
||||
const binding = this.getBinding(node.name);
|
||||
|
||||
if (binding && binding.constant && binding.path.isGenericType("Array")) {
|
||||
@@ -392,14 +354,14 @@ class Scope {
|
||||
}
|
||||
}
|
||||
|
||||
if (t().isArrayExpression(node)) {
|
||||
if (t.isArrayExpression(node)) {
|
||||
return node;
|
||||
}
|
||||
|
||||
if (t().isIdentifier(node, {
|
||||
if (t.isIdentifier(node, {
|
||||
name: "arguments"
|
||||
})) {
|
||||
return t().callExpression(t().memberExpression(t().memberExpression(t().memberExpression(t().identifier("Array"), t().identifier("prototype")), t().identifier("slice")), t().identifier("call")), [node]);
|
||||
return t.callExpression(t.memberExpression(t.memberExpression(t.memberExpression(t.identifier("Array"), t.identifier("prototype")), t.identifier("slice")), t.identifier("call")), [node]);
|
||||
}
|
||||
|
||||
let helperName;
|
||||
@@ -408,13 +370,13 @@ class Scope {
|
||||
if (i === true) {
|
||||
helperName = "toConsumableArray";
|
||||
} else if (i) {
|
||||
args.push(t().numericLiteral(i));
|
||||
args.push(t.numericLiteral(i));
|
||||
helperName = "slicedToArray";
|
||||
} else {
|
||||
helperName = "toArray";
|
||||
}
|
||||
|
||||
return t().callExpression(this.hub.addHelper(helperName), args);
|
||||
return t.callExpression(this.hub.addHelper(helperName), args);
|
||||
}
|
||||
|
||||
hasLabel(name) {
|
||||
@@ -460,11 +422,7 @@ class Scope {
|
||||
}
|
||||
|
||||
buildUndefinedNode() {
|
||||
if (this.hasBinding("undefined")) {
|
||||
return t().unaryExpression("void", t().numericLiteral(0), true);
|
||||
} else {
|
||||
return t().identifier("undefined");
|
||||
}
|
||||
return t.unaryExpression("void", t.numericLiteral(0), true);
|
||||
}
|
||||
|
||||
registerConstantViolation(path) {
|
||||
@@ -552,56 +510,56 @@ class Scope {
|
||||
}
|
||||
|
||||
isPure(node, constantsOnly) {
|
||||
if (t().isIdentifier(node)) {
|
||||
if (t.isIdentifier(node)) {
|
||||
const binding = this.getBinding(node.name);
|
||||
if (!binding) return false;
|
||||
if (constantsOnly) return binding.constant;
|
||||
return true;
|
||||
} else if (t().isClass(node)) {
|
||||
} else if (t.isClass(node)) {
|
||||
if (node.superClass && !this.isPure(node.superClass, constantsOnly)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.isPure(node.body, constantsOnly);
|
||||
} else if (t().isClassBody(node)) {
|
||||
} else if (t.isClassBody(node)) {
|
||||
for (const method of node.body) {
|
||||
if (!this.isPure(method, constantsOnly)) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (t().isBinary(node)) {
|
||||
} else if (t.isBinary(node)) {
|
||||
return this.isPure(node.left, constantsOnly) && this.isPure(node.right, constantsOnly);
|
||||
} else if (t().isArrayExpression(node)) {
|
||||
} else if (t.isArrayExpression(node)) {
|
||||
for (const elem of node.elements) {
|
||||
if (!this.isPure(elem, constantsOnly)) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (t().isObjectExpression(node)) {
|
||||
} else if (t.isObjectExpression(node)) {
|
||||
for (const prop of node.properties) {
|
||||
if (!this.isPure(prop, constantsOnly)) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (t().isClassMethod(node)) {
|
||||
} else if (t.isClassMethod(node)) {
|
||||
if (node.computed && !this.isPure(node.key, constantsOnly)) return false;
|
||||
if (node.kind === "get" || node.kind === "set") return false;
|
||||
return true;
|
||||
} else if (t().isProperty(node)) {
|
||||
} else if (t.isProperty(node)) {
|
||||
if (node.computed && !this.isPure(node.key, constantsOnly)) return false;
|
||||
return this.isPure(node.value, constantsOnly);
|
||||
} else if (t().isUnaryExpression(node)) {
|
||||
} else if (t.isUnaryExpression(node)) {
|
||||
return this.isPure(node.argument, constantsOnly);
|
||||
} else if (t().isTaggedTemplateExpression(node)) {
|
||||
return t().matchesPattern(node.tag, "String.raw") && !this.hasBinding("String", true) && this.isPure(node.quasi, constantsOnly);
|
||||
} else if (t().isTemplateLiteral(node)) {
|
||||
} else if (t.isTaggedTemplateExpression(node)) {
|
||||
return t.matchesPattern(node.tag, "String.raw") && !this.hasBinding("String", true) && this.isPure(node.quasi, constantsOnly);
|
||||
} else if (t.isTemplateLiteral(node)) {
|
||||
for (const expression of node.expressions) {
|
||||
if (!this.isPure(expression, constantsOnly)) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return t().isPureish(node);
|
||||
return t.isPureish(node);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -640,20 +598,20 @@ class Scope {
|
||||
this.data = Object.create(null);
|
||||
|
||||
if (path.isLoop()) {
|
||||
for (const key of t().FOR_INIT_KEYS) {
|
||||
for (const key of t.FOR_INIT_KEYS) {
|
||||
const node = path.get(key);
|
||||
if (node.isBlockScoped()) this.registerBinding(node.node.kind, node);
|
||||
}
|
||||
}
|
||||
|
||||
if (path.isFunctionExpression() && path.has("id")) {
|
||||
if (!path.get("id").node[t().NOT_LOCAL_BINDING]) {
|
||||
if (!path.get("id").node[t.NOT_LOCAL_BINDING]) {
|
||||
this.registerBinding("local", path.get("id"), path);
|
||||
}
|
||||
}
|
||||
|
||||
if (path.isClassExpression() && path.has("id")) {
|
||||
if (!path.get("id").node[t().NOT_LOCAL_BINDING]) {
|
||||
if (!path.get("id").node[t.NOT_LOCAL_BINDING]) {
|
||||
this.registerBinding("local", path);
|
||||
}
|
||||
}
|
||||
@@ -732,13 +690,13 @@ class Scope {
|
||||
let declarPath = !unique && path.getData(dataKey);
|
||||
|
||||
if (!declarPath) {
|
||||
const declar = t().variableDeclaration(kind, []);
|
||||
const declar = t.variableDeclaration(kind, []);
|
||||
declar._blockHoist = blockHoist;
|
||||
[declarPath] = path.unshiftContainer("body", [declar]);
|
||||
if (!unique) path.setData(dataKey, declarPath);
|
||||
}
|
||||
|
||||
const declarator = t().variableDeclarator(opts.id, opts.init);
|
||||
const declarator = t.variableDeclarator(opts.id, opts.init);
|
||||
declarPath.node.declarations.push(declarator);
|
||||
this.registerBinding(kind, declarPath.get("declarations").pop());
|
||||
}
|
||||
@@ -784,7 +742,7 @@ class Scope {
|
||||
let scope = this;
|
||||
|
||||
do {
|
||||
(0, _defaults().default)(ids, scope.bindings);
|
||||
(0, _defaults.default)(ids, scope.bindings);
|
||||
scope = scope.parent;
|
||||
} while (scope);
|
||||
|
||||
@@ -816,10 +774,18 @@ class Scope {
|
||||
|
||||
getBinding(name) {
|
||||
let scope = this;
|
||||
let previousPath;
|
||||
|
||||
do {
|
||||
const binding = scope.getOwnBinding(name);
|
||||
if (binding) return binding;
|
||||
|
||||
if (binding) {
|
||||
if (previousPath && previousPath.isPattern() && previousPath.parentPath.isFunction() && binding.kind !== "param") {} else {
|
||||
return binding;
|
||||
}
|
||||
}
|
||||
|
||||
previousPath = scope.path;
|
||||
} while (scope = scope.parent);
|
||||
}
|
||||
|
||||
@@ -846,8 +812,8 @@ class Scope {
|
||||
if (this.hasOwnBinding(name)) return true;
|
||||
if (this.parentHasBinding(name, noGlobals)) return true;
|
||||
if (this.hasUid(name)) return true;
|
||||
if (!noGlobals && (0, _includes().default)(Scope.globals, name)) return true;
|
||||
if (!noGlobals && (0, _includes().default)(Scope.contextVariables, name)) return true;
|
||||
if (!noGlobals && (0, _includes.default)(Scope.globals, name)) return true;
|
||||
if (!noGlobals && (0, _includes.default)(Scope.contextVariables, name)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -888,5 +854,5 @@ class Scope {
|
||||
}
|
||||
|
||||
exports.default = Scope;
|
||||
Scope.globals = Object.keys(_globals().default.builtin);
|
||||
Scope.globals = Object.keys(_globals.default.builtin);
|
||||
Scope.contextVariables = ["arguments", "undefined", "Infinity", "NaN"];
|
||||
34
node_modules/@babel/traverse/lib/scope/lib/renamer.js
generated
vendored
34
node_modules/@babel/traverse/lib/scope/lib/renamer.js
generated
vendored
@@ -7,27 +7,13 @@ exports.default = void 0;
|
||||
|
||||
var _binding = _interopRequireDefault(require("../binding"));
|
||||
|
||||
function _helperSplitExportDeclaration() {
|
||||
const data = _interopRequireDefault(require("@babel/helper-split-export-declaration"));
|
||||
var _helperSplitExportDeclaration = _interopRequireDefault(require("@babel/helper-split-export-declaration"));
|
||||
|
||||
_helperSplitExportDeclaration = function () {
|
||||
return data;
|
||||
};
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
return data;
|
||||
}
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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 }; }
|
||||
|
||||
@@ -74,27 +60,27 @@ class Renamer {
|
||||
return;
|
||||
}
|
||||
|
||||
(0, _helperSplitExportDeclaration().default)(maybeExportDeclar);
|
||||
(0, _helperSplitExportDeclaration.default)(maybeExportDeclar);
|
||||
}
|
||||
|
||||
maybeConvertFromClassFunctionDeclaration(path) {
|
||||
return;
|
||||
if (!path.isFunctionDeclaration() && !path.isClassDeclaration()) return;
|
||||
if (this.binding.kind !== "hoisted") return;
|
||||
path.node.id = t().identifier(this.oldName);
|
||||
path.node.id = t.identifier(this.oldName);
|
||||
path.node._blockHoist = 3;
|
||||
path.replaceWith(t().variableDeclaration("let", [t().variableDeclarator(t().identifier(this.newName), t().toExpression(path.node))]));
|
||||
path.replaceWith(t.variableDeclaration("let", [t.variableDeclarator(t.identifier(this.newName), t.toExpression(path.node))]));
|
||||
}
|
||||
|
||||
maybeConvertFromClassFunctionExpression(path) {
|
||||
return;
|
||||
if (!path.isFunctionExpression() && !path.isClassExpression()) return;
|
||||
if (this.binding.kind !== "local") return;
|
||||
path.node.id = t().identifier(this.oldName);
|
||||
path.node.id = t.identifier(this.oldName);
|
||||
this.binding.scope.parent.push({
|
||||
id: t().identifier(this.newName)
|
||||
id: t.identifier(this.newName)
|
||||
});
|
||||
path.replaceWith(t().assignmentExpression("=", t().identifier(this.newName), path.node));
|
||||
path.replaceWith(t.assignmentExpression("=", t.identifier(this.newName), path.node));
|
||||
}
|
||||
|
||||
rename(block) {
|
||||
|
||||
36
node_modules/@babel/traverse/lib/visitors.js
generated
vendored
36
node_modules/@babel/traverse/lib/visitors.js
generated
vendored
@@ -9,29 +9,15 @@ exports.merge = merge;
|
||||
|
||||
var virtualTypes = _interopRequireWildcard(require("./path/lib/virtual-types"));
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _clone() {
|
||||
const data = _interopRequireDefault(require("lodash/clone"));
|
||||
|
||||
_clone = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
var _clone = _interopRequireDefault(require("lodash/clone"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
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; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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 explode(visitor) {
|
||||
if (visitor._exploded) return visitor;
|
||||
@@ -82,8 +68,8 @@ function explode(visitor) {
|
||||
for (const nodeType of Object.keys(visitor)) {
|
||||
if (shouldIgnoreKey(nodeType)) continue;
|
||||
const fns = visitor[nodeType];
|
||||
let aliases = t().FLIPPED_ALIAS_KEYS[nodeType];
|
||||
const deprecratedKey = t().DEPRECATED_KEYS[nodeType];
|
||||
let aliases = t.FLIPPED_ALIAS_KEYS[nodeType];
|
||||
const deprecratedKey = t.DEPRECATED_KEYS[nodeType];
|
||||
|
||||
if (deprecratedKey) {
|
||||
console.trace(`Visitor defined for ${nodeType} but it has been renamed to ${deprecratedKey}`);
|
||||
@@ -99,7 +85,7 @@ function explode(visitor) {
|
||||
if (existing) {
|
||||
mergePair(existing, fns);
|
||||
} else {
|
||||
visitor[alias] = (0, _clone().default)(fns);
|
||||
visitor[alias] = (0, _clone.default)(fns);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -126,7 +112,7 @@ function verify(visitor) {
|
||||
|
||||
if (shouldIgnoreKey(nodeType)) continue;
|
||||
|
||||
if (t().TYPES.indexOf(nodeType) < 0) {
|
||||
if (t.TYPES.indexOf(nodeType) < 0) {
|
||||
throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type`);
|
||||
}
|
||||
|
||||
@@ -198,6 +184,10 @@ function wrapWithStateOrWrapper(oldVisitor, state, wrapper) {
|
||||
newFn = wrapper(state.key, key, newFn);
|
||||
}
|
||||
|
||||
if (newFn !== fn) {
|
||||
newFn.toString = () => fn.toString();
|
||||
}
|
||||
|
||||
return newFn;
|
||||
});
|
||||
newVisitor[key] = fns;
|
||||
|
||||
48
node_modules/@babel/traverse/package.json
generated
vendored
48
node_modules/@babel/traverse/package.json
generated
vendored
@@ -1,27 +1,20 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/traverse@7.5.5",
|
||||
"/Users/drew.heavner/Documents/Github/upload-google-play"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "@babel/traverse@7.5.5",
|
||||
"_id": "@babel/traverse@7.5.5",
|
||||
"_from": "@babel/traverse@^7.8.4",
|
||||
"_id": "@babel/traverse@7.8.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ==",
|
||||
"_integrity": "sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==",
|
||||
"_location": "/@babel/traverse",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@babel/traverse@7.5.5",
|
||||
"raw": "@babel/traverse@^7.8.4",
|
||||
"name": "@babel/traverse",
|
||||
"escapedName": "@babel%2ftraverse",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.5.5",
|
||||
"rawSpec": "^7.8.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.5.5"
|
||||
"fetchSpec": "^7.8.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/core",
|
||||
@@ -30,29 +23,32 @@
|
||||
"/jest-circus",
|
||||
"/jest-jasmine2"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.5.5.tgz",
|
||||
"_spec": "7.5.5",
|
||||
"_where": "/Users/drew.heavner/Documents/Github/upload-google-play",
|
||||
"_resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz",
|
||||
"_shasum": "f0845822365f9d5b0e312ed3959d3f827f869e3c",
|
||||
"_spec": "@babel/traverse@^7.8.4",
|
||||
"_where": "/Users/drew.heavner/Documents/Github/upload-google-play/node_modules/@babel/core",
|
||||
"author": {
|
||||
"name": "Sebastian McKenzie",
|
||||
"email": "sebmck@gmail.com"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.5.5",
|
||||
"@babel/generator": "^7.5.5",
|
||||
"@babel/helper-function-name": "^7.1.0",
|
||||
"@babel/helper-split-export-declaration": "^7.4.4",
|
||||
"@babel/parser": "^7.5.5",
|
||||
"@babel/types": "^7.5.5",
|
||||
"@babel/code-frame": "^7.8.3",
|
||||
"@babel/generator": "^7.8.4",
|
||||
"@babel/helper-function-name": "^7.8.3",
|
||||
"@babel/helper-split-export-declaration": "^7.8.3",
|
||||
"@babel/parser": "^7.8.4",
|
||||
"@babel/types": "^7.8.3",
|
||||
"debug": "^4.1.0",
|
||||
"globals": "^11.1.0",
|
||||
"lodash": "^4.17.13"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes",
|
||||
"devDependencies": {
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
"@babel/helper-plugin-test-runner": "^7.8.3"
|
||||
},
|
||||
"gitHead": "0407f034f09381b95e9cabefbf6b176c76485a43",
|
||||
"gitHead": "5c2e6bc07fed3d28801d93168622c99ae622653a",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
@@ -64,5 +60,5 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel/tree/master/packages/babel-traverse"
|
||||
},
|
||||
"version": "7.5.5"
|
||||
"version": "7.8.4"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user