Infinite Recursion Loops In Javascript.

It would seem according to this article https://bugzilla.mozilla.org/show_bug.cgi?id=682793 that under certain conditions i.e. having Firebug (in this case) installed while traversing a page that contains an infinite recursion loop in Javascript has been problematic for Firefox since about 2011. I haven’t really looked into it but it may be one of these kinds of situations where it gets patched and then something changes and then it bugs out again which is common with all software. Anyway,that is neither here nor there but I have an example of an infinite recursion in Javascript.

Bugs are cool because it’s always the combination of one thing plus another thing and then maybe one more thing, that causes the issue. The unexpected.. it’s always usually 😉 the unexpected stuff where things get trippy. Here is a really good example of that (Firefox + Firebug + Infinite Recursion Loop in Javascript)

Here is the error that gets thrown.
InternalError: too much recursion

Here is an infinite recursion loop. It’s very simple. Create a function then as part of the function call the function again. It will cascade into a series of never ending function calls.

var Russell_Rockefeller = {
job: “unemployed software tester”,
married: true,
speak: function(mood) {
console.log(“Hello, I am feeling” + “” + russ.speak());
}
};

russ.speak(“great”);
russ.speak(“just okay”);
// borrowed and modified from codeacademy.com where I originally caused the problem.