Skip to content

Instantly share code, notes, and snippets.

@dekz
Created January 7, 2010 11:43
Show Gist options
  • Save dekz/271184 to your computer and use it in GitHub Desktop.
Save dekz/271184 to your computer and use it in GitHub Desktop.
function assert(code) {
if (typeof(code) === "string") {
if (!eval(code)) {
log("ASSERT FAILURE: '" + code + "'");
return false;
}
} else {
log("Assert failed: need string");
return false;
}
log(code + " passed");
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment