Skip to content

Commit fc57e74

Browse files
authored
Merge branch 'main' into ruff
2 parents 71f966f + c08204e commit fc57e74

File tree

8 files changed

+25
-20
lines changed

8 files changed

+25
-20
lines changed

src/library.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2181,18 +2181,14 @@ addToLibrary({
21812181
return x.startsWith('dynCall_') ? x : '_' + x;
21822182
},
21832183

2184-
$asyncLoad__docs: '/** @param {boolean=} noRunDep */',
2185-
$asyncLoad: (url, noRunDep) => {
2184+
$asyncLoad: (url) => {
21862185
return new Promise((resolve, reject) => {
2187-
var dep = !noRunDep ? getUniqueRunDependency(`al ${url}`) : '';
2188-
if (dep) addRunDependency(dep);
21892186
readAsync(url).then(
21902187
(arrayBuffer) => {
21912188
#if ASSERTIONS
21922189
assert(arrayBuffer, `Loading data file "${url}" failed (no arrayBuffer).`);
21932190
#endif
21942191
resolve(new Uint8Array(arrayBuffer));
2195-
if (dep) removeRunDependency(dep);
21962192
}, reject);
21972193
});
21982194
},

src/library_async.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ addToLibrary({
471471
emscripten_wget_data: (url, pbuffer, pnum, perror) => {
472472
return Asyncify.handleSleep((wakeUp) => {
473473
/* no need for run dependency, this is async but will not do any prepare etc. step */
474-
asyncLoad(UTF8ToString(url), /*noRunDep=*/true).then((byteArray) => {
474+
asyncLoad(UTF8ToString(url)).then((byteArray) => {
475475
// can only allocate the buffer after the wakeUp, not during an asyncing
476476
var buffer = _malloc(byteArray.length); // must be freed by caller!
477477
HEAPU8.set(byteArray, buffer);

src/library_wget.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ var LibraryWget = {
6565
emscripten_async_wget_data: (url, userdata, onload, onerror) => {
6666
{{{ runtimeKeepalivePush() }}}
6767
/* no need for run dependency, this is async but will not do any prepare etc. step */
68-
asyncLoad(UTF8ToString(url), /*noRunDep=*/true).then((byteArray) => {
68+
asyncLoad(UTF8ToString(url)).then((byteArray) => {
6969
{{{ runtimeKeepalivePop() }}}
7070
callUserCallback(() => {
7171
var buffer = _malloc(byteArray.length);

test/browser/test_offset_converter.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1+
#include <assert.h>
12
#include <stdio.h>
23
#include <emscripten.h>
34

4-
void *get_pc(void) { return __builtin_return_address(0); }
5+
void *get_pc(void) {
6+
return __builtin_return_address(0);
7+
}
58

6-
int magic_test_function(void) {
9+
void magic_test_function(void) {
710
int result = EM_ASM_INT({
811
function report(x) {
9-
fetch(encodeURI('http://localhost:8888?stdout=' + x));
12+
out(x);
13+
fetch('http://localhost:8888?stdout=' + encodeURIComponent(x));
1014
}
1115
report('magic_test_function: input=' + $0);
1216
var converted = wasmOffsetConverter.getName($0);
1317
report('magic_test_function: converted=' + converted);
1418
return converted == 'magic_test_function';
1519
}, get_pc());
16-
return result;
20+
assert(result);
1721
}
1822

1923
int main(void) {
20-
return magic_test_function();
24+
magic_test_function();
25+
return 0;
2126
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6294
1+
6276
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
13863
1+
13831

test/test_browser.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4948,8 +4948,12 @@ def test_minimal_runtime_loader_shell(self, args):
49484948
def test_minimal_runtime_hello_world(self, args):
49494949
self.btest_exit('small_hello_world.c', args=args + ['-sMINIMAL_RUNTIME'])
49504950

4951-
def test_offset_converter(self, *args):
4952-
self.btest_exit('test_offset_converter.c', assert_returncode=1, args=['-sUSE_OFFSET_CONVERTER', '-gsource-map', '-sPROXY_TO_PTHREAD', '-pthread'])
4951+
@parameterized({
4952+
'': ([],),
4953+
'pthread': (['-sPROXY_TO_PTHREAD', '-pthread'],)
4954+
})
4955+
def test_offset_converter(self, args):
4956+
self.btest_exit('test_offset_converter.c', args=['-sUSE_OFFSET_CONVERTER', '-gsource-map'] + args)
49534957

49544958
# Tests emscripten_unwind_to_js_event_loop() behavior
49554959
def test_emscripten_unwind_to_js_event_loop(self, *args):

test/test_sockets.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def test_enet(self):
285285
'native': [WebsockifyServerHarness, 59160, ['-DTEST_DGRAM=0']],
286286
'tcp': [CompiledServerHarness, 59162, ['-DTEST_DGRAM=0']],
287287
'udp': [CompiledServerHarness, 59164, ['-DTEST_DGRAM=1']],
288-
'pthread': [CompiledServerHarness, 59165, ['-pthread', '-sPROXY_TO_PTHREAD']],
288+
'pthread': [CompiledServerHarness, 59166, ['-pthread', '-sPROXY_TO_PTHREAD']],
289289
})
290290
def test_nodejs_sockets_echo(self, harness_class, port, args):
291291
if harness_class == WebsockifyServerHarness and common.EMTEST_LACKS_NATIVE_CLANG:
@@ -304,12 +304,12 @@ def test_nodejs_sockets_echo_subprotocol(self):
304304
# Test against a Websockified server with compile time configured WebSocket subprotocol. We use a Websockified
305305
# server because as long as the subprotocol list contains binary it will configure itself to accept binary
306306
# This test also checks that the connect url contains the correct subprotocols.
307-
with WebsockifyServerHarness(test_file('sockets/test_sockets_echo_server.c'), [], 59166):
308-
self.run_process([EMCC, '-Werror', test_file('sockets/test_sockets_echo_client.c'), '-o', 'client.js', '-sSOCKET_DEBUG', '-sWEBSOCKET_SUBPROTOCOL="base64, binary"', '-DSOCKK=59166'])
307+
with WebsockifyServerHarness(test_file('sockets/test_sockets_echo_server.c'), [], 59168):
308+
self.run_process([EMCC, '-Werror', test_file('sockets/test_sockets_echo_client.c'), '-o', 'client.js', '-sSOCKET_DEBUG', '-sWEBSOCKET_SUBPROTOCOL="base64, binary"', '-DSOCKK=59168'])
309309

310310
out = self.run_js('client.js')
311311
self.assertContained('do_msg_read: read 14 bytes', out)
312-
self.assertContained(['connect: ws://127.0.0.1:59166, base64,binary', 'connect: ws://127.0.0.1:59166/, base64,binary'], out)
312+
self.assertContained(['connect: ws://127.0.0.1:59168, base64,binary', 'connect: ws://127.0.0.1:59168/, base64,binary'], out)
313313

314314
@requires_native_clang
315315
def test_nodejs_sockets_echo_subprotocol_runtime(self):

0 commit comments

Comments
 (0)