Skip to content

RangeError: Maximum call stack size exceeded #1219

@Zamiell

Description

@Zamiell

I suspect that TSTL is doing something extremely inefficient when parsing Lua modules, because it triggers a stack size limit when there probably shouldn't be.

Steps to reproduce:

git clone git@github.com:IsaacScript/isaacscript-common.git
cd isaacscript-common
# The "bug" branch has some added functions that tip the library over the edge and cause errors
git checkout bug
npm ci
./build.sh
cd ..
git clone git@github.com:Zamiell/test3.git
cd test3
npm ci
npx tstl

The test3 repository is just a sample end-user TSTL project that consumes the isaacscript-common TSTL Lua module.

test3 only contains the following code:

import { upgradeMod } from "isaacscript-common";

const modVanilla = RegisterMod("TEST", 1);
const mod = upgradeMod(modVanilla);

Essentially, this is enough for TSTL to hit the stack limit, because "isaacscript-common" has too many functions in it.

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