Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/libbrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ var LibraryBrowser = {
}
var w = wNative;
var h = hNative;
if (Module['forcedAspectRatio'] && Module['forcedAspectRatio'] > 0) {
if (Module['forcedAspectRatio'] > 0) {
if (w/h < Module['forcedAspectRatio']) {
w = Math.round(h * Module['forcedAspectRatio']);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/libeventloop.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ LibraryJSEventLoop = {
}

if (!noSetTiming) {
if (fps && fps > 0) {
if (fps > 0) {
_emscripten_set_main_loop_timing({{{ cDefs.EM_TIMING_SETTIMEOUT }}}, 1000.0 / fps);
} else {
// Do rAF by rendering each frame (no decimating)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/libglemu.js
Original file line number Diff line number Diff line change
Expand Up @@ -3574,7 +3574,7 @@ var LibraryGLEmulation = {
for (var i = 0; i < n; i++) {
var id = {{{ makeGetValue('vaos', 'i*4', 'i32') }}};
GLEmulation.vaos[id] = null;
if (GLEmulation.currentVao && GLEmulation.currentVao.id == id) GLEmulation.currentVao = null;
if (GLEmulation.currentVao?.id == id) GLEmulation.currentVao = null;
}
},
$emulGlIsVertexArray: (array) => {
Expand Down
6 changes: 3 additions & 3 deletions src/lib/libsdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ var LibrarySDL = {
// since the browser engine handles that for us. Therefore, in JS we just
// maintain a list of channels and return IDs for them to the SDL consumer.
allocateChannels(num) { // called from Mix_AllocateChannels and init
if (SDL.numChannels && SDL.numChannels >= num && num != 0) return;
if (SDL.numChannels >= num && num != 0) return;
SDL.numChannels = num;
SDL.channels = [];
for (var i = 0; i < num; i++) {
Expand Down Expand Up @@ -3506,7 +3506,7 @@ var LibrarySDL = {
SDL_JoystickGetAxis__proxy: 'sync',
SDL_JoystickGetAxis: (joystick, axis) => {
var gamepad = SDL.getGamepad(joystick - 1);
if (gamepad && gamepad.axes.length > axis) {
if (gamepad?.axes.length > axis) {
return SDL.joystickAxisValueConversion(gamepad.axes[axis]);
}
return 0;
Expand All @@ -3519,7 +3519,7 @@ var LibrarySDL = {
SDL_JoystickGetButton__proxy: 'sync',
SDL_JoystickGetButton: (joystick, button) => {
var gamepad = SDL.getGamepad(joystick - 1);
if (gamepad && gamepad.buttons.length > button) {
if (gamepad?.buttons.length > button) {
return SDL.getJoystickButtonState(gamepad.buttons[button]) ? 1 : 0;
}
return 0;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/libstack_trace.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ var LibraryStackTrace = {
var column = 0;

var parts = chromeRe.exec(line);
if (parts && parts.length == 5) {
if (parts?.length == 5) {
symbolName = parts[1];
file = parts[2];
lineno = parts[3];
column = parts[4];
} else {
parts = newFirefoxRe.exec(line) || firefoxRe.exec(line);
if (parts && parts.length >= 4) {
if (parts?.length >= 4) {
symbolName = parts[1];
file = parts[2];
lineno = parts[3];
Expand Down
2 changes: 1 addition & 1 deletion src/lib/libtrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ var LibraryTracing = {
},

configureForGoogleWTF: () => {
if (window && window['wtf']) {
if (window?.['wtf']) {
EmscriptenTrace.googleWTFEnabled = true;
} else {
out('GOOGLE WTF NOT AVAILABLE TO ENABLE');
Expand Down
4 changes: 2 additions & 2 deletions src/lib/libtty.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ addToLibrary({
}
},
fsync(tty) {
if (tty.output && tty.output.length > 0) {
if (tty.output?.length > 0) {
out(UTF8ArrayToString(tty.output));
tty.output = [];
}
Expand Down Expand Up @@ -150,7 +150,7 @@ addToLibrary({
}
},
fsync(tty) {
if (tty.output && tty.output.length > 0) {
if (tty.output?.length > 0) {
err(UTF8ArrayToString(tty.output));
tty.output = [];
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/libwebgl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
}
// Make sure the canvas object no longer refers to the context object so
// there are no GC surprises.
if (GL.contexts[contextHandle] && GL.contexts[contextHandle].GLctx.canvas) {
if (GL.contexts[contextHandle]?.GLctx?.canvas) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second ? was not needed before so I assume it isn't after either?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I'll try reverting that.

GL.contexts[contextHandle].GLctx.canvas.GLctxObject = undefined;
}
#if PTHREADS
Expand Down
2 changes: 1 addition & 1 deletion src/polyfill/bigint64array.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if (typeof globalThis.BigInt64Array === "undefined") {
}
var orig_array;
if (!ArrayBuffer.isView(array)) {
if (array.constructor && array.constructor.name === "ArrayBuffer") {
if (array.constructor?.name === "ArrayBuffer") {
array = new Uint32Array(array);
} else {
orig_array = array;
Expand Down
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_ctors1.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8353
8350
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_ctors1.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20285
20267
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_ctors2.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8335
8333
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_ctors2.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20253
20235
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_except.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9352
9351
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_except.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24053
24035
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_except_wasm.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8298
8296
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_except_wasm.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20178
20160
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8298
8296
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20178
20160
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_lto.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8365
8361
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_lto.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20360
20342
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_mangle.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9359
9357
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_mangle.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24053
24035
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_noexcept.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8353
8350
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_noexcept.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20285
20267
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_files_js_fs.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7661
7657
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_files_js_fs.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18831
18813