@lwc/engine-core 8.10.0 → 8.10.2

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.
@@ -12,4 +12,5 @@ export declare function cloneAndOmitKey(object: {
12
12
  };
13
13
  export declare function assertNotProd(): void;
14
14
  export declare function shouldBeFormAssociated(Ctor: LightningElementConstructor): boolean;
15
+ export declare function safeHasProp<K extends PropertyKey>(obj: unknown, prop: K): obj is Record<K, unknown>;
15
16
  export {};
package/dist/index.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2024 Salesforce, Inc.
2
+ * Copyright (c) 2025 Salesforce, Inc.
3
3
  */
4
4
  'use strict';
5
5
 
@@ -251,6 +251,16 @@ function shouldBeFormAssociated(Ctor) {
251
251
  }
252
252
  return ctorFormAssociated && apiFeatureEnabled;
253
253
  }
254
+ // check if a property is in an object, and if the object throws an error merely because we are
255
+ // checking if the property exists, return false
256
+ function safeHasProp(obj, prop) {
257
+ try {
258
+ return prop in obj;
259
+ }
260
+ catch (_err) {
261
+ return false;
262
+ }
263
+ }
254
264
 
255
265
  /*
256
266
  * Copyright (c) 2024, Salesforce, Inc.
@@ -591,14 +601,14 @@ function componentValueObserved(vm, key, target = {}) {
591
601
  valueObserved(component, key);
592
602
  }
593
603
  // The portion of reactivity that's exposed to signals is to subscribe a callback to re-render the VM (templates).
594
- // We check check the following to ensure re-render is subscribed at the correct time.
604
+ // We check the following to ensure re-render is subscribed at the correct time.
595
605
  // 1. The template is currently being rendered (there is a template reactive observer)
596
606
  // 2. There was a call to a getter to access the signal (happens during vnode generation)
597
607
  if (lwcRuntimeFlags.ENABLE_EXPERIMENTAL_SIGNALS &&
598
608
  shared.isObject(target) &&
599
609
  !shared.isNull(target) &&
600
- 'value' in target &&
601
- 'subscribe' in target &&
610
+ safeHasProp(target, 'value') &&
611
+ safeHasProp(target, 'subscribe') &&
602
612
  shared.isFunction(target.subscribe) &&
603
613
  shared.isTrustedSignal(target) &&
604
614
  // Only subscribe if a template is being rendered by the engine
@@ -8598,5 +8608,5 @@ exports.swapTemplate = swapTemplate;
8598
8608
  exports.track = track;
8599
8609
  exports.unwrap = unwrap;
8600
8610
  exports.wire = wire;
8601
- /** version: 8.10.0 */
8611
+ /** version: 8.10.2 */
8602
8612
  //# sourceMappingURL=index.cjs.js.map