Skip to content

toDisplayString in packages/shared/src/toDisplayString.ts should use default JSON.stringify for objects without toString #4334

@JamesChenX

Description

@JamesChenX

Version

3.2.2

Reproduction link

9d5fd33

Steps to reproduce

toDisplayString({a: 1}) will fail TypeError: Cannot convert object to primitive value

What is expected?

toDisplayString({a: 1}) should output a display string

What is actually happening?

toDisplayString({a: 1}) fails because the object doesn't have toString implementation


The bug is caused by this PR: 9d5fd33
And please take PRs seriously, especially Vue is a fundamental framework.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions