File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " mobx " : patch
3+ ---
4+
5+ Fixed memory leak where makeAutoObservable would keep wrapping setters defined on the prototype. Fixes #4553
Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ import {
1010 autoAction ,
1111 isGenerator ,
1212 MakeResult ,
13- die
13+ die ,
14+ isAction
1415} from "../internal"
1516
1617const AUTO = "true"
@@ -40,7 +41,9 @@ function make_(
4041 // lone setter -> action setter
4142 if ( descriptor . set ) {
4243 // TODO make action applicable to setter and delegate to action.make_
43- const set = createAction ( key . toString ( ) , descriptor . set ) as ( v : any ) => void
44+ const set = isAction ( descriptor . set )
45+ ? descriptor . set // See #4553
46+ : ( createAction ( key . toString ( ) , descriptor . set ) as ( v : any ) => void )
4447 // own
4548 if ( source === adm . target_ ) {
4649 return adm . defineProperty_ ( key , {
You can’t perform that action at this time.
0 commit comments