function scheduleUpdateTiledImageBounds(whichImage, forceExecution) {
        var tiledImageBoundsUpdatesNum = tiledImageBoundsUpdatesNums[whichImage];

        if (tiledImageBoundsUpdatesNum === 0 ||
            (forceExecution && tiledImageBoundsUpdatesNum === 1)) {
            // no other instance of this function was dispatched on tiledImage
            if (!forceExecution) { // otherwise counter already increased
                tiledImageBoundsUpdatesNums[whichImage]++;
            }
            setTimeout(updateTiledImageBounds, 0, whichImage, true); // invoke asynchronously
        } else if (tiledImageBoundsUpdatesNum === 1) {
            // one function instance was dispatched on tiledImage, trying in a moment
            tiledImageBoundsUpdatesNums[whichImage]++;
            setTimeout(scheduleUpdateTiledImageBounds, 100, whichImage, true);
        }
        /* else {} // one function instance already waits, no need for a new one */
    }
/**
     * <p>Schedules the <code>updateTiledImageBounds</code> function on the <code>tiledImage</code> with index
     * <code>whichImage</code>. The whole idea behind this function is to not allow more than one invocation of
     * <code>updateTiledImageBounds</code> to wait on <code>setTimeout</code>s; it increases performance on weaker
     * computers.
     *
     * <p>If the <code>tiledImageBoundsUpdatesNums[whichImage]</code> value is:
     * <ul>
     *     <li><code>0</code> (or <code>1</code> if <code>forceExecution</code> is true), then we invoke the
     *         <code>updateTiledImageBounds</code> asynchronously.</li>
     *     <li><code>1</code>, then we wait a short time before trying again.</li>
     *     <li><code>>=2</code>, then we abort since one other instance is already waiting.</li>
     * </ul>
     * If the flag <code>forceExecution</code> is true, we invoke <code>updateTiledImageBounds</code>
     * if only <code>tiledImageBoundsUpdatesNums[whichImage] < 2</code>. This is necessary
     * because when counter increases by 1, the invocation which triggered the increase waits on
     * <code>setTimeout</code> and needs to be invoked when it remains the only waiting instance.
     *
     * @param {number} whichImage  Image index of <code>tiledImage</code> in <code>this.tiledImages</code> table.
     * @param {boolean} [forceExecution=false]
     * @private
     */
Schedules the updateTiledImageBounds function on the tiledImage with index
whichImage. The whole idea behind this function is to not allow more than one invocation of
updateTiledImageBounds to wait on setTimeouts; it increases performance on weaker
computers.

If the tiledImageBoundsUpdatesNums[whichImage] value is:

0 (or 1 if forceExecution is true), then we invoke the
updateTiledImageBounds asynchronously.
1, then we wait a short time before trying again.
>=2, then we abort since one other instance is already waiting.

If the flag forceExecution is true, we invoke updateTiledImageBounds
if only tiledImageBoundsUpdatesNums[whichImage] < 2. This is necessary
because when counter increases by 1, the invocation which triggered the increase waits on
setTimeout and needs to be invoked when it remains the only waiting instance.

@param {number} whichImage  Image index of tiledImage in this.tiledImages table.
@param {boolean} [forceExecution=false]
@private
Schedules the updateTiledImageBounds function on the tiledImage with index whichImage . The whole idea behind this function is to not allow more than one invocation of updateTiledImageBounds to wait on setTimeouts ; it increases performance on weaker computers . If the tiledImageBoundsUpdatesNums [ whichImage ] value is : 0 ( or 1 if forceExecution is true ) then we invoke the updateTiledImageBounds asynchronously . 1 then we wait a short time before trying again . > = 2 then we abort since one other instance is already waiting . If the flag forceExecution is true we invoke updateTiledImageBounds if only tiledImageBoundsUpdatesNums [ whichImage ] < 2 . This is necessary because when counter increases by 1 the invocation which triggered the increase waits on setTimeout and needs to be invoked when it remains the only waiting instance . @param { number } whichImage Image index of tiledImage in this . tiledImages table . @param { boolean } [ forceExecution = false ] @private
function scheduleUpdateTiledImageBounds(whichImage, forceExecution) {
        var tiledImageBoundsUpdatesNum = tiledImageBoundsUpdatesNums[whichImage];
        if (tiledImageBoundsUpdatesNum === 0 ||
            (forceExecution && tiledImageBoundsUpdatesNum === 1)) {
            if (!forceExecution) { 
                tiledImageBoundsUpdatesNums[whichImage]++;
            }
            setTimeout(updateTiledImageBounds, 0, whichImage, true); 
        } else if (tiledImageBoundsUpdatesNum === 1) {
            tiledImageBoundsUpdatesNums[whichImage]++;
            setTimeout(scheduleUpdateTiledImageBounds, 100, whichImage, true);
        }
    }
function scheduleUpdateTiledImageBounds ( whichImage , forceExecution ) { var tiledImageBoundsUpdatesNum = tiledImageBoundsUpdatesNums [ whichImage ] ; if ( tiledImageBoundsUpdatesNum === 0 || ( forceExecution && tiledImageBoundsUpdatesNum === 1 ) ) { if ( ! forceExecution ) { tiledImageBoundsUpdatesNums [ whichImage ] ++ ; } setTimeout ( updateTiledImageBounds , 0 , whichImage , true ) ; } else if ( tiledImageBoundsUpdatesNum === 1 ) { tiledImageBoundsUpdatesNums [ whichImage ] ++ ; setTimeout ( scheduleUpdateTiledImageBounds , 100 , whichImage , true ) ; } }
<p>Schedules the <code>updateTiledImageBounds</code> function on the <code>tiledImage</code> with index
 <code>whichImage</code>.
<p > Schedules the <code > updateTiledImageBounds< / code > function on the <code > tiledImage< / code > with index <code > whichImage< / code > .
// no other instance of this function was dispatched on tiledImage // otherwise counter already increased // invoke asynchronously // one function instance was dispatched on tiledImage, trying in a moment /* else {} // one function instance already waits, no need for a new one */