Skip to content

Commit 57fa5e0

Browse files
authored
[docs] Update docs on closure to match current behavior. (#23142)
Closure is not automatically run in -O3 by default.
1 parent 6ec518a commit 57fa5e0

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

docs/emcc.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ Options that are modified or new in *emcc* are listed below:
252252
"--closure 0|1|2"
253253
[link] Runs the *Closure Compiler*. Possible values are:
254254

255-
* "0": No closure compiler (default in "-O2" and below).
255+
* "0": No closure compiler (default).
256256

257257
* "1": Run closure compiler. This greatly reduces the size of
258258
the support JavaScript code (everything but the WebAssembly or
@@ -277,9 +277,6 @@ Options that are modified or new in *emcc* are listed below:
277277
before the closure-compiled code runs, because then it will
278278
reuse that variable.
279279

280-
* Closure is only run if JavaScript opts are being done ("-O2" or
281-
above).
282-
283280
"--closure-args=<args>"
284281
[link] Pass arguments to the *Closure compiler*. This is an
285282
alternative to "EMCC_CLOSURE_ARGS".

site/source/docs/tools_reference/emcc.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,14 @@ Options that are modified or new in *emcc* are listed below:
262262
[link]
263263
Runs the :term:`Closure Compiler`. Possible values are:
264264

265-
- ``0``: No closure compiler (default in ``-O2`` and below).
265+
- ``0``: No closure compiler (default).
266266
- ``1``: Run closure compiler. This greatly reduces the size of the support JavaScript code (everything but the WebAssembly or asm.js). Note that this increases compile time significantly.
267267
- ``2``: Run closure compiler on *all* the emitted code, even on **asm.js** output in **asm.js** mode. This can further reduce code size, but does prevent a significant amount of **asm.js** optimizations, so it is not recommended unless you want to reduce code size at all costs.
268268

269269
.. note::
270270

271271
- Consider using ``-sMODULARIZE`` when using closure, as it minifies globals to names that might conflict with others in the global scope. ``MODULARIZE`` puts all the output into a function (see ``src/settings.js``).
272272
- Closure will minify the name of `Module` itself, by default! Using ``MODULARIZE`` will solve that as well. Another solution is to make sure a global variable called `Module` already exists before the closure-compiled code runs, because then it will reuse that variable.
273-
- Closure is only run if JavaScript opts are being done (``-O2`` or above).
274273

275274
``--closure-args=<args>``
276275
[link]

0 commit comments

Comments
 (0)