Skip to content

Instantly share code, notes, and snippets.

@pmuellr
Created October 30, 2011 18:26
Show Gist options
  • Select an option

  • Save pmuellr/1326232 to your computer and use it in GitHub Desktop.

Select an option

Save pmuellr/1326232 to your computer and use it in GitHub Desktop.
generate a runtime error when something is clicked
button.addEventListener("click", function buttonClicked() {
willThrowError()
})
function willThrowError() {
throwsError()
}
function throwsError() {
x = null
x.doSomething() // this will throw an exception
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment