Skip to content

Commit 843f62a

Browse files
authored
Remove extra assignment to gwtOnLoad (#10061)
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
1 parent 373a338 commit 843f62a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1962,10 +1962,10 @@ private void markPosition(String name, Type type) {
19621962
* source loading and runs in the global scope (not inside of any function scope).
19631963
*/
19641964
private void setupGwtOnLoad() {
1965-
/**
1965+
/*
19661966
* <pre>
1967-
* var $entry = Impl.registerEntry();
1968-
* var gwtOnLoad = ModuleUtils.gwtOnLoad();
1967+
* var $entry = ModuleUtils.registerEntry();
1968+
* var gwtOnLoad = ModuleUtils.gwtOnLoad;
19691969
* ModuleUtils.addInitFunctions(init1, init2,...)
19701970
* </pre>
19711971
*/
@@ -1980,8 +1980,8 @@ private void setupGwtOnLoad() {
19801980
// var gwtOnLoad = ModuleUtils.gwtOnLoad;
19811981
JsName gwtOnLoad = topScope.findExistingUnobfuscatableName("gwtOnLoad");
19821982
JsVar varGwtOnLoad = new JsVar(sourceInfo, gwtOnLoad);
1983-
varGwtOnLoad.setInitExpr(createAssignment(gwtOnLoad.makeRef(sourceInfo),
1984-
getIndexedMethodJsName(RuntimeConstants.MODULE_UTILS_GWT_ON_LOAD).makeRef(sourceInfo)));
1983+
varGwtOnLoad.setInitExpr(
1984+
getIndexedMethodJsName(RuntimeConstants.MODULE_UTILS_GWT_ON_LOAD).makeRef(sourceInfo));
19851985
getGlobalStatements().add(new JsVars(sourceInfo, varGwtOnLoad));
19861986

19871987
// ModuleUtils.addInitFunctions(init1, init2,...)

0 commit comments

Comments
 (0)