@lwc/engine-core 8.10.1 → 8.10.3
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/framework/utils.d.ts +1 -0
- package/dist/index.cjs.js +19 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +19 -5
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -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)
|
|
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,18 @@ 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
|
|
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
|
-
|
|
601
|
-
|
|
610
|
+
(lwcRuntimeFlags.DISABLE_TRY_CATCH_FOR_SIGNALS_CHECK
|
|
611
|
+
? 'value' in target
|
|
612
|
+
: safeHasProp(target, 'value')) &&
|
|
613
|
+
(lwcRuntimeFlags.DISABLE_TRY_CATCH_FOR_SIGNALS_CHECK
|
|
614
|
+
? 'subscribe' in target
|
|
615
|
+
: safeHasProp(target, 'subscribe')) &&
|
|
602
616
|
shared.isFunction(target.subscribe) &&
|
|
603
617
|
shared.isTrustedSignal(target) &&
|
|
604
618
|
// Only subscribe if a template is being rendered by the engine
|
|
@@ -8598,5 +8612,5 @@ exports.swapTemplate = swapTemplate;
|
|
|
8598
8612
|
exports.track = track;
|
|
8599
8613
|
exports.unwrap = unwrap;
|
|
8600
8614
|
exports.wire = wire;
|
|
8601
|
-
/** version: 8.10.
|
|
8615
|
+
/** version: 8.10.3 */
|
|
8602
8616
|
//# sourceMappingURL=index.cjs.js.map
|