Skip to content
Browse files

Replace calls to goog.define with assignments to the result of goog.d…


Background: To support goog.define within modules, it will soon stop exporting the named variable on the global object. In preparation for this, we need to manually export the names instead. This is effectively performing the rewriting that the compiler was already doing in RewriteClosurePrimitives.

Nonqualified names that are never mutated have been made into module locals for production code and globals for test code.  This is consistent with production code being most likely to work compiled (where the compiler rewrites them to locals) and test code being most likely to work uncompiled (where Closure Library makes them global).

This change was generated by http://cs/experimental/users/sdh/util/googdef. See go/lsc-goog-define for more details.

    TAP train for global presubmit queue
PiperOrigin-RevId: 243685812
  • Loading branch information...
shicks authored and Copybara-Service committed Apr 15, 2019
1 parent d73b3a6 commit 9a95fdcd9691187ab10b92c9ed8b613e960f762b
Showing with 13 additions and 10 deletions.
  1. +13 −10 jre/java/java/lang/jre.js
@@ -20,30 +20,33 @@

/** @define {string} */
goog.define('jre.classMetadata', 'SIMPLE');
jre.classMetadata = goog.define('jre.classMetadata', 'SIMPLE');
/** @define {string} */
goog.define('jre.checkedMode', goog.DEBUG ? 'ENABLED' : 'DISABLED');
jre.checkedMode =
goog.define('jre.checkedMode', goog.DEBUG ? 'ENABLED' : 'DISABLED');


/** @define {string} */
goog.define('jre.checks.checkLevel', 'NORMAL');
jre.checks.checkLevel = goog.define('jre.checks.checkLevel', 'NORMAL');
/** @define {string} */
goog.define('jre.checks.bounds', 'AUTO');
jre.checks.bounds = goog.define('jre.checks.bounds', 'AUTO');
/** @define {string} */
goog.define('jre.checks.api', 'AUTO');
jre.checks.api = goog.define('jre.checks.api', 'AUTO');
/** @define {string} */
goog.define('jre.checks.numeric', 'AUTO');
jre.checks.numeric = goog.define('jre.checks.numeric', 'AUTO');
/** @define {string} */
goog.define('jre.checks.type', 'AUTO');
jre.checks.type = goog.define('jre.checks.type', 'AUTO');
/** @define {string} */
goog.define('jre.checks.critical', 'AUTO');
jre.checks.critical = goog.define('jre.checks.critical', 'AUTO');


/** @define {string} */
goog.define('jre.logging.logLevel', goog.DEBUG ? 'ALL' : 'SEVERE');
jre.logging.logLevel =
goog.define('jre.logging.logLevel', goog.DEBUG ? 'ALL' : 'SEVERE');
/** @define {string} */
goog.define('jre.logging.simpleConsoleHandler', "ENABLED");
jre.logging.simpleConsoleHandler =
goog.define('jre.logging.simpleConsoleHandler', 'ENABLED');

0 comments on commit 9a95fdc

Please sign in to comment.
You can’t perform that action at this time.