Skip to content

Instantly share code, notes, and snippets.

@JamesMGreene
Last active March 31, 2017 15:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamesMGreene/8942085 to your computer and use it in GitHub Desktop.
Save JamesMGreene/8942085 to your computer and use it in GitHub Desktop.
HTML5 `window.onerror` enhancement: getting a reference to the actual `Error` object! Also, test suites for `onerror` and `ErrorEvent`.

Original Proposal

https://gist.github.com/JamesMGreene/3ded0f6e7f0a658b9394

Final Outcome

window.onerror = function(msg, url, lineno, colno, error) {
  // `window.onerror` handlers now have a 5th argument: the `Error` object itself (or `null`).
  // This can then be used to get stack info, error type/name, etc.
};

Indirectly related to this was the introduction of the ErrorEvent.

Final HTML spec commit(s)

Test Suites

Related Blog Posts

Discussion

2012

2012 May

  1. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-May/035732.html
  2. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-May/035737.html
  3. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-May/035738.html
  4. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-May/035761.html
  5. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-May/035777.html
  6. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-May/035781.html
  7. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-May/035782.html
  8. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-May/035783.html

2012 August

  1. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-August/036833.html
  2. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-August/036835.html

2012 November

  1. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-November/038156.html
  2. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-November/038170.html

2013

2013 February

  1. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-February/038847.html
  2. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-February/038848.html
  3. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-February/038849.html
  4. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-February/038850.html

2013 March

  1. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-March/039111.html

2013 July

  1. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-July/040019.html
  2. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-July/040032.html
  3. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-July/040053.html
  4. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-July/040054.html
  5. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-July/040033.html
  6. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-July/040035.html
  7. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-July/040041.html
  8. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-July/040223.html
  9. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-July/040225.html
  10. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-July/040226.html
  11. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-July/040260.html
  12. http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-July/040262.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment