Skip to content

Commit

Permalink
Remove extra assignment to gwtOnLoad (#10061)
Browse files Browse the repository at this point in the history
Only saves about 10 bytes per GWT application, but the extra assignment
appears to serve no purpose. Also corrects some slightly inaccurate
comments about how initialization behaves.

Fixes #10060
  • Loading branch information
niloc132 authored Jan 16, 2025
1 parent 373a338 commit 843f62a
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1962,10 +1962,10 @@ private void markPosition(String name, Type type) {
* source loading and runs in the global scope (not inside of any function scope).
*/
private void setupGwtOnLoad() {
/**
/*
* <pre>
* var $entry = Impl.registerEntry();
* var gwtOnLoad = ModuleUtils.gwtOnLoad();
* var $entry = ModuleUtils.registerEntry();
* var gwtOnLoad = ModuleUtils.gwtOnLoad;
* ModuleUtils.addInitFunctions(init1, init2,...)
* </pre>
*/
Expand All @@ -1980,8 +1980,8 @@ private void setupGwtOnLoad() {
// var gwtOnLoad = ModuleUtils.gwtOnLoad;
JsName gwtOnLoad = topScope.findExistingUnobfuscatableName("gwtOnLoad");
JsVar varGwtOnLoad = new JsVar(sourceInfo, gwtOnLoad);
varGwtOnLoad.setInitExpr(createAssignment(gwtOnLoad.makeRef(sourceInfo),
getIndexedMethodJsName(RuntimeConstants.MODULE_UTILS_GWT_ON_LOAD).makeRef(sourceInfo)));
varGwtOnLoad.setInitExpr(
getIndexedMethodJsName(RuntimeConstants.MODULE_UTILS_GWT_ON_LOAD).makeRef(sourceInfo));
getGlobalStatements().add(new JsVars(sourceInfo, varGwtOnLoad));

// ModuleUtils.addInitFunctions(init1, init2,...)
Expand Down

0 comments on commit 843f62a

Please sign in to comment.