diff --git a/unity/test/Src/Cases/ExceptionTest.cs b/unity/test/Src/Cases/ExceptionTest.cs index 151ae90321..353ddaf5fb 100644 --- a/unity/test/Src/Cases/ExceptionTest.cs +++ b/unity/test/Src/Cases/ExceptionTest.cs @@ -404,5 +404,27 @@ function t() { }); jsEnv.Tick(); } + + [Test] + public void QuickjsStackOverflowTest() + { + var jsEnv = UnitTestEnv.GetEnv(); + ConsumeStackAndCallJs(4 * 1024, jsEnv); + } + + void ConsumeStackAndCallJs(int loop, JsEnv jsEnv) + { + if (loop > 0) + { + ConsumeStackAndCallJs(loop - 1, jsEnv); + } + else + { + jsEnv.Eval(@" + function foo(p) { return p;} + foo(1); + "); + } + } } } \ No newline at end of file