thanhlong203 / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

Missing includes in goog/events/events.js and goog/net/xhrio.js #335

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm building with ADVANCED_OPTIMIZATIONS and verbose warnings, using svn/trunk 
r1000 (most recent as of today).

I see four warnings that appear to be caused by missing goog.require() 
statements:

closure-library/closure/goog/events/events.js:875: WARNING - Bad type 
annotation. Unknown type goog.debug.ErrorHandler
 * @param {goog.debug.ErrorHandler} errorHandler Error handler with which to
                                  ^

closure-library/closure/goog/net/xhrio.js:208: WARNING - Bad type annotation. 
Unknown type goog.debug.ErrorHandler
 * @param {goog.debug.ErrorHandler} errorHandler Error handler with which to
                                  ^

closure-library/closure/goog/net/xhrmanager.js:507: WARNING - Bad type 
annotation. Unknown type goog.net.XhrLite
   * @type {goog.net.XhrLite}
                            ^

closure-library/closure/goog/net/xhrmanager.js:509: WARNING - Bad type 
annotation. Unknown type goog.net.XhrLite
  this.xhrLite = /** @type {goog.net.XhrLite} */ (xhrIo);
                                            ^

Original issue reported on code.google.com by kient...@catch.com on 4 Jun 2011 at 1:44

GoogleCodeExporter commented 8 years ago
If I remember well, the solution is to compile deps.js into the binary. It 
forward declares these types.

Original comment by pall...@gmail.com on 4 Jun 2011 at 7:34

GoogleCodeExporter commented 8 years ago
http://code.google.com/p/closure-library/wiki/FrequentlyAskedQuestions#When_I_co
mpile_with_type-checking_on,_I_get_warnings_about_unkno

Original comment by Nicholas.J.Santos on 4 Jun 2011 at 8:13

GoogleCodeExporter commented 8 years ago
How does one do this?

The closurebuilder examples don't show deps.js being used in the compile:

http://code.google.com/closure/library/docs/closurebuilder.html

I got this working with calcdeps.py but I'm trying to update to use
closurebuilder.py and it seems to handle this differently somehow.

Tim

Original comment by kient...@catch.com on 9 Jun 2011 at 8:02

GoogleCodeExporter commented 8 years ago
i'm not sure. Nathan, is there a way for closurebuilder to include deps.js by 
default?

Original comment by Nicholas.J.Santos on 9 Jun 2011 at 10:11

GoogleCodeExporter commented 8 years ago
I did finally figure out the necessary magic for use with closurebuilder.py:

        --compiler_flags "--js=closure-library/closure/goog/deps.js"

Adding this to the closurebuilder documentation on code.google.com
would be a step in the right direction.

Tim

Original comment by kient...@catch.com on 10 Jun 2011 at 4:52