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

useReactive 关于 RegExp 的bug #2080

Closed
xluoyu opened this issue Feb 25, 2023 · 2 comments · Fixed by #2079
Closed

useReactive 关于 RegExp 的bug #2080

xluoyu opened this issue Feb 25, 2023 · 2 comments · Fixed by #2079
Assignees

Comments

@xluoyu
Copy link

xluoyu commented Feb 25, 2023

用例如下:

const a = useReactive({
  b: /123/
})

a.b.test('321')

此时浏览器就会报错
Uncaught TypeError: Method RegExp.prototype.exec called on incompatible receiver [object RegExp]

目前拿到的 a.b 是一个被 Proxy 包裹的 RegExp ,在后续的使用中造成了麻烦,希望可以在 get 时增加一些类型判断,在必要时返回原始类型的数据。

🫡🫡🫡

@liuyib liuyib self-assigned this Feb 25, 2023
@SignDawn
Copy link

出于什么原因?要在 正则 上用 useReactive

@liuyib
Copy link
Collaborator

liuyib commented Feb 26, 2023

虽然这种特殊的值在 useReative 里可能不太常用,但是已经在处理了,PR 如果能合并的话,这个问题就可以解决了 @xluoyu

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

Successfully merging a pull request may close this issue.

3 participants