rollup 2.50.5 → 2.50.6

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.50.5
4
- Sun, 30 May 2021 18:56:20 GMT - commit b3d130b1a5448a2abc07fa3d7cde749c3169d220
3
+ Rollup.js v2.50.6
4
+ Thu, 03 Jun 2021 04:54:09 GMT - commit 9f69fe3f53ae50dffe932529a3503e619292d31a
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.50.5
4
- Sun, 30 May 2021 18:56:20 GMT - commit b3d130b1a5448a2abc07fa3d7cde749c3169d220
3
+ Rollup.js v2.50.6
4
+ Thu, 03 Jun 2021 04:54:09 GMT - commit 9f69fe3f53ae50dffe932529a3503e619292d31a
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -14,7 +14,7 @@ import * as fs from 'fs';
14
14
  import { lstatSync, realpathSync, readdirSync } from 'fs';
15
15
  import { EventEmitter } from 'events';
16
16
 
17
- var version$1 = "2.50.5";
17
+ var version$1 = "2.50.6";
18
18
 
19
19
  var charToInteger = {};
20
20
  var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -4988,8 +4988,14 @@ class SpreadElement extends NodeBase {
4988
4988
  }
4989
4989
  }
4990
4990
  hasEffects(context) {
4991
+ if (!this.deoptimized)
4992
+ this.applyDeoptimizations();
4993
+ const { propertyReadSideEffects } = this.context.options
4994
+ .treeshake;
4991
4995
  return (this.argument.hasEffects(context) ||
4992
- this.argument.hasEffectsWhenAccessedAtPath(UNKNOWN_PATH, context));
4996
+ (propertyReadSideEffects &&
4997
+ (propertyReadSideEffects === 'always' ||
4998
+ this.argument.hasEffectsWhenAccessedAtPath(UNKNOWN_PATH, context))));
4993
4999
  }
4994
5000
  applyDeoptimizations() {
4995
5001
  this.deoptimized = true;
@@ -5203,11 +5209,16 @@ class FunctionNode extends NodeBase {
5203
5209
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
5204
5210
  if (path.length > 0)
5205
5211
  return true;
5206
- if (this.async &&
5207
- this.scope
5208
- .getReturnExpression()
5209
- .hasEffectsWhenCalledAtPath(['then'], { args: NO_ARGS, thisParam: null, withNew: false }, context)) {
5210
- return true;
5212
+ if (this.async) {
5213
+ const { propertyReadSideEffects } = this.context.options
5214
+ .treeshake;
5215
+ const returnExpression = this.scope.getReturnExpression();
5216
+ if (returnExpression.hasEffectsWhenCalledAtPath(['then'], { args: NO_ARGS, thisParam: null, withNew: false }, context) ||
5217
+ (propertyReadSideEffects &&
5218
+ (propertyReadSideEffects === 'always' ||
5219
+ returnExpression.hasEffectsWhenAccessedAtPath(['then'], context)))) {
5220
+ return true;
5221
+ }
5211
5222
  }
5212
5223
  for (const param of this.params) {
5213
5224
  if (param.hasEffects(context))
@@ -5948,7 +5959,7 @@ class ArrowFunctionExpression extends NodeBase {
5948
5959
  // Arrow functions do not mutate their context
5949
5960
  deoptimizeThisOnEventAtPath() { }
5950
5961
  getReturnExpressionWhenCalledAtPath(path) {
5951
- return path.length === 0 ? this.scope.getReturnExpression() : UNKNOWN_EXPRESSION;
5962
+ return !this.async && path.length === 0 ? this.scope.getReturnExpression() : UNKNOWN_EXPRESSION;
5952
5963
  }
5953
5964
  hasEffects() {
5954
5965
  return false;
@@ -5962,6 +5973,17 @@ class ArrowFunctionExpression extends NodeBase {
5962
5973
  hasEffectsWhenCalledAtPath(path, _callOptions, context) {
5963
5974
  if (path.length > 0)
5964
5975
  return true;
5976
+ if (this.async) {
5977
+ const { propertyReadSideEffects } = this.context.options
5978
+ .treeshake;
5979
+ const returnExpression = this.scope.getReturnExpression();
5980
+ if (returnExpression.hasEffectsWhenCalledAtPath(['then'], { args: NO_ARGS, thisParam: null, withNew: false }, context) ||
5981
+ (propertyReadSideEffects &&
5982
+ (propertyReadSideEffects === 'always' ||
5983
+ returnExpression.hasEffectsWhenAccessedAtPath(['then'], context)))) {
5984
+ return true;
5985
+ }
5986
+ }
5965
5987
  for (const param of this.params) {
5966
5988
  if (param.hasEffects(context))
5967
5989
  return true;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.50.5
4
- Sun, 30 May 2021 18:56:20 GMT - commit b3d130b1a5448a2abc07fa3d7cde749c3169d220
3
+ Rollup.js v2.50.6
4
+ Thu, 03 Jun 2021 04:54:09 GMT - commit 9f69fe3f53ae50dffe932529a3503e619292d31a
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.50.5
4
- Sun, 30 May 2021 18:56:20 GMT - commit b3d130b1a5448a2abc07fa3d7cde749c3169d220
3
+ Rollup.js v2.50.6
4
+ Thu, 03 Jun 2021 04:54:09 GMT - commit 9f69fe3f53ae50dffe932529a3503e619292d31a
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup