Skip to content

Instantly share code, notes, and snippets.

@unscriptable
Created April 7, 2010 01:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unscriptable/358373 to your computer and use it in GitHub Desktop.
Save unscriptable/358373 to your computer and use it in GitHub Desktop.
$.each(itemList, function (which) {
// if dev passed an array
if ($.isArray(itemList))
// use the 2nd arg as item name (1st arg is array index)
which = arguments[1];
// check if we've already initialized this item
var already = doneMap[which];
if (!already)
var itemInit = ctrlr._getItemInit(which);
if (itemInit)
// execute initializer
try {
itemInit.call(ctrlr, root, doneMap);
}
catch (ex) {
debug('FAIL! It\'s f**kin missing, you twit:' + itemInit + ' I CRASHED! ', which, ex);
}
else if (!already)
debug('FAIL! I duzznt know what that is: ' + itemInit, which);
// mark this item as initialized
doneMap[which] = true;
});
@unscriptable
Copy link
Author

Here's a close facsimile of the javascript that jslint puked on. For a full discussion please visit http://unscriptable.com/index.php/2010/04/06/jslint-puked-on-my-javascript/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment