From d0bcc8114790b85b6e7734c04e92b3a6dcc9c4b7 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Sun, 15 Dec 2024 14:23:34 -0600 Subject: [PATCH] Remove extra assignment to gwtOnLoad Only saves about 10 bytes per GWT application, but the extra assignment appears to serve no purpose. Fixes #10060 --- .../google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java b/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java index ab5fad1679..12e03673bd 100644 --- a/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java +++ b/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java @@ -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() { - /** + /* *
-       * var $entry = Impl.registerEntry();
-       * var gwtOnLoad = ModuleUtils.gwtOnLoad();
+       * var $entry = ModuleUtils.registerEntry();
+       * var gwtOnLoad = ModuleUtils.gwtOnLoad;
        * ModuleUtils.addInitFunctions(init1, init2,...)
        * 
*/ @@ -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,...)