Updating NPM dependencies

This commit is contained in:
Drew Heavner
2020-11-11 13:30:52 +00:00
committed by GitHub
parent 7a6fb66c63
commit bd487ef324
9068 changed files with 1400893 additions and 587661 deletions

View File

@@ -7,10 +7,12 @@ exports.types = exports.TokContext = void 0;
var _types = require("./types");
var _whitespace = require("../util/whitespace");
class TokContext {
constructor(token, isExpr, preserveSpace, override) {
this.token = void 0;
this.isExpr = void 0;
this.preserveSpace = void 0;
this.override = void 0;
this.token = token;
this.isExpr = !!isExpr;
this.preserveSpace = !!preserveSpace;
@@ -23,6 +25,7 @@ exports.TokContext = TokContext;
const types = {
braceStatement: new TokContext("{", false),
braceExpression: new TokContext("{", true),
recordExpression: new TokContext("#{", true),
templateQuasi: new TokContext("${", false),
parenStatement: new TokContext("(", false),
parenExpression: new TokContext("(", true),
@@ -51,7 +54,7 @@ _types.types.name.updateContext = function (prevType) {
let allowed = false;
if (prevType !== _types.types.dot) {
if (this.state.value === "of" && !this.state.exprAllowed || this.state.value === "yield" && this.scope.inGenerator) {
if (this.state.value === "of" && !this.state.exprAllowed && prevType !== _types.types._function && prevType !== _types.types._class) {
allowed = true;
}
}
@@ -82,7 +85,7 @@ _types.types.parenL.updateContext = function (prevType) {
_types.types.incDec.updateContext = function () {};
_types.types._function.updateContext = _types.types._class.updateContext = function (prevType) {
if (prevType.beforeExpr && prevType !== _types.types.semi && prevType !== _types.types._else && !(prevType === _types.types._return && _whitespace.lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) && !((prevType === _types.types.colon || prevType === _types.types.braceL) && this.curContext() === types.b_stat)) {
if (prevType.beforeExpr && prevType !== _types.types.semi && prevType !== _types.types._else && !(prevType === _types.types._return && this.hasPrecedingLineBreak()) && !((prevType === _types.types.colon || prevType === _types.types.braceL) && this.curContext() === types.b_stat)) {
this.state.context.push(types.functionExpression);
} else {
this.state.context.push(types.functionStatement);
@@ -99,4 +102,9 @@ _types.types.backQuote.updateContext = function () {
}
this.state.exprAllowed = false;
};
_types.types.braceHashL.updateContext = function () {
this.state.context.push(types.recordExpression);
this.state.exprAllowed = true;
};