davidchambers/Base64.js — pull request #16 by davidchambers (2014-04-28 00:07:54+00:00)
Title: coerce input to string

Closes #14

Commit message:

> This is arguably undesirable behaviour, but this is what browsers do, and a polyfill should implement the missing feature as faithfully as possible.

In my limited testing, I found one discrepancy between browsers: `btoa(null)` in Safari gives the empty string, whereas other browsers I tried give the same result as `btoa('null')`. Other values (including undefined) *are* coerced in Safari; apparently only null receives special treatment.