Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(reactivity): markRaw doesn't check whether an object is extensible #10288

Closed
mattersj opened this issue Feb 7, 2024 · 0 comments · Fixed by #10289
Closed

(reactivity): markRaw doesn't check whether an object is extensible #10288

mattersj opened this issue Feb 7, 2024 · 0 comments · Fixed by #10289

Comments

@mattersj
Copy link
Contributor

mattersj commented Feb 7, 2024

Vue version

3.4.15

Link to minimal reproduction

https://play.vuejs.org/#eNp9kD9PwzAQxb+K5aWtVCVDtxIhAeoAA0WF0UtILsGp/8k+pxFRvju2Q0sH1O3uvd+d3t1IH4zJeg90SwtXWW6QOEBv7pni0miLZCSytMdDeSITaayWZBHwBVNM/erL/WcHFWaNBfiG5TitVndMFfm8LiwKDYI0okQIHSFFzXuSh7LIr3S6pugqrRreZp3TKiQaI81opaXhAuzeINfKMbolyYleKYQ+vSQNrYf1Wa++oDr+o3duiBqjbxYc2B4YvXhY2hZwtnfvrzCE+mJKXXsR6BvmAZwWPmacsUev6hD7iktpn9NfuWo/3G5AUO58VAwaySnxjIY/P904/S/uJtukOaYmOv0AgyybQQ==

Steps to reproduce

  1. Mark an object as non-extensible by sealing or freezing it.
  2. 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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant