@putout/babel 5.3.1 → 5.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/bundle/index.js +82 -110
- package/bundle/metafile-esm.json +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
Pre-builts of [Babel 8](https://github.com/babel/babel/releases/tag/v8.0.0-rc.2).
|
|
7
7
|
Includes:
|
|
8
8
|
|
|
9
|
+
- [`Fix: parser: async x => {} must be in leading pos`](https://github.com/babel/babel/pull/17839);
|
|
9
10
|
- [`Fix TypeScript parser failing on async calls in ternary consequent`](https://github.com/babel/babel/pull/17799);
|
|
10
11
|
|
|
11
12
|
Usage
|
package/bundle/index.js
CHANGED
|
@@ -9332,7 +9332,7 @@ var classMethodOrPropertyCommon = () => ({
|
|
|
9332
9332
|
},
|
|
9333
9333
|
});
|
|
9334
9334
|
|
|
9335
|
-
var classMethodOrDeclareMethodCommon = () => ({
|
|
9335
|
+
var classMethodOrDeclareMethodCommon = (allowDecorators = true) => ({
|
|
9336
9336
|
...functionCommon(),
|
|
9337
9337
|
...classMethodOrPropertyCommon(),
|
|
9338
9338
|
params: validateArrayOfType('FunctionParameter', 'TSParameterProperty'),
|
|
@@ -9344,10 +9344,12 @@ var classMethodOrDeclareMethodCommon = () => ({
|
|
|
9344
9344
|
validate: chain(assertValueType('string'), assertOneOf('public', 'private', 'protected')),
|
|
9345
9345
|
optional: true,
|
|
9346
9346
|
},
|
|
9347
|
-
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9347
|
+
...allowDecorators ? {
|
|
9348
|
+
decorators: {
|
|
9349
|
+
validate: arrayOfType('Decorator'),
|
|
9350
|
+
optional: true,
|
|
9351
|
+
},
|
|
9352
|
+
} : {},
|
|
9351
9353
|
});
|
|
9352
9354
|
|
|
9353
9355
|
defineType$4('ClassMethod', {
|
|
@@ -10820,7 +10822,6 @@ defineType('TSDeclareFunction', {
|
|
|
10820
10822
|
});
|
|
10821
10823
|
defineType('TSDeclareMethod', {
|
|
10822
10824
|
visitor: [
|
|
10823
|
-
'decorators',
|
|
10824
10825
|
'key',
|
|
10825
10826
|
'typeParameters',
|
|
10826
10827
|
'params',
|
|
@@ -10828,7 +10829,7 @@ defineType('TSDeclareMethod', {
|
|
|
10828
10829
|
],
|
|
10829
10830
|
...classMethodOrPropertyUnionShapeCommon(),
|
|
10830
10831
|
fields: {
|
|
10831
|
-
...classMethodOrDeclareMethodCommon(),
|
|
10832
|
+
...classMethodOrDeclareMethodCommon(false),
|
|
10832
10833
|
...tSFunctionTypeAnnotationCommon(),
|
|
10833
10834
|
},
|
|
10834
10835
|
});
|
|
@@ -13781,10 +13782,9 @@ function tsDeclareFunction(id = null, typeParameters = null, params, returnType
|
|
|
13781
13782
|
return node;
|
|
13782
13783
|
}
|
|
13783
13784
|
|
|
13784
|
-
function tsDeclareMethod(
|
|
13785
|
+
function tsDeclareMethod(key, typeParameters = null, params, returnType = null) {
|
|
13785
13786
|
const node = {
|
|
13786
13787
|
type: 'TSDeclareMethod',
|
|
13787
|
-
decorators,
|
|
13788
13788
|
key,
|
|
13789
13789
|
typeParameters,
|
|
13790
13790
|
params,
|
|
@@ -13797,7 +13797,6 @@ function tsDeclareMethod(decorators = null, key, typeParameters = null, params,
|
|
|
13797
13797
|
};
|
|
13798
13798
|
|
|
13799
13799
|
const defs2 = NODE_FIELDS.TSDeclareMethod;
|
|
13800
|
-
validate(defs2.decorators, node, 'decorators', decorators, 1);
|
|
13801
13800
|
validate(defs2.key, node, 'key', key, 1);
|
|
13802
13801
|
validate(defs2.typeParameters, node, 'typeParameters', typeParameters, 1);
|
|
13803
13802
|
validate(defs2.params, node, 'params', params, 1);
|
|
@@ -16918,8 +16917,8 @@ function toExpression(node) {
|
|
|
16918
16917
|
return node;
|
|
16919
16918
|
}
|
|
16920
16919
|
|
|
16921
|
-
var _skip = Symbol();
|
|
16922
|
-
var _stop = Symbol();
|
|
16920
|
+
var _skip = /* @__PURE__ */Symbol();
|
|
16921
|
+
var _stop = /* @__PURE__ */Symbol();
|
|
16923
16922
|
|
|
16924
16923
|
function traverseFast(node, enter, opts) {
|
|
16925
16924
|
if (!node)
|
|
@@ -17885,6 +17884,7 @@ var StandardErrors = {
|
|
|
17885
17884
|
ConstructorIsAsync: 'Constructor can\'t be an async function.',
|
|
17886
17885
|
ConstructorIsGenerator: 'Constructor can\'t be a generator.',
|
|
17887
17886
|
DeclarationMissingInitializer: ({kind}) => `Missing initializer in ${kind} declaration.`,
|
|
17887
|
+
DecoratorAbstractMethod: 'Decorators can\'t be used with an abstract method.',
|
|
17888
17888
|
DecoratorArgumentsOutsideParentheses: 'Decorator arguments must be moved inside parentheses: use \'@(decorator(args))\' instead of \'@(decorator)(args)\'.',
|
|
17889
17889
|
DecoratorsBeforeAfterExport: 'Decorators can be placed *either* before or after the \'export\' keyword, but not in both locations at the same time.',
|
|
17890
17890
|
DecoratorConstructor: 'Decorators can\'t be used with a constructor. Did you mean \'@dec class { ... }\'?',
|
|
@@ -18045,6 +18045,7 @@ var PipelineOperatorErrors = {
|
|
|
18045
18045
|
PipeUnparenthesizedBody: ({type}) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({
|
|
18046
18046
|
type,
|
|
18047
18047
|
})}; please wrap it in parentheses.`,
|
|
18048
|
+
PipelineUnparenthesized: 'Cannot mix binary operator with solo-await F#-style pipeline. Please wrap the pipeline in parentheses.',
|
|
18048
18049
|
};
|
|
18049
18050
|
|
|
18050
18051
|
function defineHidden(obj, key, value) {
|
|
@@ -21582,6 +21583,10 @@ var ProductionParameterHandler = class {
|
|
|
21582
21583
|
get hasIn() {
|
|
21583
21584
|
return (this.currentFlags() & 8) > 0;
|
|
21584
21585
|
}
|
|
21586
|
+
|
|
21587
|
+
get inFSharpPipelineDirectBody() {
|
|
21588
|
+
return (this.currentFlags() & 16) === 0;
|
|
21589
|
+
}
|
|
21585
21590
|
};
|
|
21586
21591
|
|
|
21587
21592
|
function functionFlags(isAsync, isGenerator) {
|
|
@@ -21836,7 +21841,7 @@ var CommentsParser = class extends BaseParser {
|
|
|
21836
21841
|
};
|
|
21837
21842
|
|
|
21838
21843
|
var State = class _State {
|
|
21839
|
-
flags =
|
|
21844
|
+
flags = 1024;
|
|
21840
21845
|
get strict() {
|
|
21841
21846
|
return (this.flags & 1) > 0;
|
|
21842
21847
|
}
|
|
@@ -21965,28 +21970,6 @@ var State = class _State {
|
|
|
21965
21970
|
this.flags &= -513;
|
|
21966
21971
|
}
|
|
21967
21972
|
|
|
21968
|
-
get soloAwait() {
|
|
21969
|
-
return (this.flags & 1024) > 0;
|
|
21970
|
-
}
|
|
21971
|
-
|
|
21972
|
-
set soloAwait(v) {
|
|
21973
|
-
if (v)
|
|
21974
|
-
this.flags |= 1024;
|
|
21975
|
-
else
|
|
21976
|
-
this.flags &= -1025;
|
|
21977
|
-
}
|
|
21978
|
-
|
|
21979
|
-
get inFSharpPipelineDirectBody() {
|
|
21980
|
-
return (this.flags & 2048) > 0;
|
|
21981
|
-
}
|
|
21982
|
-
|
|
21983
|
-
set inFSharpPipelineDirectBody(v) {
|
|
21984
|
-
if (v)
|
|
21985
|
-
this.flags |= 2048;
|
|
21986
|
-
else
|
|
21987
|
-
this.flags &= -2049;
|
|
21988
|
-
}
|
|
21989
|
-
|
|
21990
21973
|
labels = [];
|
|
21991
21974
|
commentsLen = 0;
|
|
21992
21975
|
commentStack = [];
|
|
@@ -21999,37 +21982,37 @@ var State = class _State {
|
|
|
21999
21982
|
lastTokStartLoc = null;
|
|
22000
21983
|
context = [types.brace];
|
|
22001
21984
|
get canStartJSXElement() {
|
|
22002
|
-
return (this.flags &
|
|
21985
|
+
return (this.flags & 1024) > 0;
|
|
22003
21986
|
}
|
|
22004
21987
|
|
|
22005
21988
|
set canStartJSXElement(v) {
|
|
22006
21989
|
if (v)
|
|
22007
|
-
this.flags |=
|
|
21990
|
+
this.flags |= 1024;
|
|
22008
21991
|
else
|
|
22009
|
-
this.flags &= -
|
|
21992
|
+
this.flags &= -1025;
|
|
22010
21993
|
}
|
|
22011
21994
|
|
|
22012
21995
|
get containsEsc() {
|
|
22013
|
-
return (this.flags &
|
|
21996
|
+
return (this.flags & 2048) > 0;
|
|
22014
21997
|
}
|
|
22015
21998
|
|
|
22016
21999
|
set containsEsc(v) {
|
|
22017
22000
|
if (v)
|
|
22018
|
-
this.flags |=
|
|
22001
|
+
this.flags |= 2048;
|
|
22019
22002
|
else
|
|
22020
|
-
this.flags &= -
|
|
22003
|
+
this.flags &= -2049;
|
|
22021
22004
|
}
|
|
22022
22005
|
|
|
22023
22006
|
firstInvalidTemplateEscapePos = null;
|
|
22024
22007
|
get hasTopLevelAwait() {
|
|
22025
|
-
return (this.flags &
|
|
22008
|
+
return (this.flags & 4096) > 0;
|
|
22026
22009
|
}
|
|
22027
22010
|
|
|
22028
22011
|
set hasTopLevelAwait(v) {
|
|
22029
22012
|
if (v)
|
|
22030
|
-
this.flags |=
|
|
22013
|
+
this.flags |= 4096;
|
|
22031
22014
|
else
|
|
22032
|
-
this.flags &= -
|
|
22015
|
+
this.flags &= -4097;
|
|
22033
22016
|
}
|
|
22034
22017
|
|
|
22035
22018
|
strictErrors = /* @__PURE__ */new Map();
|
|
@@ -23382,6 +23365,13 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23382
23365
|
next = this.input.charCodeAt(this.state.pos);
|
|
23383
23366
|
}
|
|
23384
23367
|
|
|
23368
|
+
const str = this
|
|
23369
|
+
.input
|
|
23370
|
+
.slice(start, this
|
|
23371
|
+
.state
|
|
23372
|
+
.pos)
|
|
23373
|
+
.replaceAll('_', '');
|
|
23374
|
+
|
|
23385
23375
|
if (next === 110) {
|
|
23386
23376
|
if (isFloat || hasLeadingZero) {
|
|
23387
23377
|
this.raise(Errors.InvalidBigIntLiteral, startLoc);
|
|
@@ -23395,13 +23385,6 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23395
23385
|
throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
|
|
23396
23386
|
}
|
|
23397
23387
|
|
|
23398
|
-
const str = this
|
|
23399
|
-
.input
|
|
23400
|
-
.slice(start, this
|
|
23401
|
-
.state
|
|
23402
|
-
.pos)
|
|
23403
|
-
.replace(/[_mn]/g, '');
|
|
23404
|
-
|
|
23405
23388
|
if (isBigInt) {
|
|
23406
23389
|
this.finishToken(132, str);
|
|
23407
23390
|
return;
|
|
@@ -24181,11 +24164,13 @@ var Node = class {
|
|
|
24181
24164
|
this.end = 0;
|
|
24182
24165
|
this.loc = new SourceLocation(loc);
|
|
24183
24166
|
|
|
24184
|
-
if (parser
|
|
24185
|
-
|
|
24186
|
-
|
|
24187
|
-
|
|
24188
|
-
|
|
24167
|
+
if (parser != null) {
|
|
24168
|
+
if (parser.optionFlags & 128)
|
|
24169
|
+
this.range = [pos, 0];
|
|
24170
|
+
|
|
24171
|
+
if (parser.filename)
|
|
24172
|
+
this.loc.filename = parser.filename;
|
|
24173
|
+
}
|
|
24189
24174
|
}
|
|
24190
24175
|
|
|
24191
24176
|
type = '';
|
|
@@ -24212,10 +24197,6 @@ var NodeUtils = class extends UtilParser {
|
|
|
24212
24197
|
}
|
|
24213
24198
|
|
|
24214
24199
|
finishNodeAt(node, type, endLoc) {
|
|
24215
|
-
if (process.env.NODE_ENV !== 'production' && node.end > 0) {
|
|
24216
|
-
throw new Error('Do not call finishNode*() twice on the same node. Instead use resetEndLocation() or change type directly.');
|
|
24217
|
-
}
|
|
24218
|
-
|
|
24219
24200
|
node.type = type;
|
|
24220
24201
|
node.end = endLoc.index;
|
|
24221
24202
|
node.loc.end = endLoc;
|
|
@@ -29152,7 +29133,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29152
29133
|
if (op === 35) {
|
|
29153
29134
|
this.expectPlugin('pipelineOperator');
|
|
29154
29135
|
|
|
29155
|
-
if (this.
|
|
29136
|
+
if (this.prodParam.inFSharpPipelineDirectBody) {
|
|
29156
29137
|
return left;
|
|
29157
29138
|
}
|
|
29158
29139
|
}
|
|
@@ -29194,9 +29175,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29194
29175
|
});
|
|
29195
29176
|
|
|
29196
29177
|
case 'fsharp':
|
|
29197
|
-
return this.
|
|
29198
|
-
return this.parseFSharpPipelineBody(prec);
|
|
29199
|
-
});
|
|
29178
|
+
return this.parseFSharpPipelineBody(prec);
|
|
29200
29179
|
}
|
|
29201
29180
|
|
|
29202
29181
|
default:
|
|
@@ -29523,9 +29502,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29523
29502
|
parseCallExpressionArguments(allowPlaceholder, nodeForExtra, refExpressionErrors) {
|
|
29524
29503
|
const elts = [];
|
|
29525
29504
|
let first = true;
|
|
29526
|
-
const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
|
|
29527
29505
|
|
|
29528
|
-
this.state.inFSharpPipelineDirectBody = false;
|
|
29529
29506
|
while (!this.eat(7)) {
|
|
29530
29507
|
if (first) {
|
|
29531
29508
|
first = false;
|
|
@@ -29550,7 +29527,6 @@ var ExpressionParser = class extends LValParser {
|
|
|
29550
29527
|
));
|
|
29551
29528
|
}
|
|
29552
29529
|
|
|
29553
|
-
this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
|
|
29554
29530
|
return elts;
|
|
29555
29531
|
}
|
|
29556
29532
|
|
|
@@ -29734,7 +29710,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29734
29710
|
this.next();
|
|
29735
29711
|
return this.parseAsyncFunctionExpression(this.startNodeAtNode(id));
|
|
29736
29712
|
} else if (tokenIsIdentifier(type2)) {
|
|
29737
|
-
if (this.lookaheadCharCode() === 61) {
|
|
29713
|
+
if (canBeArrow && this.lookaheadCharCode() === 61) {
|
|
29738
29714
|
return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id));
|
|
29739
29715
|
} else {
|
|
29740
29716
|
return id;
|
|
@@ -29999,9 +29975,6 @@ var ExpressionParser = class extends LValParser {
|
|
|
29999
29975
|
let val;
|
|
30000
29976
|
this.next();
|
|
30001
29977
|
this.expressionScope.enter(newArrowHeadScope());
|
|
30002
|
-
const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
|
|
30003
|
-
|
|
30004
|
-
this.state.inFSharpPipelineDirectBody = false;
|
|
30005
29978
|
const innerStartLoc = this.state.startLoc;
|
|
30006
29979
|
const exprList = [];
|
|
30007
29980
|
const refExpressionErrors = new ExpressionErrors();
|
|
@@ -30044,7 +30017,6 @@ var ExpressionParser = class extends LValParser {
|
|
|
30044
30017
|
|
|
30045
30018
|
const innerEndLoc = this.state.lastTokEndLoc;
|
|
30046
30019
|
this.expect(7);
|
|
30047
|
-
this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
|
|
30048
30020
|
let arrowNode = this.startNodeAt(startLoc);
|
|
30049
30021
|
|
|
30050
30022
|
if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) {
|
|
@@ -30211,9 +30183,6 @@ var ExpressionParser = class extends LValParser {
|
|
|
30211
30183
|
}
|
|
30212
30184
|
|
|
30213
30185
|
parseObjectLike(close, isPattern3, refExpressionErrors) {
|
|
30214
|
-
const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
|
|
30215
|
-
|
|
30216
|
-
this.state.inFSharpPipelineDirectBody = false;
|
|
30217
30186
|
let sawProto = false;
|
|
30218
30187
|
let first = true;
|
|
30219
30188
|
const node = this.startNode();
|
|
@@ -30245,7 +30214,6 @@ var ExpressionParser = class extends LValParser {
|
|
|
30245
30214
|
}
|
|
30246
30215
|
|
|
30247
30216
|
this.next();
|
|
30248
|
-
this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
|
|
30249
30217
|
const type = isPattern3 ? 'ObjectPattern' : 'ObjectExpression';
|
|
30250
30218
|
|
|
30251
30219
|
return this.finishNode(node, type);
|
|
@@ -30493,13 +30461,9 @@ var ExpressionParser = class extends LValParser {
|
|
|
30493
30461
|
}
|
|
30494
30462
|
|
|
30495
30463
|
parseArrayLike(close, refExpressionErrors) {
|
|
30496
|
-
const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
|
|
30497
|
-
|
|
30498
|
-
this.state.inFSharpPipelineDirectBody = false;
|
|
30499
30464
|
const node = this.startNode();
|
|
30500
30465
|
this.next();
|
|
30501
30466
|
node.elements = this.parseExprList(close, true, refExpressionErrors, node);
|
|
30502
|
-
this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
|
|
30503
30467
|
return this.finishNode(node, 'ArrayExpression');
|
|
30504
30468
|
}
|
|
30505
30469
|
|
|
@@ -30507,8 +30471,8 @@ var ExpressionParser = class extends LValParser {
|
|
|
30507
30471
|
this.scope.enter(514 | 4);
|
|
30508
30472
|
let flags = functionFlags(isAsync, false);
|
|
30509
30473
|
|
|
30510
|
-
if (!this.match(2)
|
|
30511
|
-
flags |= 8;
|
|
30474
|
+
if (!this.match(2)) {
|
|
30475
|
+
flags |= this.prodParam.currentFlags() & (8 | 16);
|
|
30512
30476
|
}
|
|
30513
30477
|
|
|
30514
30478
|
this.prodParam.enter(flags);
|
|
@@ -30756,7 +30720,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30756
30720
|
return isAwaitAllowed;
|
|
30757
30721
|
}
|
|
30758
30722
|
|
|
30759
|
-
parseAwait(startLoc) {
|
|
30723
|
+
parseAwait(startLoc, soloAwait) {
|
|
30760
30724
|
const node = this.startNodeAt(startLoc);
|
|
30761
30725
|
this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, node);
|
|
30762
30726
|
|
|
@@ -30772,7 +30736,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30772
30736
|
}
|
|
30773
30737
|
}
|
|
30774
30738
|
|
|
30775
|
-
if (!
|
|
30739
|
+
if (!soloAwait) {
|
|
30776
30740
|
node.argument = this.parseMaybeUnary(null, true);
|
|
30777
30741
|
}
|
|
30778
30742
|
|
|
@@ -30869,23 +30833,12 @@ var ExpressionParser = class extends LValParser {
|
|
|
30869
30833
|
}
|
|
30870
30834
|
}
|
|
30871
30835
|
|
|
30872
|
-
withSoloAwaitPermittingContext(callback) {
|
|
30873
|
-
const outerContextSoloAwaitState = this.state.soloAwait;
|
|
30874
|
-
|
|
30875
|
-
this.state.soloAwait = true;
|
|
30876
|
-
try {
|
|
30877
|
-
return callback();
|
|
30878
|
-
} finally {
|
|
30879
|
-
this.state.soloAwait = outerContextSoloAwaitState;
|
|
30880
|
-
}
|
|
30881
|
-
}
|
|
30882
|
-
|
|
30883
30836
|
allowInAnd(callback) {
|
|
30884
30837
|
const flags = this.prodParam.currentFlags();
|
|
30885
|
-
const prodParamToSet = 8 & ~flags;
|
|
30838
|
+
const prodParamToSet = (8 | 16) & ~flags;
|
|
30886
30839
|
|
|
30887
30840
|
if (prodParamToSet) {
|
|
30888
|
-
this.prodParam.enter(flags | 8);
|
|
30841
|
+
this.prodParam.enter(flags | 8 | 16);
|
|
30889
30842
|
try {
|
|
30890
30843
|
return callback();
|
|
30891
30844
|
} finally {
|
|
@@ -30899,9 +30852,10 @@ var ExpressionParser = class extends LValParser {
|
|
|
30899
30852
|
disallowInAnd(callback) {
|
|
30900
30853
|
const flags = this.prodParam.currentFlags();
|
|
30901
30854
|
const prodParamToClear = 8 & flags;
|
|
30855
|
+
const prodParamToSet = 16 & ~flags;
|
|
30902
30856
|
|
|
30903
|
-
if (prodParamToClear) {
|
|
30904
|
-
this.prodParam.enter(flags & ~8);
|
|
30857
|
+
if (prodParamToClear || prodParamToSet) {
|
|
30858
|
+
this.prodParam.enter(flags & ~8 | 16);
|
|
30905
30859
|
try {
|
|
30906
30860
|
return callback();
|
|
30907
30861
|
} finally {
|
|
@@ -30928,12 +30882,22 @@ var ExpressionParser = class extends LValParser {
|
|
|
30928
30882
|
const startLoc = this.state.startLoc;
|
|
30929
30883
|
|
|
30930
30884
|
this.state.potentialArrowAt = this.state.start;
|
|
30931
|
-
|
|
30885
|
+
this.prodParam.enter(this.prodParam.currentFlags() & ~16);
|
|
30886
|
+
let ret;
|
|
30932
30887
|
|
|
30933
|
-
this.
|
|
30934
|
-
|
|
30888
|
+
if (this.isContextual(92) && this.recordAwaitIfAllowed()) {
|
|
30889
|
+
this.next();
|
|
30890
|
+
ret = this.parseAwait(startLoc, true);
|
|
30891
|
+
const nextOp = this.state.type;
|
|
30892
|
+
|
|
30893
|
+
if (tokenIsOperator(nextOp) && nextOp !== 35 && (this.prodParam.hasIn || nextOp !== 54)) {
|
|
30894
|
+
this.raise(Errors.PipelineUnparenthesized, startLoc);
|
|
30895
|
+
}
|
|
30896
|
+
} else {
|
|
30897
|
+
ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, prec);
|
|
30898
|
+
}
|
|
30935
30899
|
|
|
30936
|
-
this.
|
|
30900
|
+
this.prodParam.exit();
|
|
30937
30901
|
return ret;
|
|
30938
30902
|
}
|
|
30939
30903
|
|
|
@@ -32154,8 +32118,14 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32154
32118
|
|
|
32155
32119
|
this.parseClassMember(classBody2, member, state);
|
|
32156
32120
|
|
|
32157
|
-
if (member.
|
|
32158
|
-
this.
|
|
32121
|
+
if (member.decorators && member.decorators.length > 0) {
|
|
32122
|
+
if (this.hasPlugin('typescript') && (this.hasPlugin('estree') ? member.type === 'TSAbstractMethodDefinition' : member.type === 'TSDeclareMethod')) {
|
|
32123
|
+
this.raise(Errors.DecoratorAbstractMethod, member);
|
|
32124
|
+
}
|
|
32125
|
+
|
|
32126
|
+
if (member.kind === 'constructor') {
|
|
32127
|
+
this.raise(Errors.DecoratorConstructor, member);
|
|
32128
|
+
}
|
|
32159
32129
|
}
|
|
32160
32130
|
}
|
|
32161
32131
|
|
|
@@ -34367,7 +34337,7 @@ function parseAndBuildMetadata(formatter, code2, opts) {
|
|
|
34367
34337
|
const {
|
|
34368
34338
|
placeholderWhitelist,
|
|
34369
34339
|
placeholderPattern,
|
|
34370
|
-
preserveComments,
|
|
34340
|
+
preserveComments = false,
|
|
34371
34341
|
syntacticPlaceholders,
|
|
34372
34342
|
} = opts;
|
|
34373
34343
|
|
|
@@ -37658,7 +37628,7 @@ function TSDeclareFunction2(node, parent) {
|
|
|
37658
37628
|
}
|
|
37659
37629
|
|
|
37660
37630
|
function TSDeclareMethod2(node) {
|
|
37661
|
-
_classMethodHead.call(this, node);
|
|
37631
|
+
_classMethodHead.call(this, node, false);
|
|
37662
37632
|
this.semicolon();
|
|
37663
37633
|
}
|
|
37664
37634
|
|
|
@@ -39707,8 +39677,10 @@ function ClassPrivateMethod2(node) {
|
|
|
39707
39677
|
this.print(node.body);
|
|
39708
39678
|
}
|
|
39709
39679
|
|
|
39710
|
-
function _classMethodHead(node) {
|
|
39711
|
-
|
|
39680
|
+
function _classMethodHead(node, allowDecorators = true) {
|
|
39681
|
+
if (allowDecorators) {
|
|
39682
|
+
this.printJoin(node.decorators);
|
|
39683
|
+
}
|
|
39712
39684
|
|
|
39713
39685
|
if (!this.format.preserveFormat) {
|
|
39714
39686
|
const endLine = node.key.loc?.end?.line;
|
|
@@ -46993,7 +46965,7 @@ function isExecutionUncertainInList(paths, maxIndex) {
|
|
|
46993
46965
|
return false;
|
|
46994
46966
|
}
|
|
46995
46967
|
|
|
46996
|
-
var SYMBOL_CHECKING = Symbol();
|
|
46968
|
+
var SYMBOL_CHECKING = /* @__PURE__ */Symbol();
|
|
46997
46969
|
|
|
46998
46970
|
function _guessExecutionStatusRelativeTo(target) {
|
|
46999
46971
|
return _guessExecutionStatusRelativeToCached(this, target, /* @__PURE__ */new Map());
|
package/bundle/metafile-esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"../babel-babel/packages/babel-helper-validator-identifier/lib/index.js":{"bytes":13639,"imports":[],"format":"esm"},"../babel-babel/packages/babel-helper-string-parser/lib/index.js":{"bytes":7680,"imports":[],"format":"esm"},"../babel-babel/packages/babel-types/lib/index.js":{"bytes":
|
|
1
|
+
{"inputs":{"../babel-babel/packages/babel-helper-validator-identifier/lib/index.js":{"bytes":13639,"imports":[],"format":"esm"},"../babel-babel/packages/babel-helper-string-parser/lib/index.js":{"bytes":7680,"imports":[],"format":"esm"},"../babel-babel/packages/babel-types/lib/index.js":{"bytes":352299,"imports":[{"path":"../babel-babel/packages/babel-helper-validator-identifier/lib/index.js","kind":"import-statement","original":"@babel/helper-validator-identifier"},{"path":"../babel-babel/packages/babel-helper-string-parser/lib/index.js","kind":"import-statement","original":"@babel/helper-string-parser"}],"format":"esm"},"../babel-babel/packages/babel-parser/lib/index.js":{"bytes":481510,"imports":[],"format":"esm"},"../babel-babel/packages/babel-code-frame/lib/common-BO7XIBW3.js":{"bytes":3594,"imports":[],"format":"esm"},"../babel-babel/node_modules/js-tokens/index.js":{"bytes":12672,"imports":[],"format":"esm"},"../babel-babel/packages/babel-code-frame/lib/index.js":{"bytes":4080,"imports":[{"path":"../babel-babel/packages/babel-code-frame/lib/common-BO7XIBW3.js","kind":"import-statement","original":"./common-BO7XIBW3.js"},{"path":"util","kind":"import-statement","external":true},{"path":"../babel-babel/node_modules/js-tokens/index.js","kind":"import-statement","original":"js-tokens"},{"path":"../babel-babel/packages/babel-helper-validator-identifier/lib/index.js","kind":"import-statement","original":"@babel/helper-validator-identifier"}],"format":"esm"},"../babel-babel/packages/babel-template/lib/index.js":{"bytes":16579,"imports":[{"path":"../babel-babel/packages/babel-types/lib/index.js","kind":"import-statement","original":"@babel/types"},{"path":"../babel-babel/packages/babel-parser/lib/index.js","kind":"import-statement","original":"@babel/parser"},{"path":"../babel-babel/packages/babel-code-frame/lib/index.js","kind":"import-statement","original":"@babel/code-frame"}],"format":"esm"},"../babel-babel/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs":{"bytes":12869,"imports":[],"format":"esm"},"../babel-babel/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs":{"bytes":8609,"imports":[],"format":"esm"},"../babel-babel/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs":{"bytes":15571,"imports":[{"path":"../babel-babel/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs","kind":"import-statement","original":"@jridgewell/sourcemap-codec"},{"path":"../babel-babel/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs","kind":"import-statement","original":"@jridgewell/resolve-uri"}],"format":"esm"},"../babel-babel/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs":{"bytes":7969,"imports":[{"path":"../babel-babel/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs","kind":"import-statement","original":"@jridgewell/sourcemap-codec"},{"path":"../babel-babel/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs","kind":"import-statement","original":"@jridgewell/trace-mapping"}],"format":"esm"},"../babel-babel/node_modules/jsesc/jsesc.js":{"bytes":8104,"imports":[],"format":"cjs"},"../babel-babel/packages/babel-generator/lib/index.js":{"bytes":128325,"imports":[{"path":"../babel-babel/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs","kind":"import-statement","original":"@jridgewell/gen-mapping"},{"path":"../babel-babel/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs","kind":"import-statement","original":"@jridgewell/trace-mapping"},{"path":"../babel-babel/packages/babel-types/lib/index.js","kind":"import-statement","original":"@babel/types"},{"path":"../babel-babel/node_modules/jsesc/jsesc.js","kind":"import-statement","original":"jsesc"}],"format":"esm"},"../babel-babel/node_modules/obug/dist/core.js":{"bytes":3557,"imports":[],"format":"esm"},"../babel-babel/node_modules/obug/dist/node.js":{"bytes":3091,"imports":[{"path":"../babel-babel/node_modules/obug/dist/core.js","kind":"import-statement","original":"./core.js"},{"path":"tty","kind":"import-statement","external":true},{"path":"util","kind":"import-statement","external":true}],"format":"esm"},"../babel-babel/packages/babel-helper-globals/data/builtin-lower.json":{"bytes":203,"imports":[],"format":"esm","with":{"type":"json"}},"../babel-babel/packages/babel-helper-globals/data/builtin-upper.json":{"bytes":718,"imports":[],"format":"esm","with":{"type":"json"}},"../babel-babel/packages/babel-traverse/lib/index.js":{"bytes":152692,"imports":[{"path":"../babel-babel/node_modules/obug/dist/node.js","kind":"import-statement","original":"obug"},{"path":"../babel-babel/packages/babel-code-frame/lib/index.js","kind":"import-statement","original":"@babel/code-frame"},{"path":"../babel-babel/packages/babel-types/lib/index.js","kind":"import-statement","original":"@babel/types"},{"path":"../babel-babel/packages/babel-parser/lib/index.js","kind":"import-statement","original":"@babel/parser"},{"path":"../babel-babel/packages/babel-helper-globals/data/builtin-lower.json","kind":"import-statement","original":"@babel/helper-globals/data/builtin-lower.json","with":{"type":"json"}},{"path":"../babel-babel/packages/babel-helper-globals/data/builtin-upper.json","kind":"import-statement","original":"@babel/helper-globals/data/builtin-upper.json","with":{"type":"json"}},{"path":"../babel-babel/packages/babel-generator/lib/index.js","kind":"import-statement","original":"@babel/generator"},{"path":"../babel-babel/packages/babel-template/lib/index.js","kind":"import-statement","original":"@babel/template"}],"format":"esm"},"lib/index.js":{"bytes":300,"imports":[{"path":"../babel-babel/packages/babel-template/lib/index.js","kind":"import-statement","original":"@babel/template"},{"path":"../babel-babel/packages/babel-generator/lib/index.js","kind":"import-statement","original":"@babel/generator"},{"path":"../babel-babel/packages/babel-types/lib/index.js","kind":"import-statement","original":"@babel/types"},{"path":"../babel-babel/packages/babel-traverse/lib/index.js","kind":"import-statement","original":"@babel/traverse"},{"path":"../babel-babel/packages/babel-parser/lib/index.js","kind":"import-statement","original":"@babel/parser"},{"path":"../babel-babel/packages/babel-code-frame/lib/index.js","kind":"import-statement","original":"@babel/code-frame"}],"format":"esm"}},"outputs":{"bundle/index.js":{"imports":[{"path":"util","kind":"import-statement","external":true},{"path":"tty","kind":"import-statement","external":true},{"path":"util","kind":"import-statement","external":true}],"exports":["codeFrameColumns","generate","parse","parseExpression","template","tokTypes","traverse","types"],"entryPoint":"lib/index.js","inputs":{"../babel-babel/node_modules/jsesc/jsesc.js":{"bytesInOutput":8976},"../babel-babel/packages/babel-types/lib/index.js":{"bytesInOutput":383585},"../babel-babel/packages/babel-helper-validator-identifier/lib/index.js":{"bytesInOutput":13192},"../babel-babel/packages/babel-helper-string-parser/lib/index.js":{"bytesInOutput":7645},"../babel-babel/packages/babel-parser/lib/index.js":{"bytesInOutput":481293},"../babel-babel/packages/babel-code-frame/lib/common-BO7XIBW3.js":{"bytesInOutput":3540},"../babel-babel/packages/babel-code-frame/lib/index.js":{"bytesInOutput":3834},"../babel-babel/node_modules/js-tokens/index.js":{"bytesInOutput":14697},"../babel-babel/packages/babel-template/lib/index.js":{"bytesInOutput":16926},"../babel-babel/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs":{"bytesInOutput":4609},"../babel-babel/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs":{"bytesInOutput":4373},"../babel-babel/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs":{"bytesInOutput":5805},"../babel-babel/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs":{"bytesInOutput":5767},"../babel-babel/packages/babel-generator/lib/index.js":{"bytesInOutput":129088},"lib/index.js":{"bytesInOutput":0},"../babel-babel/node_modules/obug/dist/core.js":{"bytesInOutput":3434},"../babel-babel/node_modules/obug/dist/node.js":{"bytesInOutput":2805},"../babel-babel/packages/babel-helper-globals/data/builtin-lower.json":{"bytesInOutput":232},"../babel-babel/packages/babel-helper-globals/data/builtin-upper.json":{"bytesInOutput":747},"../babel-babel/packages/babel-traverse/lib/index.js":{"bytesInOutput":154505}},"bytes":1247974}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/babel",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Babel 8 bundled",
|
|
@@ -57,15 +57,15 @@
|
|
|
57
57
|
"@swc/core": "^1.3.101",
|
|
58
58
|
"@types/node": "^25.0.6",
|
|
59
59
|
"acorn-stage3": "^4.0.0",
|
|
60
|
-
"c8": "^10.1.2",
|
|
61
60
|
"check-dts": "^0.9.0",
|
|
62
|
-
"eslint": "^
|
|
61
|
+
"eslint": "^10.0.2",
|
|
63
62
|
"eslint-plugin-n": "^17.9.0",
|
|
64
63
|
"eslint-plugin-putout": "^29.4.0",
|
|
65
64
|
"globals": "^17.0.0",
|
|
66
|
-
"madrun": "^
|
|
65
|
+
"madrun": "^13.0.0",
|
|
67
66
|
"nodemon": "^3.0.1",
|
|
68
|
-
"putout": "^
|
|
67
|
+
"putout": "^42.0.23",
|
|
68
|
+
"superc8": "^12.1.2",
|
|
69
69
|
"supertape": "^12.0.12",
|
|
70
70
|
"tsup": "^8.0.1",
|
|
71
71
|
"typescript": "^5.2.2"
|