rollup 2.52.0 → 2.52.1

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.52.0
4
- Wed, 16 Jun 2021 05:23:55 GMT - commit c4f9d13bd284a6b483b1a087917ed3f0bc93cd18
3
+ Rollup.js v2.52.1
4
+ Thu, 17 Jun 2021 05:22:05 GMT - commit bef5fe8a573648f73c258ce9adf1a7ff3ffb129d
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.52.0
4
- Wed, 16 Jun 2021 05:23:55 GMT - commit c4f9d13bd284a6b483b1a087917ed3f0bc93cd18
3
+ Rollup.js v2.52.1
4
+ Thu, 17 Jun 2021 05:22:05 GMT - commit bef5fe8a573648f73c258ce9adf1a7ff3ffb129d
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.52.0
4
- Wed, 16 Jun 2021 05:23:55 GMT - commit c4f9d13bd284a6b483b1a087917ed3f0bc93cd18
3
+ Rollup.js v2.52.1
4
+ Thu, 17 Jun 2021 05:22:05 GMT - commit bef5fe8a573648f73c258ce9adf1a7ff3ffb129d
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.52.0
4
- Wed, 16 Jun 2021 05:23:55 GMT - commit c4f9d13bd284a6b483b1a087917ed3f0bc93cd18
3
+ Rollup.js v2.52.1
4
+ Thu, 17 Jun 2021 05:22:05 GMT - commit bef5fe8a573648f73c258ce9adf1a7ff3ffb129d
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.52.0
4
- Wed, 16 Jun 2021 05:23:55 GMT - commit c4f9d13bd284a6b483b1a087917ed3f0bc93cd18
3
+ Rollup.js v2.52.1
4
+ Thu, 17 Jun 2021 05:22:05 GMT - commit bef5fe8a573648f73c258ce9adf1a7ff3ffb129d
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -32,7 +32,7 @@ function _interopNamespaceDefault(e) {
32
32
 
33
33
  var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
34
34
 
35
- var version$1 = "2.52.0";
35
+ var version$1 = "2.52.1";
36
36
 
37
37
  function ensureArray(items) {
38
38
  if (Array.isArray(items)) {
@@ -4752,9 +4752,10 @@ const INTEGER_REG_EXP = /^\d+$/;
4752
4752
  class ObjectEntity extends ExpressionEntity {
4753
4753
  // If a PropertyMap is used, this will be taken as propertiesAndGettersByKey
4754
4754
  // and we assume there are no setters or getters
4755
- constructor(properties, prototypeExpression) {
4755
+ constructor(properties, prototypeExpression, immutable = false) {
4756
4756
  super();
4757
4757
  this.prototypeExpression = prototypeExpression;
4758
+ this.immutable = immutable;
4758
4759
  this.allProperties = [];
4759
4760
  this.deoptimizedPaths = Object.create(null);
4760
4761
  this.expressionsToBeDeoptimizedByKey = Object.create(null);
@@ -4810,7 +4811,7 @@ class ObjectEntity extends ExpressionEntity {
4810
4811
  }
4811
4812
  deoptimizePath(path) {
4812
4813
  var _a;
4813
- if (this.hasUnknownDeoptimizedProperty)
4814
+ if (this.hasUnknownDeoptimizedProperty || this.immutable)
4814
4815
  return;
4815
4816
  const key = path[0];
4816
4817
  if (path.length === 1) {
@@ -4842,9 +4843,6 @@ class ObjectEntity extends ExpressionEntity {
4842
4843
  }
4843
4844
  deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker) {
4844
4845
  var _a;
4845
- if (path.length === 0) {
4846
- return;
4847
- }
4848
4846
  const [key, ...subPath] = path;
4849
4847
  if (this.hasUnknownDeoptimizedProperty ||
4850
4848
  // single paths that are deoptimized will not become getters or setters
@@ -4871,7 +4869,9 @@ class ObjectEntity extends ExpressionEntity {
4871
4869
  property.deoptimizeThisOnEventAtPath(event, subPath, thisParameter, recursionTracker);
4872
4870
  }
4873
4871
  }
4874
- this.thisParametersToBeDeoptimized.add(thisParameter);
4872
+ if (!this.immutable) {
4873
+ this.thisParametersToBeDeoptimized.add(thisParameter);
4874
+ }
4875
4875
  return;
4876
4876
  }
4877
4877
  for (const property of relevantUnmatchableProperties) {
@@ -4895,7 +4895,9 @@ class ObjectEntity extends ExpressionEntity {
4895
4895
  property.deoptimizeThisOnEventAtPath(event, subPath, thisParameter, recursionTracker);
4896
4896
  }
4897
4897
  }
4898
- this.thisParametersToBeDeoptimized.add(thisParameter);
4898
+ if (!this.immutable) {
4899
+ this.thisParametersToBeDeoptimized.add(thisParameter);
4900
+ }
4899
4901
  (_a = this.prototypeExpression) === null || _a === void 0 ? void 0 : _a.deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker);
4900
4902
  }
4901
4903
  getLiteralValueAtPath(path, recursionTracker, origin) {
@@ -4958,8 +4960,9 @@ class ObjectEntity extends ExpressionEntity {
4958
4960
  return false;
4959
4961
  }
4960
4962
  for (const getter of this.unmatchableGetters) {
4961
- if (getter.hasEffectsWhenAccessedAtPath(subPath, context))
4963
+ if (getter.hasEffectsWhenAccessedAtPath(subPath, context)) {
4962
4964
  return true;
4965
+ }
4963
4966
  }
4964
4967
  }
4965
4968
  else {
@@ -4992,6 +4995,7 @@ class ObjectEntity extends ExpressionEntity {
4992
4995
  }
4993
4996
  if (this.hasUnknownDeoptimizedProperty)
4994
4997
  return true;
4998
+ // We do not need to test for unknown properties as in that case, hasUnknownDeoptimizedProperty is true
4995
4999
  if (typeof key === 'string') {
4996
5000
  if (this.propertiesAndSettersByKey[key]) {
4997
5001
  const setters = this.settersByKey[key];
@@ -5004,15 +5008,8 @@ class ObjectEntity extends ExpressionEntity {
5004
5008
  return false;
5005
5009
  }
5006
5010
  for (const property of this.unmatchableSetters) {
5007
- if (property.hasEffectsWhenAssignedAtPath(subPath, context))
5011
+ if (property.hasEffectsWhenAssignedAtPath(subPath, context)) {
5008
5012
  return true;
5009
- }
5010
- }
5011
- else {
5012
- for (const setters of Object.values(this.settersByKey).concat([this.unmatchableSetters])) {
5013
- for (const setter of setters) {
5014
- if (setter.hasEffectsWhenAssignedAtPath(subPath, context))
5015
- return true;
5016
5013
  }
5017
5014
  }
5018
5015
  }
@@ -5071,11 +5068,6 @@ class ObjectEntity extends ExpressionEntity {
5071
5068
  }
5072
5069
  if (!propertiesAndGettersByKey[key]) {
5073
5070
  propertiesAndGettersByKey[key] = [property, ...unmatchablePropertiesAndGetters];
5074
- if (INTEGER_REG_EXP.test(key)) {
5075
- for (const integerProperty of unknownIntegerProps) {
5076
- propertiesAndGettersByKey[key].push(integerProperty);
5077
- }
5078
- }
5079
5071
  }
5080
5072
  }
5081
5073
  }
@@ -5126,7 +5118,7 @@ class ObjectEntity extends ExpressionEntity {
5126
5118
  return UNKNOWN_EXPRESSION;
5127
5119
  }
5128
5120
  const expression = this.getMemberExpression(key);
5129
- if (expression !== UNKNOWN_EXPRESSION) {
5121
+ if (!(expression === UNKNOWN_EXPRESSION || this.immutable)) {
5130
5122
  const expressionsToBeDeoptimized = (this.expressionsToBeDeoptimizedByKey[key] =
5131
5123
  this.expressionsToBeDeoptimizedByKey[key] || []);
5132
5124
  expressionsToBeDeoptimized.push(origin);
@@ -5259,7 +5251,7 @@ const OBJECT_PROTOTYPE = new ObjectEntity({
5259
5251
  toLocaleString: METHOD_RETURNS_STRING,
5260
5252
  toString: METHOD_RETURNS_STRING,
5261
5253
  valueOf: METHOD_RETURNS_UNKNOWN
5262
- }, null);
5254
+ }, null, true);
5263
5255
 
5264
5256
  class ClassNode extends NodeBase {
5265
5257
  constructor() {
@@ -6238,7 +6230,7 @@ const ARRAY_PROTOTYPE = new ObjectEntity({
6238
6230
  splice: METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY,
6239
6231
  unshift: METHOD_MUTATES_SELF_RETURNS_NUMBER,
6240
6232
  values: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN
6241
- }, OBJECT_PROTOTYPE);
6233
+ }, OBJECT_PROTOTYPE, true);
6242
6234
 
6243
6235
  class ArrayExpression extends NodeBase {
6244
6236
  constructor() {
@@ -6273,10 +6265,14 @@ class ArrayExpression extends NodeBase {
6273
6265
  const properties = [
6274
6266
  { key: 'length', kind: 'init', property: UNKNOWN_LITERAL_NUMBER }
6275
6267
  ];
6268
+ let hasSpread = false;
6276
6269
  for (let index = 0; index < this.elements.length; index++) {
6277
6270
  const element = this.elements[index];
6278
- if (element instanceof SpreadElement) {
6279
- properties.unshift({ key: UnknownInteger, kind: 'init', property: element });
6271
+ if (element instanceof SpreadElement || hasSpread) {
6272
+ if (element) {
6273
+ hasSpread = true;
6274
+ properties.unshift({ key: UnknownInteger, kind: 'init', property: element });
6275
+ }
6280
6276
  }
6281
6277
  else if (!element) {
6282
6278
  properties.push({ key: String(index), kind: 'init', property: UNDEFINED_EXPRESSION });
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.52.0
4
- Wed, 16 Jun 2021 05:23:55 GMT - commit c4f9d13bd284a6b483b1a087917ed3f0bc93cd18
3
+ Rollup.js v2.52.1
4
+ Thu, 17 Jun 2021 05:22:05 GMT - commit bef5fe8a573648f73c258ce9adf1a7ff3ffb129d
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.52.0
4
- Wed, 16 Jun 2021 05:23:55 GMT - commit c4f9d13bd284a6b483b1a087917ed3f0bc93cd18
3
+ Rollup.js v2.52.1
4
+ Thu, 17 Jun 2021 05:22:05 GMT - commit bef5fe8a573648f73c258ce9adf1a7ff3ffb129d
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup",
3
- "version": "2.52.0",
3
+ "version": "2.52.1",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",