diff --git a/CHANGELOG.md b/CHANGELOG.md
index b5ef4213c6d..ee519b69adc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -472,7 +472,7 @@ Released 2023-11-01
[#3537](https://github.com/rustwasm/wasm-bindgen/pull/3537)
* Changed behavior when compiling to `wasm32-wasi` to match `wasm32-emscripten` and
- non-WASM targets, generating a stub that panics when called rather than a wasm-
+ non-Wasm targets, generating a stub that panics when called rather than a wasm-
bindgen placeholder.
[#3233](https://github.com/rustwasm/wasm-bindgen/pull/3233)
@@ -940,7 +940,7 @@ Released 2020-04-29.
[#2099](https://github.com/rustwasm/wasm-bindgen/pull/2099)
* The output of `wasm-bindgen` is now compatible with Webpack 5 and the updated
- version of the wasm ESM integration specification.
+ version of the Wasm ESM integration specification.
[#2110](https://github.com/rustwasm/wasm-bindgen/pull/2099)
--------------------------------------------------------------------------------
@@ -1123,7 +1123,7 @@ Released 2019-11-19.
* Running `wasm-bindgen` over empty anyref modules now works again.
[#1861](https://github.com/rustwasm/wasm-bindgen/pull/1861)
-* Support for multi-value JS engines has been fixed as a wasm interface types
+* Support for multi-value JS engines has been fixed as a Wasm interface types
polyfill.
[#1863](https://github.com/rustwasm/wasm-bindgen/pull/1863)
@@ -1346,8 +1346,8 @@ Released 2019-07-11.
slices.
[#1639](https://github.com/rustwasm/wasm-bindgen/pull/1639)
-* When using the `bundler` target the import of the wasm file now uses the
- `.wasm` extension to ensure a wasm file is loaded.
+* When using the `bundler` target the import of the Wasm file now uses the
+ `.wasm` extension to ensure a Wasm file is loaded.
[#1646](https://github.com/rustwasm/wasm-bindgen/pull/1646)
* The old internal `Stack` trait has been removed since it is no longer used.
@@ -1475,7 +1475,7 @@ Released 2019-05-16.
* A utility for counting the size of the `anyref` heap has been added.
[#1521](https://github.com/rustwasm/wasm-bindgen/pull/1521)
-* Passing ASCII-only strings to WASM should now be significantly faster.
+* Passing ASCII-only strings to Wasm should now be significantly faster.
[#1470](https://github.com/rustwasm/wasm-bindgen/pull/1470)
* The `selectionStart` and `selectionEnd` APIs of text areas have been enabled.
@@ -1615,7 +1615,7 @@ Released 2019-04-10.
[#1416](https://github.com/rustwasm/wasm-bindgen/pull/1416)
* A `wasm_bindgen::function_table()` function has been added to expose the
- `WebAssembly.Table` and get access to it in wasm code.
+ `WebAssembly.Table` and get access to it in Wasm code.
[#1431](https://github.com/rustwasm/wasm-bindgen/pull/1431)
### Fixed
@@ -1778,7 +1778,7 @@ Released 2019-02-15.
[#1225](https://github.com/rustwasm/wasm-bindgen/pull/1225).
* A `--remove-producers-section` flag has been added to the CLI tool to, well,
- remove the `producers` section from the final wasm file.
+ remove the `producers` section from the final Wasm file.
[#1256](https://github.com/rustwasm/wasm-bindgen/pull/1256).
### Fixed
@@ -1816,7 +1816,7 @@ Released 2019-02-12.
### Changed
* `wasm-bindgen` now internally uses the `walrus` crate to perform its
- transformations of the wasm that rustc/LLVM emits. See
+ transformations of the Wasm that rustc/LLVM emits. See
[#1237](https://github.com/rustwasm/wasm-bindgen/pull/1237).
### Fixed
@@ -1968,17 +1968,17 @@ Released 2018-12-04.
### Added
* Add a `#[wasm_bindgen(start)]` attribute to customize the `start` section of
- the wasm module.
+ the Wasm module.
[#1057](https://github.com/rustwasm/wasm-bindgen/pull/1057)
-* Add support for producing the new "producers" section of wasm binaries
+* Add support for producing the new "producers" section of Wasm binaries
[#1041](https://github.com/rustwasm/wasm-bindgen/pull/1041)
* Add support a `typescript_custom_section` attribute for producing custom
typescript abstractions
[#1048](https://github.com/rustwasm/wasm-bindgen/pull/1048)
-* Generate `*.d.ts` files for wasm files in addition to the JS bindings
+* Generate `*.d.ts` files for Wasm files in addition to the JS bindings
[#1053](https://github.com/rustwasm/wasm-bindgen/pull/1053)
* Add a feature to assert that all attributes in `#[wasm_bindgen]` are used to
@@ -2255,7 +2255,7 @@ Released 2018-09-07
### Fixed
-* The "names" section of the wasm binary is now correctly preserved by
+* The "names" section of the Wasm binary is now correctly preserved by
wasm-bindgen.
--------------------------------------------------------------------------------
diff --git a/README.md b/README.md
index a9d57ee0a4e..d8e07bc0952 100644
--- a/README.md
+++ b/README.md
@@ -87,7 +87,7 @@ greet("World!");
* **Designed with the ["Web IDL bindings" proposal][webidl-bindings] in mind.**
Eventually, there won't be any JavaScript shims between Rust-generated wasm
- functions and native DOM methods. Because the wasm functions are statically
+ functions and native DOM methods. Because the Wasm functions are statically
type checked, some of those native methods' dynamic type checks should become
unnecessary, promising to unlock even-faster-than-JavaScript DOM access.
diff --git a/benchmarks/index.html b/benchmarks/index.html
index 49cf021333a..b20d27e5d45 100644
--- a/benchmarks/index.html
+++ b/benchmarks/index.html
@@ -56,7 +56,7 @@
JS / wasm-bindgen comparison
This benchmarks tests out how long it take JS to call a thunk in
the given language. For example JS will call a JS thunk or
- JS will call a wasm function that does nothing.
+ JS will call a Wasm function that does nothing.
@@ -131,7 +131,7 @@
JS / wasm-bindgen comparison
This benchmarks calculates the 40th fibonacci number. It in
- theory should favor wasm since wasm is "better a compute", but
+ theory should favor Wasm since Wasm is "better a compute", but
a good JIT will probably make the code roughly equivalent.
- This benchmarks the overhead of passing strings to wasm and
+ This benchmarks the overhead of passing strings to Wasm and
also receiving them from wasm.
diff --git a/benchmarks/index.js b/benchmarks/index.js
index e74d8781da5..a8cbae01e77 100644
--- a/benchmarks/index.js
+++ b/benchmarks/index.js
@@ -160,7 +160,7 @@ function executeBenchmark(name, bm) {
});
}
-// Load wasm files and when they're done (plus the DOM) then we initialize
+// Load Wasm files and when they're done (plus the DOM) then we initialize
// everything
const wasms = [];
wasms.push(wbindgen_init('./pkg/wasm_bindgen_benchmark_bg.wasm'));
diff --git a/crates/backend/src/ast.rs b/crates/backend/src/ast.rs
index e10cf756ddd..d27e1e746b8 100644
--- a/crates/backend/src/ast.rs
+++ b/crates/backend/src/ast.rs
@@ -1,5 +1,5 @@
//! A representation of the Abstract Syntax Tree of a Rust program,
-//! with all the added metadata necessary to generate WASM bindings
+//! with all the added metadata necessary to generate Wasm bindings
//! for it.
use crate::{util::ShortHash, Diagnostic};
@@ -100,7 +100,7 @@ pub struct Export {
pub rust_class: Option,
/// The name of the rust function/method on the rust side.
pub rust_name: Ident,
- /// Whether or not this function should be flagged as the wasm start
+ /// Whether or not this function should be flagged as the Wasm start
/// function.
pub start: bool,
/// Path to wasm_bindgen
diff --git a/crates/backend/src/codegen.rs b/crates/backend/src/codegen.rs
index 9a41621cb1e..11daf2ccc15 100644
--- a/crates/backend/src/codegen.rs
+++ b/crates/backend/src/codegen.rs
@@ -86,7 +86,7 @@ impl TryToTokens for ast::Program {
Diagnostic::from_vec(errors)?;
// Generate a static which will eventually be what lives in a custom section
- // of the wasm executable. For now it's just a plain old static, but we'll
+ // of the Wasm executable. For now it's just a plain old static, but we'll
// eventually have it actually in its own section.
// See comments in `crates/cli-support/src/lib.rs` about what this
@@ -278,7 +278,7 @@ impl ToTokens for ast::Struct {
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
unsafe fn #new_fn(_: u32) -> u32 {
- panic!("cannot convert to JsValue outside of the wasm target")
+ panic!("cannot convert to JsValue outside of the Wasm target")
}
unsafe {
@@ -384,7 +384,7 @@ impl ToTokens for ast::Struct {
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
unsafe fn #unwrap_fn(_: u32) -> u32 {
- panic!("cannot convert from JsValue outside of the wasm target")
+ panic!("cannot convert from JsValue outside of the Wasm target")
}
let ptr = unsafe { #unwrap_fn(idx) };
diff --git a/crates/cli-support/src/externref.rs b/crates/cli-support/src/externref.rs
index be732ceeef0..a7803313541 100644
--- a/crates/cli-support/src/externref.rs
+++ b/crates/cli-support/src/externref.rs
@@ -86,7 +86,7 @@ pub fn process(module: &mut Module) -> Result<()> {
for instr in instrs {
match instr.instr {
// Calls to the heap live count intrinsic are now routed to the
- // actual wasm function which keeps track of this.
+ // actual Wasm function which keeps track of this.
Instruction::CallAdapter(adapter) => {
let id = match meta.live_count {
Some(id) => id,
@@ -103,7 +103,7 @@ pub fn process(module: &mut Module) -> Result<()> {
instr.instr = Instruction::CallCore(id);
}
- // Optional externref values are now managed in the wasm module, so
+ // Optional externref values are now managed in the Wasm module, so
// we need to store where they're managed.
Instruction::I32FromOptionExternref {
ref mut table_and_alloc,
@@ -333,7 +333,7 @@ fn export_xform(cx: &mut Context, export: Export, instrs: &mut Vec {
/// use to translate the `arg.get` instruction.
args: Vec,
- /// The wasm interface types "stack". The expressions pushed onto this stack
+ /// The Wasm interface types "stack". The expressions pushed onto this stack
/// are intended to be *pure*, and if they're not, they should be pushed
/// into the `prelude`, assigned to a variable, and the variable should be
/// pushed to the stack. We're not super principled about this though, so
@@ -164,7 +164,7 @@ impl<'a, 'b> Builder<'a, 'b> {
// We don't actually manage a literal stack at runtime, but instead we
// act as more of a compiler to generate straight-line code to make it
// more JIT-friendly. The generated code should be equivalent to the
- // wasm interface types stack machine, however.
+ // Wasm interface types stack machine, however.
for instr in instructions {
instruction(
&mut js,
@@ -1103,8 +1103,8 @@ fn instruction(
// Then pass it the pointer and the length of where we copied it.
js.push(format!("ptr{}", i));
js.push(format!("len{}", i));
- // Then we give wasm a reference to the original typed array, so that it can
- // update it with modifications made on the wasm side before returning.
+ // Then we give Wasm a reference to the original typed array, so that it can
+ // update it with modifications made on the Wasm side before returning.
js.push(val);
}
diff --git a/crates/cli-support/src/js/mod.rs b/crates/cli-support/src/js/mod.rs
index 8450349482d..87042e608fb 100644
--- a/crates/cli-support/src/js/mod.rs
+++ b/crates/cli-support/src/js/mod.rs
@@ -36,7 +36,7 @@ pub struct Context<'a> {
/// renames for each identifier.
js_imports: HashMap)>>,
- /// A map of each wasm import and what JS to hook up to it.
+ /// A map of each Wasm import and what JS to hook up to it.
wasm_import_definitions: HashMap,
/// A map from an import to the name we've locally imported it as.
@@ -377,7 +377,7 @@ impl<'a> Context<'a> {
}
// Depending on the output mode, generate necessary glue to actually
- // import the wasm file in one way or another.
+ // import the Wasm file in one way or another.
let mut init = (String::new(), String::new());
let mut footer = String::new();
let mut imports = self.js_import_header()?;
@@ -445,9 +445,9 @@ impl<'a> Context<'a> {
}
}
- // With Bundlers we can simply import the wasm file as if it were an ES module
+ // With Bundlers we can simply import the Wasm file as if it were an ES module
// and let the bundler/runtime take care of it.
- // With Node we manually read the wasm file from the filesystem and instantiate it.
+ // With Node we manually read the Wasm file from the filesystem and instantiate it.
OutputMode::Bundler { .. } | OutputMode::Node { module: true } => {
for (id, js) in crate::sorted_iter(&self.wasm_import_definitions) {
let import = self.module.imports.get_mut(*id);
@@ -491,7 +491,7 @@ impl<'a> Context<'a> {
}
// With a browser-native output we're generating an ES module, but
- // browsers don't support natively importing wasm right now so we
+ // browsers don't support natively importing Wasm right now so we
// expose the same initialization function as `--target no-modules`
// as the default export of the module.
OutputMode::Web => {
@@ -821,7 +821,7 @@ impl<'a> Context<'a> {
}} catch (e) {{
if (module.headers.get('Content-Type') != 'application/wasm') {{
console.warn(\"`WebAssembly.instantiateStreaming` failed \
- because your server does not serve wasm with \
+ because your server does not serve Wasm with \
`application/wasm` MIME type. Falling back to \
`WebAssembly.instantiate` which is slower. Original \
error:\\n\", e);
@@ -1307,7 +1307,7 @@ impl<'a> Context<'a> {
}
}
- // A fast path that directly writes char codes into WASM memory as long
+ // A fast path that directly writes char codes into Wasm memory as long
// as it finds only ASCII characters.
//
// This is much faster for common ASCII strings because it can avoid
@@ -1836,7 +1836,7 @@ impl<'a> Context<'a> {
let cache = format!("cached{}Memory{}", kind, view.num);
let resized_check = if self.module.memories.get(memory).shared {
- // When it's backed by a `SharedArrayBuffer`, growing the wasm module's memory
+ // When it's backed by a `SharedArrayBuffer`, growing the Wasm module's memory
// doesn't detach old references; instead, it just leaves them pointing to a
// slice of the up-to-date memory. So in order to check if it's been grown, we
// have to compare it to the up-to-date buffer.
@@ -2393,7 +2393,7 @@ impl<'a> Context<'a> {
}
/// If a start function is present, it removes it from the `start` section
- /// of the wasm module and then moves it to an exported function, named
+ /// of the Wasm module and then moves it to an exported function, named
/// `__wbindgen_start`.
fn unstart_start_function(&mut self) -> bool {
let start = match self.module.start.take() {
@@ -2780,7 +2780,7 @@ impl<'a> Context<'a> {
}
}
- /// Attempts to directly hook up the `id` import in the wasm module with
+ /// Attempts to directly hook up the `id` import in the Wasm module with
/// the `instrs` specified.
///
/// If this succeeds it returns `Ok(true)`, otherwise if it cannot be
@@ -2845,15 +2845,15 @@ impl<'a> Context<'a> {
// If there's no field projection happening here and this is a direct
// import from an ES-looking module, then we can actually just hook this
- // up directly in the wasm file itself. Note that this is covered in the
+ // up directly in the Wasm file itself. Note that this is covered in the
// various output formats as well:
//
- // * `bundler` - they think wasm is an ES module anyway
+ // * `bundler` - they think Wasm is an ES module anyway
// * `web` - we're sure to emit more `import` directives during
// `gen_init` and we update the import object accordingly.
- // * `nodejs` - the polyfill we have for requiring a wasm file as a node
+ // * `nodejs` - the polyfill we have for requiring a Wasm file as a node
// module will naturally emit `require` directives for the module
- // listed on each wasm import.
+ // listed on each Wasm import.
// * `no-modules` - imports aren't allowed here anyway from other
// modules and an error is generated.
if js.fields.is_empty() {
@@ -2928,11 +2928,11 @@ impl<'a> Context<'a> {
// needed.
CallAdapter(_) => saw_call = true,
- // Conversions to wasm integers are always supported since
+ // Conversions to Wasm integers are always supported since
// they're coerced into i32/f32/f64 appropriately.
IntToWasm { .. } => {}
- // Converts from wasm to JS, however, only supports most
+ // Converts from Wasm to JS, however, only supports most
// integers. Converting into a u32 isn't supported because we
// need to generate glue to change the sign.
WasmToInt {
@@ -3993,7 +3993,7 @@ impl<'a> Context<'a> {
let stack_pointer = match self.aux.stack_pointer {
Some(s) => s,
// In theory this shouldn't happen since malloc is included in
- // most wasm binaries (and may be gc'd out) and that almost
+ // most Wasm binaries (and may be gc'd out) and that almost
// always pulls in a stack pointer. We can try to synthesize
// something here later if necessary.
None => bail!("failed to find stack pointer"),
diff --git a/crates/cli-support/src/lib.rs b/crates/cli-support/src/lib.rs
index 7366bb5acb9..cf37a130616 100755
--- a/crates/cli-support/src/lib.rs
+++ b/crates/cli-support/src/lib.rs
@@ -35,7 +35,7 @@ pub struct Bindgen {
remove_producers_section: bool,
omit_default_module_path: bool,
emit_start: bool,
- // Support for the wasm threads proposal, transforms the wasm module to be
+ // Support for the Wasm threads proposal, transforms the Wasm module to be
// "ready to be instantiated on any thread"
threads: wasm_bindgen_threads_xform::Config,
externref: bool,
@@ -364,7 +364,7 @@ impl Bindgen {
descriptors::execute(&mut module)?;
// Process the custom section we extracted earlier. In its stead insert
- // a forward-compatible wasm interface types section as well as an
+ // a forward-compatible Wasm interface types section as well as an
// auxiliary section for all sorts of miscellaneous information and
// features #[wasm_bindgen] supports that aren't covered by wasm
// interface types.
@@ -405,7 +405,7 @@ impl Bindgen {
.context("failed to transform return pointers into multi-value Wasm")?;
}
- // We've done a whole bunch of transformations to the wasm module, many
+ // We've done a whole bunch of transformations to the Wasm module, many
// of which leave "garbage" lying around, so let's prune out all our
// unnecessary things here.
gc_module_and_adapters(&mut module);
@@ -724,8 +724,8 @@ export * from \"./{js_name}\";
fn gc_module_and_adapters(module: &mut Module) {
loop {
- // Fist up, cleanup the native wasm module. Note that roots can come
- // from custom sections, namely our wasm interface types custom section
+ // Fist up, cleanup the native Wasm module. Note that roots can come
+ // from custom sections, namely our Wasm interface types custom section
// as well as the aux section.
walrus::passes::gc::run(module);
diff --git a/crates/cli-support/src/multivalue.rs b/crates/cli-support/src/multivalue.rs
index f6b8afb078f..a49875381bf 100644
--- a/crates/cli-support/src/multivalue.rs
+++ b/crates/cli-support/src/multivalue.rs
@@ -30,7 +30,7 @@ pub fn run(module: &mut Module) -> Result<(), Error> {
.get_typed::()
.expect("aux section should be present")
.stack_pointer
- .ok_or_else(|| anyhow!("failed to find stack pointer in wasm module"))?;
+ .ok_or_else(|| anyhow!("failed to find stack pointer in Wasm module"))?;
let memory = wasm_conventions::get_memory(module)?;
let wrappers = multi_value_xform::run(module, memory, stack_pointer, &to_xform)?;
diff --git a/crates/cli-support/src/wasm2es6js.rs b/crates/cli-support/src/wasm2es6js.rs
index 77a51d8b445..36298fdd54e 100644
--- a/crates/cli-support/src/wasm2es6js.rs
+++ b/crates/cli-support/src/wasm2es6js.rs
@@ -205,7 +205,7 @@ impl Output {
// This ends up helping out in situations such as:
//
// * The start function calls an imported function
- // * That imported function in turn tries to access the wasm module
+ // * That imported function in turn tries to access the Wasm module
//
// If we don't do this then the second step won't work because the start
// function is automatically executed before the promise of
diff --git a/crates/cli-support/src/wit/incoming.rs b/crates/cli-support/src/wit/incoming.rs
index 583c1c34378..73571763834 100644
--- a/crates/cli-support/src/wit/incoming.rs
+++ b/crates/cli-support/src/wit/incoming.rs
@@ -1,8 +1,8 @@
-//! Definition of how to convert Rust types (`Description`) into wasm types
+//! Definition of how to convert Rust types (`Description`) into Wasm types
//! through adapter functions.
//!
//! Note that many Rust types use "nonstandard" instructions which only work in
-//! the JS output, not for the "pure wasm interface types" output.
+//! the JS output, not for the "pure Wasm interface types" output.
//!
//! Note that the mirror operation, going from WebAssembly to JS, is found in
//! the `outgoing.rs` module.
@@ -23,7 +23,7 @@ impl InstructionBuilder<'_, '_> {
}
// This is a wrapper around `_incoming` to have a number of sanity checks
// that we don't forget things. We should always produce at least one
- // wasm arge and exactly one webidl arg. Additionally the number of
+ // Wasm arge and exactly one webidl arg. Additionally the number of
// bindings should always match the number of webidl types for now.
let input_before = self.input.len();
let output_before = self.output.len();
diff --git a/crates/cli-support/src/wit/mod.rs b/crates/cli-support/src/wit/mod.rs
index ca0306967be..fb1825e01d7 100644
--- a/crates/cli-support/src/wit/mod.rs
+++ b/crates/cli-support/src/wit/mod.rs
@@ -23,9 +23,9 @@ struct Context<'a> {
module: &'a mut Module,
adapters: NonstandardWitSection,
aux: WasmBindgenAux,
- /// All of the wasm module's exported functions.
+ /// All of the Wasm module's exported functions.
function_exports: HashMap,
- /// All of the wasm module's imported functions.
+ /// All of the Wasm module's imported functions.
function_imports: HashMap,
/// A map from the signature of a function in the function table to its adapter, if we've already created it.
table_adapters: HashMap,
@@ -1093,7 +1093,7 @@ impl<'a> Context<'a> {
/// Perform a small verification pass over the module to perform some
/// internal sanity checks.
fn verify(&self) -> Result<(), Error> {
- // First up verify that all imports in the wasm module from our
+ // First up verify that all imports in the Wasm module from our
// `$PLACEHOLDER_MODULE` are connected to an adapter via the
// `implements` section.
let mut implemented = HashMap::new();
@@ -1182,7 +1182,7 @@ impl<'a> Context<'a> {
};
// Process the returned type first to see if it needs an out-pointer. This
- // happens if the results of the incoming arguments translated to wasm take
+ // happens if the results of the incoming arguments translated to Wasm take
// up more than one type.
let mut ret = self.instruction_builder(true);
ret.incoming(&signature.ret)?;
@@ -1200,7 +1200,7 @@ impl<'a> Context<'a> {
}
// Build up the list of instructions for our adapter function. We start out
- // with all the outgoing instructions which convert all wasm params to the
+ // with all the outgoing instructions which convert all Wasm params to the
// desired types to call our import...
let mut instructions = args.instructions;
@@ -1226,7 +1226,7 @@ impl<'a> Context<'a> {
instructions.extend(ret.instructions);
// ... and if a return pointer is in use then we need to store the types on
- // the stack into the wasm return pointer. Note that we iterate in reverse
+ // the stack into the Wasm return pointer. Note that we iterate in reverse
// here because the last result is the top value on the stack.
let results = if uses_retptr {
let mem = args.cx.memory()?;
@@ -1342,10 +1342,10 @@ impl<'a> Context<'a> {
let uses_retptr = ret.input.len() > 1;
// Our instruction stream starts out with the return pointer as the first
- // argument to the wasm function, if one is in use. Then we convert
- // everything to wasm types.
+ // argument to the Wasm function, if one is in use. Then we convert
+ // everything to Wasm types.
//
- // After calling the core wasm function we need to load all the return
+ // After calling the core Wasm function we need to load all the return
// pointer arguments if there were any, otherwise we simply convert
// everything into the outgoing arguments.
let mut instructions = Vec::new();
@@ -1530,7 +1530,7 @@ pub fn extract_programs<'a>(
while let Some(raw) = module.customs.remove_raw("__wasm_bindgen_unstable") {
log::debug!(
- "custom section '{}' looks like a wasm bindgen section",
+ "custom section '{}' looks like a Wasm bindgen section",
raw.name
);
program_storage.push(raw.data);
@@ -1542,7 +1542,7 @@ pub fn extract_programs<'a>(
while let Some(data) = get_remaining(&mut payload) {
// Historical versions of wasm-bindgen have used JSON as the custom
// data section format. Newer versions, however, are using a custom
- // serialization protocol that looks much more like the wasm spec.
+ // serialization protocol that looks much more like the Wasm spec.
//
// We, however, want a sanity check to ensure that if we're running
// against the wrong wasm-bindgen we get a nicer error than an
@@ -1559,10 +1559,10 @@ pub fn extract_programs<'a>(
bail!(
"
-it looks like the Rust project used to create this wasm file was linked against
+it looks like the Rust project used to create this Wasm file was linked against
version of wasm-bindgen that uses a different bindgen format than this binary:
- rust wasm file schema version: {their_version}
+ rust Wasm file schema version: {their_version}
this binary schema version: {my_version}
Currently the bindgen format is unstable enough that these two schema versions
@@ -1573,7 +1573,7 @@ You should be able to update the wasm-bindgen dependency with:
cargo update -p wasm-bindgen --precise {my_version}
-don't forget to recompile your wasm file! Alternatively, you can update the
+don't forget to recompile your Wasm file! Alternatively, you can update the
binary with:
cargo install -f wasm-bindgen-cli --version {their_version}
diff --git a/crates/cli-support/src/wit/nonstandard.rs b/crates/cli-support/src/wit/nonstandard.rs
index 4a9d5598ff5..5099a72098c 100644
--- a/crates/cli-support/src/wit/nonstandard.rs
+++ b/crates/cli-support/src/wit/nonstandard.rs
@@ -85,17 +85,17 @@ pub struct AuxExport {
pub variadic: bool,
}
-/// All possible kinds of exports from a wasm module.
+/// All possible kinds of exports from a Wasm module.
///
-/// This `enum` says where to place an exported wasm function. For example it
+/// This `enum` says where to place an exported Wasm function. For example it
/// may want to get hooked up to a JS class, or it may want to be exported as a
/// free function (etc).
///
/// TODO: it feels like this should not really be here per se. We probably want
-/// to either construct the JS object itself from within wasm or somehow move
+/// to either construct the JS object itself from within Wasm or somehow move
/// more of this information into some other section. Really what this is is
/// sort of an "export map" saying how to wire up all the free functions from
-/// the wasm module into the output expected JS module. All our functions here
+/// the Wasm module into the output expected JS module. All our functions here
/// currently take integer parameters and require a JS wrapper, but ideally
/// we'd change them one day to taking/receiving `externref` which then use some
/// sort of webidl import to customize behavior or something like that. In any
@@ -184,7 +184,7 @@ pub struct AuxStruct {
pub generate_typescript: bool,
}
-/// All possible types of imports that can be imported by a wasm module.
+/// All possible types of imports that can be imported by a Wasm module.
///
/// This `enum` is intended to map out what an imported value is. For example
/// this contains a ton of shims and various ways you can call a function. The
@@ -193,7 +193,7 @@ pub struct AuxStruct {
///
/// Note that this is *not* the same as the webidl bindings section. This is
/// intended to be coupled with that to map out what actually gets hooked up to
-/// an import in the wasm module. The two work in tandem.
+/// an import in the Wasm module. The two work in tandem.
///
/// Some of these items here are native to JS (like `Value`, indexing
/// operations, etc). Others are shims generated by wasm-bindgen (like `Closure`
diff --git a/crates/cli-support/src/wit/outgoing.rs b/crates/cli-support/src/wit/outgoing.rs
index 033217f61ad..b79a7b68cc6 100644
--- a/crates/cli-support/src/wit/outgoing.rs
+++ b/crates/cli-support/src/wit/outgoing.rs
@@ -6,10 +6,10 @@ use walrus::ValType;
impl InstructionBuilder<'_, '_> {
/// Processes one more `Descriptor` as an argument to a JS function that
- /// wasm is calling.
+ /// Wasm is calling.
///
/// This will internally skip `Unit` and otherwise build up the `bindings`
- /// map and ensure that it's correctly mapped from wasm to JS.
+ /// map and ensure that it's correctly mapped from Wasm to JS.
pub fn outgoing(&mut self, arg: &Descriptor) -> Result<(), Error> {
if let Descriptor::Unit = arg {
return Ok(());
@@ -213,7 +213,7 @@ impl InstructionBuilder<'_, '_> {
Descriptor::Function(descriptor) => {
// synthesize the a/b arguments that aren't present in the
- // signature from wasm-bindgen but are present in the wasm file.
+ // signature from wasm-bindgen but are present in the Wasm file.
let mut descriptor = (**descriptor).clone();
let nargs = descriptor.arguments.len();
descriptor.arguments.insert(0, Descriptor::I32);
diff --git a/crates/cli-support/src/wit/section.rs b/crates/cli-support/src/wit/section.rs
index c1e4ce4a896..a534e87ce39 100644
--- a/crates/cli-support/src/wit/section.rs
+++ b/crates/cli-support/src/wit/section.rs
@@ -1,20 +1,20 @@
-//! Support for generating a standard wasm interface types
+//! Support for generating a standard Wasm interface types
//!
//! This module has all the necessary support for generating a full-fledged
-//! standard wasm interface types section as defined by the `wit_walrus`
+//! standard Wasm interface types section as defined by the `wit_walrus`
//! crate. This module also critically assumes that the WebAssembly module
//! being generated **must be standalone**. In this mode all sorts of features
//! supported by `#[wasm_bindgen]` aren't actually supported, such as closures,
//! imports of global js names, js getters/setters, exporting structs, etc.
//! These features may all eventually come to the standard bindings proposal,
//! but it will likely take some time. In the meantime this module simply focuses
-//! on taking what's already a valid wasm module and letting it through with a
+//! on taking what's already a valid Wasm module and letting it through with a
//! standard WebIDL custom section. All other modules generate an error during
//! this binding process.
//!
//! Note that when this function is called and used we're also not actually
//! generating any JS glue. Any JS glue currently generated is also invalid if
-//! the module contains the wasm bindings section and it's actually respected.
+//! the module contains the Wasm bindings section and it's actually respected.
use crate::wit::AuxExport;
use crate::wit::{AdapterId, AdapterJsImportKind, AdapterType, AuxExportedMethodKind, Instruction};
@@ -145,7 +145,7 @@ pub fn add(module: &mut Module) -> Result<(), Error> {
bail!(
"generating a bindings section is currently incompatible with \
local JS modules being specified as well, `{}` cannot be used \
- since a standalone wasm file is being generated",
+ since a standalone Wasm file is being generated",
name,
);
}
@@ -154,7 +154,7 @@ pub fn add(module: &mut Module) -> Result<(), Error> {
bail!(
"generating a bindings section is currently incompatible with \
local JS snippets being specified as well, `{}` cannot be used \
- since a standalone wasm file is being generated",
+ since a standalone Wasm file is being generated",
name,
);
}
@@ -163,7 +163,7 @@ pub fn add(module: &mut Module) -> Result<(), Error> {
bail!(
"generating a bindings section is currently incompatible with \
package.json being consumed as well, `{}` cannot be used \
- since a standalone wasm file is being generated",
+ since a standalone Wasm file is being generated",
path.display(),
);
}
@@ -187,7 +187,7 @@ pub fn add(module: &mut Module) -> Result<(), Error> {
if let Some(enum_) = enums.iter().next() {
bail!(
"generating a bindings section is currently incompatible with \
- exporting an `enum` from the wasm file, cannot export `{}`",
+ exporting an `enum` from the Wasm file, cannot export `{}`",
enum_.name,
);
}
@@ -195,7 +195,7 @@ pub fn add(module: &mut Module) -> Result<(), Error> {
if let Some(struct_) = structs.iter().next() {
bail!(
"generating a bindings section is currently incompatible with \
- exporting a `struct` from the wasm file, cannot export `{}`",
+ exporting a `struct` from the Wasm file, cannot export `{}`",
struct_.name,
);
}
diff --git a/crates/cli-support/src/wit/standard.rs b/crates/cli-support/src/wit/standard.rs
index 0be106f060d..c93c4ef4d3f 100644
--- a/crates/cli-support/src/wit/standard.rs
+++ b/crates/cli-support/src/wit/standard.rs
@@ -9,7 +9,7 @@ pub struct NonstandardWitSection {
/// A list of adapter functions, keyed by their id.
pub adapters: HashMap,
- /// A list of pairs for adapter functions that implement core wasm imports.
+ /// A list of pairs for adapter functions that implement core Wasm imports.
pub implements: Vec<(ImportId, FunctionId, AdapterId)>,
/// A list of adapter functions and the names they're exported under.
@@ -130,18 +130,18 @@ pub enum Instruction {
size: u32,
},
- /// Pops a typed integer (`u8`, `s16`, etc.) and pushes a plain wasm `i32` or `i64` equivalent.
+ /// Pops a typed integer (`u8`, `s16`, etc.) and pushes a plain Wasm `i32` or `i64` equivalent.
IntToWasm {
input: AdapterType,
output: walrus::ValType,
},
- /// Pops a wasm `i32` or `i64` and pushes a typed integer (`u8`, `s16`, etc.) equivalent.
+ /// Pops a Wasm `i32` or `i64` and pushes a typed integer (`u8`, `s16`, etc.) equivalent.
WasmToInt {
input: walrus::ValType,
output: AdapterType,
},
- /// Pops a wasm `i32` and pushes the enum variant as a string
+ /// Pops a Wasm `i32` and pushes the enum variant as a string
WasmToStringEnum {
variant_values: Vec,
},
@@ -170,7 +170,7 @@ pub enum Instruction {
/// Pops an `externref` from the stack, allocates space in the externref table,
/// returns the index it was stored at.
I32FromExternrefOwned,
- /// Pops an `externref` from the stack, pushes it onto the externref wasm table
+ /// Pops an `externref` from the stack, pushes it onto the externref Wasm table
/// stack, and returns the index it was stored at.
I32FromExternrefBorrow,
/// Pops an `externref` from the stack, assumes it's a Rust class given, and
@@ -190,7 +190,7 @@ pub enum Instruction {
class: String,
},
/// Pops an `externref` from the stack, pushes either 0 if it's "none" or and
- /// index into the owned wasm table it was stored at if it's "some"
+ /// index into the owned Wasm table it was stored at if it's "some"
I32FromOptionExternref {
/// Set to `Some` by the externref pass of where to put it in the wasm
/// module, otherwise it's shoved into the JS shim.
diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs
index 26959e9e57f..919702af026 100644
--- a/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs
+++ b/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs
@@ -1,7 +1,7 @@
-//! A "wrapper binary" used to execute wasm files as tests
+//! A "wrapper binary" used to execute Wasm files as tests
//!
-//! This binary is intended to be used as a "test runner" for wasm binaries,
-//! being compatible with `cargo test` for the wasm target. It will
+//! This binary is intended to be used as a "test runner" for Wasm binaries,
+//! being compatible with `cargo test` for the Wasm target. It will
//! automatically execute `wasm-bindgen` (or the equivalent thereof) and then
//! execute either Node.js over the tests or start a server which a browser can
//! be used to run against to execute tests. In a browser mode if `CI` is in the
@@ -72,7 +72,7 @@ fn main() -> anyhow::Result<()> {
let shell = shell::Shell::new();
// Currently no flags are supported, and assume there's only one argument
- // which is the wasm file to test. This'll want to improve over time!
+ // which is the Wasm file to test. This'll want to improve over time!
let wasm_file_to_test = match args.next() {
Some(file) => PathBuf::from(file),
None => bail!("must have a file to test as first argument"),
@@ -112,9 +112,9 @@ fn main() -> anyhow::Result<()> {
// Collect all tests that the test harness is supposed to run. We assume
// that any exported function with the prefix `__wbg_test` is a test we need
// to execute.
- let wasm = fs::read(&wasm_file_to_test).context("failed to read wasm file")?;
+ let wasm = fs::read(&wasm_file_to_test).context("failed to read Wasm file")?;
let mut wasm =
- walrus::Module::from_buffer(&wasm).context("failed to deserialize wasm module")?;
+ walrus::Module::from_buffer(&wasm).context("failed to deserialize Wasm module")?;
let mut tests = Vec::new();
for export in wasm.exports.iter() {
@@ -230,7 +230,7 @@ fn main() -> anyhow::Result<()> {
.keep_debug(false)
.emit_start(false)
.generate(&tmpdir)
- .context("executing `wasm-bindgen` over the wasm file")?;
+ .context("executing `wasm-bindgen` over the Wasm file")?;
shell.clear();
let args: Vec<_> = args.collect();
diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/node.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/node.rs
index 2bc9f2ae640..ba131cf5465 100644
--- a/crates/cli/src/bin/wasm-bindgen-test-runner/node.rs
+++ b/crates/cli/src/bin/wasm-bindgen-test-runner/node.rs
@@ -82,7 +82,7 @@ pub fn execute(
);
// Note that we're collecting *JS objects* that represent the functions to
- // execute, and then those objects are passed into wasm for it to execute
+ // execute, and then those objects are passed into Wasm for it to execute
// when it sees fit.
for test in tests {
js_to_execute.push_str(&format!("tests.push('{}')\n", test));
diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/server.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/server.rs
index d0eee0c81d5..f77768c3c61 100644
--- a/crates/cli/src/bin/wasm-bindgen-test-runner/server.rs
+++ b/crates/cli/src/bin/wasm-bindgen-test-runner/server.rs
@@ -167,8 +167,8 @@ pub(crate) fn spawn(
r#"
// Now that we've gotten to the point where JS is executing, update our
// status text as at this point we should be asynchronously fetching the
- // wasm module.
- document.getElementById('output').textContent = "Loading wasm module...";
+ // Wasm module.
+ document.getElementById('output').textContent = "Loading Wasm module...";
{}
port.addEventListener("message", function(e) {{
@@ -252,8 +252,8 @@ pub(crate) fn spawn(
r#"
// Now that we've gotten to the point where JS is executing, update our
// status text as at this point we should be asynchronously fetching the
- // wasm module.
- document.getElementById('output').textContent = "Loading wasm module...";
+ // Wasm module.
+ document.getElementById('output').textContent = "Loading Wasm module...";
async function main(test) {{
const wasm = await init('./{0}_bg.wasm');
diff --git a/crates/cli/src/bin/wasm-bindgen.rs b/crates/cli/src/bin/wasm-bindgen.rs
index ee33c8de036..6076641c138 100644
--- a/crates/cli/src/bin/wasm-bindgen.rs
+++ b/crates/cli/src/bin/wasm-bindgen.rs
@@ -6,7 +6,7 @@ use std::process;
use wasm_bindgen_cli_support::{Bindgen, EncodeInto};
const USAGE: &str = "
-Generating JS bindings for a wasm file
+Generating JS bindings for a Wasm file
Usage:
wasm-bindgen [options]
@@ -28,7 +28,7 @@ Options:
--debug Include otherwise-extraneous debug checks in output
--no-demangle Don't demangle Rust symbol names
--keep-lld-exports Keep exports synthesized by LLD
- --keep-debug Keep debug sections in wasm files
+ --keep-debug Keep debug sections in Wasm files
--remove-name-section Remove the debugging `name` section of the file
--remove-producers-section Remove the telemetry `producers` section
--omit-default-module-path Don't add WebAssembly fallback imports in generated JavaScript
diff --git a/crates/cli/src/bin/wasm2es6js.rs b/crates/cli/src/bin/wasm2es6js.rs
index 249faa3a3dd..593dcfb2d11 100644
--- a/crates/cli/src/bin/wasm2es6js.rs
+++ b/crates/cli/src/bin/wasm2es6js.rs
@@ -5,7 +5,7 @@ use std::fs;
use std::path::PathBuf;
const USAGE: &str = "
-Converts a wasm file to an ES6 JS module
+Converts a Wasm file to an ES6 JS module
Usage:
wasm2es6js [options]
@@ -16,7 +16,7 @@ Options:
-o --output FILE File to place output in
--out-dir DIR Directory to place output in
--typescript Output a `*.d.ts` file next to the JS output
- --base64 Inline the wasm module using base64 encoding
+ --base64 Inline the Wasm module using base64 encoding
--fetch PATH Load module by passing the PATH argument to `fetch()`
Note that this is not intended to produce a production-ready output module
diff --git a/crates/cli/tests/reference.rs b/crates/cli/tests/reference.rs
index a8a39132310..6a4c57956df 100644
--- a/crates/cli/tests/reference.rs
+++ b/crates/cli/tests/reference.rs
@@ -1,8 +1,8 @@
-//! A test suite to check the reference JS and wasm output of the `wasm-bindgen`
+//! A test suite to check the reference JS and Wasm output of the `wasm-bindgen`
//! library.
//!
//! This is intended as an end-to-end integration test where we can track
-//! changes to the JS and wasm output.
+//! changes to the JS and Wasm output.
//!
//! Tests are located in `reference/*.rs` files and are accompanied with sibling
//! `*.js` files and `*.wat` files with the expected output of the `*.rs`
@@ -127,7 +127,7 @@ fn assert_same(output: &str, expected: &Path) -> Result<()> {
}
fn sanitize_wasm(wasm: &Path) -> Result {
- // Clean up the wasm module by removing all function
+ // Clean up the Wasm module by removing all function
// implementations/instructions, data sections, etc. This'll help us largely
// only deal with exports/imports which is all we're really interested in.
let mut module = ModuleConfig::new()
diff --git a/crates/externref-xform/src/lib.rs b/crates/externref-xform/src/lib.rs
index df18491889a..7ddf593b2cf 100644
--- a/crates/externref-xform/src/lib.rs
+++ b/crates/externref-xform/src/lib.rs
@@ -2,7 +2,7 @@
//! module.
//!
//! This crate is in charge of enabling code using `wasm-bindgen` to use the
-//! `externref` type inside of the wasm module. This transformation pass primarily
+//! `externref` type inside of the Wasm module. This transformation pass primarily
//! wraps exports and imports in shims which use `externref`, but quickly turn them
//! into `i32` value types. This is all largely a stopgap until Rust has
//! first-class support for the `externref` type, but that's thought to be in the
@@ -11,9 +11,9 @@
//!
//! The pass here works by collecting information during binding generation
//! about imports and exports. Afterwards this pass runs in one go against a
-//! wasm module, updating exports, imports, calls to these functions, etc. The
-//! goal at least is to have valid wasm modules coming in that don't use
-//! `externref` and valid wasm modules going out which use `externref` at the fringes.
+//! Wasm module, updating exports, imports, calls to these functions, etc. The
+//! goal at least is to have valid Wasm modules coming in that don't use
+//! `externref` and valid Wasm modules going out which use `externref` at the fringes.
use anyhow::{anyhow, bail, Context as _, Error};
use std::cmp;
@@ -97,7 +97,7 @@ enum Intrinsic {
}
impl Context {
- /// Executed first very early over a wasm module, used to learn about how
+ /// Executed first very early over a Wasm module, used to learn about how
/// large the function table is so we know what indexes to hand out when
/// we're appending entries.
pub fn prepare(&mut self, module: &mut Module) -> Result<(), Error> {
@@ -669,7 +669,7 @@ impl Transform<'_> {
//
// Note that we pave over all our stack slots with `ref.null` to ensure
// that the table doesn't accidentally hold a strong reference to items
- // no longer in use by our wasm instance.
+ // no longer in use by our Wasm instance.
if externref_stack > 0 {
body.local_get(fp)
.ref_null(RefType::Externref)
diff --git a/crates/futures/src/lib.rs b/crates/futures/src/lib.rs
index ba54d7864a1..2c1eb3db6ee 100644
--- a/crates/futures/src/lib.rs
+++ b/crates/futures/src/lib.rs
@@ -204,13 +204,13 @@ impl Future for JsFuture {
///
/// # Panics
///
-/// Note that in wasm panics are currently translated to aborts, but "abort" in
-/// this case means that a JavaScript exception is thrown. The wasm module is
+/// Note that in Wasm panics are currently translated to aborts, but "abort" in
+/// this case means that a JavaScript exception is thrown. The Wasm module is
/// still usable (likely erroneously) after Rust panics.
///
/// If the `future` provided panics then the returned `Promise` **will not
/// resolve**. Instead it will be a leaked promise. This is an unfortunate
-/// limitation of wasm currently that's hoped to be fixed one day!
+/// limitation of Wasm currently that's hoped to be fixed one day!
pub fn future_to_promise(future: F) -> Promise
where
F: Future