@putout/babel 5.2.14 → 5.3.1

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 CHANGED
@@ -3,13 +3,10 @@
3
3
  [NPMIMGURL]: https://img.shields.io/npm/v/@putout/babel.svg?style=flat&longCache=true
4
4
  [NPMURL]: https://npmjs.org/package/@putout/babel "npm"
5
5
 
6
- Pre-builts of [Babel 8](https://github.com/babel/babel/releases/tag/v8.0.0-rc.1).
7
-
6
+ Pre-builts of [Babel 8](https://github.com/babel/babel/releases/tag/v8.0.0-rc.2).
8
7
  Includes:
9
- - [`fix: properly handle await in finally`](https://github.com/babel/babel/pull/17797);
10
- - [`fix: preserve trailing comma in optional call args`](https://github.com/babel/babel/pull/17781);
11
- - [`remove deprecated default export from @babel/code-frame`](https://github.com/babel/babel/pull/17772);
12
- - [`clean up unused error message`](https://github.com/babel/babel/pull/17764);
8
+
9
+ - [`Fix TypeScript parser failing on async calls in ternary consequent`](https://github.com/babel/babel/pull/17799);
13
10
 
14
11
  Usage
15
12
 
package/bundle/index.js CHANGED
@@ -1643,9 +1643,6 @@ var nonASCIIidentifierStartChars = '\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u0
1643
1643
  var nonASCIIidentifierChars = '\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65';
1644
1644
  var nonASCIIidentifierStart = new RegExp('[' + nonASCIIidentifierStartChars + ']');
1645
1645
  var nonASCIIidentifier = new RegExp('[' + nonASCIIidentifierStartChars + nonASCIIidentifierChars + ']');
1646
-
1647
- nonASCIIidentifierStartChars =
1648
- nonASCIIidentifierChars = null;
1649
1646
  var astralIdentifierStartCodes = [
1650
1647
  0,
1651
1648
  11,
@@ -16449,15 +16446,13 @@ function removeTypeDuplicates$1(nodesIn) {
16449
16446
  const name = getQualifiedName$1(node.id);
16450
16447
 
16451
16448
  if (generics.has(name)) {
16452
- let existing = generics.get(name);
16449
+ const existingTypeParameters = generics.get(name).typeParameters;
16453
16450
 
16454
- if (existing.typeParameters) {
16451
+ if (existingTypeParameters) {
16455
16452
  if (node.typeParameters) {
16456
- existing.typeParameters.params.push(...node.typeParameters.params);
16457
- existing.typeParameters.params = removeTypeDuplicates$1(existing.typeParameters.params);
16453
+ existingTypeParameters.params.push(...node.typeParameters.params);
16454
+ existingTypeParameters.params = removeTypeDuplicates$1(existingTypeParameters.params);
16458
16455
  }
16459
- } else {
16460
- existing = node.typeParameters;
16461
16456
  }
16462
16457
  } else {
16463
16458
  generics.set(name, node);
@@ -16536,14 +16531,11 @@ function removeTypeDuplicates(nodesIn) {
16536
16531
  const name = getQualifiedName(node.typeName);
16537
16532
 
16538
16533
  if (generics.has(name)) {
16539
- let existing = generics.get(name);
16540
- const existingTypeArguments = existing[typeArgumentsKey];
16534
+ const existingTypeArguments = generics.get(name)[typeArgumentsKey];
16541
16535
 
16542
16536
  if (existingTypeArguments) {
16543
16537
  existingTypeArguments.params.push(...typeArguments.params);
16544
16538
  existingTypeArguments.params = removeTypeDuplicates(existingTypeArguments.params);
16545
- } else {
16546
- existing = typeArguments;
16547
16539
  }
16548
16540
  } else {
16549
16541
  generics.set(name, node);
@@ -16603,6 +16595,9 @@ function cloneIfNodeOrArray(obj, deep, withoutLoc, commentsCache) {
16603
16595
  }
16604
16596
 
16605
16597
  function cloneNode(node, deep = true, withoutLoc = false) {
16598
+ if (!node)
16599
+ return node;
16600
+
16606
16601
  return cloneNodeInternal(node, deep, withoutLoc, /* @__PURE__ */new Map());
16607
16602
  }
16608
16603
 
@@ -16838,7 +16833,7 @@ function toBlock(node, parent) {
16838
16833
  return node;
16839
16834
  }
16840
16835
 
16841
- let blockNodes = [];
16836
+ let blockNodes;
16842
16837
 
16843
16838
  if (isEmptyStatement(node)) {
16844
16839
  blockNodes = [];
@@ -18251,8 +18246,7 @@ var estree = (superClass) => class ESTreeParserMixin extends superClass {
18251
18246
  regex = new RegExp(pattern, flags);
18252
18247
  } catch {}
18253
18248
 
18254
-
18255
- const node = this.estreeParseLiteral(regex);
18249
+ const node = this.estreeParseLiteral(regex);
18256
18250
 
18257
18251
  node.regex = {
18258
18252
  pattern,
@@ -18270,8 +18264,7 @@ var estree = (superClass) => class ESTreeParserMixin extends superClass {
18270
18264
  bigInt = null;
18271
18265
  }
18272
18266
 
18273
-
18274
- const node = this.estreeParseLiteral(bigInt);
18267
+ const node = this.estreeParseLiteral(bigInt);
18275
18268
 
18276
18269
  node.bigint = String(node.value || value);
18277
18270
  return node;
@@ -19240,9 +19233,6 @@ var nonASCIIidentifierStartChars2 = '\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u
19240
19233
  var nonASCIIidentifierChars2 = '\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65';
19241
19234
  var nonASCIIidentifierStart2 = new RegExp('[' + nonASCIIidentifierStartChars2 + ']');
19242
19235
  var nonASCIIidentifier2 = new RegExp('[' + nonASCIIidentifierStartChars2 + nonASCIIidentifierChars2 + ']');
19243
-
19244
- nonASCIIidentifierStartChars2 =
19245
- nonASCIIidentifierChars2 = null;
19246
19236
  var astralIdentifierStartCodes2 = [
19247
19237
  0,
19248
19238
  11,
@@ -21846,7 +21836,7 @@ var CommentsParser = class extends BaseParser {
21846
21836
  };
21847
21837
 
21848
21838
  var State = class _State {
21849
- flags = 512;
21839
+ flags = 4096;
21850
21840
  get strict() {
21851
21841
  return (this.flags & 1) > 0;
21852
21842
  }
@@ -21942,32 +21932,61 @@ var State = class _State {
21942
21932
  this.flags &= -65;
21943
21933
  }
21944
21934
 
21945
- topicContext = {
21946
- maxNumOfResolvableTopics: 0,
21947
- maxTopicIndex: null,
21948
- };
21949
- get soloAwait() {
21935
+ get inConditionalConsequent() {
21950
21936
  return (this.flags & 128) > 0;
21951
21937
  }
21952
21938
 
21953
- set soloAwait(v) {
21939
+ set inConditionalConsequent(v) {
21954
21940
  if (v)
21955
21941
  this.flags |= 128;
21956
21942
  else
21957
21943
  this.flags &= -129;
21958
21944
  }
21959
21945
 
21960
- get inFSharpPipelineDirectBody() {
21946
+ get inHackPipelineBody() {
21961
21947
  return (this.flags & 256) > 0;
21962
21948
  }
21963
21949
 
21964
- set inFSharpPipelineDirectBody(v) {
21950
+ set inHackPipelineBody(v) {
21965
21951
  if (v)
21966
21952
  this.flags |= 256;
21967
21953
  else
21968
21954
  this.flags &= -257;
21969
21955
  }
21970
21956
 
21957
+ get seenTopicReference() {
21958
+ return (this.flags & 512) > 0;
21959
+ }
21960
+
21961
+ set seenTopicReference(v) {
21962
+ if (v)
21963
+ this.flags |= 512;
21964
+ else
21965
+ this.flags &= -513;
21966
+ }
21967
+
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
+
21971
21990
  labels = [];
21972
21991
  commentsLen = 0;
21973
21992
  commentStack = [];
@@ -21980,37 +21999,37 @@ var State = class _State {
21980
21999
  lastTokStartLoc = null;
21981
22000
  context = [types.brace];
21982
22001
  get canStartJSXElement() {
21983
- return (this.flags & 512) > 0;
22002
+ return (this.flags & 4096) > 0;
21984
22003
  }
21985
22004
 
21986
22005
  set canStartJSXElement(v) {
21987
22006
  if (v)
21988
- this.flags |= 512;
22007
+ this.flags |= 4096;
21989
22008
  else
21990
- this.flags &= -513;
22009
+ this.flags &= -4097;
21991
22010
  }
21992
22011
 
21993
22012
  get containsEsc() {
21994
- return (this.flags & 1024) > 0;
22013
+ return (this.flags & 8192) > 0;
21995
22014
  }
21996
22015
 
21997
22016
  set containsEsc(v) {
21998
22017
  if (v)
21999
- this.flags |= 1024;
22018
+ this.flags |= 8192;
22000
22019
  else
22001
- this.flags &= -1025;
22020
+ this.flags &= -8193;
22002
22021
  }
22003
22022
 
22004
22023
  firstInvalidTemplateEscapePos = null;
22005
22024
  get hasTopLevelAwait() {
22006
- return (this.flags & 2048) > 0;
22025
+ return (this.flags & 16384) > 0;
22007
22026
  }
22008
22027
 
22009
22028
  set hasTopLevelAwait(v) {
22010
22029
  if (v)
22011
- this.flags |= 2048;
22030
+ this.flags |= 16384;
22012
22031
  else
22013
- this.flags &= -2049;
22032
+ this.flags &= -16385;
22014
22033
  }
22015
22034
 
22016
22035
  strictErrors = /* @__PURE__ */new Map();
@@ -22032,7 +22051,6 @@ var State = class _State {
22032
22051
  state.potentialArrowAt = this.potentialArrowAt;
22033
22052
  state.noArrowAt = this.noArrowAt.slice();
22034
22053
  state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice();
22035
- state.topicContext = this.topicContext;
22036
22054
  state.labels = this.labels.slice();
22037
22055
  state.commentsLen = this.commentsLen;
22038
22056
  state.commentStack = this.commentStack.slice();
@@ -27413,7 +27431,18 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
27413
27431
  }
27414
27432
  }
27415
27433
 
27416
- return super.parseConditional(expr, startLoc, refExpressionErrors);
27434
+ this.next();
27435
+ const node = this.startNodeAt(startLoc);
27436
+
27437
+ node.test = expr;
27438
+ const oldInConditionalConsequent = this.state.inConditionalConsequent;
27439
+
27440
+ this.state.inConditionalConsequent = true;
27441
+ node.consequent = this.parseMaybeAssignAllowIn();
27442
+ this.state.inConditionalConsequent = oldInConditionalConsequent;
27443
+ this.expect(10);
27444
+ node.alternate = this.parseMaybeAssign();
27445
+ return this.finishNode(node, 'ConditionalExpression');
27417
27446
  }
27418
27447
 
27419
27448
  parseParenItem(node, startLoc) {
@@ -27998,7 +28027,24 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
27998
28027
  }
27999
28028
 
28000
28029
  shouldParseAsyncArrow() {
28001
- return this.match(10) || super.shouldParseAsyncArrow();
28030
+ if (this.match(10)) {
28031
+ if (this.state.inConditionalConsequent)
28032
+ return false;
28033
+
28034
+ return true;
28035
+ }
28036
+
28037
+ return super.shouldParseAsyncArrow();
28038
+ }
28039
+
28040
+ parseParenAndDistinguishExpression(canBeArrow) {
28041
+ const oldInConditionalConsequent = this.state.inConditionalConsequent;
28042
+
28043
+ this.state.inConditionalConsequent = false;
28044
+ const result = super.parseParenAndDistinguishExpression(canBeArrow);
28045
+
28046
+ this.state.inConditionalConsequent = oldInConditionalConsequent;
28047
+ return result;
28002
28048
  }
28003
28049
 
28004
28050
  canHaveLeadingDecorator() {
@@ -29920,8 +29966,7 @@ var ExpressionParser = class extends LValParser {
29920
29966
  bigInt = null;
29921
29967
  }
29922
29968
 
29923
-
29924
- const node = this.parseLiteral(bigInt, 'BigIntLiteral');
29969
+ const node = this.parseLiteral(bigInt, 'BigIntLiteral');
29925
29970
 
29926
29971
  return node;
29927
29972
  }
@@ -30219,7 +30264,7 @@ var ExpressionParser = class extends LValParser {
30219
30264
  }
30220
30265
 
30221
30266
  parsePropertyDefinition(refExpressionErrors) {
30222
- let decorators = [];
30267
+ const decorators = [];
30223
30268
 
30224
30269
  if (this.match(22)) {
30225
30270
  if (this.hasPlugin('decorators')) {
@@ -30245,7 +30290,6 @@ var ExpressionParser = class extends LValParser {
30245
30290
 
30246
30291
  if (decorators.length) {
30247
30292
  prop.decorators = decorators;
30248
- decorators = [];
30249
30293
  }
30250
30294
 
30251
30295
  prop.method = false;
@@ -30811,16 +30855,17 @@ var ExpressionParser = class extends LValParser {
30811
30855
  }
30812
30856
 
30813
30857
  withTopicBindingContext(callback) {
30814
- const outerContextTopicState = this.state.topicContext;
30858
+ const oldInHackPipelineBody = this.state.inHackPipelineBody;
30815
30859
 
30816
- this.state.topicContext = {
30817
- maxNumOfResolvableTopics: 1,
30818
- maxTopicIndex: null,
30819
- };
30860
+ this.state.inHackPipelineBody = true;
30861
+ const oldSeenTopicReference = this.state.seenTopicReference;
30862
+
30863
+ this.state.seenTopicReference = false;
30820
30864
  try {
30821
30865
  return callback();
30822
30866
  } finally {
30823
- this.state.topicContext = outerContextTopicState;
30867
+ this.state.inHackPipelineBody = oldInHackPipelineBody;
30868
+ this.state.seenTopicReference = oldSeenTopicReference;
30824
30869
  }
30825
30870
  }
30826
30871
 
@@ -30868,15 +30913,15 @@ var ExpressionParser = class extends LValParser {
30868
30913
  }
30869
30914
 
30870
30915
  registerTopicReference() {
30871
- this.state.topicContext.maxTopicIndex = 0;
30916
+ this.state.seenTopicReference = true;
30872
30917
  }
30873
30918
 
30874
30919
  topicReferenceIsAllowedInCurrentContext() {
30875
- return this.state.topicContext.maxNumOfResolvableTopics >= 1;
30920
+ return this.state.inHackPipelineBody;
30876
30921
  }
30877
30922
 
30878
30923
  topicReferenceWasUsedInCurrentContext() {
30879
- return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0;
30924
+ return this.state.seenTopicReference;
30880
30925
  }
30881
30926
 
30882
30927
  parseFSharpPipelineBody(prec) {
@@ -30910,8 +30955,7 @@ var ExpressionParser = class extends LValParser {
30910
30955
  } finally {
30911
30956
  revertScopes();
30912
30957
  }
30913
-
30914
-
30958
+
30915
30959
  return this.finishNode(node, 'ModuleExpression');
30916
30960
  }
30917
30961
 
@@ -33235,8 +33279,7 @@ function parse(input, options) {
33235
33279
  return getParser(options, input).parse();
33236
33280
  } catch {}
33237
33281
 
33238
-
33239
- throw moduleError;
33282
+ throw moduleError;
33240
33283
  }
33241
33284
  } else {
33242
33285
  return getParser(options, input).parse();
@@ -42368,7 +42411,7 @@ function verify$1(visitor) {
42368
42411
  continue;
42369
42412
 
42370
42413
  if (!TYPES2.includes(nodeType)) {
42371
- throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse ${'8.0.0-rc.1'}`);
42414
+ throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse ${'8.0.0-rc.2'}`);
42372
42415
  }
42373
42416
 
42374
42417
  const visitors2 = visitor[nodeType];
@@ -45288,8 +45331,7 @@ function replaceWithSourceString(replacement) {
45288
45331
  throw err;
45289
45332
  }
45290
45333
 
45291
-
45292
- const expressionAST = ast.program.body[0].expression;
45334
+ const expressionAST = ast.program.body[0].expression;
45293
45335
  traverse3.removeProperties(expressionAST);
45294
45336
  return this.replaceWith(expressionAST);
45295
45337
  }
@@ -1 +1 @@
1
- {"inputs":{"../babel-babel/packages/babel-helper-validator-identifier/lib/index.js":{"bytes":13698,"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":352438,"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":481119,"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":16571,"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":128263,"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":383695},"../babel-babel/packages/babel-helper-validator-identifier/lib/index.js":{"bytesInOutput":13255},"../babel-babel/packages/babel-helper-string-parser/lib/index.js":{"bytesInOutput":7645},"../babel-babel/packages/babel-parser/lib/index.js":{"bytesInOutput":480898},"../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":16918},"../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":129026},"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":154489}},"bytes":1247666}}}
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":352341,"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":482266,"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":16571,"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":128263,"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":383598},"../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":482054},"../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":16918},"../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":129026},"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":154489}},"bytes":1248662}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/babel",
3
- "version": "5.2.14",
3
+ "version": "5.3.1",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Babel 8 bundled",
@@ -36,7 +36,7 @@
36
36
  "build:babel": "madrun build:babel",
37
37
  "build:js": "madrun build:js",
38
38
  "build:types": "madrun build:types",
39
- "build:fix": "madrun build:fix"
39
+ "build:fix:dts": "madrun build:fix:dts"
40
40
  },
41
41
  "dependencies": {
42
42
  "rollup-plugin-visualizer": "^6.0.3"
@@ -48,12 +48,12 @@
48
48
  "commonjs"
49
49
  ],
50
50
  "devDependencies": {
51
- "@babel/code-frame": "8.0.0-rc.1",
52
- "@babel/generator": "8.0.0-rc.1",
53
- "@babel/parser": "8.0.0-rc.1",
54
- "@babel/template": "8.0.0-rc.1",
55
- "@babel/traverse": "8.0.0-rc.1",
56
- "@babel/types": "8.0.0-rc.1",
51
+ "@babel/code-frame": "8.0.0-rc.2",
52
+ "@babel/generator": "8.0.0-rc.2",
53
+ "@babel/parser": "8.0.0-rc.2",
54
+ "@babel/template": "8.0.0-rc.2",
55
+ "@babel/traverse": "8.0.0-rc.2",
56
+ "@babel/types": "8.0.0-rc.2",
57
57
  "@swc/core": "^1.3.101",
58
58
  "@types/node": "^25.0.6",
59
59
  "acorn-stage3": "^4.0.0",