@rollup/wasm-node 4.34.5 → 4.34.7

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.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.34.5
4
- Fri, 07 Feb 2025 08:52:31 GMT - commit 3426b026e95319048dd5b703f2a0330c1c924e52
3
+ Rollup.js v4.34.7
4
+ Fri, 14 Feb 2025 09:53:29 GMT - commit f9c52f80074e33f5b0799e8ca215e3bfac7d2755
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.34.5
4
- Fri, 07 Feb 2025 08:52:31 GMT - commit 3426b026e95319048dd5b703f2a0330c1c924e52
3
+ Rollup.js v4.34.7
4
+ Fri, 14 Feb 2025 09:53:29 GMT - commit f9c52f80074e33f5b0799e8ca215e3bfac7d2755
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.34.5
4
- Fri, 07 Feb 2025 08:52:31 GMT - commit 3426b026e95319048dd5b703f2a0330c1c924e52
3
+ Rollup.js v4.34.7
4
+ Fri, 14 Feb 2025 09:53:29 GMT - commit f9c52f80074e33f5b0799e8ca215e3bfac7d2755
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -17,7 +17,7 @@ const native_js = require('../native.js');
17
17
  const node_perf_hooks = require('node:perf_hooks');
18
18
  const promises = require('node:fs/promises');
19
19
 
20
- var version = "4.34.5";
20
+ var version = "4.34.7";
21
21
 
22
22
  function ensureArray$1(items) {
23
23
  if (Array.isArray(items)) {
@@ -3780,13 +3780,8 @@ class ExpressionEntity {
3780
3780
  * ensures that nested nodes are included while the latter ensures that all
3781
3781
  * paths of the expression are included.
3782
3782
  * */
3783
- includeCallArguments(context, interaction) {
3784
- for (const argument of interaction.args) {
3785
- if (argument) {
3786
- argument.includePath(UNKNOWN_PATH, context);
3787
- argument.include(context, false);
3788
- }
3789
- }
3783
+ includeCallArguments(interaction, context) {
3784
+ includeInteraction(interaction, context);
3790
3785
  }
3791
3786
  shouldBeIncluded(_context) {
3792
3787
  return true;
@@ -3803,6 +3798,18 @@ const deoptimizeInteraction = (interaction) => {
3803
3798
  argument?.deoptimizePath(UNKNOWN_PATH);
3804
3799
  }
3805
3800
  };
3801
+ const includeInteraction = ({ args }, context) => {
3802
+ // We do not re-include the "this" argument as we expect this is already
3803
+ // re-included at the call site
3804
+ args[0]?.includePath(UNKNOWN_PATH, context);
3805
+ for (let argumentIndex = 1; argumentIndex < args.length; argumentIndex++) {
3806
+ const argument = args[argumentIndex];
3807
+ if (argument) {
3808
+ argument.includePath(UNKNOWN_PATH, context);
3809
+ argument.include(context, false);
3810
+ }
3811
+ }
3812
+ };
3806
3813
 
3807
3814
  const INTERACTION_ACCESSED = 0;
3808
3815
  const INTERACTION_ASSIGNED = 1;
@@ -4703,13 +4710,11 @@ class Method extends ExpressionEntity {
4703
4710
  false
4704
4711
  ];
4705
4712
  }
4706
- hasEffectsOnInteractionAtPath(path, interaction, context) {
4707
- const { type } = interaction;
4713
+ hasEffectsOnInteractionAtPath(path, { args, type }, context) {
4708
4714
  if (path.length > (type === INTERACTION_ACCESSED ? 1 : 0)) {
4709
4715
  return true;
4710
4716
  }
4711
4717
  if (type === INTERACTION_CALLED) {
4712
- const { args } = interaction;
4713
4718
  if (this.description.mutatesSelfAsArray === true &&
4714
4719
  args[0]?.hasEffectsOnInteractionAtPath(UNKNOWN_INTEGER_PATH, NODE_INTERACTION_UNKNOWN_ASSIGNMENT, context)) {
4715
4720
  return true;
@@ -6614,22 +6619,17 @@ class LocalVariable extends Variable {
6614
6619
  }
6615
6620
  }
6616
6621
  }
6617
- includeCallArguments(context, interaction) {
6622
+ includeCallArguments(interaction, context) {
6618
6623
  if (this.isReassigned ||
6619
6624
  context.includedCallArguments.has(this.init) ||
6620
6625
  // This can be removed again once we can include arguments when called at
6621
6626
  // a specific path
6622
6627
  this.initPath.length > 0) {
6623
- for (const argument of interaction.args) {
6624
- if (argument) {
6625
- argument.includePath(UNKNOWN_PATH, context);
6626
- argument.include(context, false);
6627
- }
6628
- }
6628
+ includeInteraction(interaction, context);
6629
6629
  }
6630
6630
  else {
6631
6631
  context.includedCallArguments.add(this.init);
6632
- this.init.includeCallArguments(context, interaction);
6632
+ this.init.includeCallArguments(interaction, context);
6633
6633
  context.includedCallArguments.delete(this.init);
6634
6634
  }
6635
6635
  }
@@ -6709,9 +6709,12 @@ class IdentifierBase extends NodeBase {
6709
6709
  }
6710
6710
  }
6711
6711
  }
6712
- include(context) {
6712
+ include(context, includeChildrenRecursively) {
6713
6713
  if (!this.included)
6714
6714
  this.includeNode(context);
6715
+ if (includeChildrenRecursively) {
6716
+ this.variable?.includePath(UNKNOWN_PATH, context);
6717
+ }
6715
6718
  }
6716
6719
  includeNode(context) {
6717
6720
  this.included = true;
@@ -6734,8 +6737,8 @@ class IdentifierBase extends NodeBase {
6734
6737
  this.variable?.includePath(path, context);
6735
6738
  }
6736
6739
  }
6737
- includeCallArguments(context, interaction) {
6738
- this.variable.includeCallArguments(context, interaction);
6740
+ includeCallArguments(interaction, context) {
6741
+ this.variable.includeCallArguments(interaction, context);
6739
6742
  }
6740
6743
  isPossibleTDZ() {
6741
6744
  // return cached value to avoid issues with the next tree-shaking pass
@@ -7281,7 +7284,7 @@ class ClassNode extends NodeBase {
7281
7284
  decorator.include(context, includeChildrenRecursively);
7282
7285
  if (this.id) {
7283
7286
  this.id.markDeclarationReached();
7284
- this.id.include(context);
7287
+ this.id.include(context, includeChildrenRecursively);
7285
7288
  }
7286
7289
  }
7287
7290
  initialise() {
@@ -7448,7 +7451,7 @@ class ParameterVariable extends LocalVariable {
7448
7451
  this.knownValue = null;
7449
7452
  this.knownValueLiteral = UnknownValue;
7450
7453
  }
7451
- addArgumentValue(entity) {
7454
+ addArgumentForDeoptimization(entity) {
7452
7455
  this.updateKnownValue(entity);
7453
7456
  if (entity === UNKNOWN_EXPRESSION) {
7454
7457
  // As unknown expressions fully deoptimize all interactions, we can clear
@@ -7737,11 +7740,10 @@ class ParameterScope extends ChildScope {
7737
7740
  }
7738
7741
  this.hasRest = hasRest;
7739
7742
  }
7740
- includeCallArguments(context, interaction) {
7743
+ includeCallArguments({ args }, context) {
7741
7744
  let calledFromTryStatement = false;
7742
7745
  let argumentIncluded = false;
7743
7746
  const restParameter = this.hasRest && this.parameters[this.parameters.length - 1];
7744
- const { args } = interaction;
7745
7747
  let lastExplicitlyIncludedIndex = args.length - 1;
7746
7748
  // If there is a SpreadElement, we need to include all arguments after it
7747
7749
  // because we no longer know which argument corresponds to which parameter.
@@ -7802,9 +7804,8 @@ class ReturnValueScope extends ParameterScope {
7802
7804
  addReturnExpression(expression) {
7803
7805
  this.returnExpressions.push(expression);
7804
7806
  }
7805
- deoptimizeArgumentsOnCall(interaction) {
7807
+ deoptimizeArgumentsOnCall({ args }) {
7806
7808
  const { parameters } = this;
7807
- const { args } = interaction;
7808
7809
  let position = 0;
7809
7810
  for (; position < args.length - 1; position++) {
7810
7811
  // Only the "this" argument arg[0] can be null
@@ -7813,7 +7814,9 @@ class ReturnValueScope extends ParameterScope {
7813
7814
  // This deoptimizes the current and remaining parameters and arguments
7814
7815
  for (; position < parameters.length; position++) {
7815
7816
  args[position + 1]?.deoptimizePath(UNKNOWN_PATH);
7816
- parameters[position].forEach(variable => variable.markReassigned());
7817
+ for (const variable of parameters[position]) {
7818
+ variable.markReassigned();
7819
+ }
7817
7820
  }
7818
7821
  break;
7819
7822
  }
@@ -7824,7 +7827,7 @@ class ReturnValueScope extends ParameterScope {
7824
7827
  const variables = parameters[position];
7825
7828
  if (variables) {
7826
7829
  for (const variable of variables) {
7827
- variable.addArgumentValue(argument);
7830
+ variable.addArgumentForDeoptimization(argument);
7828
7831
  }
7829
7832
  }
7830
7833
  this.addArgumentToBeDeoptimized(argument);
@@ -7833,7 +7836,7 @@ class ReturnValueScope extends ParameterScope {
7833
7836
  const nonRestParameterLength = this.hasRest ? parameters.length - 1 : parameters.length;
7834
7837
  for (; position < nonRestParameterLength; position++) {
7835
7838
  for (const variable of parameters[position]) {
7836
- variable.addArgumentValue(UNDEFINED_EXPRESSION);
7839
+ variable.addArgumentForDeoptimization(UNDEFINED_EXPRESSION);
7837
7840
  }
7838
7841
  }
7839
7842
  }
@@ -7882,8 +7885,8 @@ class FunctionScope extends ReturnValueScope {
7882
7885
  findLexicalBoundary() {
7883
7886
  return this;
7884
7887
  }
7885
- includeCallArguments(context, interaction) {
7886
- super.includeCallArguments(context, interaction);
7888
+ includeCallArguments(interaction, context) {
7889
+ super.includeCallArguments(interaction, context);
7887
7890
  if (this.argumentsVariable.included) {
7888
7891
  const { args } = interaction;
7889
7892
  for (let argumentIndex = 1; argumentIndex < args.length; argumentIndex++) {
@@ -8210,13 +8213,13 @@ class FunctionNode extends FunctionBase {
8210
8213
  this.constructedEntity = new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE);
8211
8214
  // This makes sure that all deoptimizations of "this" are applied to the
8212
8215
  // constructed entity.
8213
- this.scope.thisVariable.addArgumentValue(this.constructedEntity);
8216
+ this.scope.thisVariable.addArgumentForDeoptimization(this.constructedEntity);
8214
8217
  }
8215
8218
  deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) {
8216
8219
  super.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker);
8217
8220
  if (interaction.type === INTERACTION_CALLED && path.length === 0 && interaction.args[0]) {
8218
8221
  // args[0] is the "this" argument
8219
- this.scope.thisVariable.addArgumentValue(interaction.args[0]);
8222
+ this.scope.thisVariable.addArgumentForDeoptimization(interaction.args[0]);
8220
8223
  }
8221
8224
  }
8222
8225
  hasEffects(context) {
@@ -8262,7 +8265,7 @@ class FunctionNode extends FunctionBase {
8262
8265
  }
8263
8266
  include(context, includeChildrenRecursively) {
8264
8267
  super.include(context, includeChildrenRecursively);
8265
- this.id?.include(context);
8268
+ this.id?.include(context, includeChildrenRecursively);
8266
8269
  const hasArguments = this.scope.argumentsVariable.included;
8267
8270
  for (const parameter of this.params) {
8268
8271
  if (!(parameter instanceof Identifier) || hasArguments) {
@@ -8947,6 +8950,17 @@ class MemberExpression extends NodeBase {
8947
8950
  this.object.includePath([this.propertyKey], context);
8948
8951
  }
8949
8952
  }
8953
+ includeNodeAsAssignmentTarget(context) {
8954
+ this.included = true;
8955
+ if (!this.assignmentDeoptimized)
8956
+ this.applyAssignmentDeoptimization();
8957
+ if (this.variable) {
8958
+ this.scope.context.includeVariableInModule(this.variable, EMPTY_PATH, context);
8959
+ }
8960
+ else if (!this.isUndefined) {
8961
+ this.object.includePath([this.propertyKey], context);
8962
+ }
8963
+ }
8950
8964
  includePath(path, context) {
8951
8965
  if (!this.included)
8952
8966
  this.includeNode(context);
@@ -8963,24 +8977,19 @@ class MemberExpression extends NodeBase {
8963
8977
  }
8964
8978
  }
8965
8979
  includeAsAssignmentTarget(context, includeChildrenRecursively, deoptimizeAccess) {
8966
- if (!this.assignmentDeoptimized)
8967
- this.applyAssignmentDeoptimization();
8968
- if (deoptimizeAccess) {
8969
- this.include(context, includeChildrenRecursively);
8970
- }
8971
- else {
8972
- if (!this.included)
8973
- this.includeNode(context);
8974
- this.object.include(context, includeChildrenRecursively);
8975
- this.property.include(context, includeChildrenRecursively);
8976
- }
8980
+ if (!this.included)
8981
+ this.includeNodeAsAssignmentTarget(context);
8982
+ if (deoptimizeAccess && !this.deoptimized)
8983
+ this.applyDeoptimizations();
8984
+ this.object.include(context, includeChildrenRecursively);
8985
+ this.property.include(context, includeChildrenRecursively);
8977
8986
  }
8978
- includeCallArguments(context, interaction) {
8987
+ includeCallArguments(interaction, context) {
8979
8988
  if (this.variable) {
8980
- this.variable.includeCallArguments(context, interaction);
8989
+ this.variable.includeCallArguments(interaction, context);
8981
8990
  }
8982
8991
  else {
8983
- super.includeCallArguments(context, interaction);
8992
+ includeInteraction(interaction, context);
8984
8993
  }
8985
8994
  }
8986
8995
  includeDestructuredIfNecessary(context, destructuredInitPath, init) {
@@ -11954,7 +11963,7 @@ function requireParse () {
11954
11963
  }
11955
11964
 
11956
11965
  if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
11957
- const end = rest[1] !== undefined ? '|$' : '';
11966
+ const end = rest[1] !== void 0 ? '|$' : '';
11958
11967
 
11959
11968
  state.output = state.output.slice(0, -(prior.output + prev.output).length);
11960
11969
  prior.output = `(?:${prior.output}`;
@@ -13180,10 +13189,10 @@ class BreakStatement extends NodeBase {
13180
13189
  context.brokenFlow = true;
13181
13190
  return false;
13182
13191
  }
13183
- include(context) {
13192
+ include(context, includeChildrenRecursively) {
13184
13193
  this.included = true;
13185
13194
  if (this.label) {
13186
- this.label.include(context);
13195
+ this.label.include(context, includeChildrenRecursively);
13187
13196
  context.includedLabels.add(this.label.name);
13188
13197
  }
13189
13198
  else {
@@ -13383,11 +13392,7 @@ class CallExpression extends CallExpressionBase {
13383
13392
  if (!this.included)
13384
13393
  this.includeNode(context);
13385
13394
  if (includeChildrenRecursively) {
13386
- this.callee.include(context, true);
13387
- for (const argument of this.arguments) {
13388
- argument.includePath(UNKNOWN_PATH, context);
13389
- argument.include(context, true);
13390
- }
13395
+ super.include(context, true);
13391
13396
  if (includeChildrenRecursively === INCLUDE_PARAMETERS &&
13392
13397
  this.callee instanceof Identifier &&
13393
13398
  this.callee.variable) {
@@ -13395,17 +13400,8 @@ class CallExpression extends CallExpressionBase {
13395
13400
  }
13396
13401
  }
13397
13402
  else {
13398
- // If the callee is a member expression and does not have a variable, its
13399
- // object will already be included via the first argument of the
13400
- // interaction in includeCallArguments. Including it again can lead to
13401
- // severe performance problems.
13402
- if (this.callee instanceof MemberExpression && !this.callee.variable) {
13403
- this.callee.property.include(context, false);
13404
- }
13405
- else {
13406
- this.callee.include(context, false);
13407
- }
13408
- this.callee.includeCallArguments(context, this.interaction);
13403
+ this.callee.include(context, false);
13404
+ this.callee.includeCallArguments(this.interaction, context);
13409
13405
  }
13410
13406
  }
13411
13407
  includeNode(context) {
@@ -13666,14 +13662,14 @@ class ConditionalExpression extends NodeBase {
13666
13662
  usedBranch.includePath(path, context);
13667
13663
  }
13668
13664
  }
13669
- includeCallArguments(context, interaction) {
13665
+ includeCallArguments(interaction, context) {
13670
13666
  const usedBranch = this.getUsedBranch();
13671
13667
  if (usedBranch) {
13672
- usedBranch.includeCallArguments(context, interaction);
13668
+ usedBranch.includeCallArguments(interaction, context);
13673
13669
  }
13674
13670
  else {
13675
- this.consequent.includeCallArguments(context, interaction);
13676
- this.alternate.includeCallArguments(context, interaction);
13671
+ this.consequent.includeCallArguments(interaction, context);
13672
+ this.alternate.includeCallArguments(interaction, context);
13677
13673
  }
13678
13674
  }
13679
13675
  removeAnnotations(code) {
@@ -13736,10 +13732,10 @@ class ContinueStatement extends NodeBase {
13736
13732
  context.brokenFlow = true;
13737
13733
  return false;
13738
13734
  }
13739
- include(context) {
13735
+ include(context, includeChildrenRecursively) {
13740
13736
  this.included = true;
13741
13737
  if (this.label) {
13742
- this.label.include(context);
13738
+ this.label.include(context, includeChildrenRecursively);
13743
13739
  context.includedLabels.add(this.label.name);
13744
13740
  }
13745
13741
  else {
@@ -15191,7 +15187,7 @@ class LabeledStatement extends NodeBase {
15191
15187
  context.includedLabels = new Set();
15192
15188
  this.body.include(context, includeChildrenRecursively);
15193
15189
  if (includeChildrenRecursively || context.includedLabels.has(this.label.name)) {
15194
- this.label.include(context);
15190
+ this.label.include(context, includeChildrenRecursively);
15195
15191
  context.includedLabels.delete(this.label.name);
15196
15192
  context.brokenFlow = brokenFlow;
15197
15193
  }
@@ -15421,15 +15417,15 @@ class NewExpression extends NodeBase {
15421
15417
  return path.length > 0 || type !== INTERACTION_ACCESSED;
15422
15418
  }
15423
15419
  include(context, includeChildrenRecursively) {
15420
+ if (!this.included)
15421
+ this.includeNode(context);
15424
15422
  if (includeChildrenRecursively) {
15425
- super.include(context, includeChildrenRecursively);
15423
+ super.include(context, true);
15426
15424
  }
15427
15425
  else {
15428
- if (!this.included)
15429
- this.includeNode(context);
15430
15426
  this.callee.include(context, false);
15427
+ this.callee.includeCallArguments(this.interaction, context);
15431
15428
  }
15432
- this.callee.includeCallArguments(context, this.interaction);
15433
15429
  }
15434
15430
  includeNode(context) {
15435
15431
  this.included = true;
@@ -16052,17 +16048,12 @@ class TaggedTemplateExpression extends CallExpressionBase {
16052
16048
  if (!this.included)
16053
16049
  this.includeNode(context);
16054
16050
  if (includeChildrenRecursively) {
16055
- super.include(context, includeChildrenRecursively);
16051
+ super.include(context, true);
16056
16052
  }
16057
16053
  else {
16058
- this.included = true;
16059
- this.tag.include(context, includeChildrenRecursively);
16060
- this.quasi.include(context, includeChildrenRecursively);
16061
- }
16062
- this.tag.includeCallArguments(context, this.interaction);
16063
- const [returnExpression] = this.getReturnExpression();
16064
- if (!returnExpression.included) {
16065
- returnExpression.include(context, false);
16054
+ this.quasi.include(context, false);
16055
+ this.tag.include(context, false);
16056
+ this.tag.includeCallArguments(this.interaction, context);
16066
16057
  }
16067
16058
  }
16068
16059
  initialise() {
@@ -16415,7 +16406,11 @@ class UnaryExpression extends NodeBase {
16415
16406
  }
16416
16407
  const CHARACTERS_THAT_DO_NOT_REQUIRE_SPACE = /[\s([=%&*+-/<>^|,?:;]/;
16417
16408
  function getRenderedLiteralValue(value) {
16418
- if (value === undefined || typeof value === 'boolean') {
16409
+ if (value === undefined) {
16410
+ // At the moment, the undefined only happens when the operator is void
16411
+ return 'void 0';
16412
+ }
16413
+ if (typeof value === 'boolean') {
16419
16414
  return String(value);
16420
16415
  }
16421
16416
  if (typeof value === 'string') {
@@ -21611,18 +21606,18 @@ function flru (max) {
21611
21606
  return {
21612
21607
  clear: reset,
21613
21608
  has: function (key) {
21614
- return curr[key] !== undefined || prev[key] !== undefined;
21609
+ return curr[key] !== void 0 || prev[key] !== void 0;
21615
21610
  },
21616
21611
  get: function (key) {
21617
21612
  var val = curr[key];
21618
- if (val !== undefined) return val;
21619
- if ((val=prev[key]) !== undefined) {
21613
+ if (val !== void 0) return val;
21614
+ if ((val=prev[key]) !== void 0) {
21620
21615
  keep(key, val);
21621
21616
  return val;
21622
21617
  }
21623
21618
  },
21624
21619
  set: function (key, value) {
21625
- if (curr[key] !== undefined) {
21620
+ if (curr[key] !== void 0) {
21626
21621
  curr[key] = value;
21627
21622
  } else {
21628
21623
  keep(key, value);
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.34.5
4
- Fri, 07 Feb 2025 08:52:31 GMT - commit 3426b026e95319048dd5b703f2a0330c1c924e52
3
+ Rollup.js v4.34.7
4
+ Fri, 14 Feb 2025 09:53:29 GMT - commit f9c52f80074e33f5b0799e8ca215e3bfac7d2755
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.34.5
4
- Fri, 07 Feb 2025 08:52:31 GMT - commit 3426b026e95319048dd5b703f2a0330c1c924e52
3
+ Rollup.js v4.34.7
4
+ Fri, 14 Feb 2025 09:53:29 GMT - commit f9c52f80074e33f5b0799e8ca215e3bfac7d2755
5
5
 
6
6
  https://github.com/rollup/rollup
7
7