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

fix(shared): improve toDisplayString #4335

Merged
merged 2 commits into from
Aug 16, 2021
Merged

Conversation

edison1105
Copy link
Member

fix #4334

: isArray(val) || (isObject(val) && val.toString === objectToString)
: isArray(val) ||
(isObject(val) &&
(val.toString === objectToString || val.toString == null))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another thing we could do is check if the toString value is not a function. But I don't know if we want to push toDisplayString too far and I think this was already proposed in the past, either here or in Vue 2 repo

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh very good idea, this is implemented in the pr #4337 that was closed

@lidlanca
Copy link
Contributor

great pr @edison1105 please consider the changes in #4337
@posva closed the pr because it is similar to your pr title but actually has improved coverage of cases.

@yyx990803 yyx990803 merged commit 42a334e into vuejs:master Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants