google / google/closure-compiler
@export on a Polymer method just adds the method to "Object.prototype"
Open
enhancement
P3
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
I noticed this while fixing a bug in GenerateExports: If you add `@export` to a method of a Polymer element that is defined in the Polymer 1 style (`Polymer({ method1() {} method2() {} })`) the compiler just adds that method to `Object.prototype` in the externs, rather than generating a `goog.exportSymbol` call. This means that other properties with the same name won't get renamed, so code size might suffer. If a Polymer project finds their code size is too big this is one place we might look. Until then, I'm guessing this is a relatively low-priority issue.
cc @rictic
Contributor guide
Assessment
This issue has not been assessed yet.