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

Maximum stack size error not thrown from within special functions #749

Open
lewisevan opened this issue May 30, 2021 · 0 comments
Open

Maximum stack size error not thrown from within special functions #749

lewisevan opened this issue May 30, 2021 · 0 comments

Comments

@lewisevan
Copy link

Original report from Larry Serflaten: https://support.khanacademy.org/hc/en-us/community/posts/360078034731-Bug-Report-Programming-environment-Maximum-stack-size-NOT-exceeded

A recursive runaway function that will normally error when entered directly, does not error when enclosed in an environment supplied ('special') function. Example code:

mouseClicked = function(){
   var z = 0;
   fill(0);

   var stackKiller = function(){
       background(255);
       text(z++, 20, 20);
       stackKiller();  // recursive error
   };

   // kaboom!
   stackKiller();
};

Clicking on the mouse in that program should produce an error, but does not (currently).

If you move the above mouseClicked code to outside of the mouseClicked function, the expected 'maximum stack size exceeded' error will be reported. This seems to be true for all environment functions except the draw function which does report the error. MouseClicked, mousePressed, mouseDragged, keyPressed, were all tested and exhibited this same behavior.

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