(reactivity): markRaw doesn't check whether an object is extensible
Vue version
3.4.15
Link to minimal reproduction
Steps to reproduce
- Mark an object as non-extensible by sealing or freezing it.
- Try to mark it as raw using
markRaw
.
What is expected?
markRaw
should just return the original object since it can't be changed (or observed) anyway. This is how it already works in Vue 2.7 and it makes sense to keep the same behavior here.
What is actually happening?
markRaw
tries to define a new property on the object causing a TypeError.
System Info
System:
OS: macOS 12.6.8
CPU: (10) arm64 Apple M1 Pro
Memory: 160.86 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.17.1/bin/yarn
npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm
pnpm: 8.15.1 - ~/.nvm/versions/node/v18.17.1/bin/pnpm
Browsers:
Chrome: 121.0.6167.139
Safari: 17.0
Any additional comments?
No response