@rollup/wasm-node 4.63.5 → 4.64.0
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/bin/rollup +151 -46
- package/dist/es/getLogFilter.js +2 -2
- package/dist/es/parseAst.js +2 -2
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/node-entry.js +191 -53
- package/dist/es/shared/parseAst.js +2 -2
- package/dist/es/shared/watch.js +2 -2
- package/dist/getLogFilter.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/parseAst.js +2 -2
- package/dist/rollup.js +2 -2
- package/dist/shared/fsevents-importer.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/node-entry.js +2 -2
- package/dist/shared/parseAst.js +2 -2
- package/dist/shared/rollup.js +190 -52
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/dist/wasm-node/bindings_wasm.js +3 -3
- package/dist/wasm-node/bindings_wasm_bg.wasm +0 -0
- package/package.json +18 -18
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.64.0
|
|
4
|
+
Fri, 02 Oct 2026 15:38:16 GMT - commit 77773bf8ee9130c4edbde14c017855c41e500692
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
8
8
|
Released under the MIT License.
|
|
9
9
|
*/
|
|
10
|
-
import { EMPTY_OBJECT, ExportDefaultDeclaration as ExportDefaultDeclaration$1, CallExpression as CallExpression$1, EMPTY_ARRAY, LOGLEVEL_WARN, logUnusedExternalImports, ANNOTATION_KEY, INVALID_ANNOTATION_KEY,
|
|
10
|
+
import { EMPTY_OBJECT, ExportDefaultDeclaration as ExportDefaultDeclaration$1, CallExpression as CallExpression$1, EMPTY_ARRAY, LOGLEVEL_WARN, logUnusedExternalImports, ANNOTATION_KEY, INVALID_ANNOTATION_KEY, Identifier as Identifier$1, ExpressionStatement as ExpressionStatement$1, AwaitExpression as AwaitExpression$1, MemberExpression as MemberExpression$1, FunctionExpression as FunctionExpression$1, ArrowFunctionExpression as ArrowFunctionExpression$1, ObjectExpression as ObjectExpression$1, Property as Property$1, Program as Program$1, logIllegalImportReassignment, BLANK, logRedeclarationError, StaticBlock as StaticBlock$1, CatchClause as CatchClause$1, logDuplicateArgumentNameError, logModuleLevelDirective, ReturnStatement as ReturnStatement$1, VariableDeclarator as VariableDeclarator$1, logMissingExport, normalize, getImportPath, error, logSourcePhaseFormatUnsupported, logMissingNodeBuiltins, logReservedNamespace, logIllegalIdentifierAsName, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, RestElement as RestElement$1, logConstVariableReassignError, EMPTY_SET, logCannotCallNamespace, logEval, BlockStatement as BlockStatement$1, getRollupError, logModuleParseError, logParseError, LOGLEVEL_INFO, logFirstSideEffect, locate, logInvalidAnnotation, logThisIsUndefined, getAstBuffer, convertAnnotations, FIXED_STRINGS, convertNode as convertNode$1, logImportAttributeIsInvalid, logImportOptionsAreInvalid, logMissingEntryExport, logSyntheticNamedExportsNeedNamespaceExport, logDuplicateExportError, logInvalidSourcemapForError, augmentCodeLocation, logInconsistentImportAttributes, logMissingJsxExport, logNamespaceConflict, logAmbiguousExternalNamespaces, logShimmedExport, parseAst, TemplateLiteral as TemplateLiteral$1, Literal as Literal$1, logCircularReexport, logInvalidFormatForTopLevelAwait, logAddonNotGenerated, logIncompatibleExportOptionValue, logMixedExport, logFailedValidation, isPathFragment, logCyclicCrossChunkReexport, getAliasName, logUnexpectedNamedImport, isAbsolute as isAbsolute$1, relative as relative$1, logUnexpectedNamespaceReexport, logEmptyChunk, logMissingGlobalName, logOptimizeChunkStatus, logSourcemapBroken, logConflictingSourcemapSources, logChunkInvalid, logInvalidOption, URL_OUTPUT_FORMAT, URL_OUTPUT_DIR, URL_OUTPUT_SOURCEMAPFILE, URL_OUTPUT_AMD_ID, logFileNameOutsideOutputDirectory, logCannotAssignModuleToChunk, logCircularChunk, logUnknownOption, printQuotedStringList, LOGLEVEL_ERROR, logLevelPriority, LOGLEVEL_DEBUG, logAnonymousPluginCache, logDuplicatePluginName, logInvalidSetAssetSourceCall, logPluginError, logNoTransformMapOrAstWithoutCode, warnDeprecation, URL_TRANSFORM, relativeId, logBadLoader, logNonExternalSourcePhaseImport, logInternalIdCannotBeExternal, isRelative, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logExternalSyntheticExports, logUnresolvedEntry, logUnresolvedImplicitDependant, logExternalModulesCannotBeIncludedInManualChunks, logEntryCannotBeExternal, logImplicitDependantCannotBeExternal, logExternalModulesCannotBeTransformedToModules, URL_LOAD, logNoAssetSourceSet, logFileReferenceIdNotFoundForFilename, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logInvalidRollupPhaseForChunkEmission, logChunkNotGeneratedForFileName, logAssetNotFinalisedForFileName, logFileNameConflict, URL_GENERATEBUNDLE, logInvalidLogPosition, logInputHookInOutputPlugin, logInvalidAddonPluginHook, logInvalidFunctionPluginHook, logImplicitDependantIsNotIncluded, logCircularDependency, augmentLogMessage, URL_JSX, URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_PRESERVEENTRYSIGNATURES, URL_OUTPUT_GENERATEDCODE, isValidUrl, addTrailingSlashIfMissed, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_MANUALCHUNKS, logInvalidExportOptionValue, URL_OUTPUT_AMD_BASEPATH, URL_OUTPUT_INTEROP, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, logAlreadyClosed, logMissingFileOrDirOption, logCannotEmitFromOptionsHook, URL_WATCH } from './parseAst.js';
|
|
11
11
|
import { relative, dirname, basename, extname, resolve as resolve$1, join } from 'node:path';
|
|
12
12
|
import { posix, isAbsolute, resolve, win32 } from 'path';
|
|
13
13
|
import { parseAsync, xxhashBase16, xxhashBase64Url, xxhashBase36 } from '../../native.js';
|
|
@@ -27,7 +27,7 @@ function _mergeNamespaces(n, m) {
|
|
|
27
27
|
return Object.defineProperty(n, Symbol.toStringTag, { value: 'Module' });
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
var version = "4.
|
|
30
|
+
var version = "4.64.0";
|
|
31
31
|
const pkg = {
|
|
32
32
|
version: version};
|
|
33
33
|
|
|
@@ -317,7 +317,7 @@ var Chunk$1 = class Chunk {
|
|
|
317
317
|
this.outro = "";
|
|
318
318
|
this.end = index;
|
|
319
319
|
if (this.edited) {
|
|
320
|
-
newChunk.edit("", false);
|
|
320
|
+
newChunk.edit("", false, true);
|
|
321
321
|
this.content = "";
|
|
322
322
|
} else this.content = originalBefore;
|
|
323
323
|
newChunk.next = this.next;
|
|
@@ -1295,7 +1295,7 @@ var MagicString = class MagicString {
|
|
|
1295
1295
|
* Content appended or prepended at positions strictly inside the range is removed with it, while
|
|
1296
1296
|
* content attached at `start` or `end` is preserved — use `s.overwrite(start, end, '')` to remove
|
|
1297
1297
|
* the range including its edge inserts.
|
|
1298
|
-
*
|
|
1298
|
+
* Repeated removals and removals with partially overlapping ranges are allowed.
|
|
1299
1299
|
*/
|
|
1300
1300
|
remove(start, end) {
|
|
1301
1301
|
start = start + this.offset;
|
|
@@ -1577,10 +1577,16 @@ var MagicString = class MagicString {
|
|
|
1577
1577
|
* @internal
|
|
1578
1578
|
*/
|
|
1579
1579
|
_hasRemovedContent(start, end) {
|
|
1580
|
-
let chunk = this.
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1580
|
+
let chunk = this.byStart.get(start);
|
|
1581
|
+
if (!chunk) {
|
|
1582
|
+
chunk = this.lastSearchedChunk;
|
|
1583
|
+
const searchForward = start >= chunk.end;
|
|
1584
|
+
while (chunk && !chunk.contains(start)) chunk = searchForward ? this.byStart.get(chunk.end) : this.byEnd.get(chunk.start);
|
|
1585
|
+
if (chunk) this.lastSearchedChunk = chunk;
|
|
1586
|
+
}
|
|
1587
|
+
while (chunk && chunk.start < end) {
|
|
1588
|
+
if (chunk.content === "") return true;
|
|
1589
|
+
chunk = this.byStart.get(chunk.end);
|
|
1584
1590
|
}
|
|
1585
1591
|
return false;
|
|
1586
1592
|
}
|
|
@@ -1644,6 +1650,7 @@ var MagicString = class MagicString {
|
|
|
1644
1650
|
const stringLength = string.length;
|
|
1645
1651
|
if (stringLength === 0) {
|
|
1646
1652
|
for (let index = 0; index <= original.length; index += 1) {
|
|
1653
|
+
if (this._hasRemovedContent(index, index)) continue;
|
|
1647
1654
|
const _replacement = typeof replacement === "function" ? replacement("", index, original) : expandReplacement(replacement, "", index, original, [], void 0);
|
|
1648
1655
|
if (_replacement !== "") this.appendRight(index, _replacement);
|
|
1649
1656
|
}
|
|
@@ -2430,6 +2437,7 @@ function createInclusionContext() {
|
|
|
2430
2437
|
hasBreak: false,
|
|
2431
2438
|
hasContinue: false,
|
|
2432
2439
|
includedCallArguments: new Set(),
|
|
2440
|
+
includedCallArgumentsOfPossibleValues: null,
|
|
2433
2441
|
includedLabels: new Set()
|
|
2434
2442
|
};
|
|
2435
2443
|
}
|
|
@@ -2503,11 +2511,7 @@ class ExpressionEntity {
|
|
|
2503
2511
|
if (!this.included)
|
|
2504
2512
|
this.includeNode(context);
|
|
2505
2513
|
}
|
|
2506
|
-
|
|
2507
|
-
* ensures that nested nodes are included while the latter ensures that all
|
|
2508
|
-
* paths of the expression are included.
|
|
2509
|
-
* */
|
|
2510
|
-
includeCallArguments(interaction, context) {
|
|
2514
|
+
includeCallArgumentsWhenCalledAtPath(_path, interaction, context) {
|
|
2511
2515
|
includeInteraction(interaction, context);
|
|
2512
2516
|
}
|
|
2513
2517
|
shouldBeIncluded(_context) {
|
|
@@ -2531,6 +2535,10 @@ const includeInteraction = (interaction, context) => {
|
|
|
2531
2535
|
interaction.args[0]?.includePath(UNKNOWN_PATH, context);
|
|
2532
2536
|
includeInteractionWithoutThis(interaction, context);
|
|
2533
2537
|
};
|
|
2538
|
+
/* We are running both include() and includePath(UNKNOWN_PATH) here as the former
|
|
2539
|
+
* ensures that nested nodes are included while the latter ensures that all
|
|
2540
|
+
* paths of the expression are included.
|
|
2541
|
+
* */
|
|
2534
2542
|
const includeInteractionWithoutThis = ({ args }, context) => {
|
|
2535
2543
|
for (let argumentIndex = 1; argumentIndex < args.length; argumentIndex++) {
|
|
2536
2544
|
const argument = args[argumentIndex];
|
|
@@ -2662,6 +2670,7 @@ class Variable extends ExpressionEntity {
|
|
|
2662
2670
|
this.renderedLikeHoisted = variable;
|
|
2663
2671
|
}
|
|
2664
2672
|
markCalledFromTryStatement() { }
|
|
2673
|
+
addReassignedValue(_value) { }
|
|
2665
2674
|
setRenderNames(baseName, name) {
|
|
2666
2675
|
this.renderBaseName = baseName;
|
|
2667
2676
|
this.renderName = name;
|
|
@@ -3844,6 +3853,37 @@ class ObjectEntity extends ExpressionEntity {
|
|
|
3844
3853
|
}
|
|
3845
3854
|
this.prototypeExpression?.includePath(path, context);
|
|
3846
3855
|
}
|
|
3856
|
+
includeCallArgumentsWhenCalledAtPath(path, interaction, context) {
|
|
3857
|
+
// Mirrors deoptimizeArgumentsOnInteractionAtPath, falling back to
|
|
3858
|
+
// including all arguments when the exact property cannot be tracked
|
|
3859
|
+
const [key, ...subPath] = path;
|
|
3860
|
+
if (this.hasLostTrack ||
|
|
3861
|
+
this.hasUnknownDeoptimizedProperty ||
|
|
3862
|
+
!isConcreteKey(key) ||
|
|
3863
|
+
this.deoptimizedPaths.get(key) ||
|
|
3864
|
+
(typeof key === 'string' && INTEGER_REG_EXP.test(key) && this.hasUnknownDeoptimizedInteger)) {
|
|
3865
|
+
includeInteraction(interaction, context);
|
|
3866
|
+
return;
|
|
3867
|
+
}
|
|
3868
|
+
const properties = this.propertiesAndGettersByKey.get(key);
|
|
3869
|
+
if (properties !== undefined) {
|
|
3870
|
+
// This mirrors the "this" argument inclusion of includeInteraction
|
|
3871
|
+
interaction.args[0]?.includePath(UNKNOWN_PATH, context);
|
|
3872
|
+
for (const property of properties) {
|
|
3873
|
+
property.includeCallArgumentsWhenCalledAtPath(subPath, interaction, context);
|
|
3874
|
+
}
|
|
3875
|
+
return;
|
|
3876
|
+
}
|
|
3877
|
+
if (this.unmatchablePropertiesAndGetters.length > 0 ||
|
|
3878
|
+
(typeof key === 'string' &&
|
|
3879
|
+
INTEGER_REG_EXP.test(key) &&
|
|
3880
|
+
this.unknownIntegerProps.length > 0) ||
|
|
3881
|
+
!this.prototypeExpression) {
|
|
3882
|
+
includeInteraction(interaction, context);
|
|
3883
|
+
return;
|
|
3884
|
+
}
|
|
3885
|
+
this.prototypeExpression.includeCallArgumentsWhenCalledAtPath(path, interaction, context);
|
|
3886
|
+
}
|
|
3847
3887
|
buildPropertyMaps(properties) {
|
|
3848
3888
|
const { allProperties, alwaysIncludedProperties, propertiesAndGettersByKey, propertiesAndSettersByKey, settersByKey, gettersByKey, unknownIntegerProps, unmatchablePropertiesAndGetters, unmatchablePropertiesAndSetters, unmatchableGetters, unmatchableSetters } = this;
|
|
3849
3889
|
for (let index = properties.length - 1; index >= 0; index--) {
|
|
@@ -5285,6 +5325,10 @@ class LocalVariable extends Variable {
|
|
|
5285
5325
|
this.kind = kind;
|
|
5286
5326
|
this.calledFromTryStatement = false;
|
|
5287
5327
|
this.additionalInitializers = null;
|
|
5328
|
+
// A possibly incomplete list of values assigned to this variable after its
|
|
5329
|
+
// declaration; as it is incomplete, it must never be used for value queries
|
|
5330
|
+
// but only to forward call arguments to possible values
|
|
5331
|
+
this.reassignedValues = null;
|
|
5288
5332
|
this.includedPathTracker = new IncludedFullPathTracker();
|
|
5289
5333
|
this.expressionsToBeDeoptimized = [];
|
|
5290
5334
|
this.declarations = declarator ? [declarator] : [];
|
|
@@ -5408,20 +5452,49 @@ class LocalVariable extends Variable {
|
|
|
5408
5452
|
}
|
|
5409
5453
|
}
|
|
5410
5454
|
}
|
|
5411
|
-
|
|
5412
|
-
if (this.isReassigned
|
|
5413
|
-
|
|
5414
|
-
//
|
|
5415
|
-
// a specific path
|
|
5416
|
-
this.initPath.length > 0) {
|
|
5455
|
+
includeCallArgumentsWhenCalledAtPath(path, interaction, context) {
|
|
5456
|
+
if (this.isReassigned) {
|
|
5457
|
+
// Even when the value is unknown, it may be one of the assigned values;
|
|
5458
|
+
// forwarding to all of them retains the arguments of try-catch helpers
|
|
5417
5459
|
includeInteraction(interaction, context);
|
|
5460
|
+
// Each possible value is visited at most once per path and call
|
|
5461
|
+
// per traversal so that dense assignment graphs do not repeat work
|
|
5462
|
+
// for every simple path
|
|
5463
|
+
const previousTracker = context.includedCallArgumentsOfPossibleValues;
|
|
5464
|
+
context.includedCallArgumentsOfPossibleValues ??= new DiscriminatedPathTracker();
|
|
5465
|
+
this.includeCallArgumentsOfPossibleValues(path, interaction, context, context.includedCallArgumentsOfPossibleValues);
|
|
5466
|
+
context.includedCallArgumentsOfPossibleValues = previousTracker;
|
|
5467
|
+
return;
|
|
5418
5468
|
}
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5469
|
+
if (context.includedCallArguments.has(this.init) ||
|
|
5470
|
+
path.length + this.initPath.length > MAX_PATH_DEPTH) {
|
|
5471
|
+
includeInteraction(interaction, context);
|
|
5472
|
+
return;
|
|
5473
|
+
}
|
|
5474
|
+
context.includedCallArguments.add(this.init);
|
|
5475
|
+
this.init.includeCallArgumentsWhenCalledAtPath([...this.initPath, ...path], interaction, context);
|
|
5476
|
+
context.includedCallArguments.delete(this.init);
|
|
5477
|
+
}
|
|
5478
|
+
includeCallArgumentsOfPossibleValues(path, interaction, context, tracker) {
|
|
5479
|
+
if (this.reassignedValues === null || path.length + this.initPath.length > MAX_PATH_DEPTH) {
|
|
5480
|
+
return;
|
|
5481
|
+
}
|
|
5482
|
+
this.includeCallArgumentsOfPossibleValue(this.init, [...this.initPath, ...path], interaction, context, tracker);
|
|
5483
|
+
for (const entity of this.reassignedValues) {
|
|
5484
|
+
this.includeCallArgumentsOfPossibleValue(entity, path, interaction, context, tracker);
|
|
5423
5485
|
}
|
|
5424
5486
|
}
|
|
5487
|
+
includeCallArgumentsOfPossibleValue(entity, path, interaction, context, tracker) {
|
|
5488
|
+
if (entity === UNKNOWN_EXPRESSION ||
|
|
5489
|
+
entity === UNDEFINED_EXPRESSION ||
|
|
5490
|
+
tracker.trackEntityAtPathAndGetIfTracked(path, interaction, entity)) {
|
|
5491
|
+
return;
|
|
5492
|
+
}
|
|
5493
|
+
entity.includeCallArgumentsWhenCalledAtPath(path, interaction, context);
|
|
5494
|
+
}
|
|
5495
|
+
addReassignedValue(value) {
|
|
5496
|
+
(this.reassignedValues ??= []).push(value);
|
|
5497
|
+
}
|
|
5425
5498
|
markCalledFromTryStatement() {
|
|
5426
5499
|
this.calledFromTryStatement = true;
|
|
5427
5500
|
}
|
|
@@ -5526,8 +5599,8 @@ class IdentifierBase extends NodeBase {
|
|
|
5526
5599
|
this.variable?.includePath(path, context);
|
|
5527
5600
|
}
|
|
5528
5601
|
}
|
|
5529
|
-
|
|
5530
|
-
this.variable.
|
|
5602
|
+
includeCallArgumentsWhenCalledAtPath(path, interaction, context) {
|
|
5603
|
+
this.variable.includeCallArgumentsWhenCalledAtPath(path, interaction, context);
|
|
5531
5604
|
}
|
|
5532
5605
|
isPossibleTDZ() {
|
|
5533
5606
|
// return cached value to avoid issues with the next tree-shaking pass
|
|
@@ -5673,6 +5746,9 @@ class Identifier extends IdentifierBase {
|
|
|
5673
5746
|
}
|
|
5674
5747
|
deoptimizeAssignment(destructuredInitPath, init) {
|
|
5675
5748
|
this.deoptimizePath(EMPTY_PATH);
|
|
5749
|
+
if (destructuredInitPath.length === 0) {
|
|
5750
|
+
this.variable?.addReassignedValue(init);
|
|
5751
|
+
}
|
|
5676
5752
|
init.deoptimizePath([...destructuredInitPath, UnknownKey]);
|
|
5677
5753
|
}
|
|
5678
5754
|
hasEffectsWhenDestructuring(context, destructuredInitPath, init) {
|
|
@@ -5927,6 +6003,9 @@ class MethodBase extends NodeBase {
|
|
|
5927
6003
|
}
|
|
5928
6004
|
this.getAccessedValue()[0].deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker);
|
|
5929
6005
|
}
|
|
6006
|
+
includeCallArgumentsWhenCalledAtPath(path, interaction, context) {
|
|
6007
|
+
this.getAccessedValue()[0].includeCallArgumentsWhenCalledAtPath(path, interaction, context);
|
|
6008
|
+
}
|
|
5930
6009
|
// As getter properties directly receive their values from fixed function
|
|
5931
6010
|
// expressions, there is no known situation where a getter is deoptimized.
|
|
5932
6011
|
deoptimizeCache() { }
|
|
@@ -6674,16 +6753,31 @@ class ReturnValueScope extends ParameterScope {
|
|
|
6674
6753
|
}
|
|
6675
6754
|
addArgumentToBeDeoptimized(_argument) { }
|
|
6676
6755
|
updateReturnExpression() {
|
|
6677
|
-
|
|
6678
|
-
|
|
6756
|
+
const { returnExpressions } = this;
|
|
6757
|
+
if (returnExpressions.length === 1) {
|
|
6758
|
+
this.returnExpression = returnExpressions[0];
|
|
6679
6759
|
}
|
|
6680
6760
|
else {
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6761
|
+
// Returning the same variable on all paths is equivalent to a single
|
|
6762
|
+
// return, so the return expression can be resolved to that variable
|
|
6763
|
+
const [firstExpression] = returnExpressions;
|
|
6764
|
+
if (firstExpression && this.returnExpressionsResolveToSameVariable(firstExpression)) {
|
|
6765
|
+
this.returnExpression = firstExpression;
|
|
6766
|
+
}
|
|
6767
|
+
else {
|
|
6768
|
+
this.returnExpression = UNKNOWN_EXPRESSION;
|
|
6769
|
+
for (const expression of returnExpressions) {
|
|
6770
|
+
expression.deoptimizePath(UNKNOWN_PATH);
|
|
6771
|
+
}
|
|
6684
6772
|
}
|
|
6685
6773
|
}
|
|
6686
6774
|
}
|
|
6775
|
+
returnExpressionsResolveToSameVariable(firstExpression) {
|
|
6776
|
+
if (!isIdentifierNode(firstExpression) || firstExpression.variable === null) {
|
|
6777
|
+
return false;
|
|
6778
|
+
}
|
|
6779
|
+
return this.returnExpressions.every(expression => isIdentifierNode(expression) && expression.variable === firstExpression.variable);
|
|
6780
|
+
}
|
|
6687
6781
|
}
|
|
6688
6782
|
|
|
6689
6783
|
class FunctionScope extends ReturnValueScope {
|
|
@@ -6872,7 +6966,6 @@ class FunctionBase extends NodeBase {
|
|
|
6872
6966
|
constructor() {
|
|
6873
6967
|
super(...arguments);
|
|
6874
6968
|
this.parameterVariableValuesDeoptimized = false;
|
|
6875
|
-
this.includeCallArguments = this.scope.includeCallArguments.bind(this.scope);
|
|
6876
6969
|
}
|
|
6877
6970
|
get async() {
|
|
6878
6971
|
return isFlagSet(this.flags, 256 /* Flag.async */);
|
|
@@ -6989,6 +7082,14 @@ class FunctionBase extends NodeBase {
|
|
|
6989
7082
|
this.body.include(context, includeChildrenRecursively);
|
|
6990
7083
|
context.brokenFlow = brokenFlow;
|
|
6991
7084
|
}
|
|
7085
|
+
includeCallArgumentsWhenCalledAtPath(path, interaction, context) {
|
|
7086
|
+
if (path.length === 0) {
|
|
7087
|
+
this.scope.includeCallArguments(interaction, context);
|
|
7088
|
+
}
|
|
7089
|
+
else {
|
|
7090
|
+
this.getObjectEntity().includeCallArgumentsWhenCalledAtPath(path, interaction, context);
|
|
7091
|
+
}
|
|
7092
|
+
}
|
|
6992
7093
|
initialise() {
|
|
6993
7094
|
super.initialise();
|
|
6994
7095
|
if (this.body instanceof BlockStatement) {
|
|
@@ -7512,9 +7613,9 @@ class Literal extends NodeBase {
|
|
|
7512
7613
|
this.regex = esTreeNode.regex;
|
|
7513
7614
|
return super.parseNode(esTreeNode);
|
|
7514
7615
|
}
|
|
7515
|
-
render(
|
|
7616
|
+
render() {
|
|
7516
7617
|
if (typeof this.value === 'string') {
|
|
7517
|
-
|
|
7618
|
+
this.scope.context.addIndentExclusionRange([this.start + 1, this.end - 1]);
|
|
7518
7619
|
}
|
|
7519
7620
|
}
|
|
7520
7621
|
}
|
|
@@ -7820,12 +7921,20 @@ class MemberExpression extends NodeBase {
|
|
|
7820
7921
|
this.object.include(context, includeChildrenRecursively);
|
|
7821
7922
|
this.property.include(context, includeChildrenRecursively);
|
|
7822
7923
|
}
|
|
7823
|
-
|
|
7924
|
+
includeCallArgumentsWhenCalledAtPath(path, interaction, context) {
|
|
7824
7925
|
if (this.promiseHandler) {
|
|
7825
|
-
|
|
7926
|
+
if (path.length === 0) {
|
|
7927
|
+
this.promiseHandler.includeCallArguments(interaction, context);
|
|
7928
|
+
}
|
|
7929
|
+
else {
|
|
7930
|
+
includeInteraction(interaction, context);
|
|
7931
|
+
}
|
|
7826
7932
|
}
|
|
7827
7933
|
else if (this.variable) {
|
|
7828
|
-
this.variable.
|
|
7934
|
+
this.variable.includeCallArgumentsWhenCalledAtPath(path, interaction, context);
|
|
7935
|
+
}
|
|
7936
|
+
else if (!this.isUndefined && path.length < MAX_PATH_DEPTH) {
|
|
7937
|
+
this.object.includeCallArgumentsWhenCalledAtPath(this.propertyKey === UnknownKey ? UNKNOWN_PATH : [this.propertyKey, ...path], interaction, context);
|
|
7829
7938
|
}
|
|
7830
7939
|
else {
|
|
7831
7940
|
includeInteraction(interaction, context);
|
|
@@ -12786,6 +12895,19 @@ class CallExpressionBase extends NodeBase {
|
|
|
12786
12895
|
return ((type === INTERACTION_ASSIGNED || !isPure) &&
|
|
12787
12896
|
returnExpression.hasEffectsOnInteractionAtPath(path, interaction, context));
|
|
12788
12897
|
}
|
|
12898
|
+
includeCallArgumentsWhenCalledAtPath(path, interaction, context) {
|
|
12899
|
+
// Mirrors deoptimizeArgumentsOnInteractionAtPath
|
|
12900
|
+
const [returnExpression, isPure] = this.getReturnExpression();
|
|
12901
|
+
if (isPure ||
|
|
12902
|
+
returnExpression === UNKNOWN_EXPRESSION ||
|
|
12903
|
+
context.includedCallArguments.has(returnExpression)) {
|
|
12904
|
+
includeInteraction(interaction, context);
|
|
12905
|
+
return;
|
|
12906
|
+
}
|
|
12907
|
+
context.includedCallArguments.add(returnExpression);
|
|
12908
|
+
returnExpression.includeCallArgumentsWhenCalledAtPath(path, interaction, context);
|
|
12909
|
+
context.includedCallArguments.delete(returnExpression);
|
|
12910
|
+
}
|
|
12789
12911
|
}
|
|
12790
12912
|
|
|
12791
12913
|
class CallExpression extends CallExpressionBase {
|
|
@@ -12864,7 +12986,7 @@ class CallExpression extends CallExpressionBase {
|
|
|
12864
12986
|
}
|
|
12865
12987
|
else {
|
|
12866
12988
|
this.callee.include(context, false);
|
|
12867
|
-
this.callee.
|
|
12989
|
+
this.callee.includeCallArgumentsWhenCalledAtPath(EMPTY_PATH, this.interaction, context);
|
|
12868
12990
|
}
|
|
12869
12991
|
}
|
|
12870
12992
|
includeNode(_context) {
|
|
@@ -13158,14 +13280,19 @@ class ConditionalExpression extends NodeBase {
|
|
|
13158
13280
|
usedBranch.includePath(path, context);
|
|
13159
13281
|
}
|
|
13160
13282
|
}
|
|
13161
|
-
|
|
13162
|
-
|
|
13163
|
-
|
|
13164
|
-
usedBranch
|
|
13283
|
+
includeCallArgumentsWhenCalledAtPath(path, interaction, context) {
|
|
13284
|
+
if (path.length === 0) {
|
|
13285
|
+
const usedBranch = this.getUsedBranch();
|
|
13286
|
+
if (usedBranch) {
|
|
13287
|
+
usedBranch.includeCallArgumentsWhenCalledAtPath(EMPTY_PATH, interaction, context);
|
|
13288
|
+
}
|
|
13289
|
+
else {
|
|
13290
|
+
this.consequent.includeCallArgumentsWhenCalledAtPath(EMPTY_PATH, interaction, context);
|
|
13291
|
+
this.alternate.includeCallArgumentsWhenCalledAtPath(EMPTY_PATH, interaction, context);
|
|
13292
|
+
}
|
|
13165
13293
|
}
|
|
13166
13294
|
else {
|
|
13167
|
-
|
|
13168
|
-
this.alternate.includeCallArguments(interaction, context);
|
|
13295
|
+
includeInteraction(interaction, context);
|
|
13169
13296
|
}
|
|
13170
13297
|
}
|
|
13171
13298
|
removeAnnotations(code) {
|
|
@@ -13751,7 +13878,7 @@ class ObjectPromiseHandler {
|
|
|
13751
13878
|
if (interaction.type === INTERACTION_CALLED &&
|
|
13752
13879
|
(isFunctionExpressionNode(interaction.args[1]) ||
|
|
13753
13880
|
isArrowFunctionExpressionNode(interaction.args[1]))) {
|
|
13754
|
-
interaction.args[1].
|
|
13881
|
+
interaction.args[1].includeCallArgumentsWhenCalledAtPath(EMPTY_PATH, this.interaction, context);
|
|
13755
13882
|
}
|
|
13756
13883
|
}
|
|
13757
13884
|
}
|
|
@@ -14931,7 +15058,7 @@ class NewExpression extends NodeBase {
|
|
|
14931
15058
|
}
|
|
14932
15059
|
else {
|
|
14933
15060
|
this.callee.include(context, false);
|
|
14934
|
-
this.callee.
|
|
15061
|
+
this.callee.includeCallArgumentsWhenCalledAtPath(EMPTY_PATH, this.interaction, context);
|
|
14935
15062
|
}
|
|
14936
15063
|
}
|
|
14937
15064
|
includeNode(context) {
|
|
@@ -15002,6 +15129,9 @@ class ObjectExpression extends NodeBase {
|
|
|
15002
15129
|
this.includeNode(context);
|
|
15003
15130
|
this.getObjectEntity().includePath(path, context);
|
|
15004
15131
|
}
|
|
15132
|
+
includeCallArgumentsWhenCalledAtPath(path, interaction, context) {
|
|
15133
|
+
this.getObjectEntity().includeCallArgumentsWhenCalledAtPath(path, interaction, context);
|
|
15134
|
+
}
|
|
15005
15135
|
render(code, options, { renderedSurroundingElement } = BLANK) {
|
|
15006
15136
|
if (renderedSurroundingElement === ExpressionStatement$1 ||
|
|
15007
15137
|
renderedSurroundingElement === ArrowFunctionExpression$1) {
|
|
@@ -15563,7 +15693,7 @@ class TaggedTemplateExpression extends CallExpressionBase {
|
|
|
15563
15693
|
else {
|
|
15564
15694
|
this.quasi.include(context, false);
|
|
15565
15695
|
this.tag.include(context, false);
|
|
15566
|
-
this.tag.
|
|
15696
|
+
this.tag.includeCallArgumentsWhenCalledAtPath(EMPTY_PATH, this.interaction, context);
|
|
15567
15697
|
}
|
|
15568
15698
|
}
|
|
15569
15699
|
initialise() {
|
|
@@ -15657,7 +15787,7 @@ class TemplateLiteral extends NodeBase {
|
|
|
15657
15787
|
}
|
|
15658
15788
|
}
|
|
15659
15789
|
render(code, options) {
|
|
15660
|
-
|
|
15790
|
+
this.scope.context.addIndentExclusionRange([this.start, this.end]);
|
|
15661
15791
|
super.render(code, options);
|
|
15662
15792
|
}
|
|
15663
15793
|
}
|
|
@@ -17558,6 +17688,7 @@ class Module {
|
|
|
17558
17688
|
this.exportedVariablesByName = null;
|
|
17559
17689
|
this.exportNamesByVariable = null;
|
|
17560
17690
|
this.exportShimVariable = new ExportShimVariable(this);
|
|
17691
|
+
this.indentExclusionRanges = [];
|
|
17561
17692
|
this.namespaceReexportsByName = new Map();
|
|
17562
17693
|
this.reexportDescriptions = new Map();
|
|
17563
17694
|
this.relevantDependencies = null;
|
|
@@ -17963,6 +18094,7 @@ class Module {
|
|
|
17963
18094
|
this.options.onLog(level, properties);
|
|
17964
18095
|
}
|
|
17965
18096
|
render(options) {
|
|
18097
|
+
this.indentExclusionRanges = [];
|
|
17966
18098
|
const source = this.magicString.clone();
|
|
17967
18099
|
this.ast.render(source, options);
|
|
17968
18100
|
source.trim();
|
|
@@ -17970,7 +18102,7 @@ class Module {
|
|
|
17970
18102
|
if (usesTopLevelAwait && options.format !== 'es' && options.format !== 'system') {
|
|
17971
18103
|
return error(logInvalidFormatForTopLevelAwait(this.id, options.format));
|
|
17972
18104
|
}
|
|
17973
|
-
return { source, usesTopLevelAwait };
|
|
18105
|
+
return { indentExclusionRanges: this.indentExclusionRanges, source, usesTopLevelAwait };
|
|
17974
18106
|
}
|
|
17975
18107
|
async setSource({ ast, code, customTransformCache, originalCode, originalSourcemap, resolvedIds, sourcemapChain, transformDependencies, transformFiles, safeVariableNames, ...moduleOptions }) {
|
|
17976
18108
|
timeStart('generate ast', 3);
|
|
@@ -17999,8 +18131,7 @@ class Module {
|
|
|
17999
18131
|
// can change that, but it makes sense to use it for the source file name
|
|
18000
18132
|
const fileName = this.id;
|
|
18001
18133
|
this.magicString = new MagicString(code, {
|
|
18002
|
-
filename: (this.excludeFromSourcemap ? null : fileName)
|
|
18003
|
-
indentExclusionRanges: []
|
|
18134
|
+
filename: (this.excludeFromSourcemap ? null : fileName) // don't include plugin helpers in sourcemap
|
|
18004
18135
|
});
|
|
18005
18136
|
this.astContext = {
|
|
18006
18137
|
addDynamicImport: this.addDynamicImport.bind(this),
|
|
@@ -18008,6 +18139,7 @@ class Module {
|
|
|
18008
18139
|
addImport: this.addImport.bind(this),
|
|
18009
18140
|
addImportMeta: this.addImportMeta.bind(this),
|
|
18010
18141
|
addImportSource: this.addImportSource.bind(this),
|
|
18142
|
+
addIndentExclusionRange: (range) => this.indentExclusionRanges.push(range),
|
|
18011
18143
|
code, // Only needed for debugging
|
|
18012
18144
|
deoptimizationTracker: this.graph.deoptimizationTracker,
|
|
18013
18145
|
error: this.error.bind(this),
|
|
@@ -19416,6 +19548,9 @@ class Chunk {
|
|
|
19416
19548
|
}
|
|
19417
19549
|
}
|
|
19418
19550
|
}
|
|
19551
|
+
else if (exportingModule instanceof ExternalModule && importedVariable.included) {
|
|
19552
|
+
includedReexports.push(importedVariable);
|
|
19553
|
+
}
|
|
19419
19554
|
}
|
|
19420
19555
|
}
|
|
19421
19556
|
if (includedReexports.length > 0) {
|
|
@@ -19846,7 +19981,10 @@ class Chunk {
|
|
|
19846
19981
|
if (renderedLength) {
|
|
19847
19982
|
if (compact && source.lastLine().includes('//'))
|
|
19848
19983
|
source.append('\n');
|
|
19849
|
-
magicString.addSource(
|
|
19984
|
+
magicString.addSource({
|
|
19985
|
+
content: source,
|
|
19986
|
+
indentExclusionRanges: rendered.indentExclusionRanges
|
|
19987
|
+
});
|
|
19850
19988
|
usedModules.push(module);
|
|
19851
19989
|
}
|
|
19852
19990
|
const namespace = module.namespace;
|
package/dist/es/shared/watch.js
CHANGED
package/dist/getLogFilter.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
package/dist/parseAst.js
CHANGED
package/dist/rollup.js
CHANGED
package/dist/shared/index.js
CHANGED
package/dist/shared/parseAst.js
CHANGED