DUP-002
createSetHandler() has a no-onWrite fast path (lines 672–691) that manually inlines the same 6-step sequence performWrite() encapsulates (lines 699–728):
| Step |
Both paths |
| Read old value |
rawTarget[prop] |
| Same-value bail |
Object.is(oldValue, value) |
| Capture array length |
getArrayLengthBeforeMutation |
| Assign |
rawTarget[prop] = value |
| Notify subscribers |
scheduleSubscribersForTarget |
| Length change check |
notifyLengthChangeIfNeeded |
The inline version omits checkInfiniteLoop (guarded by !currentEffect) and the hook call, but the structural sequence is duplicated verbatim.
performWrite could handle the hookless case by accepting optional parameters, collapsing two paths into one.
DUP-002
createSetHandler()has a no-onWritefast path (lines 672–691) that manually inlines the same 6-step sequenceperformWrite()encapsulates (lines 699–728):rawTarget[prop]Object.is(oldValue, value)getArrayLengthBeforeMutationrawTarget[prop] = valuescheduleSubscribersForTargetnotifyLengthChangeIfNeededThe inline version omits
checkInfiniteLoop(guarded by!currentEffect) and the hook call, but the structural sequence is duplicated verbatim.performWritecould handle the hookless case by accepting optional parameters, collapsing two paths into one.