The following two snippets are located in the same function:
if (view.Blob && view.URL) {
try {
new Blob;
return;
} catch (e) {}
}
view.Blob = function Blob(blobParts, options) {
var type = options ? (options.type || "") : "";
var builder = new BlobBuilder();
if (blobParts) {
for (var i = 0, len = blobParts.length; i < len; i++) {
builder.append(blobParts[i]);
}
}
return builder.getBlob(type);
};
When run through a minification tool (I am using the latest YUI), the first function (which checks for the presence of Blob in the browser) is compressed as:
if(a.Blob&&a.URL){try{new d;return}catch(c){}}
This is correct minification, as further down the file, a named function "Blob" is defined in the local scope (and is minified to the name "d")
Because "new Blob" is minified as "new d", an error will occur regardless of the browser's Blob support, thereby overwriting it with the shim instead of using the native implementation.
You can run an online version of the YUI compressor here:
http://refresh-sf.com/yui/
To fix this issue, change:
view.Blob = function Blob(blobParts, options) {
to:
view.Blob = function (blobParts, options) {
I don't know if this will break anything else though. As far as I can tell it still works when you change this.