I have a large JS application with which I use Closure. I also use the PrototypeJS library, so for my
compilation I have a custom externs.js file, select externs from the Closure sources, and the
--use_only_custom_externs option. Also using advanced optimizations.
The first JS file in my application is "base.js" which contains some utilities used throughout the
application. Currently I'm attempting to compile just the "base.js" and another file for use elsewhere on the
site, and Closure is throwing "Property xxx never defined on yyy" warnings that I don't see when compiling the
entire application. I'm including the same externs.
It does this with v20130823 and v20131118 but not v20121212. (This is not an exhaustive bisect, just the
versions I happen to have on hand.)
Why would I get different warnings when compiling a subset of a larger application?
The warning:
base.js:510: WARNING - Property onFailure never defined on Ajax.Base.prototype.options
(request.options.onTimeout || request.options.onFailure || Prototype.emptyFunction)(response, response.headerJSON);
Relevant lines from externs.js:
var Ajax = {};
/** @constructor */
Ajax.Base = function(){};
/** @type {Object} */
Ajax.Base.prototype.options;
/** @type {function(Ajax.Response, Object)|undefined} */
Ajax.Base.prototype.options.onFailure;
(Incidentally, I don't use Ajax in the two-file subset I'm attempting to compile.)