@rollup/wasm-node 4.53.5 → 4.54.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.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.53.5
4
- Tue, 16 Dec 2025 06:14:08 GMT - commit 31bb66ee9eea35e5ae348e4074bbad55d390112b
3
+ Rollup.js v4.54.0
4
+ Sat, 20 Dec 2025 09:28:12 GMT - commit 88f1430c42fe76db421623106546e50627271952
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -42,7 +42,7 @@ function _mergeNamespaces(n, m) {
42
42
 
43
43
  const promises__namespace = /*#__PURE__*/_interopNamespaceDefault(promises);
44
44
 
45
- var version = "4.53.5";
45
+ var version = "4.54.0";
46
46
 
47
47
  function ensureArray$1(items) {
48
48
  if (Array.isArray(items)) {
@@ -5792,11 +5792,22 @@ function renderSystemExportSequenceBeforeExpression(exportedVariable, expression
5792
5792
  const UnknownKey = Symbol('Unknown Key');
5793
5793
  const UnknownNonAccessorKey = Symbol('Unknown Non-Accessor Key');
5794
5794
  const UnknownInteger = Symbol('Unknown Integer');
5795
+ const UnknownWellKnown = Symbol('Unknown Well-Known');
5795
5796
  const SymbolToStringTag = Symbol('Symbol.toStringTag');
5796
5797
  const SymbolDispose = Symbol('Symbol.asyncDispose');
5797
5798
  const SymbolAsyncDispose = Symbol('Symbol.dispose');
5798
- const WELL_KNOWN_SYMBOLS_LIST = [SymbolToStringTag, SymbolDispose, SymbolAsyncDispose];
5799
+ const SymbolHasInstance = Symbol('Symbol.hasInstance');
5800
+ const WELL_KNOWN_SYMBOLS_LIST = [
5801
+ SymbolToStringTag,
5802
+ SymbolDispose,
5803
+ SymbolAsyncDispose,
5804
+ SymbolHasInstance
5805
+ ];
5799
5806
  const WELL_KNOWN_SYMBOLS = new Set(WELL_KNOWN_SYMBOLS_LIST);
5807
+ const isAnyWellKnown = (v) => WELL_KNOWN_SYMBOLS.has(v) || v === UnknownWellKnown;
5808
+ const TREE_SHAKEABLE_SYMBOLS_LIST = [SymbolHasInstance, SymbolDispose, SymbolAsyncDispose];
5809
+ const TREE_SHAKEABLE_SYMBOLS = new Set(TREE_SHAKEABLE_SYMBOLS_LIST);
5810
+ const isConcreteKey = (v) => typeof v === 'string' || WELL_KNOWN_SYMBOLS.has(v);
5800
5811
  const EMPTY_PATH = [];
5801
5812
  const UNKNOWN_PATH = [UnknownKey];
5802
5813
  // For deoptimizations, this means we are modifying an unknown property but did
@@ -5806,6 +5817,7 @@ const UNKNOWN_PATH = [UnknownKey];
5806
5817
  // Object.defineProperty
5807
5818
  const UNKNOWN_NON_ACCESSOR_PATH = [UnknownNonAccessorKey];
5808
5819
  const UNKNOWN_INTEGER_PATH = [UnknownInteger];
5820
+ const INSTANCEOF_PATH = [SymbolHasInstance];
5809
5821
  const EntitiesKey = Symbol('Entities');
5810
5822
  class EntityPathTracker {
5811
5823
  constructor() {
@@ -5878,7 +5890,7 @@ class IncludedFullPathTracker {
5878
5890
  }
5879
5891
  // Including UnknownKey automatically includes all nested paths.
5880
5892
  // From above, we know that UnknownKey is not included yet.
5881
- if (typeof pathSegment === 'symbol') {
5893
+ if (!isConcreteKey(pathSegment)) {
5882
5894
  // Hopefully, this saves some memory over just setting
5883
5895
  // currentPaths[UnknownKey] = EMPTY_OBJECT
5884
5896
  parent[parentSegment] = UNKNOWN_INCLUDED_PATH;
@@ -5909,7 +5921,7 @@ class IncludedTopLevelPathTracker {
5909
5921
  if (!firstPathSegment) {
5910
5922
  return included;
5911
5923
  }
5912
- if (typeof firstPathSegment === 'symbol') {
5924
+ if (!isConcreteKey(firstPathSegment)) {
5913
5925
  this.includedPaths = UNKNOWN_INCLUDED_TOP_LEVEL_PATH;
5914
5926
  return false;
5915
5927
  }
@@ -7130,12 +7142,13 @@ class ObjectEntity extends ExpressionEntity {
7130
7142
  this.immutable = immutable;
7131
7143
  this.additionalExpressionsToBeDeoptimized = new Set();
7132
7144
  this.allProperties = [];
7133
- this.deoptimizedPaths = Object.create(null);
7134
- this.expressionsToBeDeoptimizedByKey = Object.create(null);
7135
- this.gettersByKey = Object.create(null);
7136
- this.propertiesAndGettersByKey = Object.create(null);
7137
- this.propertiesAndSettersByKey = Object.create(null);
7138
- this.settersByKey = Object.create(null);
7145
+ this.alwaysIncludedProperties = new Set();
7146
+ this.deoptimizedPaths = new Map();
7147
+ this.expressionsToBeDeoptimizedByKey = new Map();
7148
+ this.gettersByKey = new Map();
7149
+ this.propertiesAndGettersByKey = new Map();
7150
+ this.propertiesAndSettersByKey = new Map();
7151
+ this.settersByKey = new Map();
7139
7152
  this.unknownIntegerProps = [];
7140
7153
  this.unmatchableGetters = [];
7141
7154
  this.unmatchablePropertiesAndGetters = [];
@@ -7146,7 +7159,7 @@ class ObjectEntity extends ExpressionEntity {
7146
7159
  }
7147
7160
  else {
7148
7161
  this.propertiesAndGettersByKey = this.propertiesAndSettersByKey = properties;
7149
- for (const propertiesForKey of Object.values(properties)) {
7162
+ for (const propertiesForKey of properties.values()) {
7150
7163
  this.allProperties.push(...propertiesForKey);
7151
7164
  }
7152
7165
  }
@@ -7163,8 +7176,8 @@ class ObjectEntity extends ExpressionEntity {
7163
7176
  return;
7164
7177
  }
7165
7178
  for (const properties of [
7166
- ...Object.values(this.propertiesAndGettersByKey),
7167
- ...Object.values(this.settersByKey)
7179
+ ...this.propertiesAndGettersByKey.values(),
7180
+ ...this.settersByKey.values()
7168
7181
  ]) {
7169
7182
  for (const property of properties) {
7170
7183
  property.deoptimizePath(UNKNOWN_PATH);
@@ -7181,7 +7194,7 @@ class ObjectEntity extends ExpressionEntity {
7181
7194
  // single paths that are deoptimized will not become getters or setters
7182
7195
  ((type === INTERACTION_CALLED || path.length > 1) &&
7183
7196
  (this.hasUnknownDeoptimizedProperty ||
7184
- (typeof key === 'string' && this.deoptimizedPaths[key])))) {
7197
+ (isConcreteKey(key) && this.deoptimizedPaths.get(key))))) {
7185
7198
  deoptimizeInteraction(interaction);
7186
7199
  return;
7187
7200
  }
@@ -7194,9 +7207,9 @@ class ObjectEntity extends ExpressionEntity {
7194
7207
  : type === INTERACTION_ACCESSED
7195
7208
  ? [this.propertiesAndGettersByKey, this.gettersByKey, this.unmatchableGetters]
7196
7209
  : [this.propertiesAndSettersByKey, this.settersByKey, this.unmatchableSetters];
7197
- if (typeof key === 'string') {
7198
- if (propertiesForExactMatchByKey[key]) {
7199
- const properties = relevantPropertiesByKey[key];
7210
+ if (isConcreteKey(key)) {
7211
+ if (propertiesForExactMatchByKey.get(key)) {
7212
+ const properties = relevantPropertiesByKey.get(key);
7200
7213
  if (properties) {
7201
7214
  for (const property of properties) {
7202
7215
  property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker);
@@ -7214,7 +7227,7 @@ class ObjectEntity extends ExpressionEntity {
7214
7227
  for (const property of relevantUnmatchableProperties) {
7215
7228
  property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker);
7216
7229
  }
7217
- if (INTEGER_REG_EXP.test(key)) {
7230
+ if (typeof key === 'string' && INTEGER_REG_EXP.test(key)) {
7218
7231
  for (const property of this.unknownIntegerProps) {
7219
7232
  property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker);
7220
7233
  }
@@ -7222,7 +7235,7 @@ class ObjectEntity extends ExpressionEntity {
7222
7235
  }
7223
7236
  else {
7224
7237
  for (const properties of [
7225
- ...Object.values(relevantPropertiesByKey),
7238
+ ...relevantPropertiesByKey.values(),
7226
7239
  relevantUnmatchableProperties
7227
7240
  ]) {
7228
7241
  for (const property of properties) {
@@ -7249,8 +7262,9 @@ class ObjectEntity extends ExpressionEntity {
7249
7262
  return;
7250
7263
  }
7251
7264
  this.hasUnknownDeoptimizedInteger = true;
7252
- for (const [key, propertiesAndGetters] of Object.entries(this.propertiesAndGettersByKey)) {
7253
- if (INTEGER_REG_EXP.test(key)) {
7265
+ // Omits symbol keys but that's unimportant here
7266
+ for (const [key, propertiesAndGetters] of this.propertiesAndGettersByKey.entries()) {
7267
+ if (typeof key === 'string' && INTEGER_REG_EXP.test(key)) {
7254
7268
  for (const property of propertiesAndGetters) {
7255
7269
  property.deoptimizePath(UNKNOWN_PATH);
7256
7270
  }
@@ -7268,14 +7282,14 @@ class ObjectEntity extends ExpressionEntity {
7268
7282
  if (key === UnknownInteger) {
7269
7283
  return this.deoptimizeIntegerProperties();
7270
7284
  }
7271
- else if (typeof key !== 'string') {
7285
+ else if (!isConcreteKey(key)) {
7272
7286
  return this.deoptimizeAllProperties(key === UnknownNonAccessorKey);
7273
7287
  }
7274
- if (!this.deoptimizedPaths[key]) {
7275
- this.deoptimizedPaths[key] = true;
7288
+ if (!this.deoptimizedPaths.get(key)) {
7289
+ this.deoptimizedPaths.set(key, true);
7276
7290
  // we only deoptimizeCache exact matches as in all other cases,
7277
7291
  // we do not return a literal value or return expression
7278
- const expressionsToBeDeoptimized = this.expressionsToBeDeoptimizedByKey[key];
7292
+ const expressionsToBeDeoptimized = this.expressionsToBeDeoptimizedByKey.get(key);
7279
7293
  if (expressionsToBeDeoptimized) {
7280
7294
  for (const expression of expressionsToBeDeoptimized) {
7281
7295
  expression.deoptimizeCache();
@@ -7284,10 +7298,10 @@ class ObjectEntity extends ExpressionEntity {
7284
7298
  }
7285
7299
  }
7286
7300
  const subPath = path.length === 1 ? UNKNOWN_PATH : path.slice(1);
7287
- for (const property of typeof key === 'string'
7301
+ for (const property of isConcreteKey(key)
7288
7302
  ? [
7289
- ...(this.propertiesAndGettersByKey[key] || this.unmatchablePropertiesAndGetters),
7290
- ...(this.settersByKey[key] || this.unmatchableSetters)
7303
+ ...(this.propertiesAndGettersByKey.get(key) || this.unmatchablePropertiesAndGetters),
7304
+ ...(this.settersByKey.get(key) || this.unmatchableSetters)
7291
7305
  ]
7292
7306
  : this.allProperties) {
7293
7307
  property.deoptimizePath(subPath);
@@ -7349,9 +7363,9 @@ class ObjectEntity extends ExpressionEntity {
7349
7363
  const [propertiesAndAccessorsByKey, accessorsByKey, unmatchableAccessors] = interaction.type === INTERACTION_ACCESSED
7350
7364
  ? [this.propertiesAndGettersByKey, this.gettersByKey, this.unmatchableGetters]
7351
7365
  : [this.propertiesAndSettersByKey, this.settersByKey, this.unmatchableSetters];
7352
- if (typeof key === 'string') {
7353
- if (propertiesAndAccessorsByKey[key]) {
7354
- const accessors = accessorsByKey[key];
7366
+ if (isConcreteKey(key)) {
7367
+ if (propertiesAndAccessorsByKey.get(key)) {
7368
+ const accessors = accessorsByKey.get(key);
7355
7369
  if (accessors) {
7356
7370
  for (const accessor of accessors) {
7357
7371
  if (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context))
@@ -7367,7 +7381,7 @@ class ObjectEntity extends ExpressionEntity {
7367
7381
  }
7368
7382
  }
7369
7383
  else {
7370
- for (const accessors of [...Object.values(accessorsByKey), unmatchableAccessors]) {
7384
+ for (const accessors of [...accessorsByKey.values(), unmatchableAccessors]) {
7371
7385
  for (const accessor of accessors) {
7372
7386
  if (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context))
7373
7387
  return true;
@@ -7382,7 +7396,9 @@ class ObjectEntity extends ExpressionEntity {
7382
7396
  include(context, includeChildrenRecursively) {
7383
7397
  this.included = true;
7384
7398
  for (const property of this.allProperties) {
7385
- if (includeChildrenRecursively || property.shouldBeIncluded(context)) {
7399
+ if (includeChildrenRecursively ||
7400
+ property.shouldBeIncluded(context) ||
7401
+ this.alwaysIncludedProperties.has(property)) {
7386
7402
  property.include(context, includeChildrenRecursively);
7387
7403
  }
7388
7404
  }
@@ -7390,14 +7406,17 @@ class ObjectEntity extends ExpressionEntity {
7390
7406
  }
7391
7407
  includePath(path, context) {
7392
7408
  this.included = true;
7409
+ for (const property of this.alwaysIncludedProperties) {
7410
+ property.includePath(UNKNOWN_PATH, context);
7411
+ }
7393
7412
  if (path.length === 0)
7394
7413
  return;
7395
7414
  const [key, ...subPath] = path;
7396
- const [includedMembers, includedPath] = typeof key === 'string'
7415
+ const [includedMembers, includedPath] = isConcreteKey(key)
7397
7416
  ? [
7398
7417
  new Set([
7399
- ...(this.propertiesAndGettersByKey[key] || this.unmatchablePropertiesAndGetters),
7400
- ...(this.propertiesAndSettersByKey[key] || this.unmatchablePropertiesAndSetters)
7418
+ ...(this.propertiesAndGettersByKey.get(key) || this.unmatchablePropertiesAndGetters),
7419
+ ...(this.propertiesAndSettersByKey.get(key) || this.unmatchablePropertiesAndSetters)
7401
7420
  ]),
7402
7421
  subPath
7403
7422
  ]
@@ -7408,29 +7427,36 @@ class ObjectEntity extends ExpressionEntity {
7408
7427
  this.prototypeExpression?.includePath(path, context);
7409
7428
  }
7410
7429
  buildPropertyMaps(properties) {
7411
- const { allProperties, propertiesAndGettersByKey, propertiesAndSettersByKey, settersByKey, gettersByKey, unknownIntegerProps, unmatchablePropertiesAndGetters, unmatchablePropertiesAndSetters, unmatchableGetters, unmatchableSetters } = this;
7430
+ const { allProperties, alwaysIncludedProperties, propertiesAndGettersByKey, propertiesAndSettersByKey, settersByKey, gettersByKey, unknownIntegerProps, unmatchablePropertiesAndGetters, unmatchablePropertiesAndSetters, unmatchableGetters, unmatchableSetters } = this;
7412
7431
  for (let index = properties.length - 1; index >= 0; index--) {
7413
7432
  const { key, kind, property } = properties[index];
7414
7433
  allProperties.push(property);
7415
- if (typeof key === 'string') {
7434
+ if (isAnyWellKnown(key) && !TREE_SHAKEABLE_SYMBOLS.has(key)) {
7435
+ // Never treeshake well-known symbols (unless Rollup can optimize them)
7436
+ // They are most likely called implicitly by language semantics, don't get rid of them
7437
+ alwaysIncludedProperties.add(property);
7438
+ if (key === UnknownWellKnown)
7439
+ continue;
7440
+ }
7441
+ if (isConcreteKey(key)) {
7416
7442
  if (kind === 'set') {
7417
- if (!propertiesAndSettersByKey[key]) {
7418
- propertiesAndSettersByKey[key] = [property, ...unmatchablePropertiesAndSetters];
7419
- settersByKey[key] = [property, ...unmatchableSetters];
7443
+ if (!propertiesAndSettersByKey.has(key)) {
7444
+ propertiesAndSettersByKey.set(key, [property, ...unmatchablePropertiesAndSetters]);
7445
+ settersByKey.set(key, [property, ...unmatchableSetters]);
7420
7446
  }
7421
7447
  }
7422
7448
  else if (kind === 'get') {
7423
- if (!propertiesAndGettersByKey[key]) {
7424
- propertiesAndGettersByKey[key] = [property, ...unmatchablePropertiesAndGetters];
7425
- gettersByKey[key] = [property, ...unmatchableGetters];
7449
+ if (!propertiesAndGettersByKey.has(key)) {
7450
+ propertiesAndGettersByKey.set(key, [property, ...unmatchablePropertiesAndGetters]);
7451
+ gettersByKey.set(key, [property, ...unmatchableGetters]);
7426
7452
  }
7427
7453
  }
7428
7454
  else {
7429
- if (!propertiesAndSettersByKey[key]) {
7430
- propertiesAndSettersByKey[key] = [property, ...unmatchablePropertiesAndSetters];
7455
+ if (!propertiesAndSettersByKey.has(key)) {
7456
+ propertiesAndSettersByKey.set(key, [property, ...unmatchablePropertiesAndSetters]);
7431
7457
  }
7432
- if (!propertiesAndGettersByKey[key]) {
7433
- propertiesAndGettersByKey[key] = [property, ...unmatchablePropertiesAndGetters];
7458
+ if (!propertiesAndGettersByKey.has(key)) {
7459
+ propertiesAndGettersByKey.set(key, [property, ...unmatchablePropertiesAndGetters]);
7434
7460
  }
7435
7461
  }
7436
7462
  }
@@ -7451,7 +7477,7 @@ class ObjectEntity extends ExpressionEntity {
7451
7477
  }
7452
7478
  }
7453
7479
  deoptimizeCachedEntities() {
7454
- for (const expressionsToBeDeoptimized of Object.values(this.expressionsToBeDeoptimizedByKey)) {
7480
+ for (const expressionsToBeDeoptimized of this.expressionsToBeDeoptimizedByKey.values()) {
7455
7481
  for (const expression of expressionsToBeDeoptimized) {
7456
7482
  expression.deoptimizeCache();
7457
7483
  }
@@ -7461,8 +7487,8 @@ class ObjectEntity extends ExpressionEntity {
7461
7487
  }
7462
7488
  }
7463
7489
  deoptimizeCachedIntegerEntities() {
7464
- for (const [key, expressionsToBeDeoptimized] of Object.entries(this.expressionsToBeDeoptimizedByKey)) {
7465
- if (INTEGER_REG_EXP.test(key)) {
7490
+ for (const [key, expressionsToBeDeoptimized] of this.expressionsToBeDeoptimizedByKey.entries()) {
7491
+ if (typeof key === 'string' && INTEGER_REG_EXP.test(key)) {
7466
7492
  for (const expression of expressionsToBeDeoptimized) {
7467
7493
  expression.deoptimizeCache();
7468
7494
  }
@@ -7475,30 +7501,32 @@ class ObjectEntity extends ExpressionEntity {
7475
7501
  getMemberExpression(key) {
7476
7502
  if (this.hasLostTrack ||
7477
7503
  this.hasUnknownDeoptimizedProperty ||
7478
- typeof key !== 'string' ||
7479
- (this.hasUnknownDeoptimizedInteger && INTEGER_REG_EXP.test(key)) ||
7480
- this.deoptimizedPaths[key]) {
7504
+ !isConcreteKey(key) ||
7505
+ (this.hasUnknownDeoptimizedInteger && typeof key === 'string' && INTEGER_REG_EXP.test(key)) ||
7506
+ this.deoptimizedPaths.get(key)) {
7481
7507
  return UNKNOWN_EXPRESSION;
7482
7508
  }
7483
- const properties = this.propertiesAndGettersByKey[key];
7509
+ const properties = this.propertiesAndGettersByKey.get(key);
7484
7510
  if (properties?.length === 1) {
7485
7511
  return properties[0];
7486
7512
  }
7487
7513
  if (properties ||
7488
7514
  this.unmatchablePropertiesAndGetters.length > 0 ||
7489
- (this.unknownIntegerProps.length > 0 && INTEGER_REG_EXP.test(key))) {
7515
+ (this.unknownIntegerProps.length > 0 && typeof key === 'string' && INTEGER_REG_EXP.test(key))) {
7490
7516
  return UNKNOWN_EXPRESSION;
7491
7517
  }
7492
7518
  return null;
7493
7519
  }
7494
7520
  getMemberExpressionAndTrackDeopt(key, origin) {
7495
- if (typeof key !== 'string') {
7521
+ if (!isConcreteKey(key)) {
7496
7522
  return UNKNOWN_EXPRESSION;
7497
7523
  }
7498
7524
  const expression = this.getMemberExpression(key);
7499
7525
  if (!(expression === UNKNOWN_EXPRESSION || this.immutable)) {
7500
- const expressionsToBeDeoptimized = (this.expressionsToBeDeoptimizedByKey[key] =
7501
- this.expressionsToBeDeoptimizedByKey[key] || []);
7526
+ let expressionsToBeDeoptimized = this.expressionsToBeDeoptimizedByKey.get(key);
7527
+ if (!expressionsToBeDeoptimized) {
7528
+ this.expressionsToBeDeoptimizedByKey.set(key, (expressionsToBeDeoptimized = []));
7529
+ }
7502
7530
  expressionsToBeDeoptimized.push(origin);
7503
7531
  }
7504
7532
  return expression;
@@ -7526,15 +7554,14 @@ const OBJECT_PROTOTYPE_FALLBACK = new (class ObjectPrototypeFallbackExpression e
7526
7554
  return path.length > 1 || type === INTERACTION_CALLED;
7527
7555
  }
7528
7556
  })();
7529
- const OBJECT_PROTOTYPE = new ObjectEntity({
7530
- __proto__: null,
7531
- hasOwnProperty: METHOD_RETURNS_BOOLEAN,
7532
- isPrototypeOf: METHOD_RETURNS_BOOLEAN,
7533
- propertyIsEnumerable: METHOD_RETURNS_BOOLEAN,
7534
- toLocaleString: METHOD_RETURNS_STRING,
7535
- toString: METHOD_RETURNS_STRING,
7536
- valueOf: METHOD_RETURNS_UNKNOWN
7537
- }, OBJECT_PROTOTYPE_FALLBACK, true);
7557
+ const OBJECT_PROTOTYPE = new ObjectEntity(new Map([
7558
+ ['hasOwnProperty', METHOD_RETURNS_BOOLEAN],
7559
+ ['isPrototypeOf', METHOD_RETURNS_BOOLEAN],
7560
+ ['propertyIsEnumerable', METHOD_RETURNS_BOOLEAN],
7561
+ ['toLocaleString', METHOD_RETURNS_STRING],
7562
+ ['toString', METHOD_RETURNS_STRING],
7563
+ ['valueOf', METHOD_RETURNS_UNKNOWN]
7564
+ ]), OBJECT_PROTOTYPE_FALLBACK, true);
7538
7565
 
7539
7566
  const NEW_ARRAY_PROPERTIES = [
7540
7567
  { key: UnknownInteger, kind: 'init', property: UNKNOWN_EXPRESSION },
@@ -7639,44 +7666,43 @@ const METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF = [
7639
7666
  returnsPrimitive: null
7640
7667
  })
7641
7668
  ];
7642
- const ARRAY_PROTOTYPE = new ObjectEntity({
7643
- __proto__: null,
7669
+ const ARRAY_PROTOTYPE = new ObjectEntity(new Map([
7644
7670
  // We assume that accessors have effects as we do not track the accessed value afterwards
7645
- at: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN,
7646
- concat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY,
7647
- copyWithin: METHOD_MUTATES_SELF_RETURNS_SELF,
7648
- entries: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY,
7649
- every: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN,
7650
- fill: METHOD_MUTATES_SELF_RETURNS_SELF,
7651
- filter: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY,
7652
- find: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,
7653
- findIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER,
7654
- findLast: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,
7655
- findLastIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER,
7656
- flat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY,
7657
- flatMap: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY,
7658
- forEach: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,
7659
- includes: METHOD_RETURNS_BOOLEAN,
7660
- indexOf: METHOD_RETURNS_NUMBER,
7661
- join: METHOD_RETURNS_STRING,
7662
- keys: METHOD_RETURNS_UNKNOWN,
7663
- lastIndexOf: METHOD_RETURNS_NUMBER,
7664
- map: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY,
7665
- pop: METHOD_MUTATES_SELF_RETURNS_UNKNOWN,
7666
- push: METHOD_MUTATES_SELF_AND_ARGS_RETURNS_NUMBER,
7667
- reduce: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,
7668
- reduceRight: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,
7669
- reverse: METHOD_MUTATES_SELF_RETURNS_SELF,
7670
- shift: METHOD_MUTATES_SELF_RETURNS_UNKNOWN,
7671
- slice: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY,
7672
- some: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN,
7673
- sort: METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF,
7674
- splice: METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY,
7675
- toLocaleString: METHOD_RETURNS_STRING,
7676
- toString: METHOD_RETURNS_STRING,
7677
- unshift: METHOD_MUTATES_SELF_AND_ARGS_RETURNS_NUMBER,
7678
- values: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN
7679
- }, OBJECT_PROTOTYPE, true);
7671
+ ['at', METHOD_DEOPTS_SELF_RETURNS_UNKNOWN],
7672
+ ['concat', METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY],
7673
+ ['copyWithin', METHOD_MUTATES_SELF_RETURNS_SELF],
7674
+ ['entries', METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY],
7675
+ ['every', METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN],
7676
+ ['fill', METHOD_MUTATES_SELF_RETURNS_SELF],
7677
+ ['filter', METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY],
7678
+ ['find', METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN],
7679
+ ['findIndex', METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER],
7680
+ ['findLast', METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN],
7681
+ ['findLastIndex', METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER],
7682
+ ['flat', METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY],
7683
+ ['flatMap', METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY],
7684
+ ['forEach', METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN],
7685
+ ['includes', METHOD_RETURNS_BOOLEAN],
7686
+ ['indexOf', METHOD_RETURNS_NUMBER],
7687
+ ['join', METHOD_RETURNS_STRING],
7688
+ ['keys', METHOD_RETURNS_UNKNOWN],
7689
+ ['lastIndexOf', METHOD_RETURNS_NUMBER],
7690
+ ['map', METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY],
7691
+ ['pop', METHOD_MUTATES_SELF_RETURNS_UNKNOWN],
7692
+ ['push', METHOD_MUTATES_SELF_AND_ARGS_RETURNS_NUMBER],
7693
+ ['reduce', METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN],
7694
+ ['reduceRight', METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN],
7695
+ ['reverse', METHOD_MUTATES_SELF_RETURNS_SELF],
7696
+ ['shift', METHOD_MUTATES_SELF_RETURNS_UNKNOWN],
7697
+ ['slice', METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY],
7698
+ ['some', METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN],
7699
+ ['sort', METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF],
7700
+ ['splice', METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY],
7701
+ ['toLocaleString', METHOD_RETURNS_STRING],
7702
+ ['toString', METHOD_RETURNS_STRING],
7703
+ ['unshift', METHOD_MUTATES_SELF_AND_ARGS_RETURNS_NUMBER],
7704
+ ['values', METHOD_DEOPTS_SELF_RETURNS_UNKNOWN]
7705
+ ]), OBJECT_PROTOTYPE, true);
7680
7706
 
7681
7707
  class SpreadElement extends NodeBase {
7682
7708
  deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) {
@@ -7783,6 +7809,14 @@ const ValueProperties = Symbol('Value Properties');
7783
7809
  const getUnknownValue = () => UnknownValue;
7784
7810
  const returnFalse = () => false;
7785
7811
  const returnTrue = () => true;
7812
+ const getWellKnownSymbol = (symbol) => ({
7813
+ __proto__: null,
7814
+ [ValueProperties]: {
7815
+ deoptimizeArgumentsOnCall: doNothing,
7816
+ getLiteralValue: () => symbol,
7817
+ hasEffectsWhenCalled: returnTrue
7818
+ }
7819
+ });
7786
7820
  const PURE = {
7787
7821
  deoptimizeArgumentsOnCall: doNothing,
7788
7822
  getLiteralValue: getUnknownValue,
@@ -7868,6 +7902,11 @@ const INTL_MEMBER = {
7868
7902
  [ValueProperties]: PURE,
7869
7903
  supportedLocalesOf: PC
7870
7904
  };
7905
+ const UNKNOWN_WELL_KNOWN = {
7906
+ deoptimizeArgumentsOnCall: doNothing,
7907
+ getLiteralValue: () => UnknownWellKnown,
7908
+ hasEffectsWhenCalled: returnTrue
7909
+ };
7871
7910
  const knownGlobals = {
7872
7911
  // Placeholders for global objects to avoid shape mutations
7873
7912
  global: O,
@@ -8063,37 +8102,10 @@ const knownGlobals = {
8063
8102
  for: PF,
8064
8103
  keyFor: PF,
8065
8104
  prototype: O,
8066
- asyncDispose: {
8067
- __proto__: null,
8068
- [ValueProperties]: {
8069
- deoptimizeArgumentsOnCall: doNothing,
8070
- getLiteralValue() {
8071
- return SymbolAsyncDispose;
8072
- },
8073
- // This might not be needed, but then we need to check a few more cases
8074
- hasEffectsWhenCalled: returnTrue
8075
- }
8076
- },
8077
- dispose: {
8078
- __proto__: null,
8079
- [ValueProperties]: {
8080
- deoptimizeArgumentsOnCall: doNothing,
8081
- getLiteralValue() {
8082
- return SymbolDispose;
8083
- },
8084
- hasEffectsWhenCalled: returnTrue
8085
- }
8086
- },
8087
- toStringTag: {
8088
- __proto__: null,
8089
- [ValueProperties]: {
8090
- deoptimizeArgumentsOnCall: doNothing,
8091
- getLiteralValue() {
8092
- return SymbolToStringTag;
8093
- },
8094
- hasEffectsWhenCalled: returnTrue
8095
- }
8096
- }
8105
+ asyncDispose: getWellKnownSymbol(SymbolAsyncDispose),
8106
+ dispose: getWellKnownSymbol(SymbolDispose),
8107
+ hasInstance: getWellKnownSymbol(SymbolHasInstance),
8108
+ toStringTag: getWellKnownSymbol(SymbolToStringTag)
8097
8109
  },
8098
8110
  SyntaxError: PC,
8099
8111
  toLocaleString: O,
@@ -8767,7 +8779,9 @@ function getGlobalAtPath(path) {
8767
8779
  }
8768
8780
  currentGlobal = currentGlobal[pathSegment];
8769
8781
  if (!currentGlobal) {
8770
- return null;
8782
+ // Well-known symbols very often have a complex meaning and are invoked implicitly by the language.
8783
+ // Resolve them to a special value so they can be distinguished and excluded from treeshaking.
8784
+ return path[0] === 'Symbol' && path.length === 2 ? UNKNOWN_WELL_KNOWN : null;
8771
8785
  }
8772
8786
  }
8773
8787
  return currentGlobal[ValueProperties];
@@ -9701,7 +9715,11 @@ class ClassNode extends NodeBase {
9701
9715
  if (definition.computed) {
9702
9716
  const keyValue = definition.key.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);
9703
9717
  if (typeof keyValue === 'symbol') {
9704
- properties.push({ key: UnknownKey, kind, property: definition });
9718
+ properties.push({
9719
+ key: isAnyWellKnown(keyValue) ? keyValue : UnknownKey,
9720
+ kind,
9721
+ property: definition
9722
+ });
9705
9723
  continue;
9706
9724
  }
9707
9725
  else {
@@ -10586,7 +10604,7 @@ class FunctionNode extends FunctionBase {
10586
10604
  }
10587
10605
  createScope(parentScope) {
10588
10606
  this.scope = new FunctionScope(parentScope, this);
10589
- this.constructedEntity = new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE);
10607
+ this.constructedEntity = new ObjectEntity(new Map(), OBJECT_PROTOTYPE);
10590
10608
  // This makes sure that all deoptimizations of "this" are applied to the
10591
10609
  // constructed entity.
10592
10610
  this.scope.thisVariable.addArgumentForDeoptimization(this.constructedEntity);
@@ -11321,6 +11339,9 @@ class MemberExpression extends NodeBase {
11321
11339
  this.includeNode(context);
11322
11340
  this.object.include(context, includeChildrenRecursively);
11323
11341
  this.property.include(context, includeChildrenRecursively);
11342
+ if (includeChildrenRecursively) {
11343
+ this.variable?.includePath(UNKNOWN_PATH, context);
11344
+ }
11324
11345
  }
11325
11346
  includeNode(context) {
11326
11347
  this.included = true;
@@ -13569,6 +13590,9 @@ class BinaryExpression extends NodeBase {
13569
13590
  if (typeof this.getRenderedLiteralValue() === 'symbol') {
13570
13591
  this.left.include(context, includeChildrenRecursively, options);
13571
13592
  this.right.include(context, includeChildrenRecursively, options);
13593
+ // `instanceof` will attempt to call RHS's `Symbol.hasInstance` if it exists.
13594
+ if (this.operator === 'instanceof')
13595
+ this.right.includePath(INSTANCEOF_PATH, context);
13572
13596
  }
13573
13597
  }
13574
13598
  includeNode(context) {
@@ -16068,7 +16092,11 @@ class ObjectExpression extends NodeBase {
16068
16092
  if (property.computed) {
16069
16093
  const keyValue = property.key.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);
16070
16094
  if (typeof keyValue === 'symbol') {
16071
- properties.push({ key: UnknownKey, kind: property.kind, property });
16095
+ properties.push({
16096
+ key: isAnyWellKnown(keyValue) ? keyValue : UnknownKey,
16097
+ kind: property.kind,
16098
+ property
16099
+ });
16072
16100
  continue;
16073
16101
  }
16074
16102
  else {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.53.5
4
- Tue, 16 Dec 2025 06:14:08 GMT - commit 31bb66ee9eea35e5ae348e4074bbad55d390112b
3
+ Rollup.js v4.54.0
4
+ Sat, 20 Dec 2025 09:28:12 GMT - commit 88f1430c42fe76db421623106546e50627271952
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.53.5
4
- Tue, 16 Dec 2025 06:14:08 GMT - commit 31bb66ee9eea35e5ae348e4074bbad55d390112b
3
+ Rollup.js v4.54.0
4
+ Sat, 20 Dec 2025 09:28:12 GMT - commit 88f1430c42fe76db421623106546e50627271952
5
5
 
6
6
  https://github.com/rollup/rollup
7
7