Skip to content

Commit 67dd0bf

Browse files
msamuelmikesamuel
msamuel
authored andcommitted
Fix non-debug standalone version of polymer-resin.
JSCompiler was not seeing the export symbol calls because they were in a MOE:insert comment when JSCompiler ran. That resulted in an open-source polymer-resin/standalone/polymer-resin.js that consisted solely of a function wrapper around a copyright header. 3e119dd#diff-22b137e7d8e727980f9f215f6d593dfd That was stupid of me. Changed polymer-resin.js to use a goog.define instead. Tested: Ran package tests and visually checked the generated JS. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158983112
1 parent 42b78e5 commit 67dd0bf

File tree

3 files changed

+34
-5
lines changed

3 files changed

+34
-5
lines changed

polymer-resin.js

+14-3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ goog.require('security.polymer_resin.CustomElementClassification');
3939
goog.require('security.polymer_resin.classifyElement');
4040
goog.require('security.polymer_resin.hintUsesDeprecatedRegisterElement');
4141

42+
/**
43+
* @define {boolean} whether bundled with its dependencies while
44+
* exporting its public API.
45+
*/
46+
goog.define('security.polymer_resin.STANDALONE', false);
4247

4348
/**
4449
* Type for a configuration object that can be passed to install.
@@ -219,9 +224,15 @@ security.polymer_resin.setReportHandler_ = function (reportHandler) {
219224

220225

221226

222-
goog.exportSymbol(
223-
'security.polymer_resin.install',
224-
security.polymer_resin.install);
227+
if (security.polymer_resin.STANDALONE) {
228+
goog.exportSymbol(
229+
'security.polymer_resin.install',
230+
security.polymer_resin.install);
231+
232+
goog.exportSymbol(
233+
'security.polymer_resin.CONSOLE_LOGGING_REPORT_HANDLER',
234+
security.polymer_resin.CONSOLE_LOGGING_REPORT_HANDLER);
235+
}
225236

226237

227238
/**

standalone/polymer-resin-debug.js

+2
Original file line numberDiff line numberDiff line change
@@ -2954,6 +2954,7 @@ security.polymer_resin.classifyElement = function(name, ctor) {
29542954
}
29552955
return customElementsRegistry && customElementsRegistry.get(name) || security.polymer_resin.docRegisteredElements_[name] === security.polymer_resin.docRegisteredElements_ ? security.polymer_resin.CustomElementClassification.CUSTOM : ctor === HTMLUnknownElement ? security.polymer_resin.CustomElementClassification.LEGACY : ctor === HTMLElement && security.polymer_resin.VALID_CUSTOM_ELEMENT_NAME_REGEX_.test(name) ? security.polymer_resin.CustomElementClassification.CUSTOMIZABLE : security.polymer_resin.CustomElementClassification.BUILTIN;
29562956
};
2957+
security.polymer_resin.STANDALONE = !0;
29572958
security.polymer_resin.CONSOLE_LOGGING_REPORT_HANDLER = function(isViolation, formatString, var_args) {
29582959
for (var consoleArgs = [formatString], i = 2, n = arguments.length; i < n; ++i) {
29592960
consoleArgs[i - 1] = arguments[i];
@@ -2969,6 +2970,7 @@ security.polymer_resin.allowIdentifierWithPrefix_ = function(prefix) {
29692970
security.polymer_resin.setReportHandler_ = function(reportHandler) {
29702971
security.polymer_resin.reportHandler_ = reportHandler || null;
29712972
};
2973+
security.polymer_resin.STANDALONE && (goog.exportSymbol("security.polymer_resin.install", security.polymer_resin.install), goog.exportSymbol("security.polymer_resin.CONSOLE_LOGGING_REPORT_HANDLER", security.polymer_resin.CONSOLE_LOGGING_REPORT_HANDLER));
29722974
security.polymer_resin.allowedIdentifierPattern_ = /^$/;
29732975
security.polymer_resin.allowUnsafeValues_ = !1;
29742976
security.polymer_resin.reportHandler_ = void 0;

standalone/polymer-resin.js

+18-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)