Summary: Functionality to 'crsh' when certain conditions are met.

Function Summary
crsh Present an error message in an alert box, and also redisplay the provided error message to screen, on a new web page, surrounded by H1 tags.
ciMissing Basic Crash if a required parameter is provided.
cibBoolStr Intended for utility.js. Crash if the provided BooleanString is undefined or bogus.
cibAFLS Intended for fl_stats.js. Crash if the provided array of FLStats is bogus. Otherwise do nothing..
ciNotFLStats Intended for fl_stats.js. Crash if the provided variable is FLStats is bogus. Otherwise do nothing..
cibRA Intended for util_array.js. Crash if the provided array is bad.


crash_if.js: Overview

Functionality to 'crsh' when certain conditions are met.

All 'crash-if' functionality is grouped into this single file, to facilitate compression. For...

Public variables







TOP     crash_if.crsh()

Present an error message in an alert box, and also redisplay the provided error message to screen, on a new web page, surrounded by H1 tags.

This function is intended for fatal programming errors, not users-put-a-bad-value-in-the-form errors.

PARAMETERS

Actions taken by this function, in order

  1. If bCRSH_ALRT equals true, then an alert box is displayed with s_callingFuncAndError
  2. If bCRSH_DGNSTCS equals true, then you are redirected to a 'new' page, in which s_callingFuncAndError, along with a boat-load of diagnostics, are prominently displayed. Although execution is not truly interrupted, this should be significant enough to alert the programmer to an error. I'm notincing that redisplay is not 100% consistent when Venkman (the JavaScript Debugger) is installed.
  3. If bCRSH_THROW is true, then
         throw "DEVELOPER ERROR (code=' + s_code + ') in ' + s_callingFuncAndError

    When false, after the initial error is displayed, unpredictable behavior should be expected.

FOR EXAMPLE

Take this code...

function theCallingFunction()  {
    theFunctionItself(8, 27, undefined, "Here's a string parameter.");
}

function theFunctionItself(i_1, i_2, v_ariable, s_tring)  {
    crsh("tfi1", theFunctionItself, "theFunctionItself:  You really shouldn't do that!  :'  (");
}

...run theCallingFunction()...

...and you'll get this alert() box (if bCRSH_ALRT is true)...

...and this diagnostics page (if bCRSH_DGNSTCS is true).

The error I'm getting makes no sense! Some tips...

SIGNATURE

crsh(s_code, f_unc, s_callingFuncAndError)





TOP     crash_if.ciMissing()

Basic Crash if a required parameter is provided.

When the parameter is provided, do nothing.

PARAMETERS

SIGNATURE

ciMissing(f_calling, s_callingFileFunc, s_varName, v_required)





TOP     crash_if.cibBoolStr()

Intended for utility.js. Crash if the provided BooleanString is undefined or bogus.

When the BooleanString is provided and valid, do nothing.

A BooleanString is considerd valid (good) when it is both defined and a string equal to 'true' or 'false'.

PARAMETERS

SIGNATURE

cibBoolStr(s_callingFunc, s_bsName, bs_shouldBe)





TOP     crash_if.cibAFLS()

Intended for fl_stats.js. Crash if the provided array of FLStats is bogus. Otherwise do nothing..

'Good' is defined as not bad and that every element is an FLStats.

PARAMETERS

SIGNATURE

cibAFLS(s_callingFunc, s_aosName, a_flStats)





TOP     crash_if.ciNotFLStats()

Intended for fl_stats.js. Crash if the provided variable is FLStats is bogus. Otherwise do nothing..

'Good' is defined as

!(!df(v_shouldBeFLS.type)  ||
            v_shouldBeFLS.type != "FLStats")
.

PARAMETERS

SIGNATURE

ciNotFLStats(s_callingFunc, s_flsName, v_shouldBeFLS)





TOP     crash_if.cibRA()

Intended for util_array.js. Crash if the provided array is bad.

A 'bad' array...

PARAMETERS

SIGNATURE

cibRA(s_callingFunc, s_arrayNm, a_rray)





























___RPLC___ vfjs_doc_footer ___RPLCZ___