rollup 2.75.1 → 2.75.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.
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.1
4
- Sat, 28 May 2022 13:06:58 GMT - commit 03088cc0ee948dcc51f26edde067cc2b2736a679
3
+ Rollup.js v2.75.4
4
+ Tue, 31 May 2022 11:26:29 GMT - commit 0409bf0d8859a43f2d5d40dc23ebf74afadb83f7
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.1
4
- Sat, 28 May 2022 13:06:58 GMT - commit 03088cc0ee948dcc51f26edde067cc2b2736a679
3
+ Rollup.js v2.75.4
4
+ Tue, 31 May 2022 11:26:29 GMT - commit 0409bf0d8859a43f2d5d40dc23ebf74afadb83f7
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.1
4
- Sat, 28 May 2022 13:06:58 GMT - commit 03088cc0ee948dcc51f26edde067cc2b2736a679
3
+ Rollup.js v2.75.4
4
+ Tue, 31 May 2022 11:26:29 GMT - commit 0409bf0d8859a43f2d5d40dc23ebf74afadb83f7
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.1
4
- Sat, 28 May 2022 13:06:58 GMT - commit 03088cc0ee948dcc51f26edde067cc2b2736a679
3
+ Rollup.js v2.75.4
4
+ Tue, 31 May 2022 11:26:29 GMT - commit 0409bf0d8859a43f2d5d40dc23ebf74afadb83f7
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.1
4
- Sat, 28 May 2022 13:06:58 GMT - commit 03088cc0ee948dcc51f26edde067cc2b2736a679
3
+ Rollup.js v2.75.4
4
+ Tue, 31 May 2022 11:26:29 GMT - commit 0409bf0d8859a43f2d5d40dc23ebf74afadb83f7
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -27,7 +27,7 @@ function _interopNamespaceDefault(e) {
27
27
  return n;
28
28
  }
29
29
 
30
- var version$1 = "2.75.1";
30
+ var version$1 = "2.75.4";
31
31
 
32
32
  function ensureArray$1(items) {
33
33
  if (Array.isArray(items)) {
@@ -2227,6 +2227,7 @@ class ExpressionEntity {
2227
2227
  constructor() {
2228
2228
  this.included = false;
2229
2229
  }
2230
+ deoptimizeCallParameters() { }
2230
2231
  deoptimizePath(_path) { }
2231
2232
  deoptimizeThisOnEventAtPath(_event, _path, thisParameter, _recursionTracker) {
2232
2233
  thisParameter.deoptimizePath(UNKNOWN_PATH);
@@ -5335,6 +5336,11 @@ const INCLUDE_PARAMETERS = 'variables';
5335
5336
  class NodeBase extends ExpressionEntity {
5336
5337
  constructor(esTreeNode, parent, parentScope) {
5337
5338
  super();
5339
+ // Nodes can apply custom deoptimizations once they become part of the
5340
+ // executed code. To do this, they must initialize this as false, implement
5341
+ // applyDeoptimizations and call this from include and hasEffects if they
5342
+ // have custom handlers
5343
+ this.deoptimized = false;
5338
5344
  this.esTreeNode = esTreeNode;
5339
5345
  this.keys = keys[esTreeNode.type] || getAndCreateKeys(esTreeNode);
5340
5346
  this.parent = parent;
@@ -5372,7 +5378,7 @@ class NodeBase extends ExpressionEntity {
5372
5378
  this.scope = parentScope;
5373
5379
  }
5374
5380
  hasEffects(context) {
5375
- if (this.deoptimized === false)
5381
+ if (!this.deoptimized)
5376
5382
  this.applyDeoptimizations();
5377
5383
  for (const key of this.keys) {
5378
5384
  const value = this[key];
@@ -5390,7 +5396,7 @@ class NodeBase extends ExpressionEntity {
5390
5396
  return false;
5391
5397
  }
5392
5398
  include(context, includeChildrenRecursively, _options) {
5393
- if (this.deoptimized === false)
5399
+ if (!this.deoptimized)
5394
5400
  this.applyDeoptimizations();
5395
5401
  this.included = true;
5396
5402
  for (const key of this.keys) {
@@ -5489,10 +5495,6 @@ class NodeBase extends ExpressionEntity {
5489
5495
  }
5490
5496
 
5491
5497
  class SpreadElement extends NodeBase {
5492
- constructor() {
5493
- super(...arguments);
5494
- this.deoptimized = false;
5495
- }
5496
5498
  deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker) {
5497
5499
  if (path.length > 0) {
5498
5500
  this.argument.deoptimizeThisOnEventAtPath(event, [UnknownKey, ...path], thisParameter, recursionTracker);
@@ -6171,7 +6173,6 @@ const ARRAY_PROTOTYPE = new ObjectEntity({
6171
6173
  class ArrayExpression extends NodeBase {
6172
6174
  constructor() {
6173
6175
  super(...arguments);
6174
- this.deoptimized = false;
6175
6176
  this.objectEntity = null;
6176
6177
  }
6177
6178
  deoptimizePath(path) {
@@ -6200,11 +6201,16 @@ class ArrayExpression extends NodeBase {
6200
6201
  let hasSpread = false;
6201
6202
  for (let index = 0; index < this.elements.length; index++) {
6202
6203
  const element = this.elements[index];
6203
- if (hasSpread || element instanceof SpreadElement) {
6204
- if (element) {
6204
+ if (element) {
6205
+ if (hasSpread || element instanceof SpreadElement) {
6205
6206
  hasSpread = true;
6207
+ // This also deoptimizes parameter defaults
6206
6208
  element.deoptimizePath(UNKNOWN_PATH);
6207
6209
  }
6210
+ else {
6211
+ // We do not track parameter defaults in arrays
6212
+ element.deoptimizeCallParameters();
6213
+ }
6208
6214
  }
6209
6215
  }
6210
6216
  this.context.requestTreeshakingPass();
@@ -6298,6 +6304,10 @@ class LocalVariable extends Variable {
6298
6304
  this.additionalInitializers = null;
6299
6305
  }
6300
6306
  }
6307
+ deoptimizeCallParameters() {
6308
+ var _a;
6309
+ (_a = this.init) === null || _a === void 0 ? void 0 : _a.deoptimizeCallParameters();
6310
+ }
6301
6311
  deoptimizePath(path) {
6302
6312
  var _a, _b;
6303
6313
  if (this.isReassigned ||
@@ -6644,10 +6654,6 @@ class ReturnValueScope extends ParameterScope {
6644
6654
  }
6645
6655
 
6646
6656
  class AssignmentPattern extends NodeBase {
6647
- constructor() {
6648
- super(...arguments);
6649
- this.deoptimized = false;
6650
- }
6651
6657
  addExportedVariables(variables, exportNamesByVariable) {
6652
6658
  this.left.addExportedVariables(variables, exportNamesByVariable);
6653
6659
  }
@@ -6883,6 +6889,7 @@ class ExpressionStatement extends NodeBase {
6883
6889
  return this.parent.type !== Program$1;
6884
6890
  return super.shouldBeIncluded(context);
6885
6891
  }
6892
+ applyDeoptimizations() { }
6886
6893
  }
6887
6894
 
6888
6895
  class BlockStatement extends NodeBase {
@@ -6943,7 +6950,6 @@ class BlockStatement extends NodeBase {
6943
6950
  class RestElement extends NodeBase {
6944
6951
  constructor() {
6945
6952
  super(...arguments);
6946
- this.deoptimized = false;
6947
6953
  this.declarationInit = null;
6948
6954
  }
6949
6955
  addExportedVariables(variables, exportNamesByVariable) {
@@ -6981,6 +6987,9 @@ class FunctionBase extends NodeBase {
6981
6987
  deoptimizeCache() {
6982
6988
  this.forceIncludeParameters = true;
6983
6989
  }
6990
+ deoptimizeCallParameters() {
6991
+ this.forceIncludeParameters = true;
6992
+ }
6984
6993
  deoptimizePath(path) {
6985
6994
  this.getObjectEntity().deoptimizePath(path);
6986
6995
  if (path.length === 1 && path[0] === UnknownKey) {
@@ -7053,6 +7062,8 @@ class FunctionBase extends NodeBase {
7053
7062
  return false;
7054
7063
  }
7055
7064
  include(context, includeChildrenRecursively, { includeWithoutParameterDefaults } = BLANK) {
7065
+ if (!this.deoptimized)
7066
+ this.applyDeoptimizations();
7056
7067
  this.included = true;
7057
7068
  const { brokenFlow } = context;
7058
7069
  context.brokenFlow = BROKEN_FLOW_NONE;
@@ -7105,6 +7116,15 @@ class FunctionBase extends NodeBase {
7105
7116
  }
7106
7117
  super.parseNode(esTreeNode);
7107
7118
  }
7119
+ applyDeoptimizations() {
7120
+ // We currently do not track deoptimizations of default values, deoptimize them
7121
+ // just as we deoptimize call arguments
7122
+ for (const param of this.params) {
7123
+ if (param instanceof AssignmentPattern) {
7124
+ param.right.deoptimizePath(UNKNOWN_PATH);
7125
+ }
7126
+ }
7127
+ }
7108
7128
  }
7109
7129
  FunctionBase.prototype.preventChildBlockScope = true;
7110
7130
 
@@ -7117,6 +7137,8 @@ class ArrowFunctionExpression extends FunctionBase {
7117
7137
  this.scope = new ReturnValueScope(parentScope, this.context);
7118
7138
  }
7119
7139
  hasEffects() {
7140
+ if (!this.deoptimized)
7141
+ this.applyDeoptimizations();
7120
7142
  return false;
7121
7143
  }
7122
7144
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
@@ -8130,7 +8152,6 @@ class Identifier extends NodeBase {
8130
8152
  constructor() {
8131
8153
  super(...arguments);
8132
8154
  this.variable = null;
8133
- this.deoptimized = false;
8134
8155
  this.isTDZAccess = null;
8135
8156
  }
8136
8157
  addExportedVariables(variables, exportNamesByVariable) {
@@ -8175,11 +8196,17 @@ class Identifier extends NodeBase {
8175
8196
  variable.kind = kind;
8176
8197
  return [(this.variable = variable)];
8177
8198
  }
8199
+ deoptimizeCallParameters() {
8200
+ this.variable.deoptimizeCallParameters();
8201
+ }
8178
8202
  deoptimizePath(path) {
8203
+ var _a;
8179
8204
  if (path.length === 0 && !this.scope.contains(this.name)) {
8180
8205
  this.disallowImportReassignment();
8181
8206
  }
8182
- this.variable.deoptimizePath(path);
8207
+ // We keep conditional chaining because an unknown Node could have an
8208
+ // Identifier as property that might be deoptimized by default
8209
+ (_a = this.variable) === null || _a === void 0 ? void 0 : _a.deoptimizePath(path);
8183
8210
  }
8184
8211
  deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker) {
8185
8212
  this.variable.deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker);
@@ -8342,10 +8369,6 @@ class ObjectPattern extends NodeBase {
8342
8369
  }
8343
8370
 
8344
8371
  class AssignmentExpression extends NodeBase {
8345
- constructor() {
8346
- super(...arguments);
8347
- this.deoptimized = false;
8348
- }
8349
8372
  hasEffects(context) {
8350
8373
  if (!this.deoptimized)
8351
8374
  this.applyDeoptimizations();
@@ -8534,6 +8557,8 @@ class FunctionNode extends FunctionBase {
8534
8557
  }
8535
8558
  hasEffects() {
8536
8559
  var _a;
8560
+ if (!this.deoptimized)
8561
+ this.applyDeoptimizations();
8537
8562
  return !!((_a = this.id) === null || _a === void 0 ? void 0 : _a.hasEffects());
8538
8563
  }
8539
8564
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
@@ -8589,10 +8614,6 @@ class FunctionNode extends FunctionBase {
8589
8614
  }
8590
8615
 
8591
8616
  class AwaitExpression extends NodeBase {
8592
- constructor() {
8593
- super(...arguments);
8594
- this.deoptimized = false;
8595
- }
8596
8617
  hasEffects() {
8597
8618
  if (!this.deoptimized)
8598
8619
  this.applyDeoptimizations();
@@ -8786,7 +8807,6 @@ class MemberExpression extends NodeBase {
8786
8807
  constructor() {
8787
8808
  super(...arguments);
8788
8809
  this.variable = null;
8789
- this.deoptimized = false;
8790
8810
  this.bound = false;
8791
8811
  this.expressionsToBeDeoptimized = [];
8792
8812
  this.replacement = null;
@@ -9036,7 +9056,6 @@ class MemberExpression extends NodeBase {
9036
9056
  class CallExpressionBase extends NodeBase {
9037
9057
  constructor() {
9038
9058
  super(...arguments);
9039
- this.deoptimized = false;
9040
9059
  this.returnExpression = null;
9041
9060
  this.deoptimizableDependentExpressions = [];
9042
9061
  this.expressionsToBeDeoptimized = new Set();
@@ -9287,6 +9306,7 @@ class ClassBody extends NodeBase {
9287
9306
  }
9288
9307
  super.parseNode(esTreeNode);
9289
9308
  }
9309
+ applyDeoptimizations() { }
9290
9310
  }
9291
9311
 
9292
9312
  class MethodBase extends NodeBase {
@@ -9338,6 +9358,7 @@ class MethodBase extends NodeBase {
9338
9358
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
9339
9359
  return this.getAccessedValue().hasEffectsWhenCalledAtPath(path, callOptions, context);
9340
9360
  }
9361
+ applyDeoptimizations() { }
9341
9362
  getAccessedValue() {
9342
9363
  if (this.accessedValue === null) {
9343
9364
  if (this.kind === 'get') {
@@ -9353,6 +9374,42 @@ class MethodBase extends NodeBase {
9353
9374
  }
9354
9375
 
9355
9376
  class MethodDefinition extends MethodBase {
9377
+ applyDeoptimizations() { }
9378
+ }
9379
+
9380
+ class PropertyDefinition extends NodeBase {
9381
+ deoptimizePath(path) {
9382
+ var _a;
9383
+ (_a = this.value) === null || _a === void 0 ? void 0 : _a.deoptimizePath(path);
9384
+ }
9385
+ deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker) {
9386
+ var _a;
9387
+ (_a = this.value) === null || _a === void 0 ? void 0 : _a.deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker);
9388
+ }
9389
+ getLiteralValueAtPath(path, recursionTracker, origin) {
9390
+ return this.value
9391
+ ? this.value.getLiteralValueAtPath(path, recursionTracker, origin)
9392
+ : UnknownValue;
9393
+ }
9394
+ getReturnExpressionWhenCalledAtPath(path, callOptions, recursionTracker, origin) {
9395
+ return this.value
9396
+ ? this.value.getReturnExpressionWhenCalledAtPath(path, callOptions, recursionTracker, origin)
9397
+ : UNKNOWN_EXPRESSION;
9398
+ }
9399
+ hasEffects(context) {
9400
+ var _a;
9401
+ return this.key.hasEffects(context) || (this.static && !!((_a = this.value) === null || _a === void 0 ? void 0 : _a.hasEffects(context)));
9402
+ }
9403
+ hasEffectsWhenAccessedAtPath(path, context) {
9404
+ return !this.value || this.value.hasEffectsWhenAccessedAtPath(path, context);
9405
+ }
9406
+ hasEffectsWhenAssignedAtPath(path, context) {
9407
+ return !this.value || this.value.hasEffectsWhenAssignedAtPath(path, context);
9408
+ }
9409
+ hasEffectsWhenCalledAtPath(path, callOptions, context) {
9410
+ return !this.value || this.value.hasEffectsWhenCalledAtPath(path, callOptions, context);
9411
+ }
9412
+ applyDeoptimizations() { }
9356
9413
  }
9357
9414
 
9358
9415
  class ObjectMember extends ExpressionEntity {
@@ -9387,7 +9444,6 @@ class ObjectMember extends ExpressionEntity {
9387
9444
  class ClassNode extends NodeBase {
9388
9445
  constructor() {
9389
9446
  super(...arguments);
9390
- this.deoptimized = false;
9391
9447
  this.objectEntity = null;
9392
9448
  }
9393
9449
  createScope(parentScope) {
@@ -9466,6 +9522,7 @@ class ClassNode extends NodeBase {
9466
9522
  this.classConstructor = null;
9467
9523
  }
9468
9524
  applyDeoptimizations() {
9525
+ var _a, _b;
9469
9526
  this.deoptimized = true;
9470
9527
  for (const definition of this.body.body) {
9471
9528
  if (!(definition.static ||
@@ -9473,7 +9530,11 @@ class ClassNode extends NodeBase {
9473
9530
  // Calls to methods are not tracked, ensure that the return value is deoptimized
9474
9531
  definition.deoptimizePath(UNKNOWN_PATH);
9475
9532
  }
9533
+ else if (definition instanceof PropertyDefinition) {
9534
+ (_a = definition.value) === null || _a === void 0 ? void 0 : _a.deoptimizeCallParameters();
9535
+ }
9476
9536
  }
9537
+ (_b = this.superClass) === null || _b === void 0 ? void 0 : _b.deoptimizeCallParameters();
9477
9538
  this.context.requestTreeshakingPass();
9478
9539
  }
9479
9540
  getObjectEntity() {
@@ -9802,6 +9863,7 @@ class ExportAllDeclaration extends NodeBase {
9802
9863
  render(code, _options, nodeRenderOptions) {
9803
9864
  code.remove(nodeRenderOptions.start, nodeRenderOptions.end);
9804
9865
  }
9866
+ applyDeoptimizations() { }
9805
9867
  }
9806
9868
  ExportAllDeclaration.prototype.needsBoundaries = true;
9807
9869
 
@@ -9879,6 +9941,7 @@ class ExportDefaultDeclaration extends NodeBase {
9879
9941
  }
9880
9942
  this.declaration.render(code, options);
9881
9943
  }
9944
+ applyDeoptimizations() { }
9882
9945
  renderNamedDeclaration(code, declarationStart, declarationKeyword, endMarker, needsId, options) {
9883
9946
  const { exportNamesByVariable, format, snippets: { getPropertyAccess } } = options;
9884
9947
  const name = this.variable.getName(getPropertyAccess);
@@ -9933,17 +9996,15 @@ class ExportNamedDeclaration extends NodeBase {
9933
9996
  this.declaration.render(code, options, { end, start });
9934
9997
  }
9935
9998
  }
9999
+ applyDeoptimizations() { }
9936
10000
  }
9937
10001
  ExportNamedDeclaration.prototype.needsBoundaries = true;
9938
10002
 
9939
10003
  class ExportSpecifier extends NodeBase {
10004
+ applyDeoptimizations() { }
9940
10005
  }
9941
10006
 
9942
10007
  class ForInStatement extends NodeBase {
9943
- constructor() {
9944
- super(...arguments);
9945
- this.deoptimized = false;
9946
- }
9947
10008
  createScope(parentScope) {
9948
10009
  this.scope = new BlockScope(parentScope);
9949
10010
  }
@@ -9992,10 +10053,6 @@ class ForInStatement extends NodeBase {
9992
10053
  }
9993
10054
 
9994
10055
  class ForOfStatement extends NodeBase {
9995
- constructor() {
9996
- super(...arguments);
9997
- this.deoptimized = false;
9998
- }
9999
10056
  createScope(parentScope) {
10000
10057
  this.scope = new BlockScope(parentScope);
10001
10058
  }
@@ -10190,6 +10247,7 @@ class IfStatement extends NodeBase {
10190
10247
  }
10191
10248
  this.renderHoistedDeclarations(hoistedDeclarations, code, getPropertyAccess);
10192
10249
  }
10250
+ applyDeoptimizations() { }
10193
10251
  getTestValue() {
10194
10252
  if (this.testValue === unset) {
10195
10253
  return (this.testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this));
@@ -10275,10 +10333,12 @@ class ImportDeclaration extends NodeBase {
10275
10333
  render(code, _options, nodeRenderOptions) {
10276
10334
  code.remove(nodeRenderOptions.start, nodeRenderOptions.end);
10277
10335
  }
10336
+ applyDeoptimizations() { }
10278
10337
  }
10279
10338
  ImportDeclaration.prototype.needsBoundaries = true;
10280
10339
 
10281
10340
  class ImportDefaultSpecifier extends NodeBase {
10341
+ applyDeoptimizations() { }
10282
10342
  }
10283
10343
 
10284
10344
  const INTEROP_DEFAULT_VARIABLE = '_interopDefault';
@@ -10537,6 +10597,7 @@ class ImportExpression extends NodeBase {
10537
10597
  setInternalResolution(inlineNamespace) {
10538
10598
  this.inlineNamespace = inlineNamespace;
10539
10599
  }
10600
+ applyDeoptimizations() { }
10540
10601
  getDynamicImportMechanismAndHelper(resolution, exportMode, { compact, dynamicImportFunction, format, generatedCode: { arrowFunctions }, interop }, { _, getDirectReturnFunction, getDirectReturnIifeLeft }, pluginDriver) {
10541
10602
  const mechanism = pluginDriver.hookFirstSync('renderDynamicImport', [
10542
10603
  {
@@ -10645,9 +10706,11 @@ const accessedImportGlobals = {
10645
10706
  };
10646
10707
 
10647
10708
  class ImportNamespaceSpecifier extends NodeBase {
10709
+ applyDeoptimizations() { }
10648
10710
  }
10649
10711
 
10650
10712
  class ImportSpecifier extends NodeBase {
10713
+ applyDeoptimizations() { }
10651
10714
  }
10652
10715
 
10653
10716
  class LabeledStatement extends NodeBase {
@@ -10993,10 +11056,6 @@ const importMetaMechanisms = {
10993
11056
  };
10994
11057
 
10995
11058
  class NewExpression extends NodeBase {
10996
- constructor() {
10997
- super(...arguments);
10998
- this.deoptimized = false;
10999
- }
11000
11059
  hasEffects(context) {
11001
11060
  try {
11002
11061
  for (const argument of this.arguments) {
@@ -11046,6 +11105,42 @@ class NewExpression extends NodeBase {
11046
11105
  }
11047
11106
  }
11048
11107
 
11108
+ class Property extends MethodBase {
11109
+ constructor() {
11110
+ super(...arguments);
11111
+ this.declarationInit = null;
11112
+ }
11113
+ declare(kind, init) {
11114
+ this.declarationInit = init;
11115
+ return this.value.declare(kind, UNKNOWN_EXPRESSION);
11116
+ }
11117
+ hasEffects(context) {
11118
+ if (!this.deoptimized)
11119
+ this.applyDeoptimizations();
11120
+ const propertyReadSideEffects = this.context.options.treeshake
11121
+ .propertyReadSideEffects;
11122
+ return ((this.parent.type === 'ObjectPattern' && propertyReadSideEffects === 'always') ||
11123
+ this.key.hasEffects(context) ||
11124
+ this.value.hasEffects(context));
11125
+ }
11126
+ markDeclarationReached() {
11127
+ this.value.markDeclarationReached();
11128
+ }
11129
+ render(code, options) {
11130
+ if (!this.shorthand) {
11131
+ this.key.render(code, options);
11132
+ }
11133
+ this.value.render(code, options, { isShorthandProperty: this.shorthand });
11134
+ }
11135
+ applyDeoptimizations() {
11136
+ this.deoptimized = true;
11137
+ if (this.declarationInit !== null) {
11138
+ this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]);
11139
+ this.context.requestTreeshakingPass();
11140
+ }
11141
+ }
11142
+ }
11143
+
11049
11144
  class ObjectExpression extends NodeBase {
11050
11145
  constructor() {
11051
11146
  super(...arguments);
@@ -11083,6 +11178,14 @@ class ObjectExpression extends NodeBase {
11083
11178
  code.prependLeft(this.end, ')');
11084
11179
  }
11085
11180
  }
11181
+ applyDeoptimizations() {
11182
+ this.deoptimized = true;
11183
+ for (const property of this.properties) {
11184
+ if (property instanceof Property) {
11185
+ property.value.deoptimizeCallParameters();
11186
+ }
11187
+ }
11188
+ }
11086
11189
  getObjectEntity() {
11087
11190
  if (this.objectEntity !== null) {
11088
11191
  return this.objectEntity;
@@ -11159,77 +11262,7 @@ class Program extends NodeBase {
11159
11262
  super.render(code, options);
11160
11263
  }
11161
11264
  }
11162
- }
11163
-
11164
- class Property extends MethodBase {
11165
- constructor() {
11166
- super(...arguments);
11167
- this.deoptimized = false;
11168
- this.declarationInit = null;
11169
- }
11170
- declare(kind, init) {
11171
- this.declarationInit = init;
11172
- return this.value.declare(kind, UNKNOWN_EXPRESSION);
11173
- }
11174
- hasEffects(context) {
11175
- if (!this.deoptimized)
11176
- this.applyDeoptimizations();
11177
- const propertyReadSideEffects = this.context.options.treeshake
11178
- .propertyReadSideEffects;
11179
- return ((this.parent.type === 'ObjectPattern' && propertyReadSideEffects === 'always') ||
11180
- this.key.hasEffects(context) ||
11181
- this.value.hasEffects(context));
11182
- }
11183
- markDeclarationReached() {
11184
- this.value.markDeclarationReached();
11185
- }
11186
- render(code, options) {
11187
- if (!this.shorthand) {
11188
- this.key.render(code, options);
11189
- }
11190
- this.value.render(code, options, { isShorthandProperty: this.shorthand });
11191
- }
11192
- applyDeoptimizations() {
11193
- this.deoptimized = true;
11194
- if (this.declarationInit !== null) {
11195
- this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]);
11196
- this.context.requestTreeshakingPass();
11197
- }
11198
- }
11199
- }
11200
-
11201
- class PropertyDefinition extends NodeBase {
11202
- deoptimizePath(path) {
11203
- var _a;
11204
- (_a = this.value) === null || _a === void 0 ? void 0 : _a.deoptimizePath(path);
11205
- }
11206
- deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker) {
11207
- var _a;
11208
- (_a = this.value) === null || _a === void 0 ? void 0 : _a.deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker);
11209
- }
11210
- getLiteralValueAtPath(path, recursionTracker, origin) {
11211
- return this.value
11212
- ? this.value.getLiteralValueAtPath(path, recursionTracker, origin)
11213
- : UnknownValue;
11214
- }
11215
- getReturnExpressionWhenCalledAtPath(path, callOptions, recursionTracker, origin) {
11216
- return this.value
11217
- ? this.value.getReturnExpressionWhenCalledAtPath(path, callOptions, recursionTracker, origin)
11218
- : UNKNOWN_EXPRESSION;
11219
- }
11220
- hasEffects(context) {
11221
- var _a;
11222
- return this.key.hasEffects(context) || (this.static && !!((_a = this.value) === null || _a === void 0 ? void 0 : _a.hasEffects(context)));
11223
- }
11224
- hasEffectsWhenAccessedAtPath(path, context) {
11225
- return !this.value || this.value.hasEffectsWhenAccessedAtPath(path, context);
11226
- }
11227
- hasEffectsWhenAssignedAtPath(path, context) {
11228
- return !this.value || this.value.hasEffectsWhenAssignedAtPath(path, context);
11229
- }
11230
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
11231
- return !this.value || this.value.hasEffectsWhenCalledAtPath(path, callOptions, context);
11232
- }
11265
+ applyDeoptimizations() { }
11233
11266
  }
11234
11267
 
11235
11268
  class ReturnStatement extends NodeBase {
@@ -11826,10 +11859,6 @@ const unaryOperators = {
11826
11859
  '~': value => ~value
11827
11860
  };
11828
11861
  class UnaryExpression extends NodeBase {
11829
- constructor() {
11830
- super(...arguments);
11831
- this.deoptimized = false;
11832
- }
11833
11862
  getLiteralValueAtPath(path, recursionTracker, origin) {
11834
11863
  if (path.length > 0)
11835
11864
  return UnknownValue;
@@ -11872,10 +11901,6 @@ class UnknownNode extends NodeBase {
11872
11901
  }
11873
11902
 
11874
11903
  class UpdateExpression extends NodeBase {
11875
- constructor() {
11876
- super(...arguments);
11877
- this.deoptimized = false;
11878
- }
11879
11904
  hasEffects(context) {
11880
11905
  if (!this.deoptimized)
11881
11906
  this.applyDeoptimizations();
@@ -11977,6 +12002,7 @@ class VariableDeclaration extends NodeBase {
11977
12002
  this.renderReplacedDeclarations(code, options);
11978
12003
  }
11979
12004
  }
12005
+ applyDeoptimizations() { }
11980
12006
  renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, systemPatternExports, options) {
11981
12007
  if (code.original.charCodeAt(this.end - 1) === 59 /*";"*/) {
11982
12008
  code.remove(this.end - 1, this.end);
@@ -12133,6 +12159,7 @@ class VariableDeclarator extends NodeBase {
12133
12159
  code.appendLeft(this.end, `${_}=${_}void 0`);
12134
12160
  }
12135
12161
  }
12162
+ applyDeoptimizations() { }
12136
12163
  }
12137
12164
 
12138
12165
  class WhileStatement extends NodeBase {
@@ -12159,10 +12186,6 @@ class WhileStatement extends NodeBase {
12159
12186
  }
12160
12187
 
12161
12188
  class YieldExpression extends NodeBase {
12162
- constructor() {
12163
- super(...arguments);
12164
- this.deoptimized = false;
12165
- }
12166
12189
  hasEffects(context) {
12167
12190
  var _a;
12168
12191
  if (!this.deoptimized)
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.1
4
- Sat, 28 May 2022 13:06:58 GMT - commit 03088cc0ee948dcc51f26edde067cc2b2736a679
3
+ Rollup.js v2.75.4
4
+ Tue, 31 May 2022 11:26:29 GMT - commit 0409bf0d8859a43f2d5d40dc23ebf74afadb83f7
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.1
4
- Sat, 28 May 2022 13:06:58 GMT - commit 03088cc0ee948dcc51f26edde067cc2b2736a679
3
+ Rollup.js v2.75.4
4
+ Tue, 31 May 2022 11:26:29 GMT - commit 0409bf0d8859a43f2d5d40dc23ebf74afadb83f7
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup",
3
- "version": "2.75.1",
3
+ "version": "2.75.4",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -24,7 +24,7 @@
24
24
  "perf:init": "node scripts/perf-init.js",
25
25
  "postpublish": "git push && git push --tags",
26
26
  "prepare": "husky install && npm run build",
27
- "prepublishOnly": "npm ci && npm run lint:nofix && npm run security && npm run build:bootstrap && npm run test:all",
27
+ "prepublishOnly": "git pull --ff-only && npm ci && npm run lint:nofix && npm run security && npm run build:bootstrap && npm run test:all",
28
28
  "security": "npm audit",
29
29
  "test": "npm run build && npm run test:all",
30
30
  "test:cjs": "npm run build:cjs && npm run test:only",