From 9e1d95a91037d591fb903694688e1dfe4608363c Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Thu, 22 Feb 2024 11:31:47 +0700 Subject: [PATCH] Fix more typos. --- emar.py | 2 +- embuilder.py | 2 +- emcc.py | 2 +- emrun.py | 6 +++--- src/embind/embind.js | 2 +- src/gl-matrix.js | 8 ++++---- src/headless.js | 2 +- src/jsifier.js | 24 ++++++++++++------------ src/library.js | 10 +++++----- src/library_browser.js | 2 +- src/library_dylink.js | 2 +- src/library_exceptions.js | 2 +- src/library_fs.js | 4 ++-- src/library_glemu.js | 10 +++++----- src/library_glut.js | 2 +- src/library_int53.js | 2 +- src/library_pthread.js | 22 +++++++++++----------- src/library_sdl.js | 4 ++-- src/library_uuid.js | 2 +- src/library_wasi.js | 2 +- src/library_wasm_worker.js | 2 +- src/library_wasmfs.js | 2 +- src/modules.js | 4 ++-- src/polyfill/atob.js | 2 +- src/postamble.js | 2 +- src/preamble.js | 8 ++++---- src/proxyWorker.js | 2 +- src/runtime_debug.js | 6 +++--- src/settings_internal.js | 2 +- system/include/emscripten/bind.h | 4 ++-- system/include/emscripten/console.h | 2 +- system/include/emscripten/wasm_worker.h | 4 ++-- test/test_other.py | 2 +- 33 files changed, 77 insertions(+), 77 deletions(-) diff --git a/emar.py b/emar.py index 2153890308a17..061fc5d4ce927 100755 --- a/emar.py +++ b/emar.py @@ -4,7 +4,7 @@ # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. -"""Wrapper scripte around `llvm-ar`. +"""Wrapper script around `llvm-ar`. """ import sys diff --git a/embuilder.py b/embuilder.py index 3c770a7d05e96..9684670b4eb7a 100755 --- a/embuilder.py +++ b/embuilder.py @@ -232,7 +232,7 @@ def main(): auto_tasks = False task_targets = dict.fromkeys(args.targets) # use dict to keep targets order - # subsitute + # substitute predefined_tasks = { 'SYSTEM': system_tasks, 'USER': PORTS, diff --git a/emcc.py b/emcc.py index 3f411b08b091f..6cd88c9793b71 100644 --- a/emcc.py +++ b/emcc.py @@ -578,7 +578,7 @@ def run(args): if 'EMMAKEN_COMPILER' in os.environ: exit_with_error('`EMMAKEN_COMPILER` is no longer supported.\n' + - 'Please use the `LLVM_ROOT` and/or `COMPILER_WRAPPER` config settings instread') + 'Please use the `LLVM_ROOT` and/or `COMPILER_WRAPPER` config settings instead') if 'EMMAKEN_CFLAGS' in os.environ: exit_with_error('`EMMAKEN_CFLAGS` is no longer supported, please use `EMCC_CFLAGS` instead') diff --git a/emrun.py b/emrun.py index 51652887329e5..4b6d55aafb58d 100644 --- a/emrun.py +++ b/emrun.py @@ -996,7 +996,7 @@ def win_get_file_properties(fname): props = {'FixedFileInfo': None, 'StringFileInfo': None, 'FileVersion': None} import win32api - # backslash as parm returns dictionary of numeric info corresponding to VS_FIXEDFILEINFO struc + # backslash as parm returns dictionary of numeric info corresponding to VS_FIXEDFILEINFO struct fixedInfo = win32api.GetFileVersionInfo(fname, '\\') props['FixedFileInfo'] = fixedInfo props['FileVersion'] = "%d.%d.%d.%d" % (fixedInfo['FileVersionMS'] / 65536, @@ -1005,7 +1005,7 @@ def win_get_file_properties(fname): fixedInfo['FileVersionLS'] % 65536) # \VarFileInfo\Translation returns list of available (language, codepage) - # pairs that can be used to retreive string info. We are using only the first pair. + # pairs that can be used to retrieve string info. We are using only the first pair. lang, codepage = win32api.GetFileVersionInfo(fname, '\\VarFileInfo\\Translation')[0] # any other must be of the form \StringfileInfo\%04X%04X\parm_name, middle @@ -1731,7 +1731,7 @@ def run(): elif 'opera' in browser_exe.lower(): processname_killed_atexit = 'opera' - # In Windows cmdline, & character delimits multiple commmands, so must + # In Windows cmdline, & character delimits multiple commands, so must # use ^ to escape them. if browser_exe == 'cmd': url = url.replace('&', '^&') diff --git a/src/embind/embind.js b/src/embind/embind.js index 44296c9de684b..fadae6bdbf465 100644 --- a/src/embind/embind.js +++ b/src/embind/embind.js @@ -747,7 +747,7 @@ var LibraryEmbind = { * though at creation, the 'dummy' has the correct constructor name. Thus, * objects created with IMVU.new would show up in the debugger as 'dummy', * which isn't very helpful. Using IMVU.createNamedFunction addresses the - * issue. Doublely-unfortunately, there's no way to write a test for this + * issue. Doubly-unfortunately, there's no way to write a test for this * behavior. -NRD 2013.02.22 */ var dummy = createNamedFunction(constructor.name || 'unknownFunctionName', function(){}); diff --git a/src/gl-matrix.js b/src/gl-matrix.js index 6dd0f80c787bc..fab9ad32437bb 100644 --- a/src/gl-matrix.js +++ b/src/gl-matrix.js @@ -6,7 +6,7 @@ * @version 1.2.4 */ -// Modifed for emscripten: +// Modified for emscripten: // - Global scoping etc. // - Disabled some non-closure-compatible javadoc comments. @@ -267,7 +267,7 @@ vec3.cross = function (vec, vec2, dest) { }; /** - * Caclulates the length of a vec3 + * Calculates the length of a vec3 * * _param {vec3} vec vec3 to calculate length of * @@ -279,7 +279,7 @@ vec3.length = function (vec) { }; /** - * Caclulates the dot product of two vec3s + * Calculates the dot product of two vec3s * * _param {vec3} vec First operand * _param {vec3} vec2 Second operand @@ -342,7 +342,7 @@ vec3.lerp = function (vec, vec2, lerp, dest) { }; /** - * Calculates the euclidian distance between two vec3 + * Calculates the euclidean distance between two vec3 * * Params: * _param {vec3} vec First vector diff --git a/src/headless.js b/src/headless.js index 65fe29165771f..e1b0697684ab3 100644 --- a/src/headless.js +++ b/src/headless.js @@ -240,7 +240,7 @@ var Worker = (workerPath) => { workerPath = fixPath(workerPath); var workerCode = read(workerPath); workerCode = workerCode.replace(/Module/g, 'zzModuleyy' + (Worker.id++)). // prevent collision with the global Module object. Note that this becomes global, so we need unique ids - replace(/\nonmessage = /, '\nvar onmessage = '); // workers commonly do "onmessage = ", we need to varify that to sandbox + replace(/\nonmessage = /, '\nvar onmessage = '); // workers commonly do "onmessage = ", we need to verify that to sandbox headlessPrint(`loading worker ${workerPath} : ${workerCode.substring(0, 50)}`); eval(workerCode); // will implement onmessage() diff --git a/src/jsifier.js b/src/jsifier.js index cb3b65dd04a9c..2c4cffbc432ae 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -69,7 +69,7 @@ function isDefined(symName) { if (symName == '__main_argc_argv' && SIDE_MODULE_EXPORTS.has('main')) { return true; } - // 'invoke_' symbols are created at runtime in libary_dylink.py so can + // 'invoke_' symbols are created at runtime in library_dylink.py so can // always be considered as defined. if (RELOCATABLE && symName.startsWith('invoke_')) { return true; @@ -138,14 +138,14 @@ function runJSify() { } function handleI64Signatures(symbol, snippet, sig, i53abi) { - // Handle i64 paramaters and return values. + // Handle i64 parameters and return values. // // When WASM_BIGINT is enabled these arrive as BigInt values which we // convert to int53 JS numbers. If necessary, we also convert the return // value back into a BigInt. // // When WASM_BIGINT is not enabled we receive i64 values as a pair of i32 - // numbers which is coverted to single int53 number. In necessary, we also + // numbers which is converted to single int53 number. In necessary, we also // split the return value into a pair of i32 numbers. return modifyJSFunction(snippet, (args, body, async_, oneliner) => { let argLines = args.split('\n'); @@ -153,7 +153,7 @@ function runJSify() { const argNames = argLines.join(' ').split(',').map((name) => name.trim()); const newArgs = []; let innerArgs = []; - let argConvertions = ''; + let argConversions = ''; if (sig.length > argNames.length + 1) { error(`handleI64Signatures: signature too long for ${symbol}`); return snippet; @@ -164,13 +164,13 @@ function runJSify() { // here, which will result in the default case below. const argType = sig[i + 1]; if (WASM_BIGINT && ((MEMORY64 && argType == 'p') || (i53abi && argType == 'j'))) { - argConvertions += ` ${receiveI64ParamAsI53(name, undefined, false)}\n`; + argConversions += ` ${receiveI64ParamAsI53(name, undefined, false)}\n`; } else { if (argType == 'j' && i53abi) { - argConvertions += ` ${receiveI64ParamAsI53(name, undefined, false)}\n`; + argConversions += ` ${receiveI64ParamAsI53(name, undefined, false)}\n`; newArgs.push(defineI64Param(name)); } else if (argType == 'p' && CAN_ADDRESS_2GB) { - argConvertions += ` ${name} >>>= 0;\n`; + argConversions += ` ${name} >>>= 0;\n`; newArgs.push(name); } else { newArgs.push(name); @@ -187,9 +187,9 @@ function runJSify() { // For functions that where we need to mutate the return value, we // also need to wrap the body in an inner function. if (oneliner) { - if (argConvertions) { + if (argConversions) { return `${async_}(${args}) => { -${argConvertions} +${argConversions} return ${makeReturn64(body)}; }` } @@ -197,7 +197,7 @@ ${argConvertions} } return `\ ${async_}function(${args}) { -${argConvertions} +${argConversions} var ret = (() => { ${body} })(); return ${makeReturn64('ret')}; }`; @@ -210,7 +210,7 @@ ${argConvertions} } return `\ ${async_}function(${args}) { -${argConvertions} +${argConversions} ${body}; }`; }); @@ -514,7 +514,7 @@ function(${args}) { // in library.js and library_pthread.js. These happen before deps are // processed so depending on it via `__deps` doesn't work. if (dep === '$noExitRuntime') { - error('noExitRuntime cannot be referenced via __deps mechansim. Use DEFAULT_LIBRARY_FUNCS_TO_INCLUDE or EXPORTED_RUNTIME_METHODS') + error('noExitRuntime cannot be referenced via __deps mechanism. Use DEFAULT_LIBRARY_FUNCS_TO_INCLUDE or EXPORTED_RUNTIME_METHODS') } return addFromLibrary(dep, `${symbol}, referenced by ${dependent}`, dep === aliasTarget); } diff --git a/src/library.js b/src/library.js index dab6accfb5a4a..94bfd91b96178 100644 --- a/src/library.js +++ b/src/library.js @@ -76,7 +76,7 @@ addToLibrary({ #if PTHREADS if (ENVIRONMENT_IS_PTHREAD) { - // implict exit can never happen on a pthread + // implicit exit can never happen on a pthread #if ASSERTIONS assert(!implicit); #endif @@ -2586,7 +2586,7 @@ addToLibrary({ // skip this function and the caller to get caller's return address #if MEMORY64 // MEMORY64 injects and extra wrapper within emscripten_return_address - // to handle BigInt convertions. + // to handle BigInt conversions. var caller = callstack[level + 4]; #else var caller = callstack[level + 3]; @@ -3129,7 +3129,7 @@ addToLibrary({ #else #if !WASM_BIGINT // Without WASM_BIGINT support we cannot directly call function with i64 as - // part of thier signature, so we rely the dynCall functions generated by + // part of their signature, so we rely on the dynCall functions generated by // wasm-emscripten-finalize if (sig.includes('j')) { return dynCallLegacy(sig, ptr, args); @@ -3166,7 +3166,7 @@ addToLibrary({ $setWasmTableEntry__deps: ['$wasmTableMirror', '$wasmTable'], $setWasmTableEntry: (idx, func) => { wasmTable.set(idx, func); - // With ABORT_ON_WASM_EXCEPTIONS wasmTable.get is overriden to return wrapped + // With ABORT_ON_WASM_EXCEPTIONS wasmTable.get is overridden to return wrapped // functions so we need to call it here to retrieve the potential wrapper correctly // instead of just storing 'func' directly into wasmTableMirror wasmTableMirror[idx] = wasmTable.get(idx); @@ -3379,7 +3379,7 @@ addToLibrary({ // setTimeout or any other kind of event handler that calls into user case // needs to use this wrapper. // - // The job of this wrapper is the handle emscripten-specfic exceptions such + // The job of this wrapper is the handle emscripten-specific exceptions such // as ExitStatus and 'unwind' and prevent these from escaping to the top // level. $callUserCallback__deps: ['$handleException', '$maybeExit'], diff --git a/src/library_browser.js b/src/library_browser.js index b51d919ba644d..c493d8be54dc9 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -595,7 +595,7 @@ var LibraryBrowser = { Browser.mouseX = SDL.mouseX + Browser.mouseMovementX; Browser.mouseY = SDL.mouseY + Browser.mouseMovementY; } else { - // just add the mouse delta to the current absolut mouse position + // just add the mouse delta to the current absolute mouse position // FIXME: ideally this should be clamped against the canvas size and zero Browser.mouseX += Browser.mouseMovementX; Browser.mouseY += Browser.mouseMovementY; diff --git a/src/library_dylink.js b/src/library_dylink.js index ae5bc41cb5f14..4c4607254b8f6 100644 --- a/src/library_dylink.js +++ b/src/library_dylink.js @@ -52,7 +52,7 @@ var LibraryDylink = { $isSymbolDefined: (symName) => { // Ignore 'stub' symbols that are auto-generated as part of the original - // `wasmImports` used to instantate the main module. + // `wasmImports` used to instantiate the main module. var existing = wasmImports[symName]; if (!existing || existing.stub) { return false; diff --git a/src/library_exceptions.js b/src/library_exceptions.js index 502dc98678464..82f4601f54bf7 100644 --- a/src/library_exceptions.js +++ b/src/library_exceptions.js @@ -397,7 +397,7 @@ addCxaCatch = (n) => { LibraryManager.library[`__cxa_find_matching_catch_${n}`] = eval(`(${args}) => findMatchingCatch([${argString}])`); }; -// Add the first 2-5 catch handlers premptively. Others get added on demand in +// Add the first 2-5 catch handlers preemptively. Others get added on demand in // jsifier. This is done here primarily so that these symbols end up with the // correct deps in the stub library that we pass to wasm-ld. // Note: __cxa_find_matching_catch_N function uses N = NumClauses + 2 so diff --git a/src/library_fs.js b/src/library_fs.js index b6f0a5092b23d..f5d16b86c0fe4 100644 --- a/src/library_fs.js +++ b/src/library_fs.js @@ -130,7 +130,7 @@ FS.staticInit();` + #if ASSERTIONS super(ERRNO_MESSAGES[errno]); #endif - // TODO(sbc): Use the inline member delclaration syntax once we + // TODO(sbc): Use the inline member declaration syntax once we // support it in acorn and closure. this.name = 'ErrnoError'; this.errno = errno; @@ -745,7 +745,7 @@ FS.staticInit();` + // parents must exist var lookup, old_dir, new_dir; - // let the errors from non existant directories percolate up + // let the errors from non existent directories percolate up lookup = FS.lookupPath(old_path, { parent: true }); old_dir = lookup.node; lookup = FS.lookupPath(new_path, { parent: true }); diff --git a/src/library_glemu.js b/src/library_glemu.js index b5cf3001c2db6..8d0b63a5ee614 100644 --- a/src/library_glemu.js +++ b/src/library_glemu.js @@ -3002,10 +3002,10 @@ var LibraryGLEmulation = { var renderer = GLImmediate.getRenderer(); // Generate index data in a format suitable for GLES 2.0/WebGL - var numVertexes = 4 * GLImmediate.vertexCounter / GLImmediate.stride; - if (!numVertexes) return; + var numVertices = 4 * GLImmediate.vertexCounter / GLImmediate.stride; + if (!numVertices) return; #if ASSERTIONS - assert(numVertexes % 1 == 0, "`numVertexes` must be an integer."); + assert(numVertices % 1 == 0, "`numVertices` must be an integer."); #endif var emulatedElementArrayBuffer = false; var numIndexes = 0; @@ -3047,7 +3047,7 @@ var LibraryGLEmulation = { assert(GLImmediate.firstVertex % 4 == 0); #endif ptr = GLImmediate.firstVertex * 3; - var numQuads = numVertexes / 4; + var numQuads = numVertices / 4; numIndexes = numQuads * 6; // 0 1 2, 0 2 3 pattern #if ASSERTIONS assert(ptr + (numIndexes << 1) <= GL.MAX_TEMP_BUFFER_SIZE, 'too many immediate mode indexes (b)'); @@ -3062,7 +3062,7 @@ var LibraryGLEmulation = { if (numIndexes) { GLctx.drawElements(GLImmediate.mode, numIndexes, GLctx.UNSIGNED_SHORT, ptr); } else { - GLctx.drawArrays(GLImmediate.mode, startIndex, numVertexes); + GLctx.drawArrays(GLImmediate.mode, startIndex, numVertices); } if (emulatedElementArrayBuffer) { diff --git a/src/library_glut.js b/src/library_glut.js index 359a339b8f523..972b6e6b3cadc 100644 --- a/src/library_glut.js +++ b/src/library_glut.js @@ -153,7 +153,7 @@ var LibraryGLUT = { case 191: return s ? 63 : 47; // forward slash case 219: return s ? 123 : 91; // open bracket case 220: return s ? 124 : 47; // back slash - case 221: return s ? 125 : 93; // close braket + case 221: return s ? 125 : 93; // close bracket case 222: return s ? 34 : 39; // single quote } diff --git a/src/library_int53.js b/src/library_int53.js index dd82ba8d39606..c93e24c95185c 100644 --- a/src/library_int53.js +++ b/src/library_int53.js @@ -134,7 +134,7 @@ addToLibrary({ $MIN_INT53: '-{{{ Math.pow(2, 53) }}}', // Counvert a bigint value (usually coming from Wasm->JS call) into an int53 // JS Number. This is used when we have an incoming i64 that we know is a - // pointer or size_t and is expected to be withing the int53 range. + // pointer or size_t and is expected to be within the int53 range. // Returns NaN if the incoming bigint is outside the range. $bigintToI53Checked__deps: ['$MAX_INT53', '$MIN_INT53'], $bigintToI53Checked: (num) => (num < MIN_INT53 || num > MAX_INT53) ? NaN : Number(num), diff --git a/src/library_pthread.js b/src/library_pthread.js index eebbc2b5d4613..2966bae0c2db2 100644 --- a/src/library_pthread.js +++ b/src/library_pthread.js @@ -37,7 +37,7 @@ var LibraryPThread = { '$killThread', '$cancelThread', '$cleanupThread', '$zeroMemory', #if MAIN_MODULE - '$markAsFinshed', + '$markAsFinished', #endif '$spawnThread', '_emscripten_thread_free_data', @@ -284,8 +284,8 @@ var LibraryPThread = { } else if (cmd === 'cleanupThread') { cleanupThread(d['thread']); #if MAIN_MODULE - } else if (cmd === 'markAsFinshed') { - markAsFinshed(d['thread']); + } else if (cmd === 'markAsFinished') { + markAsFinished(d['thread']); #endif } else if (cmd === 'killThread') { killThread(d['thread']); @@ -964,7 +964,7 @@ var LibraryPThread = { $proxyToMainThread__docs: '/** @type{function(number, (number|boolean), ...number)} */', $proxyToMainThread: (funcIndex, emAsmAddr, sync, ...callArgs) => { // EM_ASM proxying is done by passing a pointer to the address of the EM_ASM - // contant as `emAsmAddr`. JS library proxying is done by passing an index + // content as `emAsmAddr`. JS library proxying is done by passing an index // into `proxiedJSCallArgs` as `funcIndex`. If `emAsmAddr` is non-zero then // `funcIndex` will be ignored. // Additional arguments are passed after the first three are the actual @@ -1119,7 +1119,7 @@ var LibraryPThread = { #if MAIN_MODULE // Before we call the thread entry point, make sure any shared libraries - // have been loaded on this there. Otherwise our table migth be not be + // have been loaded on this there. Otherwise our table might be not be // in sync and might not contain the function pointer `ptr` at all. __emscripten_dlsync_self(); #endif @@ -1161,15 +1161,15 @@ var LibraryPThread = { _emscripten_thread_exit_joinable: (thread) => { // Called when a thread exits and is joinable. We mark these threads // as finished, which means that are in state where are no longer actually - // runnning, but remain around waiting to be joined. In this state they + // running, but remain around waiting to be joined. In this state they // cannot run any more proxied work. - if (!ENVIRONMENT_IS_PTHREAD) markAsFinshed(thread); - else postMessage({ 'cmd': 'markAsFinshed', 'thread': thread }); + if (!ENVIRONMENT_IS_PTHREAD) markAsFinished(thread); + else postMessage({ 'cmd': 'markAsFinished', 'thread': thread }); }, - $markAsFinshed: (pthread_ptr) => { + $markAsFinished: (pthread_ptr) => { #if PTHREADS_DEBUG - dbg(`markAsFinshed: ${ptrToString(pthread_ptr)}`); + dbg(`markAsFinished: ${ptrToString(pthread_ptr)}`); #endif PThread.finishedThreads.add(pthread_ptr); if (pthread_ptr in PThread.outstandingPromises) { @@ -1203,7 +1203,7 @@ var LibraryPThread = { // We then create a sequence of promises, one per thread, that resolve once // each thread has performed its sync using _emscripten_proxy_dlsync. - // Any new threads that are created after this call will automaticaly be + // Any new threads that are created after this call will automatically be // in sync because we call `__emscripten_dlsync_self` in // invokeEntryPoint before the threads entry point is called. for (const ptr of Object.keys(PThread.pthreads)) { diff --git a/src/library_sdl.js b/src/library_sdl.js index ed6b4f22dc48f..90d290b07c033 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -436,7 +436,7 @@ var LibrarySDL = { // for surface with HWPALETTE flag(8bpp depth) copyIndexedColorData: (surfData, rX, rY, rW, rH) => { // HWPALETTE works with palette - // setted by SDL_SetColors + // set by SDL_SetColors if (!surfData.colors) { return; } @@ -1562,7 +1562,7 @@ var LibrarySDL = { if (SDL.defaults.copyOnLock && !SDL.defaults.discardOnLock) { // Copy pixel data to somewhere accessible to 'C/C++' if (surfData.isFlagSet(0x00200000 /* SDL_HWPALETTE */)) { - // If this is neaded then + // If this is needed then // we should compact the data from 32bpp to 8bpp index. // I think best way to implement this is use // additional colorMap hash (color->index). diff --git a/src/library_uuid.js b/src/library_uuid.js index fe5c5ce863133..14429bea6e1a1 100644 --- a/src/library_uuid.js +++ b/src/library_uuid.js @@ -13,7 +13,7 @@ addToLibrary({ // Compare whether or not two 'compact' UUIDs are the same. // Returns an integer less than, equal to, or greater than zero if uu1 is found, respectively, to be - // lexigraphically less than, equal, or greater than uu2. + // lexicographically less than, equal, or greater than uu2. uuid_compare__deps: ['memcmp'], uuid_compare: (uu1, uu2) => _memcmp(uu1, uu2, 16), diff --git a/src/library_wasi.js b/src/library_wasi.js index 9551f69dcc1d7..20583455a280d 100644 --- a/src/library_wasi.js +++ b/src/library_wasi.js @@ -109,7 +109,7 @@ var WasiLibrary = { return 0; }, - // In normal (non-standalone) mode arguments are passed direclty + // In normal (non-standalone) mode arguments are passed directly // to main, and the `mainArgs` global does not exist. #if STANDALONE_WASM args_sizes_get__nothrow: true, diff --git a/src/library_wasm_worker.js b/src/library_wasm_worker.js index 753055059437e..5e9d1161e7406 100644 --- a/src/library_wasm_worker.js +++ b/src/library_wasm_worker.js @@ -302,7 +302,7 @@ if (ENVIRONMENT_IS_WASM_WORKER) { let val = num; do { let ret = Atomics.compareExchange(HEAP32, {{{ getHeapOffset('sem', 'i32') }}}, - val, /* We expect this many semaphore resoures to be available*/ + val, /* We expect this many semaphore resources to be available*/ val - num /* Acquire 'num' of them */); if (ret == val) return dispatch(ret/*index of resource acquired*/, 0/*'ok'*/); val = ret; diff --git a/src/library_wasmfs.js b/src/library_wasmfs.js index 3087abe038658..7d303c8c78932 100644 --- a/src/library_wasmfs.js +++ b/src/library_wasmfs.js @@ -238,7 +238,7 @@ FS.init(); var buf = FS.handleError(__wasmfs_mmap(length, prot, flags, stream.fd, {{{ splitI64('offset') }}})); return { ptr: buf, allocated: true }; }, - // offset is passed to msync to maintain backwards compatability with the legacy JS API but is not used by WasmFS. + // offset is passed to msync to maintain backwards compatibility with the legacy JS API but is not used by WasmFS. msync: (stream, bufferPtr, offset, length, mmapFlags) => { assert(offset === 0); // TODO: assert that stream has the fd corresponding to the mapped buffer (bufferPtr). diff --git a/src/modules.js b/src/modules.js index d40d1f9ed0532..06176d023b488 100644 --- a/src/modules.js +++ b/src/modules.js @@ -302,7 +302,7 @@ function isInternalSymbol(ident) { return ident + '__internal' in LibraryManager.library; } -function getUnusedLibarySymbols() { +function getUnusedLibrarySymbols() { const librarySymbolSet = new Set(librarySymbols); const missingSyms = new Set(); for (const [ident, value] of Object.entries(LibraryManager.library)) { @@ -475,7 +475,7 @@ function exportRuntime() { const results = exports.filter((name) => name); if (ASSERTIONS && !EXPORT_ALL) { - const unusedLibSymbols = getUnusedLibarySymbols(); + const unusedLibSymbols = getUnusedLibrarySymbols(); if (unusedLibSymbols.size) { results.push(addMissingLibraryStubs(unusedLibSymbols)); } diff --git a/src/polyfill/atob.js b/src/polyfill/atob.js index 44167cf51237b..5de121d14a13f 100644 --- a/src/polyfill/atob.js +++ b/src/polyfill/atob.js @@ -9,7 +9,7 @@ #endif #if !ENVIRONMENT_MAY_BE_SHELL && !ENVIRONMENT_MAY_BE_NODE -#error "this polyfill should only be included when targetting node or shell" +#error "this polyfill should only be included when targeting node or shell" #endif if (typeof atob == 'undefined') { diff --git a/src/postamble.js b/src/postamble.js index c3e3a906a2641..1b71ef3a46ab1 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -129,7 +129,7 @@ function stackCheckInit() { // get these values before even running any of the ctors so we call it redundantly // here. #if ASSERTIONS && PTHREADS - // See $establishStackSpace for the equivelent code that runs on a thread + // See $establishStackSpace for the equivalent code that runs on a thread assert(!ENVIRONMENT_IS_PTHREAD); #endif #if RELOCATABLE diff --git a/src/preamble.js b/src/preamble.js index f1314217c0d75..7526ae4d587f5 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -83,7 +83,7 @@ function assert(condition, text) { #else // This build was created without ASSERTIONS defined. `assert()` should not // ever be called in this configuration but in case there are callers in - // the wild leave this simple abort() implemenation here for now. + // the wild leave this simple abort() implementation here for now. abort(text); #endif } @@ -456,7 +456,7 @@ function abort(what) { // allows this in the wasm spec. // Suppress closure compiler warning here. Closure compiler's builtin extern - // defintion for WebAssembly.RuntimeError claims it takes no arguments even + // definition for WebAssembly.RuntimeError claims it takes no arguments even // though it can. // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure gets fixed. #if WASM_EXCEPTIONS == 1 @@ -819,7 +819,7 @@ function instantiateArrayBuffer(binaryFile, imports, receiver) { if (search.indexOf('_rwasm=0') < 0) { location.href += (search ? search + '&' : '?') + '_rwasm=0'; // Return here to avoid calling abort() below. The application - // still has a chance to start sucessfully do we don't want to + // still has a chance to start successfully do we don't want to // trigger onAbort or onExit handlers. return; } @@ -1016,7 +1016,7 @@ function createWasm() { #if !DECLARE_ASM_MODULE_EXPORTS // If we didn't declare the asm exports as top level enties this function - // is in charge of programatically exporting them on the global object. + // is in charge of programmatically exporting them on the global object. exportWasmSymbols(wasmExports); #endif diff --git a/src/proxyWorker.js b/src/proxyWorker.js index 073964f561c8f..0ed0dd3f552d3 100644 --- a/src/proxyWorker.js +++ b/src/proxyWorker.js @@ -371,7 +371,7 @@ var messageBuffer = null; var messageResenderTimeout = null; var calledMain = false; -// Set calledMain to true during postRun which happens onces main returns +// Set calledMain to true during postRun which happens once main returns Module['postRun'] ||= []; if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']]; Module['postRun'].push(() => { calledMain = true; }); diff --git a/src/runtime_debug.js b/src/runtime_debug.js index d5082859671c3..3846497c1243f 100644 --- a/src/runtime_debug.js +++ b/src/runtime_debug.js @@ -6,12 +6,12 @@ #if ASSERTIONS -function legacyModuleProp(prop, newName, incomming=true) { +function legacyModuleProp(prop, newName, incoming=true) { if (!Object.getOwnPropertyDescriptor(Module, prop)) { Object.defineProperty(Module, prop, { configurable: true, get() { - let extra = incomming ? ' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)' : ''; + let extra = incoming ? ' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)' : ''; abort(`\`Module.${prop}\` has been replaced by \`${newName}\`` + extra); } @@ -79,7 +79,7 @@ function missingLibrarySymbol(sym) { } }); } - // Any symbol that is not included from the JS libary is also (by definition) + // Any symbol that is not included from the JS library is also (by definition) // not exported on the Module object. unexportedRuntimeSymbol(sym); } diff --git a/src/settings_internal.js b/src/settings_internal.js index 96fad541fad1a..60a77da6b4f9c 100644 --- a/src/settings_internal.js +++ b/src/settings_internal.js @@ -253,7 +253,7 @@ var ALL_INCOMING_MODULE_JS_API = []; // List of all imports that are weak, and therefore allowed to be undefined at // runtime. This is used by the JS compiler to avoid build-time warnings/errors -// when weak symbols are undefined. Only applies in the case of dyanmic linking +// when weak symbols are undefined. Only applies in the case of dynamic linking // (MAIN_MODULE). var WEAK_IMPORTS = []; diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h index f29343e21b6a8..8be5b160ed0dd 100644 --- a/system/include/emscripten/bind.h +++ b/system/include/emscripten/bind.h @@ -262,9 +262,9 @@ void _embind_register_user_type( // Register an InitFunc in the global linked list of init functions. void _embind_register_bindings(struct InitFunc* f); -// Binding initialization functions registerd by EMSCRIPTEN_BINDINGS macro +// Binding initialization functions registered by EMSCRIPTEN_BINDINGS macro // below. Stored as linked list of static data object avoiding std containers -// to avoid static contructor ordering issues. +// to avoid static constructor ordering issues. struct InitFunc { InitFunc(void (*init_func)()) : init_func(init_func) { // This the function immediately upon constructions, and also register diff --git a/system/include/emscripten/console.h b/system/include/emscripten/console.h index 9469fa7d1d14d..c1fb40a640285 100644 --- a/system/include/emscripten/console.h +++ b/system/include/emscripten/console.h @@ -28,7 +28,7 @@ void emscripten_out(const char *utf8String __attribute__((nonnull))); void emscripten_err(const char *utf8String __attribute__((nonnull))); void emscripten_dbg(const char *utf8String __attribute__((nonnull))); -// Same as above but only with the legnth of string specified by the second +// Same as above but only with the length of string specified by the second // argument. This allows for non-NULL-terminated strings to be passed. void emscripten_outn(const char *utf8String __attribute__((nonnull)), size_t len); void emscripten_errn(const char *utf8String __attribute__((nonnull)), size_t len); diff --git a/system/include/emscripten/wasm_worker.h b/system/include/emscripten/wasm_worker.h index cb3fee2910c6b..3fdace54d3425 100644 --- a/system/include/emscripten/wasm_worker.h +++ b/system/include/emscripten/wasm_worker.h @@ -195,7 +195,7 @@ void emscripten_lock_async_acquire(emscripten_lock_t *lock __attribute__((nonnul EM_BOOL emscripten_lock_try_acquire(emscripten_lock_t *lock __attribute__((nonnull))); // Unlocks the specified lock for another thread to access. Note that locks are -// extermely lightweight, there is no "lock owner" tracking: this function does +// extremely lightweight, there is no "lock owner" tracking: this function does // not actually check whether the calling thread owns the specified lock, but // any thread can call this function to release a lock on behalf of whichever // thread owns it. This function can be called on both main thread and in @@ -232,7 +232,7 @@ int emscripten_semaphore_waitinf_acquire(emscripten_semaphore_t *sem __attribute // Releases the given number of resources back to the semaphore. Note that the // ownership of resources is completely conceptual - there is no actual checking -// that the calling thread had previously acquired that many resouces, so +// that the calling thread had previously acquired that many resources, so // programs need to keep check of their semaphore usage consistency themselves. // Returns how many resources were available in the semaphore before the new // resources were released back to the semaphore. (i.e. the index where the diff --git a/test/test_other.py b/test/test_other.py index 6ed8c0a58ba15..59d3673ef8711 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -14354,7 +14354,7 @@ def test_noExitRuntime_deps(self): }); ''') err = self.expect_fail([EMCC, test_file('hello_world.c'), '--js-library=lib.js', '-sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE=foo']) - self.assertContained('error: noExitRuntime cannot be referenced via __deps mechansim', err) + self.assertContained('error: noExitRuntime cannot be referenced via __deps mechanism', err) def test_hello_world_argv(self): self.do_runf('hello_world_argv.c', 'hello, world! (1)')