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

Handle recursive expressions #5

Open
tshemsedinov opened this issue May 13, 2022 · 0 comments
Open

Handle recursive expressions #5

tshemsedinov opened this issue May 13, 2022 · 0 comments
Labels
metarhia-s'22 Good for newcomers

Comments

@tshemsedinov
Copy link
Member

tshemsedinov commented May 13, 2022

Maximum call stack size exceeded

If we have recursive expressions (direct or indirect) like in the following example

metatests.test('Expression chain', async (test) => {
  const sheet = new Sheet();
  sheet.cells['A1'] = 100;
  sheet.cells['B1'] = 2;
  sheet.cells['C1'] = '=A1*E1';
  sheet.cells['D1'] = '=C1+8';
  sheet.cells['E1'] = '=D1/2';
  test.strictSame(sheet.values['D1'], 208);
  test.strictSame(sheet.values['E1'], 104);
  test.end();
});

we will receive RangeError: Maximum call stack size exceeded

Describe the solution you'd like

Solutions:

  • Log chain of calls and prevent this call
  • Catch and handle exception
@tshemsedinov tshemsedinov added the metarhia-s'22 Good for newcomers label Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
metarhia-s'22 Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant