mirror of
https://github.com/morluto/rea.git
synced 2026-11-12 01:41:21 +00:00
fix(javascript): invalidate Electron reads after direct eval (#7053)
This commit is contained in:
1 parent
69a2faa120
commit
26e155987f
6 files changed
+308
-5
No files matched your search
@@ -6,6 +6,8 @@ import { createSemanticModuleInterop } from "./javascriptModuleInterop.js";
|
||||
import {
|
||||
semanticEffectTiming,
|
||||
semanticBindingEffectFollowsCapture,
|
||||
semanticBindingEffectFollowsRead,
|
||||
semanticReadPrecedesEffectWithinActivation,
|
||||
} from "./javascriptSemanticMutationInitializers.js";
|
||||
import {
|
||||
isUnshadowedGlobal,
|
||||
@@ -134,6 +136,17 @@ export const semanticBindingMayHaveOpaqueEffect = (
|
||||
read,
|
||||
effect,
|
||||
state.parentsByNode,
|
||||
) &&
|
||||
// Rebinding a freshly initialized local is activation-specific;
|
||||
// mutations to the referenced object may persist across calls.
|
||||
!(
|
||||
kind === "binding" &&
|
||||
semanticBindingEffectFollowsRead(
|
||||
binding,
|
||||
read,
|
||||
effect,
|
||||
state.parentsByNode,
|
||||
)
|
||||
))
|
||||
)
|
||||
return true;
|
||||
@@ -186,7 +199,13 @@ export const semanticOpaqueNameMayHaveChanged = (
|
||||
(binding === undefined ||
|
||||
resolveSemanticBindingState(state, effect, binding.name)
|
||||
?.bindingId === binding.bindingId) &&
|
||||
semanticEffectTiming(read, effect, state) !== "after",
|
||||
semanticEffectTiming(read, effect, state) !== "after" &&
|
||||
// A sloppy-eval name belongs to this activation, not a prior call.
|
||||
!semanticReadPrecedesEffectWithinActivation(
|
||||
read,
|
||||
effect,
|
||||
state.parentsByNode,
|
||||
),
|
||||
)
|
||||
)
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user