PolymerElements / iron-overlay-behavior

Makes an element an overlay with an optional backdrop
41 stars 71 forks source link

Closure Compiler issue with 3.0 preview #268

Open RebeccaStevens opened 6 years ago

RebeccaStevens commented 6 years ago

When using the Closure Compiler with the 3.0 preview version of this element, Constant reassigned errors occur:

stdin:25174: ERROR - Constant reassigned: _lockedElementCache
  _lockedElementCache = [];
  ^^^^^^^^^^^^^^^^^^^

stdin:25175: ERROR - Constant reassigned: _unlockedElementCache
  _unlockedElementCache = [];
  ^^^^^^^^^^^^^^^^^^^^^

version: @polymer/iron-overlay-behavior#3.0.0-pre.10

Lines at fault

https://github.com/PolymerElements/iron-overlay-behavior/blob/1cbc71fce4d7c6e32b445e8f350b9d507904b363/iron-scroll-manager.js#L102-L103

If I change the lines above to use let instead of const, the compiler no longer complains.

RebeccaStevens commented 6 years ago

Related #267

valdrinkoshi commented 6 years ago

Looks like polymer-modulizer always converts object properties to const variables - @aomarks @FredKSchott could you take a look?