Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with declaring hash and functions with curly braces on newline #2847

Open
api33tiramisu opened this issue Dec 6, 2023 · 0 comments
Open

Comments

@api33tiramisu
Copy link

To reproduce:

In Stylus, functions and declarations can be written with or without the curly braces. Hashes do.

body {
    background: red;
}

hash = {
   foo: bar;
}

add(a, b) {
    a + b;
}

In other languages, I can also put the first brace on a newline, but not here in Stylus. This issue won't occur for declarations.

/* This works */

body
{
    background: red;
}

/* These don't work */

hash =
{
    foo: bar;
}

add(a, b)
{
    a + b;
}

Current behaviour:

Stylus will throw an error this.nodes[0] is undefined for functions and Expected "{" but found "" for hashes.

Expected behaviour:

Stylus won't throw any issue and I can declare functions and hashes as usual.

Environment information:

  • stylus version: 0.58.1
  • nodejs version: n/a

I use the Stylus extension version 1.5.38 for Firefox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant