rollup 2.50.4 → 2.50.5

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.4
4
- Sat, 29 May 2021 04:39:28 GMT - commit 184eb6006e0e9a7f170a9208f923af0d568a31b6
3
+ Rollup.js v2.50.5
4
+ Sun, 30 May 2021 18:56:20 GMT - commit b3d130b1a5448a2abc07fa3d7cde749c3169d220
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.4
4
- Sat, 29 May 2021 04:39:28 GMT - commit 184eb6006e0e9a7f170a9208f923af0d568a31b6
3
+ Rollup.js v2.50.5
4
+ Sun, 30 May 2021 18:56:20 GMT - commit b3d130b1a5448a2abc07fa3d7cde749c3169d220
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.4";
17
+ var version$1 = "2.50.5";
18
18
 
19
19
  var charToInteger = {};
20
20
  var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -3397,10 +3397,11 @@ const knownGlobals = {
3397
3397
  Promise: {
3398
3398
  __proto__: null,
3399
3399
  [ValueProperties]: IMPURE,
3400
- all: PF,
3400
+ all: O,
3401
3401
  prototype: O,
3402
- race: PF,
3403
- resolve: PF
3402
+ race: O,
3403
+ reject: O,
3404
+ resolve: O
3404
3405
  },
3405
3406
  propertyIsEnumerable: O,
3406
3407
  Proxy: O,
@@ -5183,7 +5184,7 @@ class FunctionNode extends NodeBase {
5183
5184
  }
5184
5185
  }
5185
5186
  getReturnExpressionWhenCalledAtPath(path) {
5186
- return path.length === 0 ? this.scope.getReturnExpression() : UNKNOWN_EXPRESSION;
5187
+ return !this.async && path.length === 0 ? this.scope.getReturnExpression() : UNKNOWN_EXPRESSION;
5187
5188
  }
5188
5189
  hasEffects() {
5189
5190
  return this.id !== null && this.id.hasEffects();
@@ -5202,6 +5203,12 @@ class FunctionNode extends NodeBase {
5202
5203
  hasEffectsWhenCalledAtPath(path, callOptions, context) {
5203
5204
  if (path.length > 0)
5204
5205
  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;
5211
+ }
5205
5212
  for (const param of this.params) {
5206
5213
  if (param.hasEffects(context))
5207
5214
  return true;
@@ -6110,7 +6117,14 @@ class AssignmentPattern extends NodeBase {
6110
6117
 
6111
6118
  class AwaitExpression extends NodeBase {
6112
6119
  hasEffects(context) {
6113
- return !context.ignore.returnAwaitYield || this.argument.hasEffects(context);
6120
+ const { propertyReadSideEffects } = this.context.options
6121
+ .treeshake;
6122
+ return (!context.ignore.returnAwaitYield ||
6123
+ this.argument.hasEffects(context) ||
6124
+ this.argument.hasEffectsWhenCalledAtPath(['then'], { args: NO_ARGS, thisParam: null, withNew: false }, context) ||
6125
+ (propertyReadSideEffects &&
6126
+ (propertyReadSideEffects === 'always' ||
6127
+ this.argument.hasEffectsWhenAccessedAtPath(['then'], context))));
6114
6128
  }
6115
6129
  include(context, includeChildrenRecursively) {
6116
6130
  if (!this.included) {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.50.4
4
- Sat, 29 May 2021 04:39:28 GMT - commit 184eb6006e0e9a7f170a9208f923af0d568a31b6
3
+ Rollup.js v2.50.5
4
+ Sun, 30 May 2021 18:56:20 GMT - commit b3d130b1a5448a2abc07fa3d7cde749c3169d220
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.4
4
- Sat, 29 May 2021 04:39:28 GMT - commit 184eb6006e0e9a7f170a9208f923af0d568a31b6
3
+ Rollup.js v2.50.5
4
+ Sun, 30 May 2021 18:56:20 GMT - commit b3d130b1a5448a2abc07fa3d7cde749c3169d220
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup