compile errors in library

51 views
Skip to first unread message

ghosttie

unread,
Oct 29, 2018, 10:18:23 PM10/29/18
to Closure Library Discuss
I updated the closure library and compiler for the first time in a couple years and I'm getting a bunch of compile errors in the library:

closure-library/closure/goog/events/browserevent.js:280: ERROR - Property changedTouches never defined on Event
  var relevantTouch = e.changedTouches ? e.changedTouches[0] : null;
                        ^^^^^^^^^^^^^^

closure-library/closure/goog/events/browserevent.js:332: ERROR - Property key never defined on Event
  this.key = e.key || '';
               ^^^

closure-library/closure/goog/events/browserevent.js:339: ERROR - Property pointerId never defined on Event
  this.pointerId = e.pointerId || 0;
                     ^^^^^^^^^

closure-library/closure/goog/events/browserevent.js:341: ERROR - Property state never defined on Event
  this.state = e.state;
                 ^^^^^

closure-library/closure/goog/events/browserevent.js:463: ERROR - Property pointerType never defined on Event
  if (goog.isString(e.pointerType)) {
                      ^^^^^^^^^^^

closure-library/closure/goog/events/events.js:253: ERROR - Property src never defined on Function
  proxy.src = src;
        ^^^

closure-library/closure/goog/events/events.js:254: ERROR - Property listener never defined on Function
  proxy.listener = listenerObj;
        ^^^^^^^^

closure-library/closure/goog/events/events.js:265: ERROR - Property attachEvent never defined on EventTarget
  } else if (src.attachEvent) {
                 ^^^^^^^^^^^

closure-library/closure/goog/events/events.js:271: ERROR - Property addListener never defined on EventTarget
  } else if (src.addListener && src.removeListener) {
                 ^^^^^^^^^^^

closure-library/closure/goog/events/events.js:271: ERROR - Property removeListener never defined on EventTarget
  } else if (src.addListener && src.removeListener) {
                                    ^^^^^^^^^^^^^^

closure-library/closure/goog/events/events.js:296: ERROR - Property src never defined on f
        return proxyCallbackFunction.call(f.src, f.listener, eventObject);
                                            ^^^

closure-library/closure/goog/events/events.js:296: ERROR - Property listener never defined on f
        return proxyCallbackFunction.call(f.src, f.listener, eventObject);
                                                   ^^^^^^^^

closure-library/closure/goog/events/events.js:298: ERROR - Property src never defined on f
        var v = proxyCallbackFunction.call(f.src, f.listener, eventObject);
                                             ^^^

closure-library/closure/goog/events/events.js:298: ERROR - Property listener never defined on f
        var v = proxyCallbackFunction.call(f.src, f.listener, eventObject);
                                                    ^^^^^^^^

closure-library/closure/goog/events/events.js:452: ERROR - Property removed never defined on goog.events.ListenableKey
  if (!listener || listener.removed) {
                            ^^^^^^^

closure-library/closure/goog/events/events.js:462: ERROR - Property proxy never defined on goog.events.ListenableKey
  var proxy = listener.proxy;
                       ^^^^^

closure-library/closure/goog/events/events.js:463: ERROR - Property removeEventListener never defined on Object
  if (src.removeEventListener) {
          ^^^^^^^^^^^^^^^^^^^

closure-library/closure/goog/events/events.js:465: ERROR - Property detachEvent never defined on Object
  } else if (src.detachEvent) {
                 ^^^^^^^^^^^

closure-library/closure/goog/events/events.js:467: ERROR - Property addListener never defined on Object
  } else if (src.addListener && src.removeListener) {
                 ^^^^^^^^^^^

closure-library/closure/goog/events/events.js:467: ERROR - Property removeListener never defined on Object
  } else if (src.addListener && src.removeListener) {
                                    ^^^^^^^^^^^^^^

closure-library/closure/goog/events/events.js:992: ERROR - Property handleEvent never defined on Object
      listener.handleEvent, 'An object listener must have handleEvent method.');
               ^^^^^^^^^^^

closure-library/closure/goog/i18n/datetimeformat.js:409: ERROR - Property ZERODIGIT never defined on Object
  if (dateTimeSymbols.ZERODIGIT === undefined ||
                      ^^^^^^^^^

closure-library/closure/goog/i18n/datetimeformat.js:419: ERROR - Property ZERODIGIT never defined on Object
            String.fromCharCode(dateTimeSymbols.ZERODIGIT + c - 0x30) :
                                                ^^^^^^^^^

closure-library/closure/goog/uri/uri.js:1091: ERROR - Class goog.structs.Map has been deprecated: This type is misleading: use ES6 Map instead.
    this.keyMap_ = new goog.structs.Map();
                       ^^^^^^^^^^^^^^^^

24 error(s), 0 warning(s), 98.6% typed
Press any key to continue . . .

My command line is

java -jar compiler.jar ^
closure-library ^
!**closure-deps/** ^
!**_test.js ^
!**_perf.js ^
!**tester.js ^
!**promise/testsuiteadapter.js ^
!**relativecommontests.js ^
!**osapi/osapi.js ^
!**svgpan/svgpan.js ^
!**alltests.js ^
!**node_modules**.js ^
!**protractor_spec.js ^
!**protractor.conf.js ^
!**browser_capabilities.js ^
!**generate_closure_unit_tests.js ^
!**doc/** ^
!**debug_loader_integration_tests/testdata/** ^
web ^
!web/index.js ^
--compilation_level=ADVANCED_OPTIMIZATIONS ^
--warning_level=VERBOSE ^
--jscomp_error=accessControls ^
--jscomp_error=checkEventfulObjectDisposal ^
--jscomp_error=checkRegExp ^
--jscomp_error=checkTypes ^
--jscomp_error=constantProperty ^
--jscomp_error=const ^
--jscomp_error=deprecatedAnnotations ^
--jscomp_error=deprecated ^
--jscomp_error=extraRequire ^
--jscomp_error=missingGetCssName ^
--jscomp_error=strictMissingProperties ^
--jscomp_error=missingProvide ^
--jscomp_error=missingRequire ^
--jscomp_error=missingReturn ^
--jscomp_error=strictModuleDepCheck ^
--jscomp_error=typeInvalidation ^
--jscomp_error=undefinedNames ^
--jscomp_error=visibility ^
--jscomp_error=tooManyTypeParams ^
--jscomp_error=strictCheckTypes ^
--externs=externs/google_visualization_api.js ^
--externs=externs/google_charts.js ^
--externs=externs/weather_api.js ^
--entry_point=goog:weather.Index ^
--hide_warnings_for=_closure-library ^
--summary_detail_level=3 ^
--create_source_map=web\source.map ^
--js_output_file=web\index.js ^
--generate_exports

ghosttie

unread,
Oct 30, 2018, 8:17:21 PM10/30/18
to Closure Library Discuss
I got it to work by removing 

--jscomp_error=deprecated 
--jscomp_error=strictMissingProperties
--jscomp_error=strictCheckTypes

is there a way to enable these checks for my code but not the closure library?

Hochhaus, Andy

unread,
Oct 30, 2018, 8:31:57 PM10/30/18
to closure-lib...@googlegroups.com
I use `--hide_warnings_for=<closure_path>`. Granted this disables all checks for the library but in practice this has not caused problems for us.

-Andy

ghosttie

unread,
Oct 30, 2018, 8:37:46 PM10/30/18
to Closure Library Discuss
I'm using that but I was promoting as many checks as possible to errors to ensure the best codebase, I guess I just won't do that for these checks

Hochhaus, Andy

unread,
Oct 30, 2018, 8:59:32 PM10/30/18
to closure-lib...@googlegroups.com
Strange. I also promote the checks to errors with `--jscomp_error` but `--hide_warnings_for` still silences them. Possibly something else is going on?

ghosttie

unread,
Nov 3, 2018, 4:43:01 PM11/3/18
to Closure Library Discuss
You're right it does hide promoted warnings too, I had a typo
Reply all
Reply to author
Forward
0 new messages