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
: OverviewFunctionality to 'crsh' when certain conditions are met.
All 'crash-if' functionality is grouped into this single file, to facilitate compression. For...
bCRSH_ALRT
: Assumed to equal either true
or false
. See crsh() for how this is used.bCRSH_DGNSTCS
: Assumed to equal either true
or false
. See crsh() for how this is used.bCRSH_THROW
: Assumed to equal either true
or false
. See crsh() for how this is used.
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.
s_code
: Code that should help you identify the specific error. REQUIRED, and may not equal 0 or empty string.f_unc
: A reference to the function in which the error is occurring. There are differences between browsers which may or may not print out all the desired f_unc attributes.s_callingFuncAndError
: The function name, followed by the error message.bCRSH_ALRT
equals true, then an alert box is displayed with s_callingFuncAndError
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.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.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).
document.writeln('<SCRIPT SRC...
) from a function being called in another tag's attribute. For example, body.onLoad
.<SCRIPT LANGUAGE=...>//<!--...--></SCRIPT>
) has an error, it's as if the entire block doesn't exist. Subsequent blocks may crash for bizarre reasons, because the code in the dependant block was never executed.crsh(s_code, f_unc, s_callingFuncAndError)
crash_if
.ciMissing()
Basic Crash if a required parameter is provided.
When the parameter is provided, do nothing.
f_calling
: The function object, calling this function. For potential error diagnostics only.s_callingFunc
: The function calling this one, for potential error messages only.s_variableName
: The name of bs_shouldBe, for potential error messages only.v_required
: The required variable analyzed for existence.ciMissing(f_calling, s_callingFileFunc, s_varName, v_required)
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
'.
s_callingFunc
: The function calling this one, for potential error messages only.s_bsName
: The name of bs_shouldBe, for potential error messages only.bs_shouldBe
: The variable analyzed for BooleanString-ness.cibBoolStr(s_callingFunc, s_bsName, bs_shouldBe)
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
.
s_callingFunc
: The function calling this one, for potential error messages only.s_aosName
: The name of a_flStats, for potential error messages only.a_flStats
: The required variable analyzed.cibAFLS(s_callingFunc, s_aosName, a_flStats)
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")
s_callingFunc
: The function calling this one, for potential error messages only.s_flsName
: The name of v_shouldBeFLS, for potential error messages only.v_shouldBeFLS
: The variable to be analyzed for FLStats-ness.ciNotFLStats(s_callingFunc, s_flsName, v_shouldBeFLS)
crash_if
.cibRA()
Intended for util_array.js
. Crash if the provided array is bad.
A 'bad' array...
s_callingFunc
: The function calling this, for potential error messages only.s_arrayNm
: The name of a_rray, for potential error messages only.a_rray
: The array to analyze.cibRA(s_callingFunc, s_arrayNm, a_rray)
___RPLC___ vfjs_doc_footer ___RPLCZ___