I found what looks like a bug in the FileReader typedefs:

The following in fileapi.js:

/**
 * @param {boolean=} opt_useCapture
 * @override
 * @return {undefined}
 */
FileReader.prototype.addEventListener = function(type, listener, opt_useCapture)
    {};

/**
 * @param {boolean=} opt_useCapture
 * @override
 * @return {undefined}
 */
FileReader.prototype.removeEventListener = function(type, listener,
    opt_useCapture) {};

compiles to this in FileReader.as:

    /**
     * @param opt_useCapture [(boolean|undefined)] 
     * @see [fileapi]
     * @returns {undefined} 
     */
    public function addEventListener(type:String, listener:Object, 
useCapture:Boolean):Object /* undefined */ {  return null; }

    /**
     * @param opt_useCapture [(boolean|undefined)] 
     * @see [fileapi]
     * @returns {undefined} 
     */
    public function removeEventListener(type:String, listener:Object, 
useCapture:Boolean):Object /* undefined */ {  return null; }

The result is wrong because the third parameter is supposed to be optional. The 
thing is, I don’t understand how we ended up with the output we did. The 
parameter was renames and retyped…

Harbs

Reply via email to