dimanche 4 janvier 2015

Closure Compiler warning for FileReader and Blob - cannot fix it


I run the following through Closure Compiler with advanced optimizations:



/** @param{Blob} a_blob */
function test(a_blob){
/**@type{FileReader} */var filereader = new FileReader();
filereader.onload = function(e){};
filereader.readAsArrayBuffer(a_blob);
}


and I get:



WARNING - actual parameter 1 of FileReader.prototype.readAsArrayBuffer does not match formal parameter
found : (Blob|null)
required: Blob
filereader.readAsArrayBuffer(a_blob);
^


What can I do to fix this? Is this a bug in CC?





Aucun commentaire:

Enregistrer un commentaire