-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(reactivity): should not observe frozen objects
fix #867
- Loading branch information
Showing
2 changed files
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,8 @@ const canObserve = (value: any): boolean => { | |
!value._isVue && | ||
!value._isVNode && | ||
isObservableType(toRawType(value)) && | ||
!nonReactiveValues.has(value) | ||
!nonReactiveValues.has(value) && | ||
!Object.isFrozen(value) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
LinusBorg
Member
|
||
) | ||
} | ||
|
||
|
Will this be able to watch changes inside of a frozen object (e.g. a frozen object/array with items/properties containing not-frozen objects)? Or is Object.freeze going to intentionally skip all reactive changes inside and object and all sub-objects?