rollup 2.10.5 → 2.10.9

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.10.5
4
- Tue, 19 May 2020 19:20:59 GMT - commit 2835ee44f3671b5868188e99d2033e8ac6496804
3
+ Rollup.js v2.10.9
4
+ Sun, 24 May 2020 05:27:58 GMT - commit 462bff7b1a0c384ecc3e278b1ea877e637c70f41
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.10.5
4
- Tue, 19 May 2020 19:20:59 GMT - commit 2835ee44f3671b5868188e99d2033e8ac6496804
3
+ Rollup.js v2.10.9
4
+ Sun, 24 May 2020 05:27:58 GMT - commit 462bff7b1a0c384ecc3e278b1ea877e637c70f41
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -13,7 +13,7 @@ import { createHash as createHash$1 } from 'crypto';
13
13
  import { writeFile as writeFile$1, readdirSync, mkdirSync, readFile as readFile$1, lstatSync, realpathSync } from 'fs';
14
14
  import { EventEmitter } from 'events';
15
15
 
16
- var version = "2.10.5";
16
+ var version = "2.10.9";
17
17
 
18
18
  // Reserved word lists for various dialects of the language
19
19
 
@@ -5291,7 +5291,7 @@ var acornClassFields = function(Parser) {
5291
5291
 
5292
5292
  // Parse fields
5293
5293
  parseClassElement(_constructorAllowsSuper) {
5294
- if (this.options.ecmaVersion >= 8 && (this.type == tt.name || this.type == this.privateNameToken || this.type == tt.bracketL || this.type == tt.string)) {
5294
+ if (this.options.ecmaVersion >= 8 && (this.type == tt.name || this.type.keyword || this.type == this.privateNameToken || this.type == tt.bracketL || this.type == tt.string || this.type == tt.num)) {
5295
5295
  const branch = this._branch();
5296
5296
  if (branch.type == tt.bracketL) {
5297
5297
  let count = 0;
@@ -5388,10 +5388,10 @@ var acornStaticClassFeatures = function(Parser) {
5388
5388
  return class extends ExtendedParser {
5389
5389
  _maybeParseFieldValue(field) {
5390
5390
  if (this.eat(tt.eq)) {
5391
- const oldInFieldValue = this._inStaticFieldValue;
5392
- this._inStaticFieldValue = true;
5391
+ const oldInFieldValue = this._inStaticFieldScope;
5392
+ this._inStaticFieldScope = this.currentThisScope();
5393
5393
  field.value = this.parseExpression();
5394
- this._inStaticFieldValue = oldInFieldValue;
5394
+ this._inStaticFieldScope = oldInFieldValue;
5395
5395
  } else field.value = null;
5396
5396
  }
5397
5397
 
@@ -5403,7 +5403,7 @@ var acornStaticClassFeatures = function(Parser) {
5403
5403
 
5404
5404
  const branch = this._branch();
5405
5405
  branch.next();
5406
- if ([tt.name, tt.bracketL, tt.string, this.privateNameToken].indexOf(branch.type) == -1) {
5406
+ if ([tt.name, tt.bracketL, tt.string, tt.num, this.privateNameToken].indexOf(branch.type) == -1) {
5407
5407
  return super.parseClassElement.apply(this, arguments)
5408
5408
  }
5409
5409
  if (branch.type == tt.bracketL) {
@@ -5451,7 +5451,9 @@ var acornStaticClassFeatures = function(Parser) {
5451
5451
  // Prohibit arguments in class field initializers
5452
5452
  parseIdent(liberal, isBinding) {
5453
5453
  const ident = super.parseIdent(liberal, isBinding);
5454
- if (this._inStaticFieldValue && ident.name == "arguments") this.raise(ident.start, "A static class field initializer may not contain arguments");
5454
+ if (this._inStaticFieldScope && this.currentThisScope() === this._inStaticFieldScope && ident.name == "arguments") {
5455
+ this.raise(ident.start, "A static class field initializer may not contain arguments");
5456
+ }
5455
5457
  return ident
5456
5458
  }
5457
5459
  }
@@ -7013,6 +7015,7 @@ const BROKEN_FLOW_ERROR_RETURN_LABEL = 2;
7013
7015
  function createInclusionContext() {
7014
7016
  return {
7015
7017
  brokenFlow: BROKEN_FLOW_NONE,
7018
+ includedCallArguments: new Set(),
7016
7019
  includedLabels: new Set()
7017
7020
  };
7018
7021
  }
@@ -7188,13 +7191,15 @@ class LocalVariable extends Variable {
7188
7191
  }
7189
7192
  }
7190
7193
  includeCallArguments(context, args) {
7191
- if (this.isReassigned) {
7194
+ if (this.isReassigned || (this.init && context.includedCallArguments.has(this.init))) {
7192
7195
  for (const arg of args) {
7193
7196
  arg.include(context, false);
7194
7197
  }
7195
7198
  }
7196
7199
  else if (this.init) {
7200
+ context.includedCallArguments.add(this.init);
7197
7201
  this.init.includeCallArguments(context, args);
7202
+ context.includedCallArguments.delete(this.init);
7198
7203
  }
7199
7204
  }
7200
7205
  markCalledFromTryStatement() {
@@ -9990,9 +9995,14 @@ class SyntheticNamedExportVariable extends Variable {
9990
9995
  this.defaultVariable = defaultVariable;
9991
9996
  }
9992
9997
  getBaseVariable() {
9993
- return this.defaultVariable instanceof SyntheticNamedExportVariable
9994
- ? this.defaultVariable.getBaseVariable()
9995
- : this.defaultVariable;
9998
+ let baseVariable = this.defaultVariable;
9999
+ if (baseVariable instanceof ExportDefaultVariable) {
10000
+ baseVariable = baseVariable.getOriginalVariable();
10001
+ }
10002
+ if (baseVariable instanceof SyntheticNamedExportVariable) {
10003
+ baseVariable = baseVariable.getBaseVariable();
10004
+ }
10005
+ return baseVariable;
9996
10006
  }
9997
10007
  getName() {
9998
10008
  const name = this.name;
@@ -15993,11 +16003,12 @@ class Chunk$1 {
15993
16003
  facadedModule.hasEffects()) {
15994
16004
  chunk.dependencies.add(facadedModule.chunk);
15995
16005
  }
16006
+ chunk.ensureReexportsAreAvailableForModule(facadedModule);
15996
16007
  chunk.facadeModule = facadedModule;
15997
16008
  chunk.strictFacade = true;
15998
16009
  return chunk;
15999
16010
  }
16000
- canModuleBeFacade(module, exposedNamespaces) {
16011
+ canModuleBeFacade(module, exposedVariables) {
16001
16012
  const moduleExportNamesByVariable = module.getExportNamesByVariable();
16002
16013
  for (const exposedVariable of this.exports) {
16003
16014
  if (!moduleExportNamesByVariable.has(exposedVariable)) {
@@ -16015,7 +16026,7 @@ class Chunk$1 {
16015
16026
  return false;
16016
16027
  }
16017
16028
  }
16018
- for (const exposedVariable of exposedNamespaces) {
16029
+ for (const exposedVariable of exposedVariables) {
16019
16030
  if (!(moduleExportNamesByVariable.has(exposedVariable) || exposedVariable.module === module)) {
16020
16031
  return false;
16021
16032
  }
@@ -16049,7 +16060,14 @@ class Chunk$1 {
16049
16060
  const facades = [];
16050
16061
  const dynamicEntryModules = this.dynamicEntryModules.filter(module => module.includedDynamicImporters.some(importingModule => importingModule.chunk !== this));
16051
16062
  this.isDynamicEntry = dynamicEntryModules.length > 0;
16052
- const exposedNamespaces = dynamicEntryModules.map(module => module.namespace);
16063
+ const exposedVariables = new Set(dynamicEntryModules.map(module => module.namespace));
16064
+ for (const module of this.entryModules) {
16065
+ if (module.preserveSignature) {
16066
+ for (const exportedVariable of module.getExportNamesByVariable().keys()) {
16067
+ exposedVariables.add(exportedVariable);
16068
+ }
16069
+ }
16070
+ }
16053
16071
  for (const module of this.entryModules) {
16054
16072
  const requiredFacades = [...module.userChunkNames].map(name => ({
16055
16073
  name
@@ -16064,10 +16082,13 @@ class Chunk$1 {
16064
16082
  if (!this.facadeModule &&
16065
16083
  (this.graph.preserveModules ||
16066
16084
  module.preserveSignature !== 'strict' ||
16067
- this.canModuleBeFacade(module, exposedNamespaces))) {
16085
+ this.canModuleBeFacade(module, exposedVariables))) {
16068
16086
  this.facadeModule = module;
16069
16087
  module.facadeChunk = this;
16070
- this.strictFacade = module.preserveSignature === 'strict';
16088
+ if (module.preserveSignature) {
16089
+ this.strictFacade = module.preserveSignature === 'strict';
16090
+ this.ensureReexportsAreAvailableForModule(module);
16091
+ }
16071
16092
  this.assignFacadeName(requiredFacades.shift(), module);
16072
16093
  }
16073
16094
  for (const facadeName of requiredFacades) {
@@ -16075,7 +16096,7 @@ class Chunk$1 {
16075
16096
  }
16076
16097
  }
16077
16098
  for (const module of dynamicEntryModules) {
16078
- if (!this.facadeModule && this.canModuleBeFacade(module, exposedNamespaces)) {
16099
+ if (!this.facadeModule && this.canModuleBeFacade(module, exposedVariables)) {
16079
16100
  this.facadeModule = module;
16080
16101
  module.facadeChunk = this;
16081
16102
  this.strictFacade = true;
@@ -16083,7 +16104,7 @@ class Chunk$1 {
16083
16104
  }
16084
16105
  else if (this.facadeModule === module &&
16085
16106
  !this.strictFacade &&
16086
- this.canModuleBeFacade(module, exposedNamespaces)) {
16107
+ this.canModuleBeFacade(module, exposedVariables)) {
16087
16108
  this.strictFacade = true;
16088
16109
  }
16089
16110
  else if (!(module.facadeChunk && module.facadeChunk.strictFacade)) {
@@ -16415,6 +16436,25 @@ class Chunk$1 {
16415
16436
  }
16416
16437
  return hash.digest('hex').substr(0, 8);
16417
16438
  }
16439
+ ensureReexportsAreAvailableForModule(module) {
16440
+ const map = module.getExportNamesByVariable();
16441
+ for (const exportedVariable of map.keys()) {
16442
+ const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable;
16443
+ const importedVariable = isSynthetic
16444
+ ? exportedVariable.getBaseVariable()
16445
+ : exportedVariable;
16446
+ const exportingModule = importedVariable.module;
16447
+ if (exportingModule &&
16448
+ exportingModule.chunk &&
16449
+ exportingModule.chunk !== this &&
16450
+ !(importedVariable instanceof NamespaceVariable && this.graph.preserveModules)) {
16451
+ exportingModule.chunk.exports.add(importedVariable);
16452
+ if (isSynthetic) {
16453
+ this.imports.add(importedVariable);
16454
+ }
16455
+ }
16456
+ }
16457
+ }
16418
16458
  finaliseDynamicImports(options) {
16419
16459
  const stripKnownJsExtensions = options.format === 'amd';
16420
16460
  for (const [module, code] of this.renderedModuleSources) {
@@ -16683,12 +16723,12 @@ class Chunk$1 {
16683
16723
  }
16684
16724
  setUpChunkImportsAndExportsForModule(module) {
16685
16725
  for (let variable of module.imports) {
16726
+ if (variable instanceof ExportDefaultVariable) {
16727
+ variable = variable.getOriginalVariable();
16728
+ }
16686
16729
  if (variable instanceof SyntheticNamedExportVariable) {
16687
16730
  variable = variable.getBaseVariable();
16688
16731
  }
16689
- else if (variable instanceof ExportDefaultVariable) {
16690
- variable = variable.getOriginalVariable();
16691
- }
16692
16732
  if (variable.module && variable.module.chunk !== this) {
16693
16733
  this.imports.add(variable);
16694
16734
  if (!(variable instanceof NamespaceVariable && this.graph.preserveModules) &&
@@ -16698,41 +16738,18 @@ class Chunk$1 {
16698
16738
  }
16699
16739
  }
16700
16740
  if ((module.isEntryPoint && module.preserveSignature !== false) ||
16701
- module.includedDynamicImporters.some(importer => importer.chunk !== this)) {
16702
- const map = module.getExportNamesByVariable();
16703
- for (const exportedVariable of map.keys()) {
16704
- if (module.isEntryPoint && module.preserveSignature !== false) {
16705
- this.exports.add(exportedVariable);
16706
- }
16707
- const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable;
16708
- const importedVariable = isSynthetic
16709
- ? exportedVariable.getBaseVariable()
16710
- : exportedVariable;
16711
- const exportingModule = importedVariable.module;
16712
- if (exportingModule &&
16713
- exportingModule.chunk &&
16714
- exportingModule.chunk !== this &&
16715
- !(importedVariable instanceof NamespaceVariable && this.graph.preserveModules)) {
16716
- exportingModule.chunk.exports.add(importedVariable);
16717
- if (isSynthetic) {
16718
- this.imports.add(importedVariable);
16719
- }
16720
- }
16721
- }
16722
- }
16723
- if (module.namespace.included) {
16724
- for (const reexportName of Object.keys(module.reexportDescriptions)) {
16725
- const reexport = module.reexportDescriptions[reexportName];
16726
- const variable = reexport.module.getVariableForExportName(reexport.localName);
16727
- if (variable.module.chunk !== this) {
16728
- this.imports.add(variable);
16729
- variable.module.chunk.exports.add(variable);
16730
- }
16731
- }
16741
+ module.includedDynamicImporters.some(importer => importer.chunk !== this) ||
16742
+ module.namespace.included) {
16743
+ this.ensureReexportsAreAvailableForModule(module);
16732
16744
  }
16733
16745
  for (const { node, resolution } of module.dynamicImports) {
16734
- if (node.included && resolution instanceof Module && resolution.chunk === this)
16746
+ if (node.included &&
16747
+ resolution instanceof Module &&
16748
+ resolution.chunk === this &&
16749
+ !resolution.namespace.included) {
16735
16750
  resolution.namespace.include();
16751
+ this.ensureReexportsAreAvailableForModule(resolution);
16752
+ }
16736
16753
  }
16737
16754
  }
16738
16755
  }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.10.5
4
- Tue, 19 May 2020 19:20:59 GMT - commit 2835ee44f3671b5868188e99d2033e8ac6496804
3
+ Rollup.js v2.10.9
4
+ Sun, 24 May 2020 05:27:58 GMT - commit 462bff7b1a0c384ecc3e278b1ea877e637c70f41
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.10.5
4
- Tue, 19 May 2020 19:20:59 GMT - commit 2835ee44f3671b5868188e99d2033e8ac6496804
3
+ Rollup.js v2.10.9
4
+ Sun, 24 May 2020 05:27:58 GMT - commit 462bff7b1a0c384ecc3e278b1ea877e637c70f41
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup