Skip to content

Type error when parsing the comments #104

@shuding

Description

@shuding

Here the regexp returns null for specific code comments, which results in an Uncaught TypeError: null is not iterable error:

// hello → works

//hello  → errors if there's no space after //
// 你好   → errors
// å     → errors

const commentRegex = /\/\/\s+(\w+)(\S*)\s*(.*)/
const [, key, focusString, data] = commentRegex.exec(
comment
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions