rollup 4.5.0 → 4.5.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/dist/bin/rollup CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  /*
3
3
  @license
4
- Rollup.js v4.5.0
5
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
4
+ Rollup.js v4.5.2
5
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
6
6
 
7
7
  https://github.com/rollup/rollup
8
8
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/es/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -16,7 +16,7 @@ import { xxhashBase64Url } from '../../native.js';
16
16
  import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/promises';
17
17
  import * as tty from 'tty';
18
18
 
19
- var version = "4.5.0";
19
+ var version = "4.5.2";
20
20
 
21
21
  const comma = ','.charCodeAt(0);
22
22
  const semicolon = ';'.charCodeAt(0);
@@ -4531,7 +4531,7 @@ const literalStringMembers = assembleMemberDescriptions({
4531
4531
  toLocaleLowerCase: returnsString,
4532
4532
  toLocaleUpperCase: returnsString,
4533
4533
  toLowerCase: returnsString,
4534
- toString: returnsString,
4534
+ toString: returnsString, // overrides the toString() method of the Object object; it does not inherit Object.prototype.toString()
4535
4535
  toUpperCase: returnsString,
4536
4536
  trim: returnsString,
4537
4537
  trimEnd: returnsString,
@@ -5901,10 +5901,9 @@ class ChildScope extends Scope {
5901
5901
  }
5902
5902
 
5903
5903
  class CatchBodyScope extends ChildScope {
5904
- constructor(parent, context) {
5905
- super(parent, context);
5904
+ constructor(parent) {
5905
+ super(parent, parent.context);
5906
5906
  this.parent = parent;
5907
- this.context = context;
5908
5907
  }
5909
5908
  addDeclaration(identifier, context, init, kind) {
5910
5909
  if (kind === "var" /* VariableKind.var */) {
@@ -5951,10 +5950,8 @@ class CatchBodyScope extends ChildScope {
5951
5950
  }
5952
5951
 
5953
5952
  class FunctionBodyScope extends ChildScope {
5954
- constructor(parent, context) {
5955
- super(parent, context);
5956
- this.parent = parent;
5957
- this.context = context;
5953
+ constructor(parent) {
5954
+ super(parent, parent.context);
5958
5955
  }
5959
5956
  // There is stuff that is only allowed in function scopes, i.e. functions can
5960
5957
  // be redeclared, functions and var can redeclare each other
@@ -5979,13 +5976,11 @@ class FunctionBodyScope extends ChildScope {
5979
5976
  }
5980
5977
 
5981
5978
  class ParameterScope extends ChildScope {
5982
- constructor(parent, context, isCatchScope) {
5983
- super(parent, context);
5979
+ constructor(parent, isCatchScope) {
5980
+ super(parent, parent.context);
5984
5981
  this.parameters = [];
5985
5982
  this.hasRest = false;
5986
- this.bodyScope = isCatchScope
5987
- ? new CatchBodyScope(this, context)
5988
- : new FunctionBodyScope(this, context);
5983
+ this.bodyScope = isCatchScope ? new CatchBodyScope(this) : new FunctionBodyScope(this);
5989
5984
  }
5990
5985
  /**
5991
5986
  * Adds a parameter to this scope. Parameters must be added in the correct
@@ -7510,6 +7505,9 @@ function removeLineBreaks(code, start, end) {
7510
7505
  }
7511
7506
 
7512
7507
  class BlockScope extends ChildScope {
7508
+ constructor(parent) {
7509
+ super(parent, parent.context);
7510
+ }
7513
7511
  addDeclaration(identifier, context, init, kind) {
7514
7512
  if (kind === "var" /* VariableKind.var */) {
7515
7513
  const name = identifier.name;
@@ -7582,7 +7580,7 @@ class BlockStatement extends NodeBase {
7582
7580
  createScope(parentScope) {
7583
7581
  this.scope = this.parent.preventChildBlockScope
7584
7582
  ? parentScope
7585
- : new BlockScope(parentScope, this.scope.context);
7583
+ : new BlockScope(parentScope);
7586
7584
  }
7587
7585
  hasEffects(context) {
7588
7586
  if (this.deoptimizeBody)
@@ -7800,7 +7798,7 @@ class ArrowFunctionExpression extends FunctionBase {
7800
7798
  this.objectEntity = null;
7801
7799
  }
7802
7800
  createScope(parentScope) {
7803
- this.scope = new ReturnValueScope(parentScope, this.scope.context, false);
7801
+ this.scope = new ReturnValueScope(parentScope, false);
7804
7802
  }
7805
7803
  hasEffects() {
7806
7804
  if (!this.deoptimized)
@@ -8077,8 +8075,9 @@ class ThisVariable extends ParameterVariable {
8077
8075
  }
8078
8076
 
8079
8077
  class FunctionScope extends ReturnValueScope {
8080
- constructor(parent, context) {
8081
- super(parent, context, false);
8078
+ constructor(parent) {
8079
+ const { context } = parent;
8080
+ super(parent, false);
8082
8081
  this.variables.set('arguments', (this.argumentsVariable = new ArgumentsVariable(context)));
8083
8082
  this.variables.set('this', (this.thisVariable = new ThisVariable(context)));
8084
8083
  }
@@ -8103,7 +8102,7 @@ class FunctionNode extends FunctionBase {
8103
8102
  this.objectEntity = null;
8104
8103
  }
8105
8104
  createScope(parentScope) {
8106
- this.scope = new FunctionScope(parentScope, this.scope.context);
8105
+ this.scope = new FunctionScope(parentScope);
8107
8106
  this.constructedEntity = new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE);
8108
8107
  // This makes sure that all deoptimizations of "this" are applied to the
8109
8108
  // constructed entity.
@@ -8893,7 +8892,7 @@ class CallExpression extends CallExpressionBase {
8893
8892
 
8894
8893
  class CatchClause extends NodeBase {
8895
8894
  createScope(parentScope) {
8896
- this.scope = new ParameterScope(parentScope, this.scope.context, true);
8895
+ this.scope = new ParameterScope(parentScope, true);
8897
8896
  }
8898
8897
  parseNode(esTreeNode) {
8899
8898
  const { body, param, type } = esTreeNode;
@@ -8927,7 +8926,8 @@ class ChainExpression extends NodeBase {
8927
8926
  }
8928
8927
 
8929
8928
  class ClassBodyScope extends ChildScope {
8930
- constructor(parent, classNode, context) {
8929
+ constructor(parent, classNode) {
8930
+ const { context } = parent;
8931
8931
  super(parent, context);
8932
8932
  this.variables.set('this', (this.thisVariable = new LocalVariable('this', null, classNode, context, "other" /* VariableKind.other */)));
8933
8933
  this.instanceScope = new ChildScope(this, context);
@@ -8940,7 +8940,7 @@ class ClassBodyScope extends ChildScope {
8940
8940
 
8941
8941
  class ClassBody extends NodeBase {
8942
8942
  createScope(parentScope) {
8943
- this.scope = new ClassBodyScope(parentScope, this.parent, this.scope.context);
8943
+ this.scope = new ClassBodyScope(parentScope, this.parent);
8944
8944
  }
8945
8945
  include(context, includeChildrenRecursively) {
8946
8946
  this.included = true;
@@ -9068,7 +9068,7 @@ class ClassNode extends NodeBase {
9068
9068
  this.objectEntity = null;
9069
9069
  }
9070
9070
  createScope(parentScope) {
9071
- this.scope = new ChildScope(parentScope, this.scope.context);
9071
+ this.scope = new ChildScope(parentScope, parentScope.context);
9072
9072
  }
9073
9073
  deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) {
9074
9074
  this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker);
@@ -9628,7 +9628,7 @@ class ExportSpecifier extends NodeBase {
9628
9628
 
9629
9629
  class ForInStatement extends NodeBase {
9630
9630
  createScope(parentScope) {
9631
- this.scope = new BlockScope(parentScope, this.scope.context);
9631
+ this.scope = new BlockScope(parentScope);
9632
9632
  }
9633
9633
  hasEffects(context) {
9634
9634
  const { body, deoptimized, left, right } = this;
@@ -9674,7 +9674,7 @@ class ForOfStatement extends NodeBase {
9674
9674
  this.flags = setFlag(this.flags, 131072 /* Flag.await */, value);
9675
9675
  }
9676
9676
  createScope(parentScope) {
9677
- this.scope = new BlockScope(parentScope, this.scope.context);
9677
+ this.scope = new BlockScope(parentScope);
9678
9678
  }
9679
9679
  hasEffects() {
9680
9680
  if (!this.deoptimized)
@@ -9713,7 +9713,7 @@ class ForOfStatement extends NodeBase {
9713
9713
 
9714
9714
  class ForStatement extends NodeBase {
9715
9715
  createScope(parentScope) {
9716
- this.scope = new BlockScope(parentScope, this.scope.context);
9716
+ this.scope = new BlockScope(parentScope);
9717
9717
  }
9718
9718
  hasEffects(context) {
9719
9719
  if (this.init?.hasEffects(context) ||
@@ -9739,6 +9739,15 @@ class ForStatement extends NodeBase {
9739
9739
  }
9740
9740
 
9741
9741
  class FunctionExpression extends FunctionNode {
9742
+ createScope(parentScope) {
9743
+ super.createScope((this.idScope = new ChildScope(parentScope, parentScope.context)));
9744
+ }
9745
+ parseNode(esTreeNode) {
9746
+ if (esTreeNode.id !== null) {
9747
+ this.id = new Identifier(esTreeNode.id, this, this.idScope);
9748
+ }
9749
+ super.parseNode(esTreeNode);
9750
+ }
9742
9751
  render(code, options, { renderedSurroundingElement } = BLANK) {
9743
9752
  super.render(code, options);
9744
9753
  if (renderedSurroundingElement === ExpressionStatement$1) {
@@ -9806,10 +9815,10 @@ class IfStatement extends NodeBase {
9806
9815
  }
9807
9816
  }
9808
9817
  parseNode(esTreeNode) {
9809
- this.consequentScope = new TrackingScope(this.scope, this.scope.context);
9818
+ this.consequentScope = new TrackingScope(this.scope);
9810
9819
  this.consequent = new (this.scope.context.getNodeConstructor(esTreeNode.consequent.type))(esTreeNode.consequent, this, this.consequentScope);
9811
9820
  if (esTreeNode.alternate) {
9812
- this.alternateScope = new TrackingScope(this.scope, this.scope.context);
9821
+ this.alternateScope = new TrackingScope(this.scope);
9813
9822
  this.alternate = new (this.scope.context.getNodeConstructor(esTreeNode.alternate.type))(esTreeNode.alternate, this, this.alternateScope);
9814
9823
  }
9815
9824
  super.parseNode(esTreeNode);
@@ -11184,7 +11193,7 @@ class SequenceExpression extends NodeBase {
11184
11193
 
11185
11194
  class StaticBlock extends NodeBase {
11186
11195
  createScope(parentScope) {
11187
- this.scope = new BlockScope(parentScope, this.scope.context);
11196
+ this.scope = new BlockScope(parentScope);
11188
11197
  }
11189
11198
  hasEffects(context) {
11190
11199
  for (const node of this.body) {
@@ -11268,7 +11277,7 @@ SwitchCase.prototype.needsBoundaries = true;
11268
11277
  class SwitchStatement extends NodeBase {
11269
11278
  createScope(parentScope) {
11270
11279
  this.parentScope = parentScope;
11271
- this.scope = new BlockScope(parentScope, this.scope.context);
11280
+ this.scope = new BlockScope(parentScope);
11272
11281
  }
11273
11282
  hasEffects(context) {
11274
11283
  if (this.discriminant.hasEffects(context))
@@ -13048,10 +13057,6 @@ class Module {
13048
13057
  const shebangEndPosition = code.indexOf('\n');
13049
13058
  this.shebang = code.slice(2, shebangEndPosition);
13050
13059
  }
13051
- /* eslint-disable-next-line unicorn/number-literal-case */
13052
- if (code.charCodeAt(0) === 65279) {
13053
- code = code.slice(1);
13054
- }
13055
13060
  timeStart('generate ast', 3);
13056
13061
  this.info.code = code;
13057
13062
  this.originalCode = originalCode;
@@ -13076,7 +13081,7 @@ class Module {
13076
13081
  // can change that, but it makes sense to use it for the source file name
13077
13082
  const fileName = this.id;
13078
13083
  this.magicString = new MagicString(code, {
13079
- filename: (this.excludeFromSourcemap ? null : fileName),
13084
+ filename: (this.excludeFromSourcemap ? null : fileName), // don't include plugin helpers in sourcemap
13080
13085
  indentExclusionRanges: []
13081
13086
  });
13082
13087
  this.astContext = {
@@ -13084,10 +13089,10 @@ class Module {
13084
13089
  addExport: this.addExport.bind(this),
13085
13090
  addImport: this.addImport.bind(this),
13086
13091
  addImportMeta: this.addImportMeta.bind(this),
13087
- code,
13092
+ code, // Only needed for debugging
13088
13093
  deoptimizationTracker: this.graph.deoptimizationTracker,
13089
13094
  error: this.error.bind(this),
13090
- fileName,
13095
+ fileName, // Needed for warnings
13091
13096
  getExports: this.getExports.bind(this),
13092
13097
  getModuleExecIndex: () => this.execIndex,
13093
13098
  getModuleName: this.basename.bind(this),
@@ -13218,7 +13223,7 @@ class Module {
13218
13223
  this.assertUniqueExportName(name, node.exported.start);
13219
13224
  this.reexportDescriptions.set(name, {
13220
13225
  localName: '*',
13221
- module: null,
13226
+ module: null, // filled in later,
13222
13227
  source,
13223
13228
  start: node.start
13224
13229
  });
@@ -13237,7 +13242,7 @@ class Module {
13237
13242
  this.assertUniqueExportName(name, start);
13238
13243
  this.reexportDescriptions.set(name, {
13239
13244
  localName: local instanceof Literal ? local.value : local.name,
13240
- module: null,
13245
+ module: null, // filled in later,
13241
13246
  source,
13242
13247
  start
13243
13248
  });
@@ -13289,7 +13294,7 @@ class Module {
13289
13294
  ? specifier.imported.name
13290
13295
  : specifier.imported.value;
13291
13296
  this.importDescriptions.set(localName, {
13292
- module: null,
13297
+ module: null, // filled in later
13293
13298
  name,
13294
13299
  source,
13295
13300
  start: specifier.start
@@ -17687,6 +17692,11 @@ class ModuleLoader {
17687
17692
  : source != null && typeof source === 'object' && typeof source.code === 'string'
17688
17693
  ? source
17689
17694
  : error(logBadLoader(id));
17695
+ const code = sourceDescription.code;
17696
+ /* eslint-disable-next-line unicorn/number-literal-case */
17697
+ if (code.charCodeAt(0) === 65279) {
17698
+ sourceDescription.code = code.slice(1);
17699
+ }
17690
17700
  const cachedModule = this.graph.cachedModules.get(id);
17691
17701
  if (cachedModule &&
17692
17702
  !cachedModule.customTransformCache &&
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -4630,7 +4630,7 @@ class FileWatcher {
4630
4630
  const eventsRewrites = {
4631
4631
  create: {
4632
4632
  create: 'buggy',
4633
- delete: null,
4633
+ delete: null, //delete file from map
4634
4634
  update: 'create'
4635
4635
  },
4636
4636
  delete: {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/parseAst.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -31,7 +31,7 @@ function _interopNamespaceDefault(e) {
31
31
 
32
32
  const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
33
33
 
34
- var version = "4.5.0";
34
+ var version = "4.5.2";
35
35
 
36
36
  function ensureArray$1(items) {
37
37
  if (Array.isArray(items)) {
@@ -5980,7 +5980,7 @@ const literalStringMembers = assembleMemberDescriptions({
5980
5980
  toLocaleLowerCase: returnsString,
5981
5981
  toLocaleUpperCase: returnsString,
5982
5982
  toLowerCase: returnsString,
5983
- toString: returnsString,
5983
+ toString: returnsString, // overrides the toString() method of the Object object; it does not inherit Object.prototype.toString()
5984
5984
  toUpperCase: returnsString,
5985
5985
  trim: returnsString,
5986
5986
  trimEnd: returnsString,
@@ -7338,10 +7338,9 @@ class ChildScope extends Scope {
7338
7338
  }
7339
7339
 
7340
7340
  class CatchBodyScope extends ChildScope {
7341
- constructor(parent, context) {
7342
- super(parent, context);
7341
+ constructor(parent) {
7342
+ super(parent, parent.context);
7343
7343
  this.parent = parent;
7344
- this.context = context;
7345
7344
  }
7346
7345
  addDeclaration(identifier, context, init, kind) {
7347
7346
  if (kind === "var" /* VariableKind.var */) {
@@ -7388,10 +7387,8 @@ class CatchBodyScope extends ChildScope {
7388
7387
  }
7389
7388
 
7390
7389
  class FunctionBodyScope extends ChildScope {
7391
- constructor(parent, context) {
7392
- super(parent, context);
7393
- this.parent = parent;
7394
- this.context = context;
7390
+ constructor(parent) {
7391
+ super(parent, parent.context);
7395
7392
  }
7396
7393
  // There is stuff that is only allowed in function scopes, i.e. functions can
7397
7394
  // be redeclared, functions and var can redeclare each other
@@ -7416,13 +7413,11 @@ class FunctionBodyScope extends ChildScope {
7416
7413
  }
7417
7414
 
7418
7415
  class ParameterScope extends ChildScope {
7419
- constructor(parent, context, isCatchScope) {
7420
- super(parent, context);
7416
+ constructor(parent, isCatchScope) {
7417
+ super(parent, parent.context);
7421
7418
  this.parameters = [];
7422
7419
  this.hasRest = false;
7423
- this.bodyScope = isCatchScope
7424
- ? new CatchBodyScope(this, context)
7425
- : new FunctionBodyScope(this, context);
7420
+ this.bodyScope = isCatchScope ? new CatchBodyScope(this) : new FunctionBodyScope(this);
7426
7421
  }
7427
7422
  /**
7428
7423
  * Adds a parameter to this scope. Parameters must be added in the correct
@@ -8945,6 +8940,9 @@ function removeLineBreaks(code, start, end) {
8945
8940
  }
8946
8941
 
8947
8942
  class BlockScope extends ChildScope {
8943
+ constructor(parent) {
8944
+ super(parent, parent.context);
8945
+ }
8948
8946
  addDeclaration(identifier, context, init, kind) {
8949
8947
  if (kind === "var" /* VariableKind.var */) {
8950
8948
  const name = identifier.name;
@@ -9017,7 +9015,7 @@ class BlockStatement extends NodeBase {
9017
9015
  createScope(parentScope) {
9018
9016
  this.scope = this.parent.preventChildBlockScope
9019
9017
  ? parentScope
9020
- : new BlockScope(parentScope, this.scope.context);
9018
+ : new BlockScope(parentScope);
9021
9019
  }
9022
9020
  hasEffects(context) {
9023
9021
  if (this.deoptimizeBody)
@@ -9235,7 +9233,7 @@ class ArrowFunctionExpression extends FunctionBase {
9235
9233
  this.objectEntity = null;
9236
9234
  }
9237
9235
  createScope(parentScope) {
9238
- this.scope = new ReturnValueScope(parentScope, this.scope.context, false);
9236
+ this.scope = new ReturnValueScope(parentScope, false);
9239
9237
  }
9240
9238
  hasEffects() {
9241
9239
  if (!this.deoptimized)
@@ -9512,8 +9510,9 @@ class ThisVariable extends ParameterVariable {
9512
9510
  }
9513
9511
 
9514
9512
  class FunctionScope extends ReturnValueScope {
9515
- constructor(parent, context) {
9516
- super(parent, context, false);
9513
+ constructor(parent) {
9514
+ const { context } = parent;
9515
+ super(parent, false);
9517
9516
  this.variables.set('arguments', (this.argumentsVariable = new ArgumentsVariable(context)));
9518
9517
  this.variables.set('this', (this.thisVariable = new ThisVariable(context)));
9519
9518
  }
@@ -9538,7 +9537,7 @@ class FunctionNode extends FunctionBase {
9538
9537
  this.objectEntity = null;
9539
9538
  }
9540
9539
  createScope(parentScope) {
9541
- this.scope = new FunctionScope(parentScope, this.scope.context);
9540
+ this.scope = new FunctionScope(parentScope);
9542
9541
  this.constructedEntity = new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE);
9543
9542
  // This makes sure that all deoptimizations of "this" are applied to the
9544
9543
  // constructed entity.
@@ -10328,7 +10327,7 @@ class CallExpression extends CallExpressionBase {
10328
10327
 
10329
10328
  class CatchClause extends NodeBase {
10330
10329
  createScope(parentScope) {
10331
- this.scope = new ParameterScope(parentScope, this.scope.context, true);
10330
+ this.scope = new ParameterScope(parentScope, true);
10332
10331
  }
10333
10332
  parseNode(esTreeNode) {
10334
10333
  const { body, param, type } = esTreeNode;
@@ -10362,7 +10361,8 @@ class ChainExpression extends NodeBase {
10362
10361
  }
10363
10362
 
10364
10363
  class ClassBodyScope extends ChildScope {
10365
- constructor(parent, classNode, context) {
10364
+ constructor(parent, classNode) {
10365
+ const { context } = parent;
10366
10366
  super(parent, context);
10367
10367
  this.variables.set('this', (this.thisVariable = new LocalVariable('this', null, classNode, context, "other" /* VariableKind.other */)));
10368
10368
  this.instanceScope = new ChildScope(this, context);
@@ -10375,7 +10375,7 @@ class ClassBodyScope extends ChildScope {
10375
10375
 
10376
10376
  class ClassBody extends NodeBase {
10377
10377
  createScope(parentScope) {
10378
- this.scope = new ClassBodyScope(parentScope, this.parent, this.scope.context);
10378
+ this.scope = new ClassBodyScope(parentScope, this.parent);
10379
10379
  }
10380
10380
  include(context, includeChildrenRecursively) {
10381
10381
  this.included = true;
@@ -10503,7 +10503,7 @@ class ClassNode extends NodeBase {
10503
10503
  this.objectEntity = null;
10504
10504
  }
10505
10505
  createScope(parentScope) {
10506
- this.scope = new ChildScope(parentScope, this.scope.context);
10506
+ this.scope = new ChildScope(parentScope, parentScope.context);
10507
10507
  }
10508
10508
  deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) {
10509
10509
  this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker);
@@ -11063,7 +11063,7 @@ class ExportSpecifier extends NodeBase {
11063
11063
 
11064
11064
  class ForInStatement extends NodeBase {
11065
11065
  createScope(parentScope) {
11066
- this.scope = new BlockScope(parentScope, this.scope.context);
11066
+ this.scope = new BlockScope(parentScope);
11067
11067
  }
11068
11068
  hasEffects(context) {
11069
11069
  const { body, deoptimized, left, right } = this;
@@ -11109,7 +11109,7 @@ class ForOfStatement extends NodeBase {
11109
11109
  this.flags = setFlag(this.flags, 131072 /* Flag.await */, value);
11110
11110
  }
11111
11111
  createScope(parentScope) {
11112
- this.scope = new BlockScope(parentScope, this.scope.context);
11112
+ this.scope = new BlockScope(parentScope);
11113
11113
  }
11114
11114
  hasEffects() {
11115
11115
  if (!this.deoptimized)
@@ -11148,7 +11148,7 @@ class ForOfStatement extends NodeBase {
11148
11148
 
11149
11149
  class ForStatement extends NodeBase {
11150
11150
  createScope(parentScope) {
11151
- this.scope = new BlockScope(parentScope, this.scope.context);
11151
+ this.scope = new BlockScope(parentScope);
11152
11152
  }
11153
11153
  hasEffects(context) {
11154
11154
  if (this.init?.hasEffects(context) ||
@@ -11174,6 +11174,15 @@ class ForStatement extends NodeBase {
11174
11174
  }
11175
11175
 
11176
11176
  class FunctionExpression extends FunctionNode {
11177
+ createScope(parentScope) {
11178
+ super.createScope((this.idScope = new ChildScope(parentScope, parentScope.context)));
11179
+ }
11180
+ parseNode(esTreeNode) {
11181
+ if (esTreeNode.id !== null) {
11182
+ this.id = new Identifier(esTreeNode.id, this, this.idScope);
11183
+ }
11184
+ super.parseNode(esTreeNode);
11185
+ }
11177
11186
  render(code, options, { renderedSurroundingElement } = BLANK) {
11178
11187
  super.render(code, options);
11179
11188
  if (renderedSurroundingElement === ExpressionStatement$1) {
@@ -11241,10 +11250,10 @@ class IfStatement extends NodeBase {
11241
11250
  }
11242
11251
  }
11243
11252
  parseNode(esTreeNode) {
11244
- this.consequentScope = new TrackingScope(this.scope, this.scope.context);
11253
+ this.consequentScope = new TrackingScope(this.scope);
11245
11254
  this.consequent = new (this.scope.context.getNodeConstructor(esTreeNode.consequent.type))(esTreeNode.consequent, this, this.consequentScope);
11246
11255
  if (esTreeNode.alternate) {
11247
- this.alternateScope = new TrackingScope(this.scope, this.scope.context);
11256
+ this.alternateScope = new TrackingScope(this.scope);
11248
11257
  this.alternate = new (this.scope.context.getNodeConstructor(esTreeNode.alternate.type))(esTreeNode.alternate, this, this.alternateScope);
11249
11258
  }
11250
11259
  super.parseNode(esTreeNode);
@@ -12619,7 +12628,7 @@ class SequenceExpression extends NodeBase {
12619
12628
 
12620
12629
  class StaticBlock extends NodeBase {
12621
12630
  createScope(parentScope) {
12622
- this.scope = new BlockScope(parentScope, this.scope.context);
12631
+ this.scope = new BlockScope(parentScope);
12623
12632
  }
12624
12633
  hasEffects(context) {
12625
12634
  for (const node of this.body) {
@@ -12703,7 +12712,7 @@ SwitchCase.prototype.needsBoundaries = true;
12703
12712
  class SwitchStatement extends NodeBase {
12704
12713
  createScope(parentScope) {
12705
12714
  this.parentScope = parentScope;
12706
- this.scope = new BlockScope(parentScope, this.scope.context);
12715
+ this.scope = new BlockScope(parentScope);
12707
12716
  }
12708
12717
  hasEffects(context) {
12709
12718
  if (this.discriminant.hasEffects(context))
@@ -14476,10 +14485,6 @@ class Module {
14476
14485
  const shebangEndPosition = code.indexOf('\n');
14477
14486
  this.shebang = code.slice(2, shebangEndPosition);
14478
14487
  }
14479
- /* eslint-disable-next-line unicorn/number-literal-case */
14480
- if (code.charCodeAt(0) === 65279) {
14481
- code = code.slice(1);
14482
- }
14483
14488
  timeStart('generate ast', 3);
14484
14489
  this.info.code = code;
14485
14490
  this.originalCode = originalCode;
@@ -14504,7 +14509,7 @@ class Module {
14504
14509
  // can change that, but it makes sense to use it for the source file name
14505
14510
  const fileName = this.id;
14506
14511
  this.magicString = new MagicString(code, {
14507
- filename: (this.excludeFromSourcemap ? null : fileName),
14512
+ filename: (this.excludeFromSourcemap ? null : fileName), // don't include plugin helpers in sourcemap
14508
14513
  indentExclusionRanges: []
14509
14514
  });
14510
14515
  this.astContext = {
@@ -14512,10 +14517,10 @@ class Module {
14512
14517
  addExport: this.addExport.bind(this),
14513
14518
  addImport: this.addImport.bind(this),
14514
14519
  addImportMeta: this.addImportMeta.bind(this),
14515
- code,
14520
+ code, // Only needed for debugging
14516
14521
  deoptimizationTracker: this.graph.deoptimizationTracker,
14517
14522
  error: this.error.bind(this),
14518
- fileName,
14523
+ fileName, // Needed for warnings
14519
14524
  getExports: this.getExports.bind(this),
14520
14525
  getModuleExecIndex: () => this.execIndex,
14521
14526
  getModuleName: this.basename.bind(this),
@@ -14646,7 +14651,7 @@ class Module {
14646
14651
  this.assertUniqueExportName(name, node.exported.start);
14647
14652
  this.reexportDescriptions.set(name, {
14648
14653
  localName: '*',
14649
- module: null,
14654
+ module: null, // filled in later,
14650
14655
  source,
14651
14656
  start: node.start
14652
14657
  });
@@ -14665,7 +14670,7 @@ class Module {
14665
14670
  this.assertUniqueExportName(name, start);
14666
14671
  this.reexportDescriptions.set(name, {
14667
14672
  localName: local instanceof Literal ? local.value : local.name,
14668
- module: null,
14673
+ module: null, // filled in later,
14669
14674
  source,
14670
14675
  start
14671
14676
  });
@@ -14717,7 +14722,7 @@ class Module {
14717
14722
  ? specifier.imported.name
14718
14723
  : specifier.imported.value;
14719
14724
  this.importDescriptions.set(localName, {
14720
- module: null,
14725
+ module: null, // filled in later
14721
14726
  name,
14722
14727
  source,
14723
14728
  start: specifier.start
@@ -18762,6 +18767,11 @@ class ModuleLoader {
18762
18767
  : source != null && typeof source === 'object' && typeof source.code === 'string'
18763
18768
  ? source
18764
18769
  : parseAst_js.error(parseAst_js.logBadLoader(id));
18770
+ const code = sourceDescription.code;
18771
+ /* eslint-disable-next-line unicorn/number-literal-case */
18772
+ if (code.charCodeAt(0) === 65279) {
18773
+ sourceDescription.code = code.slice(1);
18774
+ }
18765
18775
  const cachedModule = this.graph.cachedModules.get(id);
18766
18776
  if (cachedModule &&
18767
18777
  !cachedModule.customTransformCache &&
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.5.0
4
- Sat, 18 Nov 2023 05:51:43 GMT - commit 86efc769f693516a29047c8d160c6d7287fb965d
3
+ Rollup.js v4.5.2
4
+ Fri, 24 Nov 2023 06:29:16 GMT - commit 2e94641971195c1a4eb9e1a3fe6d73b9d04ffae0
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -87,7 +87,7 @@ class FileWatcher {
87
87
  const eventsRewrites = {
88
88
  create: {
89
89
  create: 'buggy',
90
- delete: null,
90
+ delete: null, //delete file from map
91
91
  update: 'create'
92
92
  },
93
93
  delete: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup",
3
- "version": "4.5.0",
3
+ "version": "4.5.2",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -100,18 +100,18 @@
100
100
  "homepage": "https://rollupjs.org/",
101
101
  "optionalDependencies": {
102
102
  "fsevents": "~2.3.2",
103
- "@rollup/rollup-darwin-arm64": "4.5.0",
104
- "@rollup/rollup-android-arm64": "4.5.0",
105
- "@rollup/rollup-win32-arm64-msvc": "4.5.0",
106
- "@rollup/rollup-linux-arm64-gnu": "4.5.0",
107
- "@rollup/rollup-linux-arm64-musl": "4.5.0",
108
- "@rollup/rollup-android-arm-eabi": "4.5.0",
109
- "@rollup/rollup-linux-arm-gnueabihf": "4.5.0",
110
- "@rollup/rollup-win32-ia32-msvc": "4.5.0",
111
- "@rollup/rollup-darwin-x64": "4.5.0",
112
- "@rollup/rollup-win32-x64-msvc": "4.5.0",
113
- "@rollup/rollup-linux-x64-gnu": "4.5.0",
114
- "@rollup/rollup-linux-x64-musl": "4.5.0"
103
+ "@rollup/rollup-darwin-arm64": "4.5.2",
104
+ "@rollup/rollup-android-arm64": "4.5.2",
105
+ "@rollup/rollup-win32-arm64-msvc": "4.5.2",
106
+ "@rollup/rollup-linux-arm64-gnu": "4.5.2",
107
+ "@rollup/rollup-linux-arm64-musl": "4.5.2",
108
+ "@rollup/rollup-android-arm-eabi": "4.5.2",
109
+ "@rollup/rollup-linux-arm-gnueabihf": "4.5.2",
110
+ "@rollup/rollup-win32-ia32-msvc": "4.5.2",
111
+ "@rollup/rollup-darwin-x64": "4.5.2",
112
+ "@rollup/rollup-win32-x64-msvc": "4.5.2",
113
+ "@rollup/rollup-linux-x64-gnu": "4.5.2",
114
+ "@rollup/rollup-linux-x64-musl": "4.5.2"
115
115
  },
116
116
  "devDependenciesComments": {
117
117
  "@rollup/plugin-typescript": "It appears that 11.1.3 breaks sourcemaps"
@@ -124,7 +124,7 @@
124
124
  "@codemirror/state": "^6.3.1",
125
125
  "@codemirror/view": "^6.22.0",
126
126
  "@jridgewell/sourcemap-codec": "^1.4.15",
127
- "@mermaid-js/mermaid-cli": "^10.6.0",
127
+ "@mermaid-js/mermaid-cli": "^10.6.1",
128
128
  "@napi-rs/cli": "^2.16.5",
129
129
  "@rollup/plugin-alias": "^5.0.1",
130
130
  "@rollup/plugin-buble": "^1.0.3",
@@ -136,11 +136,11 @@
136
136
  "@rollup/plugin-typescript": "11.1.5",
137
137
  "@rollup/pluginutils": "^5.0.5",
138
138
  "@types/estree": "1.0.5",
139
- "@types/mocha": "^10.0.4",
139
+ "@types/mocha": "^10.0.5",
140
140
  "@types/node": "18.0.0",
141
141
  "@types/yargs-parser": "^21.0.3",
142
- "@typescript-eslint/eslint-plugin": "^6.11.0",
143
- "@typescript-eslint/parser": "^6.11.0",
142
+ "@typescript-eslint/eslint-plugin": "^6.12.0",
143
+ "@typescript-eslint/parser": "^6.12.0",
144
144
  "@vue/eslint-config-prettier": "^8.0.0",
145
145
  "@vue/eslint-config-typescript": "^12.0.0",
146
146
  "acorn": "^8.11.2",
@@ -150,11 +150,11 @@
150
150
  "chokidar": "^3.5.3",
151
151
  "colorette": "^2.0.20",
152
152
  "concurrently": "^8.2.2",
153
- "core-js": "^3.33.2",
153
+ "core-js": "^3.33.3",
154
154
  "date-time": "^4.0.0",
155
155
  "es5-shim": "^4.6.7",
156
156
  "es6-shim": "^0.35.8",
157
- "eslint": "^8.53.0",
157
+ "eslint": "^8.54.0",
158
158
  "eslint-config-prettier": "^9.0.0",
159
159
  "eslint-plugin-import": "^2.29.0",
160
160
  "eslint-plugin-prettier": "^5.0.1",
@@ -177,7 +177,7 @@
177
177
  "pretty-bytes": "^6.1.1",
178
178
  "pretty-ms": "^8.0.0",
179
179
  "requirejs": "^2.3.6",
180
- "rollup": "^4.4.0",
180
+ "rollup": "^4.5.0",
181
181
  "rollup-plugin-license": "^3.2.0",
182
182
  "rollup-plugin-string": "^3.0.0",
183
183
  "rollup-plugin-thatworks": "^1.0.4",
@@ -189,16 +189,16 @@
189
189
  "systemjs": "^6.14.2",
190
190
  "terser": "^5.24.0",
191
191
  "tslib": "^2.6.2",
192
- "typescript": "^5.2.2",
193
- "vite": "^4.5.0",
194
- "vitepress": "^1.0.0-rc.25",
192
+ "typescript": "^5.3.2",
193
+ "vite": "^5.0.0",
194
+ "vitepress": "^1.0.0-rc.29",
195
195
  "vue": "^3.3.8",
196
196
  "wasm-pack": "^0.12.1",
197
197
  "weak-napi": "^2.0.2",
198
198
  "yargs-parser": "^21.1.1"
199
199
  },
200
200
  "overrides": {
201
- "axios": "^1.6.1",
201
+ "axios": "^1.6.2",
202
202
  "semver": "^7.5.4"
203
203
  },
204
204
  "files": [