This commit is contained in:
David Kale
2020-09-08 13:25:36 -04:00
parent e4246d2b5b
commit 91fcbb0108
4227 changed files with 416837 additions and 457884 deletions

View File

@@ -18,17 +18,11 @@ exports.VariableDeclaration = VariableDeclaration;
exports.VariableDeclarator = VariableDeclarator;
exports.ThrowStatement = exports.BreakStatement = exports.ReturnStatement = exports.ContinueStatement = exports.ForOfStatement = exports.ForInStatement = 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; }
function WithStatement(node) {
this.word("with");
@@ -46,7 +40,7 @@ function IfStatement(node) {
this.print(node.test, node);
this.token(")");
this.space();
const needsBlock = node.alternate && t().isIfStatement(getLastStatement(node.consequent));
const needsBlock = node.alternate && t.isIfStatement(getLastStatement(node.consequent));
if (needsBlock) {
this.token("{");
@@ -71,7 +65,7 @@ function IfStatement(node) {
}
function getLastStatement(statement) {
if (!t().isStatement(statement.body)) return statement;
if (!t.isStatement(statement.body)) return statement;
return getLastStatement(statement.body);
}
@@ -208,6 +202,7 @@ function CatchClause(node) {
if (node.param) {
this.token("(");
this.print(node.param, node);
this.print(node.param.typeAnnotation, node);
this.token(")");
this.space();
}
@@ -280,7 +275,7 @@ function VariableDeclaration(node, parent) {
this.space();
let hasInits = false;
if (!t().isFor(parent)) {
if (!t.isFor(parent)) {
for (const declar of node.declarations) {
if (declar.init) {
hasInits = true;
@@ -298,7 +293,7 @@ function VariableDeclaration(node, parent) {
separator
});
if (t().isFor(parent)) {
if (t.isFor(parent)) {
if (parent.left === node || parent.init === node) return;
}