Skip to content

Nested @supports throws when getting debug info #3073

Description

@balpha

Using 2.7.2 in Chrome:

>>> less.render(".foo { @supports (bar: baz) { margin: 0; } }", {dumpLineNumbers: "all"})
TypeError: Cannot read property 'lineNumber' of undefined at Function.debugInfo.asComment

This happens because the ruleset parsed here doesn't get a .debugInfo attached to it, and this if block gets executed because the ruleset of a nested @supports isn't .root.

(I'm not familiar enough with the code to know what the right fix is here, hence not a PR).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions