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/es/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
 
@@ -14,7 +14,7 @@ import { createHash as createHash$1 } from 'crypto';
14
14
  import { promises } from 'fs';
15
15
  import { EventEmitter } from 'events';
16
16
 
17
- var version$1 = "2.75.1";
17
+ var version$1 = "2.75.4";
18
18
 
19
19
  var charToInteger = {};
20
20
  var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -1593,6 +1593,7 @@ class ExpressionEntity {
1593
1593
  constructor() {
1594
1594
  this.included = false;
1595
1595
  }
1596
+ deoptimizeCallParameters() { }
1596
1597
  deoptimizePath(_path) { }
1597
1598
  deoptimizeThisOnEventAtPath(_event, _path, thisParameter, _recursionTracker) {
1598
1599
  thisParameter.deoptimizePath(UNKNOWN_PATH);
@@ -5204,6 +5205,11 @@ const INCLUDE_PARAMETERS = 'variables';
5204
5205
  class NodeBase extends ExpressionEntity {
5205
5206
  constructor(esTreeNode, parent, parentScope) {
5206
5207
  super();
5208
+ // Nodes can apply custom deoptimizations once they become part of the
5209
+ // executed code. To do this, they must initialize this as false, implement
5210
+ // applyDeoptimizations and call this from include and hasEffects if they
5211
+ // have custom handlers
5212
+ this.deoptimized = false;
5207
5213
  this.esTreeNode = esTreeNode;
5208
5214
  this.keys = keys[esTreeNode.type] || getAndCreateKeys(esTreeNode);
5209
5215
  this.parent = parent;
@@ -5241,7 +5247,7 @@ class NodeBase extends ExpressionEntity {
5241
5247
  this.scope = parentScope;
5242
5248
  }
5243
5249
  hasEffects(context) {
5244
- if (this.deoptimized === false)
5250
+ if (!this.deoptimized)
5245
5251
  this.applyDeoptimizations();
5246
5252
  for (const key of this.keys) {
5247
5253
  const value = this[key];
@@ -5259,7 +5265,7 @@ class NodeBase extends ExpressionEntity {
5259
5265
  return false;
5260
5266
  }
5261
5267
  include(context, includeChildrenRecursively, _options) {
5262
- if (this.deoptimized === false)
5268
+ if (!this.deoptimized)
5263
5269
  this.applyDeoptimizations();
5264
5270
  this.included = true;
5265
5271
  for (const key of this.keys) {
@@ -5358,10 +5364,6 @@ class NodeBase extends ExpressionEntity {
5358
5364
  }
5359
5365
 
5360
5366
  class SpreadElement extends NodeBase {
5361
- constructor() {
5362
- super(...arguments);
5363
- this.deoptimized = false;
5364
- }
5365
5367
  deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker) {
5366
5368
  if (path.length > 0) {
5367
5369
  this.argument.deoptimizeThisOnEventAtPath(event, [UnknownKey, ...path], thisParameter, recursionTracker);
@@ -6040,7 +6042,6 @@ const ARRAY_PROTOTYPE = new ObjectEntity({
6040
6042
  class ArrayExpression extends NodeBase {
6041
6043
  constructor() {
6042
6044
  super(...arguments);
6043
- this.deoptimized = false;
6044
6045
  this.objectEntity = null;
6045
6046
  }
6046
6047
  deoptimizePath(path) {
@@ -6069,11 +6070,16 @@ class ArrayExpression extends NodeBase {
6069
6070
  let hasSpread = false;
6070
6071
  for (let index = 0; index < this.elements.length; index++) {
6071
6072
  const element = this.elements[index];
6072
- if (hasSpread || element instanceof SpreadElement) {
6073
- if (element) {
6073
+ if (element) {
6074
+ if (hasSpread || element instanceof SpreadElement) {
6074
6075
  hasSpread = true;
6076
+ // This also deoptimizes parameter defaults
6075
6077
  element.deoptimizePath(UNKNOWN_PATH);
6076
6078
  }
6079
+ else {
6080
+ // We do not track parameter defaults in arrays
6081
+ element.deoptimizeCallParameters();
6082
+ }
6077
6083
  }
6078
6084
  }
6079
6085
  this.context.requestTreeshakingPass();
@@ -6167,6 +6173,10 @@ class LocalVariable extends Variable {
6167
6173
  this.additionalInitializers = null;
6168
6174
  }
6169
6175
  }
6176
+ deoptimizeCallParameters() {
6177
+ var _a;
6178
+ (_a = this.init) === null || _a === void 0 ? void 0 : _a.deoptimizeCallParameters();
6179
+ }
6170
6180
  deoptimizePath(path) {
6171
6181
  var _a, _b;
6172
6182
  if (this.isReassigned ||
@@ -6513,10 +6523,6 @@ class ReturnValueScope extends ParameterScope {
6513
6523
  }
6514
6524
 
6515
6525
  class AssignmentPattern extends NodeBase {
6516
- constructor() {
6517
- super(...arguments);
6518
- this.deoptimized = false;
6519
- }
6520
6526
  addExportedVariables(variables, exportNamesByVariable) {
6521
6527
  this.left.addExportedVariables(variables, exportNamesByVariable);
6522
6528
  }
@@ -6752,6 +6758,7 @@ class ExpressionStatement extends NodeBase {
6752
6758
  return this.parent.type !== Program$1;
6753
6759
  return super.shouldBeIncluded(context);
6754
6760
  }
6761
+ applyDeoptimizations() { }
6755
6762
  }
6756
6763
 
6757
6764
  class BlockStatement extends NodeBase {
@@ -6812,7 +6819,6 @@ class BlockStatement extends NodeBase {
6812
6819
  class RestElement extends NodeBase {
6813
6820
  constructor() {
6814
6821
  super(...arguments);
6815
- this.deoptimized = false;
6816
6822
  this.declarationInit = null;
6817
6823
  }
6818
6824
  addExportedVariables(variables, exportNamesByVariable) {
@@ -6850,6 +6856,9 @@ class FunctionBase extends NodeBase {
6850
6856
  deoptimizeCache() {
6851
6857
  this.forceIncludeParameters = true;
6852
6858
  }
6859
+ deoptimizeCallParameters() {
6860
+ this.forceIncludeParameters = true;
6861
+ }
6853
6862
  deoptimizePath(path) {
6854
6863
  this.getObjectEntity().deoptimizePath(path);
6855
6864
  if (path.length === 1 && path[0] === UnknownKey) {
@@ -6922,6 +6931,8 @@ class FunctionBase extends NodeBase {
6922
6931
  return false;
6923
6932
  }
6924
6933
  include(context, includeChildrenRecursively, { includeWithoutParameterDefaults } = BLANK) {
6934
+ if (!this.deoptimized)
6935
+ this.applyDeoptimizations();
6925
6936
  this.included = true;
6926
6937
  const { brokenFlow } = context;
6927
6938
  context.brokenFlow = BROKEN_FLOW_NONE;
@@ -6974,6 +6985,15 @@ class FunctionBase extends NodeBase {
6974
6985
  }
6975
6986
  super.parseNode(esTreeNode);
6976
6987
  }
6988
+ applyDeoptimizations() {
6989
+ // We currently do not track deoptimizations of default values, deoptimize them
6990
+ // just as we deoptimize call arguments
6991
+ for (const param of this.params) {
6992
+ if (param instanceof AssignmentPattern) {
6993
+ param.right.deoptimizePath(UNKNOWN_PATH);
6994
+ }
6995
+ }
6996
+ }
6977
6997
  }
6978
6998
  FunctionBase.prototype.preventChildBlockScope = true;
6979
6999
 
@@ -6986,6 +7006,8 @@ class ArrowFunctionExpression extends FunctionBase {
6986
7006
  this.scope = new ReturnValueScope(parentScope, this.context);
6987
7007
  }
6988
7008
  hasEffects() {
7009
+ if (!this.deoptimized)
7010
+ this.applyDeoptimizations();
6989
7011
  return false;
6990
7012
  }
6991
7013
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
@@ -7999,7 +8021,6 @@ class Identifier extends NodeBase {
7999
8021
  constructor() {
8000
8022
  super(...arguments);
8001
8023
  this.variable = null;
8002
- this.deoptimized = false;
8003
8024
  this.isTDZAccess = null;
8004
8025
  }
8005
8026
  addExportedVariables(variables, exportNamesByVariable) {
@@ -8044,11 +8065,17 @@ class Identifier extends NodeBase {
8044
8065
  variable.kind = kind;
8045
8066
  return [(this.variable = variable)];
8046
8067
  }
8068
+ deoptimizeCallParameters() {
8069
+ this.variable.deoptimizeCallParameters();
8070
+ }
8047
8071
  deoptimizePath(path) {
8072
+ var _a;
8048
8073
  if (path.length === 0 && !this.scope.contains(this.name)) {
8049
8074
  this.disallowImportReassignment();
8050
8075
  }
8051
- this.variable.deoptimizePath(path);
8076
+ // We keep conditional chaining because an unknown Node could have an
8077
+ // Identifier as property that might be deoptimized by default
8078
+ (_a = this.variable) === null || _a === void 0 ? void 0 : _a.deoptimizePath(path);
8052
8079
  }
8053
8080
  deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker) {
8054
8081
  this.variable.deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker);
@@ -8211,10 +8238,6 @@ class ObjectPattern extends NodeBase {
8211
8238
  }
8212
8239
 
8213
8240
  class AssignmentExpression extends NodeBase {
8214
- constructor() {
8215
- super(...arguments);
8216
- this.deoptimized = false;
8217
- }
8218
8241
  hasEffects(context) {
8219
8242
  if (!this.deoptimized)
8220
8243
  this.applyDeoptimizations();
@@ -8403,6 +8426,8 @@ class FunctionNode extends FunctionBase {
8403
8426
  }
8404
8427
  hasEffects() {
8405
8428
  var _a;
8429
+ if (!this.deoptimized)
8430
+ this.applyDeoptimizations();
8406
8431
  return !!((_a = this.id) === null || _a === void 0 ? void 0 : _a.hasEffects());
8407
8432
  }
8408
8433
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
@@ -8458,10 +8483,6 @@ class FunctionNode extends FunctionBase {
8458
8483
  }
8459
8484
 
8460
8485
  class AwaitExpression extends NodeBase {
8461
- constructor() {
8462
- super(...arguments);
8463
- this.deoptimized = false;
8464
- }
8465
8486
  hasEffects() {
8466
8487
  if (!this.deoptimized)
8467
8488
  this.applyDeoptimizations();
@@ -8655,7 +8676,6 @@ class MemberExpression extends NodeBase {
8655
8676
  constructor() {
8656
8677
  super(...arguments);
8657
8678
  this.variable = null;
8658
- this.deoptimized = false;
8659
8679
  this.bound = false;
8660
8680
  this.expressionsToBeDeoptimized = [];
8661
8681
  this.replacement = null;
@@ -8905,7 +8925,6 @@ class MemberExpression extends NodeBase {
8905
8925
  class CallExpressionBase extends NodeBase {
8906
8926
  constructor() {
8907
8927
  super(...arguments);
8908
- this.deoptimized = false;
8909
8928
  this.returnExpression = null;
8910
8929
  this.deoptimizableDependentExpressions = [];
8911
8930
  this.expressionsToBeDeoptimized = new Set();
@@ -9156,6 +9175,7 @@ class ClassBody extends NodeBase {
9156
9175
  }
9157
9176
  super.parseNode(esTreeNode);
9158
9177
  }
9178
+ applyDeoptimizations() { }
9159
9179
  }
9160
9180
 
9161
9181
  class MethodBase extends NodeBase {
@@ -9207,6 +9227,7 @@ class MethodBase extends NodeBase {
9207
9227
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
9208
9228
  return this.getAccessedValue().hasEffectsWhenCalledAtPath(path, callOptions, context);
9209
9229
  }
9230
+ applyDeoptimizations() { }
9210
9231
  getAccessedValue() {
9211
9232
  if (this.accessedValue === null) {
9212
9233
  if (this.kind === 'get') {
@@ -9222,6 +9243,42 @@ class MethodBase extends NodeBase {
9222
9243
  }
9223
9244
 
9224
9245
  class MethodDefinition extends MethodBase {
9246
+ applyDeoptimizations() { }
9247
+ }
9248
+
9249
+ class PropertyDefinition extends NodeBase {
9250
+ deoptimizePath(path) {
9251
+ var _a;
9252
+ (_a = this.value) === null || _a === void 0 ? void 0 : _a.deoptimizePath(path);
9253
+ }
9254
+ deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker) {
9255
+ var _a;
9256
+ (_a = this.value) === null || _a === void 0 ? void 0 : _a.deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker);
9257
+ }
9258
+ getLiteralValueAtPath(path, recursionTracker, origin) {
9259
+ return this.value
9260
+ ? this.value.getLiteralValueAtPath(path, recursionTracker, origin)
9261
+ : UnknownValue;
9262
+ }
9263
+ getReturnExpressionWhenCalledAtPath(path, callOptions, recursionTracker, origin) {
9264
+ return this.value
9265
+ ? this.value.getReturnExpressionWhenCalledAtPath(path, callOptions, recursionTracker, origin)
9266
+ : UNKNOWN_EXPRESSION;
9267
+ }
9268
+ hasEffects(context) {
9269
+ var _a;
9270
+ return this.key.hasEffects(context) || (this.static && !!((_a = this.value) === null || _a === void 0 ? void 0 : _a.hasEffects(context)));
9271
+ }
9272
+ hasEffectsWhenAccessedAtPath(path, context) {
9273
+ return !this.value || this.value.hasEffectsWhenAccessedAtPath(path, context);
9274
+ }
9275
+ hasEffectsWhenAssignedAtPath(path, context) {
9276
+ return !this.value || this.value.hasEffectsWhenAssignedAtPath(path, context);
9277
+ }
9278
+ hasEffectsWhenCalledAtPath(path, callOptions, context) {
9279
+ return !this.value || this.value.hasEffectsWhenCalledAtPath(path, callOptions, context);
9280
+ }
9281
+ applyDeoptimizations() { }
9225
9282
  }
9226
9283
 
9227
9284
  class ObjectMember extends ExpressionEntity {
@@ -9256,7 +9313,6 @@ class ObjectMember extends ExpressionEntity {
9256
9313
  class ClassNode extends NodeBase {
9257
9314
  constructor() {
9258
9315
  super(...arguments);
9259
- this.deoptimized = false;
9260
9316
  this.objectEntity = null;
9261
9317
  }
9262
9318
  createScope(parentScope) {
@@ -9335,6 +9391,7 @@ class ClassNode extends NodeBase {
9335
9391
  this.classConstructor = null;
9336
9392
  }
9337
9393
  applyDeoptimizations() {
9394
+ var _a, _b;
9338
9395
  this.deoptimized = true;
9339
9396
  for (const definition of this.body.body) {
9340
9397
  if (!(definition.static ||
@@ -9342,7 +9399,11 @@ class ClassNode extends NodeBase {
9342
9399
  // Calls to methods are not tracked, ensure that the return value is deoptimized
9343
9400
  definition.deoptimizePath(UNKNOWN_PATH);
9344
9401
  }
9402
+ else if (definition instanceof PropertyDefinition) {
9403
+ (_a = definition.value) === null || _a === void 0 ? void 0 : _a.deoptimizeCallParameters();
9404
+ }
9345
9405
  }
9406
+ (_b = this.superClass) === null || _b === void 0 ? void 0 : _b.deoptimizeCallParameters();
9346
9407
  this.context.requestTreeshakingPass();
9347
9408
  }
9348
9409
  getObjectEntity() {
@@ -9671,6 +9732,7 @@ class ExportAllDeclaration extends NodeBase {
9671
9732
  render(code, _options, nodeRenderOptions) {
9672
9733
  code.remove(nodeRenderOptions.start, nodeRenderOptions.end);
9673
9734
  }
9735
+ applyDeoptimizations() { }
9674
9736
  }
9675
9737
  ExportAllDeclaration.prototype.needsBoundaries = true;
9676
9738
 
@@ -9748,6 +9810,7 @@ class ExportDefaultDeclaration extends NodeBase {
9748
9810
  }
9749
9811
  this.declaration.render(code, options);
9750
9812
  }
9813
+ applyDeoptimizations() { }
9751
9814
  renderNamedDeclaration(code, declarationStart, declarationKeyword, endMarker, needsId, options) {
9752
9815
  const { exportNamesByVariable, format, snippets: { getPropertyAccess } } = options;
9753
9816
  const name = this.variable.getName(getPropertyAccess);
@@ -9802,17 +9865,15 @@ class ExportNamedDeclaration extends NodeBase {
9802
9865
  this.declaration.render(code, options, { end, start });
9803
9866
  }
9804
9867
  }
9868
+ applyDeoptimizations() { }
9805
9869
  }
9806
9870
  ExportNamedDeclaration.prototype.needsBoundaries = true;
9807
9871
 
9808
9872
  class ExportSpecifier extends NodeBase {
9873
+ applyDeoptimizations() { }
9809
9874
  }
9810
9875
 
9811
9876
  class ForInStatement extends NodeBase {
9812
- constructor() {
9813
- super(...arguments);
9814
- this.deoptimized = false;
9815
- }
9816
9877
  createScope(parentScope) {
9817
9878
  this.scope = new BlockScope(parentScope);
9818
9879
  }
@@ -9861,10 +9922,6 @@ class ForInStatement extends NodeBase {
9861
9922
  }
9862
9923
 
9863
9924
  class ForOfStatement extends NodeBase {
9864
- constructor() {
9865
- super(...arguments);
9866
- this.deoptimized = false;
9867
- }
9868
9925
  createScope(parentScope) {
9869
9926
  this.scope = new BlockScope(parentScope);
9870
9927
  }
@@ -10059,6 +10116,7 @@ class IfStatement extends NodeBase {
10059
10116
  }
10060
10117
  this.renderHoistedDeclarations(hoistedDeclarations, code, getPropertyAccess);
10061
10118
  }
10119
+ applyDeoptimizations() { }
10062
10120
  getTestValue() {
10063
10121
  if (this.testValue === unset) {
10064
10122
  return (this.testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this));
@@ -10144,10 +10202,12 @@ class ImportDeclaration extends NodeBase {
10144
10202
  render(code, _options, nodeRenderOptions) {
10145
10203
  code.remove(nodeRenderOptions.start, nodeRenderOptions.end);
10146
10204
  }
10205
+ applyDeoptimizations() { }
10147
10206
  }
10148
10207
  ImportDeclaration.prototype.needsBoundaries = true;
10149
10208
 
10150
10209
  class ImportDefaultSpecifier extends NodeBase {
10210
+ applyDeoptimizations() { }
10151
10211
  }
10152
10212
 
10153
10213
  const INTEROP_DEFAULT_VARIABLE = '_interopDefault';
@@ -10406,6 +10466,7 @@ class ImportExpression extends NodeBase {
10406
10466
  setInternalResolution(inlineNamespace) {
10407
10467
  this.inlineNamespace = inlineNamespace;
10408
10468
  }
10469
+ applyDeoptimizations() { }
10409
10470
  getDynamicImportMechanismAndHelper(resolution, exportMode, { compact, dynamicImportFunction, format, generatedCode: { arrowFunctions }, interop }, { _, getDirectReturnFunction, getDirectReturnIifeLeft }, pluginDriver) {
10410
10471
  const mechanism = pluginDriver.hookFirstSync('renderDynamicImport', [
10411
10472
  {
@@ -10514,9 +10575,11 @@ const accessedImportGlobals = {
10514
10575
  };
10515
10576
 
10516
10577
  class ImportNamespaceSpecifier extends NodeBase {
10578
+ applyDeoptimizations() { }
10517
10579
  }
10518
10580
 
10519
10581
  class ImportSpecifier extends NodeBase {
10582
+ applyDeoptimizations() { }
10520
10583
  }
10521
10584
 
10522
10585
  class LabeledStatement extends NodeBase {
@@ -10862,10 +10925,6 @@ const importMetaMechanisms = {
10862
10925
  };
10863
10926
 
10864
10927
  class NewExpression extends NodeBase {
10865
- constructor() {
10866
- super(...arguments);
10867
- this.deoptimized = false;
10868
- }
10869
10928
  hasEffects(context) {
10870
10929
  try {
10871
10930
  for (const argument of this.arguments) {
@@ -10915,6 +10974,42 @@ class NewExpression extends NodeBase {
10915
10974
  }
10916
10975
  }
10917
10976
 
10977
+ class Property extends MethodBase {
10978
+ constructor() {
10979
+ super(...arguments);
10980
+ this.declarationInit = null;
10981
+ }
10982
+ declare(kind, init) {
10983
+ this.declarationInit = init;
10984
+ return this.value.declare(kind, UNKNOWN_EXPRESSION);
10985
+ }
10986
+ hasEffects(context) {
10987
+ if (!this.deoptimized)
10988
+ this.applyDeoptimizations();
10989
+ const propertyReadSideEffects = this.context.options.treeshake
10990
+ .propertyReadSideEffects;
10991
+ return ((this.parent.type === 'ObjectPattern' && propertyReadSideEffects === 'always') ||
10992
+ this.key.hasEffects(context) ||
10993
+ this.value.hasEffects(context));
10994
+ }
10995
+ markDeclarationReached() {
10996
+ this.value.markDeclarationReached();
10997
+ }
10998
+ render(code, options) {
10999
+ if (!this.shorthand) {
11000
+ this.key.render(code, options);
11001
+ }
11002
+ this.value.render(code, options, { isShorthandProperty: this.shorthand });
11003
+ }
11004
+ applyDeoptimizations() {
11005
+ this.deoptimized = true;
11006
+ if (this.declarationInit !== null) {
11007
+ this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]);
11008
+ this.context.requestTreeshakingPass();
11009
+ }
11010
+ }
11011
+ }
11012
+
10918
11013
  class ObjectExpression extends NodeBase {
10919
11014
  constructor() {
10920
11015
  super(...arguments);
@@ -10952,6 +11047,14 @@ class ObjectExpression extends NodeBase {
10952
11047
  code.prependLeft(this.end, ')');
10953
11048
  }
10954
11049
  }
11050
+ applyDeoptimizations() {
11051
+ this.deoptimized = true;
11052
+ for (const property of this.properties) {
11053
+ if (property instanceof Property) {
11054
+ property.value.deoptimizeCallParameters();
11055
+ }
11056
+ }
11057
+ }
10955
11058
  getObjectEntity() {
10956
11059
  if (this.objectEntity !== null) {
10957
11060
  return this.objectEntity;
@@ -11028,77 +11131,7 @@ class Program extends NodeBase {
11028
11131
  super.render(code, options);
11029
11132
  }
11030
11133
  }
11031
- }
11032
-
11033
- class Property extends MethodBase {
11034
- constructor() {
11035
- super(...arguments);
11036
- this.deoptimized = false;
11037
- this.declarationInit = null;
11038
- }
11039
- declare(kind, init) {
11040
- this.declarationInit = init;
11041
- return this.value.declare(kind, UNKNOWN_EXPRESSION);
11042
- }
11043
- hasEffects(context) {
11044
- if (!this.deoptimized)
11045
- this.applyDeoptimizations();
11046
- const propertyReadSideEffects = this.context.options.treeshake
11047
- .propertyReadSideEffects;
11048
- return ((this.parent.type === 'ObjectPattern' && propertyReadSideEffects === 'always') ||
11049
- this.key.hasEffects(context) ||
11050
- this.value.hasEffects(context));
11051
- }
11052
- markDeclarationReached() {
11053
- this.value.markDeclarationReached();
11054
- }
11055
- render(code, options) {
11056
- if (!this.shorthand) {
11057
- this.key.render(code, options);
11058
- }
11059
- this.value.render(code, options, { isShorthandProperty: this.shorthand });
11060
- }
11061
- applyDeoptimizations() {
11062
- this.deoptimized = true;
11063
- if (this.declarationInit !== null) {
11064
- this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]);
11065
- this.context.requestTreeshakingPass();
11066
- }
11067
- }
11068
- }
11069
-
11070
- class PropertyDefinition extends NodeBase {
11071
- deoptimizePath(path) {
11072
- var _a;
11073
- (_a = this.value) === null || _a === void 0 ? void 0 : _a.deoptimizePath(path);
11074
- }
11075
- deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker) {
11076
- var _a;
11077
- (_a = this.value) === null || _a === void 0 ? void 0 : _a.deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker);
11078
- }
11079
- getLiteralValueAtPath(path, recursionTracker, origin) {
11080
- return this.value
11081
- ? this.value.getLiteralValueAtPath(path, recursionTracker, origin)
11082
- : UnknownValue;
11083
- }
11084
- getReturnExpressionWhenCalledAtPath(path, callOptions, recursionTracker, origin) {
11085
- return this.value
11086
- ? this.value.getReturnExpressionWhenCalledAtPath(path, callOptions, recursionTracker, origin)
11087
- : UNKNOWN_EXPRESSION;
11088
- }
11089
- hasEffects(context) {
11090
- var _a;
11091
- return this.key.hasEffects(context) || (this.static && !!((_a = this.value) === null || _a === void 0 ? void 0 : _a.hasEffects(context)));
11092
- }
11093
- hasEffectsWhenAccessedAtPath(path, context) {
11094
- return !this.value || this.value.hasEffectsWhenAccessedAtPath(path, context);
11095
- }
11096
- hasEffectsWhenAssignedAtPath(path, context) {
11097
- return !this.value || this.value.hasEffectsWhenAssignedAtPath(path, context);
11098
- }
11099
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
11100
- return !this.value || this.value.hasEffectsWhenCalledAtPath(path, callOptions, context);
11101
- }
11134
+ applyDeoptimizations() { }
11102
11135
  }
11103
11136
 
11104
11137
  class ReturnStatement extends NodeBase {
@@ -11695,10 +11728,6 @@ const unaryOperators = {
11695
11728
  '~': value => ~value
11696
11729
  };
11697
11730
  class UnaryExpression extends NodeBase {
11698
- constructor() {
11699
- super(...arguments);
11700
- this.deoptimized = false;
11701
- }
11702
11731
  getLiteralValueAtPath(path, recursionTracker, origin) {
11703
11732
  if (path.length > 0)
11704
11733
  return UnknownValue;
@@ -11741,10 +11770,6 @@ class UnknownNode extends NodeBase {
11741
11770
  }
11742
11771
 
11743
11772
  class UpdateExpression extends NodeBase {
11744
- constructor() {
11745
- super(...arguments);
11746
- this.deoptimized = false;
11747
- }
11748
11773
  hasEffects(context) {
11749
11774
  if (!this.deoptimized)
11750
11775
  this.applyDeoptimizations();
@@ -11846,6 +11871,7 @@ class VariableDeclaration extends NodeBase {
11846
11871
  this.renderReplacedDeclarations(code, options);
11847
11872
  }
11848
11873
  }
11874
+ applyDeoptimizations() { }
11849
11875
  renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, systemPatternExports, options) {
11850
11876
  if (code.original.charCodeAt(this.end - 1) === 59 /*";"*/) {
11851
11877
  code.remove(this.end - 1, this.end);
@@ -12002,6 +12028,7 @@ class VariableDeclarator extends NodeBase {
12002
12028
  code.appendLeft(this.end, `${_}=${_}void 0`);
12003
12029
  }
12004
12030
  }
12031
+ applyDeoptimizations() { }
12005
12032
  }
12006
12033
 
12007
12034
  class WhileStatement extends NodeBase {
@@ -12028,10 +12055,6 @@ class WhileStatement extends NodeBase {
12028
12055
  }
12029
12056
 
12030
12057
  class YieldExpression extends NodeBase {
12031
- constructor() {
12032
- super(...arguments);
12033
- this.deoptimized = false;
12034
- }
12035
12058
  hasEffects(context) {
12036
12059
  var _a;
12037
12060
  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