@solidjs/signals 2.0.0-rc.14 → 2.0.0-rc.16
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/dev-shared.js +882 -405
- package/dist/dev.attribution.js +172 -66
- package/dist/dev.js +1529 -745
- package/dist/observe/affects-marks.js +86 -0
- package/dist/observe/affects.js +32 -80
- package/dist/observe/boundaries.js +202 -166
- package/dist/observe/core/async.js +192 -141
- package/dist/observe/core/attribution-queries.js +1 -1
- package/dist/observe/core/attribution.js +315 -214
- package/dist/observe/core/constants.js +23 -4
- package/dist/observe/core/context.js +3 -3
- package/dist/observe/core/core.js +532 -360
- package/dist/observe/core/dev.js +63 -35
- package/dist/observe/core/effect.js +47 -47
- package/dist/observe/core/error.js +5 -3
- package/dist/observe/core/external.js +5 -6
- package/dist/observe/core/graph.js +56 -42
- package/dist/observe/core/heap.js +33 -33
- package/dist/observe/core/identities.js +62 -0
- package/dist/observe/core/lanes.js +242 -229
- package/dist/observe/core/owner.js +62 -50
- package/dist/observe/core/scheduler.js +322 -168
- package/dist/observe/core/truth.js +45 -0
- package/dist/observe/core/verdict.js +114 -64
- package/dist/observe/deferred.js +184 -0
- package/dist/observe/index.js +7 -1
- package/dist/observe/map.js +339 -254
- package/dist/observe/reveal.js +77 -77
- package/dist/observe/signals.js +54 -33
- package/dist/observe/store/affects.js +76 -69
- package/dist/observe/store/edges.js +39 -0
- package/dist/observe/store/hooks.js +13 -0
- package/dist/observe/store/index.js +0 -2
- package/dist/observe/store/optimistic.js +82 -44
- package/dist/observe/store/projection.js +83 -64
- package/dist/observe/store/reconcile.js +32 -30
- package/dist/observe/store/store.js +219 -123
- package/dist/prod/affects-marks.js +86 -0
- package/dist/prod/affects.js +33 -79
- package/dist/prod/boundaries.js +185 -149
- package/dist/prod/core/async.js +176 -135
- package/dist/prod/core/constants.js +23 -4
- package/dist/prod/core/context.js +3 -3
- package/dist/prod/core/core.js +521 -353
- package/dist/prod/core/effect.js +66 -66
- package/dist/prod/core/error.js +5 -3
- package/dist/prod/core/external.js +5 -6
- package/dist/prod/core/graph.js +56 -42
- package/dist/prod/core/heap.js +38 -38
- package/dist/prod/core/identities.js +62 -0
- package/dist/prod/core/lanes.js +237 -224
- package/dist/prod/core/owner.js +62 -51
- package/dist/prod/core/scheduler.js +312 -158
- package/dist/prod/core/truth.js +45 -0
- package/dist/prod/core/verdict.js +113 -63
- package/dist/prod/deferred.js +182 -0
- package/dist/prod/index.js +7 -1
- package/dist/prod/map.js +366 -281
- package/dist/prod/reveal.js +77 -77
- package/dist/prod/signals.js +59 -38
- package/dist/prod/store/affects.js +76 -69
- package/dist/prod/store/edges.js +39 -0
- package/dist/prod/store/hooks.js +13 -0
- package/dist/prod/store/index.js +0 -2
- package/dist/prod/store/optimistic.js +121 -84
- package/dist/prod/store/projection.js +46 -34
- package/dist/prod/store/reconcile.js +32 -30
- package/dist/prod/store/store.js +205 -116
- package/dist/types/affects-marks.d.ts +14 -0
- package/dist/types/boundaries.d.ts +5 -1
- package/dist/types/core/async.d.ts +10 -0
- package/dist/types/core/attribution.d.ts +6 -2
- package/dist/types/core/constants.d.ts +18 -1
- package/dist/types/core/core.d.ts +77 -5
- package/dist/types/core/dev.d.ts +43 -13
- package/dist/types/core/graph.d.ts +11 -0
- package/dist/types/core/identities.d.ts +17 -0
- package/dist/types/core/index.d.ts +2 -1
- package/dist/types/core/lanes.d.ts +2 -4
- package/dist/types/core/owner.d.ts +5 -3
- package/dist/types/core/scheduler.d.ts +59 -34
- package/dist/types/core/truth.d.ts +16 -0
- package/dist/types/core/types.d.ts +21 -6
- package/dist/types/core/verdict.d.ts +32 -0
- package/dist/types/deferred.d.ts +28 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/map.d.ts +2 -2
- package/dist/types/signals.d.ts +28 -7
- package/dist/types/store/affects.d.ts +11 -0
- package/dist/types/store/edges.d.ts +9 -0
- package/dist/types/store/hooks.d.ts +48 -0
- package/dist/types/store/index.d.ts +10 -4
- package/dist/types/store/optimistic.d.ts +3 -2
- package/dist/types/store/projection.d.ts +4 -3
- package/dist/types/store/store.d.ts +4 -39
- package/dist/types/store/target.d.ts +16 -8
- package/dist/types/store/types.d.ts +14 -0
- package/package.json +1 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { attrHooks } from "../core/attribution-hooks.js";
|
|
2
|
+
|
|
1
3
|
import { CONFIG_AUTO_DISPOSE, STATUS_PENDING, STATUS_UNINITIALIZED } from "../core/constants.js";
|
|
2
4
|
|
|
3
5
|
import { computed } from "../core/core.js";
|
|
@@ -10,15 +12,15 @@ import { enqueueSub } from "../core/heap.js";
|
|
|
10
12
|
|
|
11
13
|
import { getOwner, isDisposed } from "../core/owner.js";
|
|
12
14
|
|
|
13
|
-
import { question, setQuestion, schedule } from "../core/scheduler.js";
|
|
15
|
+
import { question, setQuestion, insertSubs, schedule } from "../core/scheduler.js";
|
|
14
16
|
|
|
15
17
|
import { reconcileState } from "./reconcile.js";
|
|
16
18
|
|
|
17
19
|
import { wrap, nameStore, storeSetter, runDirect } from "./store.js";
|
|
18
20
|
|
|
19
|
-
import { setLookup } from "./target.js";
|
|
21
|
+
import { storeOwners, setLookup } from "./target.js";
|
|
20
22
|
|
|
21
|
-
import { $TARGET, markRawIngest, setWriteOverride } from "./types.js";
|
|
23
|
+
import { $TARGET, markRawIngest, isWrappable, setWriteOverride } from "./types.js";
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
26
|
* Store — projections (plan sec. 31, S3; INTERNALS §7/§7b).
|
|
@@ -50,22 +52,22 @@ import { $TARGET, markRawIngest, setWriteOverride } from "./types.js";
|
|
|
50
52
|
* set/getOwnPropertyDescriptor/defineProperty. With the store proxy as
|
|
51
53
|
* target those checks re-enter the store's traps OUTSIDE the override
|
|
52
54
|
* bracket, so `Object.keys(state)` in a derive continuation fired the gate.
|
|
53
|
-
*/ function wrapDraft(e, t, r,
|
|
55
|
+
*/ function wrapDraft(e, t, r, o, n, i) {
|
|
54
56
|
const mutate = e => {
|
|
55
57
|
if (!t()) return true;
|
|
56
58
|
setWriteOverride(true);
|
|
57
59
|
// A continuation's write is the flight's answer: it asks the flight's
|
|
58
60
|
// question (A18 provenance — a landing beneath a newer guess is held,
|
|
59
61
|
// not a correction; lanes.ts `laneWrite`).
|
|
60
|
-
const
|
|
62
|
+
const o = question;
|
|
61
63
|
if (i !== undefined) setQuestion(i());
|
|
62
64
|
try {
|
|
63
65
|
r ? r(e) : e();
|
|
64
66
|
} finally {
|
|
65
67
|
setWriteOverride(false);
|
|
66
|
-
setQuestion(
|
|
68
|
+
setQuestion(o);
|
|
67
69
|
}
|
|
68
|
-
if (
|
|
70
|
+
if (n) n();
|
|
69
71
|
return true;
|
|
70
72
|
};
|
|
71
73
|
const read = e => {
|
|
@@ -79,23 +81,23 @@ import { $TARGET, markRawIngest, setWriteOverride } from "./types.js";
|
|
|
79
81
|
const s = {
|
|
80
82
|
get(s, c) {
|
|
81
83
|
const u = read(() => e[c]);
|
|
82
|
-
return !
|
|
84
|
+
return !o && typeof u === "object" && u !== null && c !== $TARGET ? wrapDraft(u, t, r, false, n, i) : u;
|
|
83
85
|
},
|
|
84
86
|
has: (t, r) => read(() => r in e),
|
|
85
|
-
set: (t, r,
|
|
86
|
-
e[r] =
|
|
87
|
+
set: (t, r, o) => mutate(() => {
|
|
88
|
+
e[r] = o;
|
|
87
89
|
}),
|
|
88
90
|
deleteProperty: (t, r) => mutate(() => {
|
|
89
91
|
delete e[r];
|
|
90
92
|
}),
|
|
91
93
|
ownKeys: () => read(() => Reflect.ownKeys(e)),
|
|
92
94
|
getOwnPropertyDescriptor(t, r) {
|
|
93
|
-
const
|
|
94
|
-
if (
|
|
95
|
-
return
|
|
95
|
+
const o = read(() => Reflect.getOwnPropertyDescriptor(e, r));
|
|
96
|
+
if (o) o.configurable = true;
|
|
97
|
+
return o;
|
|
96
98
|
},
|
|
97
|
-
defineProperty: (t, r,
|
|
98
|
-
Reflect.defineProperty(e, r,
|
|
99
|
+
defineProperty: (t, r, o) => mutate(() => {
|
|
100
|
+
Reflect.defineProperty(e, r, o);
|
|
99
101
|
})
|
|
100
102
|
};
|
|
101
103
|
const c = new Proxy(Array.isArray(e) ? [] : {}, s);
|
|
@@ -122,7 +124,7 @@ function cloneState(e, t) {
|
|
|
122
124
|
const r = e.node;
|
|
123
125
|
e.woke = true;
|
|
124
126
|
forEachFamilyNode(e, e => {
|
|
125
|
-
if (e.
|
|
127
|
+
if (e.o === null) return;
|
|
126
128
|
// The leaf carries the derive's pending as a propagated copy, as a memo
|
|
127
129
|
// between them would: a dependent recovering one branch stays pending
|
|
128
130
|
// through a leaf it still reads (core `retryReaches`), and the landing's
|
|
@@ -139,7 +141,7 @@ function cloneState(e, t) {
|
|
|
139
141
|
/** The derive's flight rejected: every live reader of the family
|
|
140
142
|
* re-derives (its pull throws the derive's error). */ function errorFamily(e) {
|
|
141
143
|
forEachFamilyNode(e, e => {
|
|
142
|
-
if (e.
|
|
144
|
+
if (e.o === null) return;
|
|
143
145
|
forEachDependent(e, e => {
|
|
144
146
|
enqueueSub(e);
|
|
145
147
|
});
|
|
@@ -154,7 +156,7 @@ function cloneState(e, t) {
|
|
|
154
156
|
e.woke = false;
|
|
155
157
|
const t = e.node;
|
|
156
158
|
forEachFamilyNode(e, e => {
|
|
157
|
-
if (e.
|
|
159
|
+
if (e.o !== null) settlePendingSource(e, t);
|
|
158
160
|
});
|
|
159
161
|
}
|
|
160
162
|
|
|
@@ -162,8 +164,8 @@ function forEachFamilyNode(e, t) {
|
|
|
162
164
|
for (const r of e.live) {
|
|
163
165
|
const e = r.n;
|
|
164
166
|
if (e !== null) for (const r of Reflect.ownKeys(e)) t(e[r]);
|
|
165
|
-
const
|
|
166
|
-
if (
|
|
167
|
+
const o = r.h;
|
|
168
|
+
if (o !== null) for (const e of Reflect.ownKeys(o)) t(o[e]);
|
|
167
169
|
if (r.k !== null) t(r.k);
|
|
168
170
|
if (r.dk !== null) t(r.dk);
|
|
169
171
|
}
|
|
@@ -173,65 +175,70 @@ function forEachFamilyNode(e, t) {
|
|
|
173
175
|
* result (sync, or each async landing) through the reconcile channel.
|
|
174
176
|
* Draft validity is per run (R37): live from here until the NEXT run starts
|
|
175
177
|
* — a sync derive that subscribes to an external source and pushes into
|
|
176
|
-
* the draft from the callback (#3585) is the model use. */ function runProjectionComputed(e, t, r,
|
|
178
|
+
* the draft from the callback (#3585) is the model use. */ function runProjectionComputed(e, t, r, o, n) {
|
|
177
179
|
const i = getOwner();
|
|
178
180
|
const s = e[$TARGET];
|
|
179
181
|
const c = s.fam;
|
|
180
182
|
const u = c.run = (c.run || 0) + 1;
|
|
181
|
-
let
|
|
183
|
+
let l;
|
|
182
184
|
// Open loading window (seedLoadingValue): the observable store IS commit #0
|
|
183
185
|
// for the whole first flight — the derive works a detached shadow of the
|
|
184
186
|
// seed so draft writes cannot tear through to readers (#2988). Every
|
|
185
187
|
// commit point reconciles the shadow through the normal commit path.
|
|
186
|
-
const
|
|
188
|
+
const a = i.ce ? cloneState(s.v, s.s) : null;
|
|
187
189
|
// The question a write of this run answers: inside a slice, the slice's
|
|
188
190
|
// (the sync pass); in a continuation — the flight still registered — the
|
|
189
191
|
// flight's (`handleAsync` stamped it with the action that asked).
|
|
190
|
-
const asking = () => question || (i.
|
|
191
|
-
const f = wrapDraft(e, () => c.run === u && !isDisposed(i),
|
|
192
|
+
const asking = () => question || (i.T !== null && i.T.Se !== null ? i.T.Ee : 0);
|
|
193
|
+
const f = wrapDraft(e, () => c.run === u && !isDisposed(i), n, s.s,
|
|
192
194
|
// A write after the run returned (a continuation, a callback) arms the
|
|
193
195
|
// drain itself when no landing will.
|
|
194
196
|
() => {
|
|
195
|
-
if (!(i.
|
|
197
|
+
if (!(i.m & STATUS_PENDING) && !i.ce) schedule();
|
|
196
198
|
}, asking);
|
|
197
199
|
// The creation run commits directly (a memo's first value is its
|
|
198
200
|
// `_value`); every later run — a re-derive in a flush, an async landing
|
|
199
201
|
// — stages and commits with the flush like a memo's recompute.
|
|
200
202
|
const d = u === 1;
|
|
201
|
-
const pass = () => storeSetter(f,
|
|
202
|
-
|
|
203
|
+
const pass = () => storeSetter(f, n => {
|
|
204
|
+
l = t(a ?? n);
|
|
203
205
|
const commit = t => {
|
|
204
206
|
// Shadow run: commit a detached snapshot, never the shadow itself
|
|
205
207
|
// (adoption takes the value by identity — handing it the live
|
|
206
208
|
// shadow would fuse the draft to the observable store).
|
|
207
|
-
if (
|
|
208
|
-
if (t !==
|
|
209
|
+
if (a && (t === undefined || t === a)) t = cloneState(a, s.s);
|
|
210
|
+
if (t !== n && t !== undefined) {
|
|
209
211
|
const write = () => {
|
|
210
|
-
const
|
|
212
|
+
const o = question;
|
|
211
213
|
setQuestion(asking());
|
|
212
214
|
try {
|
|
213
215
|
storeSetter(e, e => reconcileState(t, e, r, true), false);
|
|
214
216
|
} finally {
|
|
215
|
-
setQuestion(
|
|
217
|
+
setQuestion(o);
|
|
216
218
|
}
|
|
217
219
|
};
|
|
218
|
-
|
|
220
|
+
o ? o(write, t) : write();
|
|
219
221
|
}
|
|
220
222
|
// A landing (not the sync pass's own commit): the readers held
|
|
221
223
|
// pending on the derive settle.
|
|
222
|
-
if (!d || !(i.
|
|
224
|
+
if (!d || !(i.m & STATUS_UNINITIALIZED)) settleFamily(c);
|
|
225
|
+
// A commit is the derive's change for the readers that observed its
|
|
226
|
+
// flight (linked by `pullFamily`; a settled pull does not link), as
|
|
227
|
+
// a memo's landing is for its readers: one that caught the NotReady
|
|
228
|
+
// (a fallback value, not pending) re-runs too (#4070).
|
|
229
|
+
insertSubs(i);
|
|
223
230
|
};
|
|
224
|
-
const u = handleAsync(i,
|
|
231
|
+
const u = handleAsync(i, l, commit, (e, t) => {
|
|
225
232
|
// The flight rejected: the leaves' readers learn it from here —
|
|
226
233
|
// they do not subscribe to the derive. Pending again (a NotReady
|
|
227
234
|
// rejection): the wake, as for the pass. Errored: every live
|
|
228
235
|
// reader re-derives and meets the error at its pull (memo parity,
|
|
229
236
|
// #2897) — and the flush that runs them advances the clock, so a
|
|
230
237
|
// later tracked re-read may retry (core `read`).
|
|
231
|
-
if (d && i.
|
|
238
|
+
if (d && i.m & STATUS_UNINITIALIZED) return;
|
|
232
239
|
if (t) wakeFamily(c, e); else errorFamily(c);
|
|
233
240
|
});
|
|
234
|
-
if (!i.
|
|
241
|
+
if (!i.ce) commit(u);
|
|
235
242
|
}, false);
|
|
236
243
|
try {
|
|
237
244
|
d ? runDirect(pass) : pass();
|
|
@@ -239,64 +246,76 @@ function forEachFamilyNode(e, t) {
|
|
|
239
246
|
// A flight went up (NotReady out of the pass — the derive's own, with
|
|
240
247
|
// the derive as its source): the leaves' readers learn it from here —
|
|
241
248
|
// they do not subscribe to the derive.
|
|
242
|
-
|
|
249
|
+
// A synchronous error the same way (#3956: a rerun that finds the
|
|
250
|
+
// entry failed throws): every live reader re-derives and meets it.
|
|
251
|
+
if (!d) e instanceof NotReadyError ? wakeFamily(c, e) : errorFamily(c);
|
|
243
252
|
throw e;
|
|
244
253
|
}
|
|
245
254
|
// A pass that returned with a flight up (an iterator's sync first yield):
|
|
246
255
|
// the wake, as for the throw. Not a sync pass that superseded one — the
|
|
247
256
|
// status it reads is the dead flight's, cleared when this pass settles
|
|
248
257
|
// (#3181: a reader the settle walk had just released, re-parked for good).
|
|
249
|
-
if (i.
|
|
258
|
+
if (i.m & STATUS_PENDING && i.T.Se !== null && !i.ce && !d) wakeFamily(c, i.T?.F);
|
|
250
259
|
return i;
|
|
251
260
|
}
|
|
252
261
|
|
|
253
262
|
function createProjectionInternal(e, t, r) {
|
|
263
|
+
// Seedless (`fn` takes no draft): the root starts as an empty record. It is
|
|
264
|
+
// a draft like any seed, never observable before the first landing (A25).
|
|
265
|
+
t ||= {};
|
|
266
|
+
const o = r?.key === undefined ? "id" : r.key;
|
|
254
267
|
const n = {
|
|
255
268
|
map: new WeakMap,
|
|
256
269
|
node: null,
|
|
257
270
|
live: new Set,
|
|
258
|
-
shallow: !!r?.shallow
|
|
271
|
+
shallow: !!r?.shallow,
|
|
272
|
+
// The row key, for a child paired after the adoption (store.ts
|
|
273
|
+
// `adoptChild`, #3712) as the adoption pairs them.
|
|
274
|
+
key: typeof o === "function" ? o : o === null ? null : e => isWrappable(e) ? e[o] : undefined
|
|
259
275
|
};
|
|
260
|
-
const
|
|
276
|
+
const i = wrap(t, null, null, n);
|
|
261
277
|
if (n.shallow) {
|
|
262
|
-
|
|
278
|
+
i[$TARGET].s = true;
|
|
263
279
|
markRawIngest(t);
|
|
264
280
|
}
|
|
265
|
-
let
|
|
266
|
-
if (r?.seedLoadingValue)
|
|
281
|
+
let s;
|
|
282
|
+
if (r?.seedLoadingValue) s = {
|
|
267
283
|
loadingValue: undefined
|
|
268
284
|
};
|
|
269
|
-
if (
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
285
|
+
if (attrHooks !== null)
|
|
286
|
+
// As createStore: the owner in scope stamps the projection's property
|
|
287
|
+
// nodes, so attribution places them under it (#4035).
|
|
288
|
+
storeOwners.set(i[$TARGET], getOwner());
|
|
289
|
+
if (r?.name || r?.loc) {
|
|
290
|
+
s = {
|
|
291
|
+
...s,
|
|
292
|
+
name: r.name,
|
|
293
|
+
loc: r.loc
|
|
273
294
|
};
|
|
274
|
-
nameStore(
|
|
295
|
+
nameStore(i, r.name, r.loc);
|
|
275
296
|
}
|
|
276
|
-
const
|
|
297
|
+
const c = computed(() => {
|
|
277
298
|
if (!n.node) n.node = getOwner();
|
|
278
|
-
runProjectionComputed(
|
|
279
|
-
},
|
|
280
|
-
|
|
281
|
-
n.node =
|
|
299
|
+
runProjectionComputed(i, e, o);
|
|
300
|
+
}, s);
|
|
301
|
+
c.l &= ~CONFIG_AUTO_DISPOSE;
|
|
302
|
+
n.node = c;
|
|
303
|
+
// The derive's leaves are not its dependents: a mark's repoll
|
|
304
|
+
// (affects-marks.ts) reaches their readers through this.
|
|
305
|
+
c.fam = n;
|
|
282
306
|
return {
|
|
283
|
-
store:
|
|
284
|
-
node:
|
|
307
|
+
store: i,
|
|
308
|
+
node: c
|
|
285
309
|
};
|
|
286
310
|
}
|
|
287
311
|
|
|
288
|
-
|
|
289
|
-
* A derived store: `fn` runs in a computed and writes its draft; readers of
|
|
290
|
-
* the store's keys re-run only when the keys they read change (the
|
|
291
|
-
* firewall). `fn` may be async or an async iterator; the seed is a draft,
|
|
292
|
-
* never an observable value, until the first landing (A25).
|
|
293
|
-
*/ function createProjection(e, t, r) {
|
|
312
|
+
function createProjection(e, t, r) {
|
|
294
313
|
return createProjectionInternal(e, t, r).store;
|
|
295
314
|
}
|
|
296
315
|
|
|
297
316
|
/** `createStore(fn, seed, options)`: a projection with a user setter. */ function createStoreDerived(e, t, r) {
|
|
298
|
-
const {store:
|
|
299
|
-
return [
|
|
317
|
+
const {store: o} = createProjectionInternal(e, t, r);
|
|
318
|
+
return [ o, e => storeSetter(o, e) ];
|
|
300
319
|
}
|
|
301
320
|
|
|
302
321
|
export { createProjection, createStoreDerived, runProjectionComputed };
|
|
@@ -2,7 +2,9 @@ import { isEqual } from "../core/core.js";
|
|
|
2
2
|
|
|
3
3
|
import { isOwned, $OWNER, storeLookup, lookupTarget } from "./target.js";
|
|
4
4
|
|
|
5
|
-
import { userWriting,
|
|
5
|
+
import { userWriting, unwrapValue, adoptPB, sameKey, materializePB, notifyFold, sameRow, targetsEqual, bumpDeep, notifyKeyValue, notifyKeyDiff, notifyFoldTail, hasAccessorFlag } from "./store.js";
|
|
6
|
+
|
|
7
|
+
import { optHooks } from "./hooks.js";
|
|
6
8
|
|
|
7
9
|
import { $TARGET, markRawIngest, isWrappable, rawValuesUsed, isRawValue } from "./types.js";
|
|
8
10
|
|
|
@@ -73,33 +75,33 @@ import { $TARGET, markRawIngest, isWrappable, rawValuesUsed, isRawValue } from "
|
|
|
73
75
|
// — key matching from the arrangement the guesses made (R28), so a row
|
|
74
76
|
// the guess added keeps its proxy when the server returns it.
|
|
75
77
|
const i = l?.opt === true ? optHooks.view(e, f) : f;
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
+
const s = Array.isArray(n);
|
|
79
|
+
const u = e.s === true;
|
|
78
80
|
const r = f;
|
|
79
81
|
adoptPB(e, n, false);
|
|
80
|
-
if (
|
|
81
|
-
if (Array.isArray(i) !==
|
|
82
|
+
if (u) markRawIngest(n);
|
|
83
|
+
if (Array.isArray(i) !== s) {
|
|
82
84
|
notifyFold(e, r, n);
|
|
83
85
|
return;
|
|
84
86
|
}
|
|
85
|
-
if (
|
|
87
|
+
if (s) {
|
|
86
88
|
const f = i;
|
|
87
|
-
const
|
|
89
|
+
const s = n;
|
|
88
90
|
const a = e.n;
|
|
89
91
|
let c = 0;
|
|
90
|
-
if (t && !
|
|
92
|
+
if (t && !u) {
|
|
91
93
|
const i = f.length;
|
|
92
|
-
const
|
|
94
|
+
const u = s.length;
|
|
93
95
|
let d = false;
|
|
94
96
|
let p = 0;
|
|
95
97
|
// Aligned prefix: same row (by reference or key) at the same index.
|
|
96
|
-
for (const y = Math.min(i,
|
|
97
|
-
const i =
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
98
|
+
for (const y = Math.min(i, u); p < y; p++) {
|
|
99
|
+
const i = s[p];
|
|
100
|
+
const u = f[p];
|
|
101
|
+
if (u !== i && !sameRow(u, i, t)) break;
|
|
100
102
|
// misaligned: fall to the keyed remainder below
|
|
101
|
-
if ((
|
|
102
|
-
if (e.dk !== null && !d && !(i !== null && typeof i === "object" ? targetsEqual(
|
|
103
|
+
if ((u !== i || i !== null && typeof i === "object" && isOwned(i)) && i !== null && typeof i === "object") descend(unwrapValue(u), i, t, l, o);
|
|
104
|
+
if (e.dk !== null && !d && !(i !== null && typeof i === "object" ? targetsEqual(u, i) : isEqual(u, i))) {
|
|
103
105
|
bumpDeep(e);
|
|
104
106
|
d = true;
|
|
105
107
|
}
|
|
@@ -111,12 +113,12 @@ import { $TARGET, markRawIngest, isWrappable, rawValuesUsed, isRawValue } from "
|
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
115
|
}
|
|
114
|
-
if (e.dk !== null && !d && p <
|
|
116
|
+
if (e.dk !== null && !d && p < s.length) bumpDeep(e);
|
|
115
117
|
const y = p;
|
|
116
118
|
// misalignment point (== nlen on aligned ticks)
|
|
117
119
|
let w = null;
|
|
118
|
-
for (;p <
|
|
119
|
-
const e =
|
|
120
|
+
for (;p < s.length; p++) {
|
|
121
|
+
const e = s[p];
|
|
120
122
|
if (e !== null && typeof e === "object") {
|
|
121
123
|
const n = t(e);
|
|
122
124
|
let i;
|
|
@@ -156,12 +158,12 @@ import { $TARGET, markRawIngest, isWrappable, rawValuesUsed, isRawValue } from "
|
|
|
156
158
|
}
|
|
157
159
|
}
|
|
158
160
|
} else {
|
|
159
|
-
const i = Math.min(f.length,
|
|
160
|
-
const d =
|
|
161
|
+
const i = Math.min(f.length, s.length);
|
|
162
|
+
const d = s.length;
|
|
161
163
|
let p = false;
|
|
162
164
|
for (let y = 0; y < d; y++) {
|
|
163
|
-
const d =
|
|
164
|
-
if (!
|
|
165
|
+
const d = s[y];
|
|
166
|
+
if (!u && y < i && d !== null && typeof d === "object") descend(unwrapValue(f[y]), d, t, l, o);
|
|
165
167
|
if (e.dk !== null && !p && !(d !== null && typeof d === "object" ? targetsEqual(f[y], d) : isEqual(f[y], d))) {
|
|
166
168
|
bumpDeep(e);
|
|
167
169
|
p = true;
|
|
@@ -179,7 +181,7 @@ import { $TARGET, markRawIngest, isWrappable, rawValuesUsed, isRawValue } from "
|
|
|
179
181
|
if (a !== null && c < e.nc) {
|
|
180
182
|
for (const e of Reflect.ownKeys(a)) {
|
|
181
183
|
const t = typeof e === "string" ? +e : NaN;
|
|
182
|
-
if (!(t >= 0 && t <
|
|
184
|
+
if (!(t >= 0 && t < s.length)) notifyKeyDiff(a[e], e, r, n, false);
|
|
183
185
|
}
|
|
184
186
|
}
|
|
185
187
|
notifyFoldTail(e, r, n);
|
|
@@ -189,15 +191,15 @@ import { $TARGET, markRawIngest, isWrappable, rawValuesUsed, isRawValue } from "
|
|
|
189
191
|
let c = 0;
|
|
190
192
|
let d = false;
|
|
191
193
|
for (const f in n) {
|
|
192
|
-
const
|
|
194
|
+
const s = n[f];
|
|
193
195
|
const p = r[f];
|
|
194
|
-
const y =
|
|
195
|
-
if (p ===
|
|
196
|
+
const y = s !== null && typeof s === "object";
|
|
197
|
+
if (p === s && (!y || !isOwned(s)) && (a === null || a[f] === undefined || !hasAccessorFlag(a[f]))) {
|
|
196
198
|
if (a !== null && a[f] !== undefined) c++;
|
|
197
199
|
continue;
|
|
198
200
|
}
|
|
199
|
-
if (y && !
|
|
200
|
-
if (e.dk !== null && !d && !(y ? targetsEqual(p,
|
|
201
|
+
if (y && !u) descend(unwrapValue(i[f]), s, t, l, o);
|
|
202
|
+
if (e.dk !== null && !d && !(y ? targetsEqual(p, s) : isEqual(p, s))) {
|
|
201
203
|
bumpDeep(e);
|
|
202
204
|
d = true;
|
|
203
205
|
}
|
|
@@ -205,7 +207,7 @@ import { $TARGET, markRawIngest, isWrappable, rawValuesUsed, isRawValue } from "
|
|
|
205
207
|
const e = a[f];
|
|
206
208
|
if (e !== undefined) {
|
|
207
209
|
c++;
|
|
208
|
-
notifyKeyValue(e, f, p,
|
|
210
|
+
notifyKeyValue(e, f, p, s, r, n);
|
|
209
211
|
}
|
|
210
212
|
}
|
|
211
213
|
}
|
|
@@ -214,7 +216,7 @@ import { $TARGET, markRawIngest, isWrappable, rawValuesUsed, isRawValue } from "
|
|
|
214
216
|
const f = p[e];
|
|
215
217
|
if (f === $OWNER) continue;
|
|
216
218
|
const i = n[f];
|
|
217
|
-
if (!
|
|
219
|
+
if (!u && i !== null && typeof i === "object") descend(unwrapValue(r[f]), i, t, l, o);
|
|
218
220
|
if (a !== null) {
|
|
219
221
|
const e = a[f];
|
|
220
222
|
if (e !== undefined) {
|