Is this a platform bug? Or a simulator bug?


#1

Had a value error in a function call. Pared down the function call to the absolute bare minimum, and added a logging statement. Noticed that my call was being run in an infinite loop. The code that calls the function simply doesn’t do that; it spins through a series of a handful of saved values, and calls this function to produce option tags and some values added for population in a drop down. It is, literally, impossible for this function to be called on an infinite loop given it’s DEFINITELY using a finite iterator. In short…

var ddTypes = [ “one”, “two”, “three” ];
for( var i=0; i<ddTypes.length; i++ ){
var html = callFunc( ddTypes[i] );
// append html to dropdown
}

That’s the basic gist of things. Finite loop is the key here.

Anyway, I added a logging message, and noticed my function was being called infinitely until the app crashed.

My logging message:

forge.loggin.warning( "Danio: " + danio.did + " // " + theSelectedOne );

The fact that I spelled logging wrong (note above: loggin) is what CAUSED the infinite loop. It’s as if the app is saying:
while( true ){
that didn’t work, let me try that function again
}

So… is that some sort of bug in what Trigger/Forge is doing? Or is that a simulator or underlying javascript interpreter bug?

I can reproduce it at will with just trying to do something with an undefined or poorly declared object. It only seems to be a thing on undefined object variables. Nulls don’t seem to cause it, nor do value types (ints, etc). So it seems.

This makes debugging a real bitch.


#2

Correction: i can absolutely reproduce it with nulls. Fixing the logging line above fixes the problem, but setting the danio object to null immediately before calling it reproduces this error 100% of the time.


#3

Update, Seems to only happen on UIWebView, but WKWebView renders like complete and utter poo.


#5

So… anyone else? I can’t be the only person having this issue. Can I?