Skip to content

@lezer/highlight parent.set is not iterable  #1034

@zealot09

Description

@zealot09

Describe the issue

macOS chrome 108.0.5359.98

maybe chrome upgrades and has special optimize for circular reference,below tag define will push itself into tag.set makes
circular reference。

    /// Define a new tag. If `parent` is given, the tag is treated as a
    /// sub-tag of that parent, and
    /// [highlighters](#highlight.tagHighlighter) that don't mention
    /// this tag will try to fall back to the parent tag (or grandparent
    /// tag, etc).
    static define(parent) {
        if (parent === null || parent === void 0 ? void 0 : parent.base)
            throw new Error("Can not derive from a modified tag");
        let tag = new Tag([], null, []);
        tag.set.push(tag);
        if (parent)
            for (let t of parent.set)
                tag.set.push(t);
        return tag;
    }

while debugging in chrome,strange things happened

image

then next line, init name with Tag.define, it turns out with Object[object] , not an instance of Tag

image

and go on, jserror

Browser and platform

macOS chrome 108.0.5359.98

Reproduction link

none

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