# Javascript class error - not all the time

**URL:** https://www.finalbuilder.com/forums/t/javascript-class-error-not-all-the-time/4697
**Category:** Bugs
**Created:** [September 1, 2015, 2:15am UTC](https://www.finalbuilder.com/forums/t/javascript-class-error-not-all-the-time/4697 "2015-09-01T02:15:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jonathanmeltzer](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jonathanmeltzer](https://www.finalbuilder.com/forums/u/jonathanmeltzer)
#### Post date: [September 1, 2015, 2:15am UTC](https://www.finalbuilder.com/forums/t/javascript-class-error-not-all-the-time/4697/1 "2015-09-01T02:15:47Z")

</div>

I have a While loop that has as its syntax (Javascript):  
  
(failedCount \< 5) && (actionSuccess == ‘FALSE’)  
  
It runs an action list in the loop, and if the action list succeeds then actionSuccess is marked TRUE. &nbsp;If it does not succeed, then failedCount is increased by one. &nbsp;This makes sure that the action list is tried a maximum of 5 times before moving on. &nbsp;Almost all the time, this logic works without a hitch. &nbsp;Every once in a while, though, the While Loop fails and I get an error message stating:  
  
Error In Execute Condition (JavaScript) While Loop [&nbsp;(failedCount \< 5) && (actionSuccess == ‘FALSE’)] : Invalid class string  
  
I have no idea what this means. &nbsp;I would think that if there was really a problem in the execute condition, it would happen every time, but it happens only once in many attempts. &nbsp;The loop is hit about 100 times in the project run, and it usually works without incident. &nbsp;Any ideas?

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [September 14, 2015, 4:43am UTC](https://www.finalbuilder.com/forums/t/javascript-class-error-not-all-the-time/4697/2 "2015-09-14T04:43:07Z")

</div>

Hi Jonathon   
  
 Apologies for taking so long to respond (FinalBuilder 8 has been taking up all our time). We’ve been discussing this error today and suspect this may be an out of memory issue… the error actually comes from windows when we attempt to instanciate a com object (the javascript engine), but it’s probably a misnomer. Automise 4 does have some issues with memory fragmentation which will be resolve in the upcoming Automise 5 release. FinalBuilder 7 also had the same issue and we resolved it in FinalBuilder 8 (unfortunately it was a huge change so cannot backport it).   
  
 If you are able to, please send your project file to [support@finalbuilder.com](mailto:support@finalbuilder.com) so we can take a look and see if we can replicate the error here, and see how it behaves in Automise 5 (still in development).

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [September 14, 2015, 4:53am UTC](https://www.finalbuilder.com/forums/t/javascript-class-error-not-all-the-time/4697/3 "2015-09-14T04:53:41Z")

</div>

BTW, I should have also said, the out of memory issue might not appear obvious, ie the machine might have plenty of memory, its more of a memory manager issue in Automise, where the memory manager is unable to allocate a contiguous block of memory (memory fragmentation). We have reworked a buch of the internals in FB8/AT5 to reduce this.

---

<div class="post-metadata">

### Author: ![jonathanmeltzer](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jonathanmeltzer](https://www.finalbuilder.com/forums/u/jonathanmeltzer)
#### Post date: [September 18, 2015, 5:31am UTC](https://www.finalbuilder.com/forums/t/javascript-class-error-not-all-the-time/4697/4 "2015-09-18T05:31:18Z")

</div>

I appreciate your looking into this. If/when it happens again, I will send the project to you. Strangely enough, it has been working fine of late.
