google-closure-compilergoogle-closure-libraryplovr

plovr warning on new closure <constructor>.base()


I checked out the latest plovr and added closure to my project using bower. while compiling the code with closure-compiler.jar in advanced_compilation works without any error or warning, using plovr gives the following errors:

/closure/goog/ui/buttonrenderer.js:107: WARNING - goog.ui.ButtonRenderer.base is never defined
var element = goog.ui.ButtonRenderer.base(this, 'createDom', button);
^
/closure/goog/ui/menu.js:425: WARNING - goog.ui.Menu.base is never defined
var handled = goog.ui.Menu.base(this, 'handleKeyEventInternal', e);
^
/closure/goog/ui/menu.js:447: WARNING - goog.ui.Menu.base is never defined
goog.ui.Menu.base(this, 'setHighlightedIndex', index);
^
/closure/goog/ui/select.js:61: WARNING - goog.ui.Select.base is never defined
goog.ui.Select.base(this, 'constructor',
^
/closure/goog/ui/select.js:142: WARNING - goog.ui.Select.base is never defined
goog.ui.Select.base(this, 'handleMenuAction', e);
^

I have set closure library in config.js using

"closure-library": "bower_components/closure-library/closure/goog/",

is there a way to solve this?


Solution

  • This is a mismatch that is bound to happen when an updated Library is used along with a stale Compiler release (Plovr is known to get behind compiler releases). These particular warnings are about .base not being supported by the Compiler release bundled with Plovr. .base was introduced as an alternative to goog.base and the superClass_ property to comply with ES5 strict when expressing inheritance (no poking arguments.callee).

    Here are a few options: