RangeError: Maximum call stack size exceeded.

For AI and campaign script related discussions and questions
Post Reply
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

RangeError: Maximum call stack size exceeded.

Post by aubergine »

Uhm, what have I broken?

Code: Select all

error   |02:44:50: [js_include:289] Uncaught exception at line 0, include file multiplay/skirmish/APIs/Test.js: RangeError: Maximum call stack size exceeded.
error   |02:44:50: [js_include:289] Uncaught exception at line 564, include file multiplay/skirmish/APIs/Test.js: RangeError: Maximum call stack size exceeded.
...
info    |02:44:50: [loadPlayerScript:428] Uncaught exception at line 564, file multiplay/skirmish/eggplant.js: RangeError: Maximum call stack size exceeded.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
vexed
Inactive
Inactive
Posts: 2538
Joined: 27 Jul 2010, 02:07

Re: RangeError: Maximum call stack size exceeded.

Post by vexed »

This smells like recursion to me.
/facepalm ...Grinch stole Warzone🙈🙉🙊 contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: RangeError: Maximum call stack size exceeded.

Post by aubergine »

Yup, and I have a rough idea of what's causing it -- but how do I track it down, eg. to a specific function, etc?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: RangeError: Maximum call stack size exceeded.

Post by aubergine »

Yup, it was indeed a recursive function. A routine that checked to see if a specific API was loaded, by checking to see if it was loaded, by checking to see if it was loaded... >universe implodes<
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Lord Apocalypse
Regular
Regular
Posts: 678
Joined: 29 Jul 2009, 18:01

Re: RangeError: Maximum call stack size exceeded.

Post by Lord Apocalypse »

:lol2: Maybe you should add a pause or tell it to implode the universe after x number of tries instead of being the never ending recursive loop
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: RangeError: Maximum call stack size exceeded.

Post by aubergine »

Well, at least it's not as bad as the time that I made a getter/setter property that returned the function that I created it with. It recursively recreated itself, which wouldn't have been so bad if it weren't for the fact that the getter/setter was designed to allow multiple functions to be nested in an event handler, so when the event fired the called function not only recursively recreated itself within itself, it also added itself to the list of functions to be called the result being an infinite multi-dimensional array of infinite multi-dimensional arrays.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Lord Apocalypse
Regular
Regular
Posts: 678
Joined: 29 Jul 2009, 18:01

Re: RangeError: Maximum call stack size exceeded.

Post by Lord Apocalypse »

:lol2: Doh! That sounds insane
Post Reply