Skip to content

Global Variables with a literal "." in the value causes the variable to be undefined #3767

Open
@rdwoodring

Description

@rdwoodring

To reproduce:
This can be reproduced using the CLI or the programmatic API. Assuming that LESS is already installed, it is most straightforward to reproduce using the CLI:

echo "body { color: @buildVersion; }" | npx lessc --global-var="buildVersion=a.hello" -

On the other hand, removing the literal period allows this to work:

echo "body { color: @buildVersion; }" | npx lessc --global-var="buildVersion=hello" -

LESS Code:

body { color: @buildVersion; }

Current behavior:
The LESS compiler throws an error that the global variable is undefined.

Expected behavior:
The LESS compiler should not throw an error and the global variable should be defined.

Environment information:

  • less version: 3.5.0 - 4.1.3 (current)
  • nodejs version: 16.13.2
  • operating system: Windows

Appears to have been introduced in 3.5.0. Version 3.0.4 appears to be working fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions