Skip to content
This repository was archived by the owner on Oct 5, 2021. It is now read-only.
This repository was archived by the owner on Oct 5, 2021. It is now read-only.

Make Typewiz robust to errors from .toString() user code #84

Closed
@zxti

Description

@zxti

The value.toString() call below can cause Typewiz to crash, since user code can override .toString() with arbitrary broken code. I ran into this trying to use the Ant library, for instance—rc-editor-mention overrides the class method Mention.toString.

function getTypeName(value, nest = 0) {
       ...
        if (value instanceof Function) {
            let argsStr = value.toString().split('=>')[0];

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions