davidchambers/Base64.js — pull request #9 by davidchambers (2013-10-05 00:38:26+00:00)
Title: handle errors consistently

Currently, document.createElement is used in an attempt to generate an error similar to those thrown by native implementations of window.btoa and window.atob, throwing a ReferenceError in non-browser environments.

This commit adds and makes use of an InvalidCharacterError constructor for environment-independent handling of errors.