@lwc/engine-core 8.12.3 → 8.12.4

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/LICENSE.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  MIT LICENSE
4
4
 
5
- Copyright (c) 2024, Salesforce, Inc.
5
+ Copyright (c) 2025, Salesforce, Inc.
6
6
  All rights reserved.
7
7
 
8
8
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@@ -12,5 +12,6 @@ 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 {};
16
17
  //# sourceMappingURL=utils.d.ts.map
package/dist/index.cjs.js CHANGED
@@ -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
@@ -8421,5 +8431,5 @@ exports.swapTemplate = swapTemplate;
8421
8431
  exports.track = track;
8422
8432
  exports.unwrap = unwrap;
8423
8433
  exports.wire = wire;
8424
- /** version: 8.12.3 */
8434
+ /** version: 8.12.4 */
8425
8435
  //# sourceMappingURL=index.cjs.js.map
package/dist/index.js CHANGED
@@ -248,6 +248,16 @@ function shouldBeFormAssociated(Ctor) {
248
248
  }
249
249
  return ctorFormAssociated && apiFeatureEnabled;
250
250
  }
251
+ // check if a property is in an object, and if the object throws an error merely because we are
252
+ // checking if the property exists, return false
253
+ function safeHasProp(obj, prop) {
254
+ try {
255
+ return prop in obj;
256
+ }
257
+ catch (_err) {
258
+ return false;
259
+ }
260
+ }
251
261
 
252
262
  /*
253
263
  * Copyright (c) 2024, Salesforce, Inc.
@@ -588,14 +598,14 @@ function componentValueObserved(vm, key, target = {}) {
588
598
  valueObserved(component, key);
589
599
  }
590
600
  // The portion of reactivity that's exposed to signals is to subscribe a callback to re-render the VM (templates).
591
- // We check check the following to ensure re-render is subscribed at the correct time.
601
+ // We check the following to ensure re-render is subscribed at the correct time.
592
602
  // 1. The template is currently being rendered (there is a template reactive observer)
593
603
  // 2. There was a call to a getter to access the signal (happens during vnode generation)
594
604
  if (lwcRuntimeFlags.ENABLE_EXPERIMENTAL_SIGNALS &&
595
605
  isObject(target) &&
596
606
  !isNull(target) &&
597
- 'value' in target &&
598
- 'subscribe' in target &&
607
+ safeHasProp(target, 'value') &&
608
+ safeHasProp(target, 'subscribe') &&
599
609
  isFunction$1(target.subscribe) &&
600
610
  isTrustedSignal(target) &&
601
611
  // Only subscribe if a template is being rendered by the engine
@@ -8367,5 +8377,5 @@ function readonly(obj) {
8367
8377
  }
8368
8378
 
8369
8379
  export { BaseBridgeElement, LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, computeShadowAndRenderMode, connectRootElement, createContextProviderWithRegister, createVM, disconnectRootElement, freezeTemplate, getAssociatedVMIfPresent, getComponentAPIVersion, getComponentConstructor, getComponentDef, getComponentHtmlPrototype, hydrateRoot, isComponentConstructor, parseFragment, parseSVGFragment, readonly, registerComponent, registerDecorators, registerTemplate, runFormAssociatedCallback, runFormDisabledCallback, runFormResetCallback, runFormStateRestoreCallback, sanitizeAttribute, shouldBeFormAssociated, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
8370
- /** version: 8.12.3 */
8380
+ /** version: 8.12.4 */
8371
8381
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
5
5
  ],
6
6
  "name": "@lwc/engine-core",
7
- "version": "8.12.3",
7
+ "version": "8.12.4",
8
8
  "description": "Core LWC engine APIs.",
9
9
  "keywords": [
10
10
  "lwc"
@@ -46,9 +46,9 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "@lwc/features": "8.12.3",
50
- "@lwc/shared": "8.12.3",
51
- "@lwc/signals": "8.12.3"
49
+ "@lwc/features": "8.12.4",
50
+ "@lwc/shared": "8.12.4",
51
+ "@lwc/signals": "8.12.4"
52
52
  },
53
53
  "devDependencies": {
54
54
  "observable-membrane": "2.0.0"