Skip to content

Commit 4e44a93

Browse files
committed
Remove MAYBE_WASM2JS settings
Fixes: #23969
1 parent ce1fdec commit 4e44a93

File tree

9 files changed

+10
-121
lines changed

9 files changed

+10
-121
lines changed

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ See docs/process.md for more on how version tagging works.
5959
- EXTRA_EXPORTED_RUNTIME_METHODS: Instead use EXPORTED_RUNTIME_METHODS.
6060
- DEMANGLE_SUPPORT: Instead use the `$demangle` JS libary function.
6161
(#23975)
62+
- The `-sMAYBE_WASM2JS` settings was removed. This is oringally added for
63+
debugging purposed, and we now have `-sWASM=2` for folks that want to be able
64+
to fall back to js if wasm fails. ()
6265

6366
4.0.5 - 03/12/25
6467
----------------

site/source/docs/tools_reference/settings_reference.rst

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3052,21 +3052,6 @@ disable HTML minification altogether.
30523052

30533053
Default value: true
30543054

3055-
.. _maybe_wasm2js:
3056-
3057-
MAYBE_WASM2JS
3058-
=============
3059-
3060-
Whether we *may* be using wasm2js. This compiles to wasm normally, but lets
3061-
you run wasm2js *later* on the wasm, and you can pick between running the
3062-
normal wasm or that wasm2js code. For details of how to do that, see the
3063-
test_maybe_wasm2js test. This option can be useful for debugging and
3064-
bisecting.
3065-
3066-
.. note:: This setting is deprecated
3067-
3068-
Default value: false
3069-
30703055
.. _asan_shadow_size:
30713056

30723057
ASAN_SHADOW_SIZE

src/preamble.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,12 @@
2020

2121
{{{ makeModuleReceiveWithVar('wasmBinary') }}}
2222

23-
#if WASM != 2 && MAYBE_WASM2JS
24-
#if !WASM2JS
25-
if (Module['doWasm2JS']) {
26-
#endif
23+
#if WASM2JS
24+
#if WASM != 2
25+
// WASM == 2 includes wasm2js.js separately.
2726
#include "wasm2js.js"
28-
#if !WASM2JS
29-
}
30-
#endif
3127
#endif
3228

33-
#if MAYBE_WASM2JS
3429
if (WebAssembly.isWasm2js) {
3530
// We don't need to actually download a wasm binary, mark it as present but
3631
// empty.

src/preamble_minimal.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,9 @@ var tempDouble;
2222
var tempI64;
2323
#endif
2424

25-
#if WASM != 2 && MAYBE_WASM2JS
26-
#if !WASM2JS
27-
if (Module['doWasm2JS']) {
28-
#endif
25+
#if WASM2JS && WASM != 2
26+
// WASM == 2 includes wasm2js.js separately.
2927
#include "wasm2js.js"
30-
#if !WASM2JS
31-
}
32-
#endif
3328
#endif
3429

3530
var HEAP8, HEAP16, HEAP32, HEAPU8, HEAPU16, HEAPU32, HEAPF32, HEAPF64,

src/settings.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,15 +2007,6 @@ var HTML5_SUPPORT_DEFERRING_USER_SENSITIVE_REQUESTS = true;
20072007
// [link]
20082008
var MINIFY_HTML = true;
20092009

2010-
// Whether we *may* be using wasm2js. This compiles to wasm normally, but lets
2011-
// you run wasm2js *later* on the wasm, and you can pick between running the
2012-
// normal wasm or that wasm2js code. For details of how to do that, see the
2013-
// test_maybe_wasm2js test. This option can be useful for debugging and
2014-
// bisecting.
2015-
// [link]
2016-
// [deprecated]
2017-
var MAYBE_WASM2JS = false;
2018-
20192010
// This option is no longer used. The appropriate shadow memory size is now
20202011
// calculated from INITIAL_MEMORY and MAXIMUM_MEMORY. Will be removed in a
20212012
// future release.
@@ -2286,4 +2277,5 @@ var LEGACY_SETTINGS = [
22862277
['EXTRA_EXPORTED_RUNTIME_METHODS', [[]], 'No longer supported, use EXPORTED_RUNTIME_METHODS'],
22872278
['SUPPORT_ERRNO', [0], 'No longer supported'],
22882279
['DEMANGLE_SUPPORT', [0], 'No longer supported'],
2280+
['MAYBE_WASM2JS', [0], 'No longer supported (use -sWASM=2)'],
22892281
];

src/wasm2js.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
77
// wasm2js.js - enough of a polyfill for the WebAssembly object so that we can load
88
// wasm2js code that way.
99

10-
// Emit "var WebAssembly" if definitely using wasm2js. Otherwise, in MAYBE_WASM2JS
11-
// mode, we can't use a "var" since it would prevent normal wasm from working.
1210
/** @suppress{duplicate, const} */
13-
#if WASM2JS || WASM == 2
14-
var
15-
#endif
16-
WebAssembly = {
11+
var WebAssembly = {
1712
// Note that we do not use closure quoting (this['buffer'], etc.) on these
1813
// functions, as they are just meant for internal use. In other words, this is
1914
// not a fully general polyfill.

test/test_core.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8397,24 +8397,6 @@ def test_wasm2js(self):
83978397
self.do_core_test('test_hello_world.c')
83988398
self.assertNotExists('test_hello_world.js.mem')
83998399

8400-
@no_sanitize('no wasm2js support yet in sanitizers')
8401-
@requires_wasm2js
8402-
def test_maybe_wasm2js(self):
8403-
if self.is_wasm2js():
8404-
self.skipTest('redundant to test wasm2js in wasm2js* mode')
8405-
self.set_setting('MAYBE_WASM2JS')
8406-
# see that running as wasm works
8407-
self.do_core_test('test_hello_world.c', emcc_args=['-Wno-deprecated'])
8408-
# run wasm2js, bundle the code, and use the wasm2js path
8409-
cmd = [PYTHON, path_from_root('tools/maybe_wasm2js.py'), 'test_hello_world.js', 'test_hello_world.wasm']
8410-
if self.is_optimizing():
8411-
cmd += ['-O2']
8412-
self.run_process(cmd, stdout=open('do_wasm2js.js', 'w'))
8413-
# remove the wasm to make sure we never use it again
8414-
os.remove('test_hello_world.wasm')
8415-
# verify that it runs
8416-
self.assertContained('hello, world!', self.run_js('do_wasm2js.js'))
8417-
84188400
@no_asan('no wasm2js support yet in asan')
84198401
@requires_wasm2js
84208402
@parameterized({

tools/link.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,6 @@ def limit_incoming_module_api():
841841
settings.WASM2JS = 1
842842

843843
if settings.WASM2JS:
844-
settings.MAYBE_WASM2JS = 1
845844
# Wasm bigint doesn't make sense with wasm2js, since it controls how the
846845
# wasm and JS interact.
847846
if user_settings.get('WASM_BIGINT') and settings.WASM_BIGINT:

tools/maybe_wasm2js.py

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)