Skip to content
Myr

fix: don't freeze drafts returned from produce if they were passed in as draft (#917)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Alt-er · committed by GitHub · parent 04c5fb3 · Browse files · 1 file+2 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−0 removed

  • other:+2 added−0 removed

1 file+2 added−0 removed

modified:src/core/immerClass.ts+2 added
86 unmodified lines
8788 // Only plain objects, arrays, and "immerable classes" are drafted.89 if (isDraftable(base)) {90 const scope = enterScope(this)91 //when base is a draft,can't freeze92 scope.canAutoFreeze_ = !isDraft(base)93 const proxy = createProxy(this, base, undefined)94 let hasError = true95 try {96 result = recipe(proxy)
147 unmodified lines