Skip to content
This repository was archived by the owner on Nov 2, 2021. It is now read-only.

Stack overflow when parsing recursive stylus functions #2

Open
thrucker opened this issue Feb 27, 2017 · 1 comment
Open

Stack overflow when parsing recursive stylus functions #2

thrucker opened this issue Feb 27, 2017 · 1 comment

Comments

@thrucker
Copy link
Contributor

thrucker commented Feb 27, 2017

The tool exits with a stack overflow exception if any parsed stylus file contains a recursive function, e.g.

recursive(n)
    div
        width: n
    if n > 0
        recursive(n - 1)

body
    recursive(3)

It seems like the deps API call of stylus cannot handle recursion:

file.data.dependencies = stylus(String(file.contents), opts).deps()

@marcmenn
Copy link
Contributor

Yes. Bad. Even worse: the stylus file isn't used anymore. So I'm unsure whether just throwing that stylus away of find a proper fix for stylus exceptions, e.g. excluding the failing file…

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

No branches or pull requests

2 participants