Skip to content

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

Open
@lewisevan

Description

@lewisevan

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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