google / google/closure-compiler

@export on a Polymer method just adds the method to "Object.prototype"

Open
#2,669 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.