@putout/babel 4.5.2 → 4.5.4

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.
Files changed (2) hide show
  1. package/bundle/index.js +26 -170
  2. package/package.json +1 -1
package/bundle/index.js CHANGED
@@ -642,13 +642,6 @@ var require_js_tokens_BABEL_8_BREAKING_true = __commonJS({
642
642
  // ../babel-babel/node_modules/js-tokens-BABEL_8_BREAKING-false/index.js
643
643
  var require_js_tokens = __commonJS({
644
644
  '../babel-babel/node_modules/js-tokens/index.js'(exports2, module2) {
645
- function bool2(value) {
646
- if (value == null)
647
- return false;
648
-
649
- return value && value !== 'false' && value !== '0';
650
- }
651
-
652
645
  module2.exports = require_js_tokens_BABEL_8_BREAKING_true();
653
646
  },
654
647
  });
@@ -1003,34 +996,12 @@ var require_jsesc = __commonJS({
1003
996
  });
1004
997
 
1005
998
  // ../babel-babel/node_modules/ms/index.js
1006
- var require_ms = () => () => {};
1007
-
1008
999
  // ../babel-babel/node_modules/debug/src/common.js
1009
- var require_common = () => () => ({
1010
- enabled: false,
1011
- });
1012
-
1013
- // ../babel-babel/node_modules/debug/src/browser.js
1014
1000
  var require_browser = () => () => ({
1015
1001
  enabled: false,
1016
1002
  });
1017
1003
 
1018
1004
  // ../babel-babel/node_modules/has-flag/index.js
1019
- var require_has_flag = __commonJS({
1020
- '../babel-babel/node_modules/has-flag/index.js'(exports2, module2) {
1021
- "use strict";
1022
-
1023
- module2.exports = (flag, argv = process.argv) => {
1024
- const prefix2 = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
1025
- const position = argv.indexOf(prefix2 + flag);
1026
- const terminatorPosition = argv.indexOf('--');
1027
-
1028
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
1029
- };
1030
- },
1031
- });
1032
-
1033
- // ../babel-babel/node_modules/supports-color/index.js
1034
1005
  var require_node = () => () => ({
1035
1006
  enabled: false,
1036
1007
  });
@@ -3428,7 +3399,6 @@ var reservedWords = {
3428
3399
 
3429
3400
  var keywords = new Set(reservedWords.keyword);
3430
3401
  var reservedWordsStrictSet = new Set(reservedWords.strict);
3431
- var reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
3432
3402
 
3433
3403
  function isReservedWord(word, inModule) {
3434
3404
  return inModule && word === 'await' || word === 'enum';
@@ -18981,7 +18951,7 @@ var estree = (superClass) => class ESTreeParserMixin extends superClass {
18981
18951
 
18982
18952
  try {
18983
18953
  regex = new RegExp(pattern, flags);
18984
- } catch(_) {}
18954
+ } catch {}
18985
18955
 
18986
18956
 
18987
18957
  const node = this.estreeParseLiteral(regex);
@@ -19058,7 +19028,7 @@ var estree = (superClass) => class ESTreeParserMixin extends superClass {
19058
19028
  return stmt;
19059
19029
  }
19060
19030
 
19061
- fillOptionalPropertiesForTSESLint(node) {}
19031
+ fillOptionalPropertiesForTSESLint() {}
19062
19032
 
19063
19033
  cloneEstreeStringLiteral(node) {
19064
19034
  const {
@@ -19951,10 +19921,6 @@ function tokenIsAssignment(token) {
19951
19921
  return token >= 29 && token <= 33;
19952
19922
  }
19953
19923
 
19954
- function tokenIsFlowInterfaceOrTypeOrOpaque(token) {
19955
- return token >= 129 && token <= 131;
19956
- }
19957
-
19958
19924
  function tokenIsLoop(token) {
19959
19925
  return token >= 90 && token <= 92;
19960
19926
  }
@@ -21103,10 +21069,6 @@ function isKeyword2(word) {
21103
21069
  return keywords2.has(word);
21104
21070
  }
21105
21071
 
21106
- function isIteratorStart(current, next, next2) {
21107
- return current === 64 && next === 64 && isIdentifierStart2(next2);
21108
- }
21109
-
21110
21072
  var reservedWordLikeSet = /* @__PURE__ */new Set([
21111
21073
  'break',
21112
21074
  'case',
@@ -21359,101 +21321,6 @@ var ScopeHandler = class {
21359
21321
  }
21360
21322
  };
21361
21323
 
21362
- var FlowScope = class extends Scope {
21363
- constructor() {
21364
- super(...arguments);
21365
- __publicField(this, 'declareFunctions', /* @__PURE__ */new Set());
21366
- }
21367
- };
21368
-
21369
- var FlowScopeHandler = class extends ScopeHandler {
21370
- createScope(flags) {
21371
- return new FlowScope(flags);
21372
- }
21373
-
21374
- declareName(name, bindingType, loc) {
21375
- const scope2 = this.currentScope();
21376
-
21377
- if (bindingType & 2048) {
21378
- this.checkRedeclarationInScope(scope2, name, bindingType, loc);
21379
- this.maybeExportDefined(scope2, name);
21380
- scope2.declareFunctions.add(name);
21381
- return;
21382
- }
21383
-
21384
- super.declareName(name, bindingType, loc);
21385
- }
21386
-
21387
- isRedeclaredInScope(scope2, name, bindingType) {
21388
- if (super.isRedeclaredInScope(scope2, name, bindingType))
21389
- return true;
21390
-
21391
- if (bindingType & 2048 && !scope2.declareFunctions.has(name)) {
21392
- const type = scope2.names.get(name);
21393
- return (type & 4) > 0 || (type & 2) > 0;
21394
- }
21395
-
21396
- return false;
21397
- }
21398
-
21399
- checkLocalExport(id) {
21400
- if (!this.scopeStack[0].declareFunctions.has(id.name)) {
21401
- super.checkLocalExport(id);
21402
- }
21403
- }
21404
- };
21405
-
21406
- var reservedTypes = /* @__PURE__ */new Set([
21407
- '_',
21408
- 'any',
21409
- 'bool',
21410
- 'boolean',
21411
- 'empty',
21412
- 'extends',
21413
- 'false',
21414
- 'interface',
21415
- 'mixed',
21416
- 'null',
21417
- 'number',
21418
- 'static',
21419
- 'string',
21420
- 'true',
21421
- 'typeof',
21422
- 'void',
21423
- ]);
21424
-
21425
- function isEsModuleType(bodyElement) {
21426
- return bodyElement.type === 'DeclareExportAllDeclaration'
21427
- || bodyElement.type === 'DeclareExportDeclaration'
21428
- && (!bodyElement.declaration
21429
- || bodyElement.declaration.type !== 'TypeAlias'
21430
- && bodyElement.declaration.type !== 'InterfaceDeclaration');
21431
- }
21432
-
21433
- function hasTypeImportKind(node) {
21434
- return node.importKind === 'type' || node.importKind === 'typeof';
21435
- }
21436
-
21437
- var exportSuggestions = {
21438
- const: 'declare export var',
21439
- let: 'declare export var',
21440
- type: 'export type',
21441
- interface: 'export interface',
21442
- };
21443
-
21444
- function partition(list, test) {
21445
- const list1 = [];
21446
- const list2 = [];
21447
-
21448
- for (let i = 0; i < list.length; i++) {
21449
- (test(list[i], i, list) ? list1 : list2).push(list[i]);
21450
- }
21451
-
21452
- return [list1, list2];
21453
- }
21454
-
21455
- var FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/;
21456
-
21457
21324
  var entities = {
21458
21325
  __proto__: null,
21459
21326
  quot: '"',
@@ -24493,7 +24360,7 @@ var Tokenizer = class extends CommentsParser {
24493
24360
  return this.raise(toParseError, at, details);
24494
24361
  }
24495
24362
 
24496
- updateContext(prevType) {}
24363
+ updateContext() {}
24497
24364
 
24498
24365
  unexpected(loc, type) {
24499
24366
  throw this.raise(Errors.UnexpectedToken, loc != null ? loc : this.state.startLoc, {
@@ -25364,7 +25231,7 @@ var LValParser = class extends NodeUtils {
25364
25231
  }
25365
25232
  }
25366
25233
 
25367
- toReferencedList(exprList, isParenthesizedExpr) {
25234
+ toReferencedList(exprList) {
25368
25235
  return exprList;
25369
25236
  }
25370
25237
 
@@ -25540,7 +25407,7 @@ var LValParser = class extends NodeUtils {
25540
25407
  return this.finishNode(node, 'AssignmentPattern');
25541
25408
  }
25542
25409
 
25543
- isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding) {
25410
+ isValidLVal(type, disallowCallExpression) {
25544
25411
  switch(type) {
25545
25412
  case 'AssignmentPattern':
25546
25413
  return 'left';
@@ -27404,7 +27271,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
27404
27271
  return this.finishNode(node, 'TSModuleBlock');
27405
27272
  }
27406
27273
 
27407
- tsParseModuleOrNamespaceDeclaration(node, nested = false) {
27274
+ tsParseModuleOrNamespaceDeclaration(node) {
27408
27275
  node.id = this.tsParseEntityName(1);
27409
27276
 
27410
27277
  if (node.id.type === 'Identifier') {
@@ -27446,7 +27313,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
27446
27313
  return this.finishNode(node, 'TSModuleDeclaration');
27447
27314
  }
27448
27315
 
27449
- tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, isExport) {
27316
+ tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier) {
27450
27317
  node.id = maybeDefaultIdentifier || this.parseIdentifier();
27451
27318
  this.checkIdentifier(node.id, 4096);
27452
27319
  this.expect(29);
@@ -27825,7 +27692,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
27825
27692
  });
27826
27693
  }
27827
27694
 
27828
- toReferencedList(exprList, isInParens) {
27695
+ toReferencedList(exprList) {
27829
27696
  this.tsCheckForInvalidTypeCasts(exprList);
27830
27697
  return exprList;
27831
27698
  }
@@ -28431,7 +28298,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
28431
28298
  return declaration;
28432
28299
  }
28433
28300
 
28434
- parseClassId(node, isStatement5, optionalId, bindingType) {
28301
+ parseClassId(node, isStatement5, optionalId) {
28435
28302
  if ((!isStatement5 || optionalId) && this.isContextual(113)) {
28436
28303
  return;
28437
28304
  }
@@ -29100,7 +28967,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
29100
28967
  return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly);
29101
28968
  }
29102
28969
 
29103
- parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) {
28970
+ parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly) {
29104
28971
  if (!importedIsString && isMaybeTypeOnly) {
29105
28972
  this.parseTypeOnlyImportExportSpecifier(specifier, true, isInTypeOnlyImport);
29106
28973
  return this.finishNode(specifier, 'ImportSpecifier');
@@ -30045,7 +29912,7 @@ var ExpressionParser = class extends LValParser {
30045
29912
  return this.parseConditional(expr, startLoc, refExpressionErrors);
30046
29913
  }
30047
29914
 
30048
- parseConditional(expr, startLoc, refExpressionErrors) {
29915
+ parseConditional(expr, startLoc) {
30049
29916
  if (this.eat(17)) {
30050
29917
  const node = this.startNodeAt(startLoc);
30051
29918
 
@@ -31080,7 +30947,7 @@ var ExpressionParser = class extends LValParser {
31080
30947
  return this.finishNode(parenExpression, 'ParenthesizedExpression');
31081
30948
  }
31082
30949
 
31083
- shouldParseArrow(params) {
30950
+ shouldParseArrow() {
31084
30951
  return !this.canInsertSemicolon();
31085
30952
  }
31086
30953
 
@@ -31090,7 +30957,7 @@ var ExpressionParser = class extends LValParser {
31090
30957
  }
31091
30958
  }
31092
30959
 
31093
- parseParenItem(node, startLoc) {
30960
+ parseParenItem(node) {
31094
30961
  return node;
31095
30962
  }
31096
30963
 
@@ -32041,7 +31908,7 @@ var ExpressionParser = class extends LValParser {
32041
31908
  return this.parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse);
32042
31909
  }
32043
31910
 
32044
- parsePropertyNamePrefixOperator(prop) {}
31911
+ parsePropertyNamePrefixOperator() {}
32045
31912
  };
32046
31913
 
32047
31914
  var loopLabel = {
@@ -32055,7 +31922,7 @@ var switchLabel = {
32055
31922
  var loneSurrogate = /[\uD800-\uDFFF]/u;
32056
31923
  var keywordRelationalOperator = /in(?:stanceof)?/y;
32057
31924
 
32058
- function babel7CompatTokens(tokens, input, startIndex) {
31925
+ function babel7CompatTokens(tokens) {
32059
31926
  for (let i = 0; i < tokens.length; i++) {
32060
31927
  const token = tokens[i];
32061
31928
  const {type} = token;
@@ -32932,7 +32799,7 @@ var StatementParser = class extends ExpressionParser {
32932
32799
  return this.finishNode(node, 'LabeledStatement');
32933
32800
  }
32934
32801
 
32935
- parseExpressionStatement(node, expr, decorators) {
32802
+ parseExpressionStatement(node, expr) {
32936
32803
  node.expression = expr;
32937
32804
  this.semicolon();
32938
32805
  return this.finishNode(node, 'ExpressionStatement');
@@ -33517,7 +33384,7 @@ var StatementParser = class extends ExpressionParser {
33517
33384
  this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.loc.start);
33518
33385
  }
33519
33386
 
33520
- parsePostMemberNameModifiers(methodOrProp) {}
33387
+ parsePostMemberNameModifiers() {}
33521
33388
 
33522
33389
  parseClassPrivateProperty(node) {
33523
33390
  this.parseInitializer(node);
@@ -33647,7 +33514,7 @@ var StatementParser = class extends ExpressionParser {
33647
33514
  throw this.unexpected(null, 5);
33648
33515
  }
33649
33516
 
33650
- eatExportStar(node) {
33517
+ eatExportStar() {
33651
33518
  return this.eat(55);
33652
33519
  }
33653
33520
 
@@ -33756,7 +33623,7 @@ var StatementParser = class extends ExpressionParser {
33756
33623
  return res;
33757
33624
  }
33758
33625
 
33759
- parseExportDeclaration(node) {
33626
+ parseExportDeclaration() {
33760
33627
  if (this.match(80)) {
33761
33628
  const node2 = this.parseClass(this.startNode(), true, false);
33762
33629
  return node2;
@@ -33970,7 +33837,7 @@ var StatementParser = class extends ExpressionParser {
33970
33837
  return nodes2;
33971
33838
  }
33972
33839
 
33973
- parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) {
33840
+ parseExportSpecifier(node, isString) {
33974
33841
  if (this.eatContextual(93)) {
33975
33842
  node.exported = this.parseModuleExportName();
33976
33843
  } else if (isString) {
@@ -34110,7 +33977,7 @@ var StatementParser = class extends ExpressionParser {
34110
33977
  }
34111
33978
  }
34112
33979
 
34113
- isPrecedingIdImportPhase(phase) {
33980
+ isPrecedingIdImportPhase() {
34114
33981
  const {type} = this.state;
34115
33982
 
34116
33983
  return tokenIsIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12;
@@ -36463,7 +36330,7 @@ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLin
36463
36330
  ]);
36464
36331
  }
36465
36332
 
36466
- function assert3(_val) {}
36333
+ function assert3() {}
36467
36334
 
36468
36335
  function getIndex(arr, index2) {
36469
36336
  for (let i = arr.length; i <= index2; i++) {
@@ -39658,10 +39525,7 @@ function VoidPattern2() {
39658
39525
  this.word('void');
39659
39526
  }
39660
39527
 
39661
- var {
39662
- isDeclareExportDeclaration: isDeclareExportDeclaration2,
39663
- isStatement: isStatement$12,
39664
- } = lib_exports;
39528
+ var {isDeclareExportDeclaration: isDeclareExportDeclaration2} = lib_exports;
39665
39529
 
39666
39530
  function AnyTypeAnnotation2() {
39667
39531
  this.word('any');
@@ -41141,11 +41005,7 @@ function TSEnumMember2(node) {
41141
41005
  }
41142
41006
 
41143
41007
  function TSModuleDeclaration2(node) {
41144
- const {
41145
- declare,
41146
- id,
41147
- kind,
41148
- } = node;
41008
+ const {declare, kind} = node;
41149
41009
 
41150
41010
  if (declare) {
41151
41011
  this.word('declare');
@@ -43666,7 +43526,6 @@ var cache = /* @__PURE__ */Object.freeze({
43666
43526
 
43667
43527
  var {
43668
43528
  assignmentExpression: assignmentExpression$3,
43669
- callExpression: callExpression$3,
43670
43529
  cloneNode: cloneNode$3,
43671
43530
  getBindingIdentifiers: getBindingIdentifiers$2,
43672
43531
  identifier: identifier$3,
@@ -43699,8 +43558,6 @@ var {
43699
43558
  isVariableDeclaration: isVariableDeclaration$1,
43700
43559
  expressionStatement: expressionStatement$3,
43701
43560
  matchesPattern: matchesPattern$1,
43702
- memberExpression: memberExpression$1,
43703
- numericLiteral: numericLiteral$2,
43704
43561
  toIdentifier: toIdentifier2,
43705
43562
  variableDeclaration: variableDeclaration$1,
43706
43563
  variableDeclarator: variableDeclarator$1,
@@ -44160,7 +44017,7 @@ var _Scope = class _Scope {
44160
44017
  }
44161
44018
  }
44162
44019
 
44163
- checkBlockScopedCollisions(local, kind, name, id) {
44020
+ checkBlockScopedCollisions(local, kind, name) {
44164
44021
  if (kind === 'param')
44165
44022
  return;
44166
44023
 
@@ -44174,7 +44031,7 @@ var _Scope = class _Scope {
44174
44031
  || local.kind === 'param' && kind === 'const';
44175
44032
 
44176
44033
  if (duplicate) {
44177
- throw this.path.hub.buildError(id, `Duplicate declaration "${name}"`, TypeError);
44034
+ throw Error(`Duplicate declaration '${name}'`, TypeError);
44178
44035
  }
44179
44036
  }
44180
44037
 
@@ -45029,7 +44886,6 @@ function inType(...candidateTypes) {
45029
44886
  var {
45030
44887
  createFlowUnionType: createFlowUnionType2,
45031
44888
  createTSUnionType: createTSUnionType2,
45032
- createUnionTypeAnnotation,
45033
44889
  isFlowType: isFlowType2,
45034
44890
  isTSType: isTSType2,
45035
44891
  } = lib_exports;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/babel",
3
- "version": "4.5.2",
3
+ "version": "4.5.4",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Babel 8 in CommonJS",