Browse Source

Merge pull request #100525 from adamscott/set-closure-language-to-default

Remove custom `--language-in` arg for the Closure compiler
Thaddeus Crews 5 months ago
parent
commit
0bb1f138f2
2 changed files with 4 additions and 3 deletions
  1. 4 0
      platform/web/SCsub
  2. 0 3
      platform/web/detect.py

+ 4 - 0
platform/web/SCsub

@@ -61,8 +61,12 @@ for lib in sys_env["JS_LIBS"]:
     sys_env.Append(LINKFLAGS=["--js-library", lib.abspath])
 for js in sys_env["JS_PRE"]:
     sys_env.Append(LINKFLAGS=["--pre-js", js.abspath])
+
+# Add JS externs to Closure.
+sys_env["ENV"]["EMCC_CLOSURE_ARGS"] = sys_env["ENV"].get("EMCC_CLOSURE_ARGS", "")
 for ext in sys_env["JS_EXTERNS"]:
     sys_env["ENV"]["EMCC_CLOSURE_ARGS"] += " --externs " + ext.abspath
+sys_env["ENV"]["EMCC_CLOSURE_ARGS"] = sys_env["ENV"]["EMCC_CLOSURE_ARGS"].strip()
 
 build = []
 build_targets = ["#bin/godot${PROGSUFFIX}.js", "#bin/godot${PROGSUFFIX}.wasm"]

+ 0 - 3
platform/web/detect.py

@@ -171,9 +171,6 @@ def configure(env: "SConsEnvironment"):
     # Add method for creating the final zip file
     env.AddMethod(create_template_zip, "CreateTemplateZip")
 
-    # Closure compiler extern and support for ecmascript specs (const, let, etc).
-    env["ENV"]["EMCC_CLOSURE_ARGS"] = "--language_in ECMASCRIPT_2021"
-
     env["CC"] = "emcc"
     env["CXX"] = "em++"