@@ -415,22 +415,24 @@ export function wrapScopedCompositionScript(
415415 if (prop !== __hfCompId) {
416416 return Reflect.get(target, prop, target);
417417 }
418- var authoredValue = Reflect.get(target, prop, target);
419- return authoredValue === undefined
420- ? Reflect.get(target, __hfTimelineCompId, target)
421- : authoredValue;
418+ var runtimeValue = Reflect.get(target, __hfTimelineCompId, target);
419+ return runtimeValue === undefined ? Reflect.get(target, prop, target) : runtimeValue;
422420 },
423421 set: function(target, prop, value, receiver) {
424422 if (prop !== __hfCompId) {
425423 return Reflect.set(target, prop, value, target);
426424 }
427425 // The authored node remains in the compiled DOM when its local id
428426 // differs from the runtime mount id, so readiness legitimately sees
429- // both compositions. Publish the same timeline under both identities
430- // instead of replacing one with the other.
431- var authoredSet = Reflect.set(target, __hfCompId, value, target);
427+ // both compositions. Publish the same timeline under both identities,
428+ // unless another mount of the same file already owns the authored one.
429+ var authoredValue = Reflect.get(target, __hfCompId, target);
430+ var ownsAuthored =
431+ authoredValue === undefined ||
432+ authoredValue === Reflect.get(target, __hfTimelineCompId, target);
432433 var runtimeSet = Reflect.set(target, __hfTimelineCompId, value, target);
433- return authoredSet && runtimeSet;
434+ if (!ownsAuthored) return runtimeSet;
435+ return Reflect.set(target, __hfCompId, value, target) && runtimeSet;
434436 },
435437 });
436438 }
0 commit comments