Skip to content

Commit e4f8c45

Browse files
authored
Consistently capitalize “Wasm” (#4094)
1 parent 125aa23 commit e4f8c45

File tree

78 files changed

+259
-259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+259
-259
lines changed

CHANGELOG.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ Released 2023-11-01
472472
[#3537](https://github.com/rustwasm/wasm-bindgen/pull/3537)
473473

474474
* Changed behavior when compiling to `wasm32-wasi` to match `wasm32-emscripten` and
475-
non-WASM targets, generating a stub that panics when called rather than a wasm-
475+
non-Wasm targets, generating a stub that panics when called rather than a wasm-
476476
bindgen placeholder.
477477
[#3233](https://github.com/rustwasm/wasm-bindgen/pull/3233)
478478

@@ -940,7 +940,7 @@ Released 2020-04-29.
940940
[#2099](https://github.com/rustwasm/wasm-bindgen/pull/2099)
941941

942942
* The output of `wasm-bindgen` is now compatible with Webpack 5 and the updated
943-
version of the wasm ESM integration specification.
943+
version of the Wasm ESM integration specification.
944944
[#2110](https://github.com/rustwasm/wasm-bindgen/pull/2099)
945945

946946
--------------------------------------------------------------------------------
@@ -1123,7 +1123,7 @@ Released 2019-11-19.
11231123
* Running `wasm-bindgen` over empty anyref modules now works again.
11241124
[#1861](https://github.com/rustwasm/wasm-bindgen/pull/1861)
11251125

1126-
* Support for multi-value JS engines has been fixed as a wasm interface types
1126+
* Support for multi-value JS engines has been fixed as a Wasm interface types
11271127
polyfill.
11281128
[#1863](https://github.com/rustwasm/wasm-bindgen/pull/1863)
11291129

@@ -1346,8 +1346,8 @@ Released 2019-07-11.
13461346
slices.
13471347
[#1639](https://github.com/rustwasm/wasm-bindgen/pull/1639)
13481348

1349-
* When using the `bundler` target the import of the wasm file now uses the
1350-
`.wasm` extension to ensure a wasm file is loaded.
1349+
* When using the `bundler` target the import of the Wasm file now uses the
1350+
`.wasm` extension to ensure a Wasm file is loaded.
13511351
[#1646](https://github.com/rustwasm/wasm-bindgen/pull/1646)
13521352

13531353
* The old internal `Stack` trait has been removed since it is no longer used.
@@ -1475,7 +1475,7 @@ Released 2019-05-16.
14751475
* A utility for counting the size of the `anyref` heap has been added.
14761476
[#1521](https://github.com/rustwasm/wasm-bindgen/pull/1521)
14771477

1478-
* Passing ASCII-only strings to WASM should now be significantly faster.
1478+
* Passing ASCII-only strings to Wasm should now be significantly faster.
14791479
[#1470](https://github.com/rustwasm/wasm-bindgen/pull/1470)
14801480

14811481
* The `selectionStart` and `selectionEnd` APIs of text areas have been enabled.
@@ -1615,7 +1615,7 @@ Released 2019-04-10.
16151615
[#1416](https://github.com/rustwasm/wasm-bindgen/pull/1416)
16161616

16171617
* A `wasm_bindgen::function_table()` function has been added to expose the
1618-
`WebAssembly.Table` and get access to it in wasm code.
1618+
`WebAssembly.Table` and get access to it in Wasm code.
16191619
[#1431](https://github.com/rustwasm/wasm-bindgen/pull/1431)
16201620

16211621
### Fixed
@@ -1778,7 +1778,7 @@ Released 2019-02-15.
17781778
[#1225](https://github.com/rustwasm/wasm-bindgen/pull/1225).
17791779

17801780
* A `--remove-producers-section` flag has been added to the CLI tool to, well,
1781-
remove the `producers` section from the final wasm file.
1781+
remove the `producers` section from the final Wasm file.
17821782
[#1256](https://github.com/rustwasm/wasm-bindgen/pull/1256).
17831783

17841784
### Fixed
@@ -1816,7 +1816,7 @@ Released 2019-02-12.
18161816
### Changed
18171817

18181818
* `wasm-bindgen` now internally uses the `walrus` crate to perform its
1819-
transformations of the wasm that rustc/LLVM emits. See
1819+
transformations of the Wasm that rustc/LLVM emits. See
18201820
[#1237](https://github.com/rustwasm/wasm-bindgen/pull/1237).
18211821

18221822
### Fixed
@@ -1968,17 +1968,17 @@ Released 2018-12-04.
19681968
### Added
19691969

19701970
* Add a `#[wasm_bindgen(start)]` attribute to customize the `start` section of
1971-
the wasm module.
1971+
the Wasm module.
19721972
[#1057](https://github.com/rustwasm/wasm-bindgen/pull/1057)
19731973

1974-
* Add support for producing the new "producers" section of wasm binaries
1974+
* Add support for producing the new "producers" section of Wasm binaries
19751975
[#1041](https://github.com/rustwasm/wasm-bindgen/pull/1041)
19761976

19771977
* Add support a `typescript_custom_section` attribute for producing custom
19781978
typescript abstractions
19791979
[#1048](https://github.com/rustwasm/wasm-bindgen/pull/1048)
19801980

1981-
* Generate `*.d.ts` files for wasm files in addition to the JS bindings
1981+
* Generate `*.d.ts` files for Wasm files in addition to the JS bindings
19821982
[#1053](https://github.com/rustwasm/wasm-bindgen/pull/1053)
19831983

19841984
* Add a feature to assert that all attributes in `#[wasm_bindgen]` are used to
@@ -2255,7 +2255,7 @@ Released 2018-09-07
22552255

22562256
### Fixed
22572257

2258-
* The "names" section of the wasm binary is now correctly preserved by
2258+
* The "names" section of the Wasm binary is now correctly preserved by
22592259
wasm-bindgen.
22602260

22612261
--------------------------------------------------------------------------------

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ greet("World!");
8787

8888
* **Designed with the ["Web IDL bindings" proposal][webidl-bindings] in mind.**
8989
Eventually, there won't be any JavaScript shims between Rust-generated wasm
90-
functions and native DOM methods. Because the wasm functions are statically
90+
functions and native DOM methods. Because the Wasm functions are statically
9191
type checked, some of those native methods' dynamic type checks should become
9292
unnecessary, promising to unlock even-faster-than-JavaScript DOM access.
9393

benchmarks/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ <h1>JS / wasm-bindgen comparison</h1>
5656
<p class='about'>
5757
This benchmarks tests out how long it take JS to call a thunk in
5858
the given language. For example JS will call a JS thunk or
59-
JS will call a wasm function that does nothing.
59+
JS will call a Wasm function that does nothing.
6060
</p>
6161
</td>
6262

@@ -131,7 +131,7 @@ <h1>JS / wasm-bindgen comparison</h1>
131131

132132
<p class='about'>
133133
This benchmarks calculates the 40th fibonacci number. It in
134-
theory should favor wasm since wasm is "better a compute", but
134+
theory should favor Wasm since Wasm is "better a compute", but
135135
a good JIT will probably make the code roughly equivalent.
136136
</p>
137137
</td>
@@ -296,7 +296,7 @@ <h1>wasm-bindgen benchmarks</h1>
296296
<a class='about-open' href='#'>(?)</a>
297297

298298
<p class='about'>
299-
This benchmarks the overhead of passing strings to wasm and
299+
This benchmarks the overhead of passing strings to Wasm and
300300
also receiving them from wasm.
301301
</p>
302302
</td>

benchmarks/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function executeBenchmark(name, bm) {
160160
});
161161
}
162162

163-
// Load wasm files and when they're done (plus the DOM) then we initialize
163+
// Load Wasm files and when they're done (plus the DOM) then we initialize
164164
// everything
165165
const wasms = [];
166166
wasms.push(wbindgen_init('./pkg/wasm_bindgen_benchmark_bg.wasm'));

crates/backend/src/ast.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! A representation of the Abstract Syntax Tree of a Rust program,
2-
//! with all the added metadata necessary to generate WASM bindings
2+
//! with all the added metadata necessary to generate Wasm bindings
33
//! for it.
44
55
use crate::{util::ShortHash, Diagnostic};
@@ -100,7 +100,7 @@ pub struct Export {
100100
pub rust_class: Option<Ident>,
101101
/// The name of the rust function/method on the rust side.
102102
pub rust_name: Ident,
103-
/// Whether or not this function should be flagged as the wasm start
103+
/// Whether or not this function should be flagged as the Wasm start
104104
/// function.
105105
pub start: bool,
106106
/// Path to wasm_bindgen

crates/backend/src/codegen.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl TryToTokens for ast::Program {
8686
Diagnostic::from_vec(errors)?;
8787

8888
// Generate a static which will eventually be what lives in a custom section
89-
// of the wasm executable. For now it's just a plain old static, but we'll
89+
// of the Wasm executable. For now it's just a plain old static, but we'll
9090
// eventually have it actually in its own section.
9191

9292
// See comments in `crates/cli-support/src/lib.rs` about what this
@@ -278,7 +278,7 @@ impl ToTokens for ast::Struct {
278278

279279
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
280280
unsafe fn #new_fn(_: u32) -> u32 {
281-
panic!("cannot convert to JsValue outside of the wasm target")
281+
panic!("cannot convert to JsValue outside of the Wasm target")
282282
}
283283

284284
unsafe {
@@ -384,7 +384,7 @@ impl ToTokens for ast::Struct {
384384

385385
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
386386
unsafe fn #unwrap_fn(_: u32) -> u32 {
387-
panic!("cannot convert from JsValue outside of the wasm target")
387+
panic!("cannot convert from JsValue outside of the Wasm target")
388388
}
389389

390390
let ptr = unsafe { #unwrap_fn(idx) };

crates/cli-support/src/externref.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub fn process(module: &mut Module) -> Result<()> {
8686
for instr in instrs {
8787
match instr.instr {
8888
// Calls to the heap live count intrinsic are now routed to the
89-
// actual wasm function which keeps track of this.
89+
// actual Wasm function which keeps track of this.
9090
Instruction::CallAdapter(adapter) => {
9191
let id = match meta.live_count {
9292
Some(id) => id,
@@ -103,7 +103,7 @@ pub fn process(module: &mut Module) -> Result<()> {
103103
instr.instr = Instruction::CallCore(id);
104104
}
105105

106-
// Optional externref values are now managed in the wasm module, so
106+
// Optional externref values are now managed in the Wasm module, so
107107
// we need to store where they're managed.
108108
Instruction::I32FromOptionExternref {
109109
ref mut table_and_alloc,
@@ -333,7 +333,7 @@ fn export_xform(cx: &mut Context, export: Export, instrs: &mut Vec<InstructionDa
333333
}
334334

335335
// Delete all unnecessary externref management instructions. We're going to
336-
// sink these instructions into the wasm module itself.
336+
// sink these instructions into the Wasm module itself.
337337
for idx in to_delete.into_iter().rev() {
338338
instrs.remove(idx);
339339
}
@@ -344,7 +344,7 @@ fn module_needs_externref_metadata(aux: &WasmBindgenAux, section: &NonstandardWi
344344
use Instruction::*;
345345

346346
// our `handleError` intrinsic uses a few pieces of metadata to store
347-
// indices directly into the wasm module.
347+
// indices directly into the Wasm module.
348348
if !aux.imports_with_catch.is_empty() {
349349
return true;
350350
}
@@ -387,7 +387,7 @@ fn module_needs_externref_metadata(aux: &WasmBindgenAux, section: &NonstandardWi
387387
})
388388
}
389389

390-
/// In MVP wasm all element segments must be contiguous lists of function
390+
/// In MVP Wasm all element segments must be contiguous lists of function
391391
/// indices. Post-MVP with reference types element segments can have holes.
392392
/// While `walrus` will select the encoding that fits, this function forces the
393393
/// listing of segments to be MVP-compatible.

crates/cli-support/src/js/binding.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub struct JsBuilder<'a, 'b> {
5454
/// use to translate the `arg.get` instruction.
5555
args: Vec<String>,
5656

57-
/// The wasm interface types "stack". The expressions pushed onto this stack
57+
/// The Wasm interface types "stack". The expressions pushed onto this stack
5858
/// are intended to be *pure*, and if they're not, they should be pushed
5959
/// into the `prelude`, assigned to a variable, and the variable should be
6060
/// pushed to the stack. We're not super principled about this though, so
@@ -164,7 +164,7 @@ impl<'a, 'b> Builder<'a, 'b> {
164164
// We don't actually manage a literal stack at runtime, but instead we
165165
// act as more of a compiler to generate straight-line code to make it
166166
// more JIT-friendly. The generated code should be equivalent to the
167-
// wasm interface types stack machine, however.
167+
// Wasm interface types stack machine, however.
168168
for instr in instructions {
169169
instruction(
170170
&mut js,
@@ -1103,8 +1103,8 @@ fn instruction(
11031103
// Then pass it the pointer and the length of where we copied it.
11041104
js.push(format!("ptr{}", i));
11051105
js.push(format!("len{}", i));
1106-
// Then we give wasm a reference to the original typed array, so that it can
1107-
// update it with modifications made on the wasm side before returning.
1106+
// Then we give Wasm a reference to the original typed array, so that it can
1107+
// update it with modifications made on the Wasm side before returning.
11081108
js.push(val);
11091109
}
11101110

crates/cli-support/src/js/mod.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub struct Context<'a> {
3636
/// renames for each identifier.
3737
js_imports: HashMap<String, Vec<(String, Option<String>)>>,
3838

39-
/// A map of each wasm import and what JS to hook up to it.
39+
/// A map of each Wasm import and what JS to hook up to it.
4040
wasm_import_definitions: HashMap<ImportId, String>,
4141

4242
/// A map from an import to the name we've locally imported it as.
@@ -377,7 +377,7 @@ impl<'a> Context<'a> {
377377
}
378378

379379
// Depending on the output mode, generate necessary glue to actually
380-
// import the wasm file in one way or another.
380+
// import the Wasm file in one way or another.
381381
let mut init = (String::new(), String::new());
382382
let mut footer = String::new();
383383
let mut imports = self.js_import_header()?;
@@ -445,9 +445,9 @@ impl<'a> Context<'a> {
445445
}
446446
}
447447

448-
// With Bundlers we can simply import the wasm file as if it were an ES module
448+
// With Bundlers we can simply import the Wasm file as if it were an ES module
449449
// and let the bundler/runtime take care of it.
450-
// With Node we manually read the wasm file from the filesystem and instantiate it.
450+
// With Node we manually read the Wasm file from the filesystem and instantiate it.
451451
OutputMode::Bundler { .. } | OutputMode::Node { module: true } => {
452452
for (id, js) in crate::sorted_iter(&self.wasm_import_definitions) {
453453
let import = self.module.imports.get_mut(*id);
@@ -491,7 +491,7 @@ impl<'a> Context<'a> {
491491
}
492492

493493
// With a browser-native output we're generating an ES module, but
494-
// browsers don't support natively importing wasm right now so we
494+
// browsers don't support natively importing Wasm right now so we
495495
// expose the same initialization function as `--target no-modules`
496496
// as the default export of the module.
497497
OutputMode::Web => {
@@ -821,7 +821,7 @@ impl<'a> Context<'a> {
821821
}} catch (e) {{
822822
if (module.headers.get('Content-Type') != 'application/wasm') {{
823823
console.warn(\"`WebAssembly.instantiateStreaming` failed \
824-
because your server does not serve wasm with \
824+
because your server does not serve Wasm with \
825825
`application/wasm` MIME type. Falling back to \
826826
`WebAssembly.instantiate` which is slower. Original \
827827
error:\\n\", e);
@@ -1307,7 +1307,7 @@ impl<'a> Context<'a> {
13071307
}
13081308
}
13091309

1310-
// A fast path that directly writes char codes into WASM memory as long
1310+
// A fast path that directly writes char codes into Wasm memory as long
13111311
// as it finds only ASCII characters.
13121312
//
13131313
// This is much faster for common ASCII strings because it can avoid
@@ -1836,7 +1836,7 @@ impl<'a> Context<'a> {
18361836

18371837
let cache = format!("cached{}Memory{}", kind, view.num);
18381838
let resized_check = if self.module.memories.get(memory).shared {
1839-
// When it's backed by a `SharedArrayBuffer`, growing the wasm module's memory
1839+
// When it's backed by a `SharedArrayBuffer`, growing the Wasm module's memory
18401840
// doesn't detach old references; instead, it just leaves them pointing to a
18411841
// slice of the up-to-date memory. So in order to check if it's been grown, we
18421842
// have to compare it to the up-to-date buffer.
@@ -2393,7 +2393,7 @@ impl<'a> Context<'a> {
23932393
}
23942394

23952395
/// If a start function is present, it removes it from the `start` section
2396-
/// of the wasm module and then moves it to an exported function, named
2396+
/// of the Wasm module and then moves it to an exported function, named
23972397
/// `__wbindgen_start`.
23982398
fn unstart_start_function(&mut self) -> bool {
23992399
let start = match self.module.start.take() {
@@ -2780,7 +2780,7 @@ impl<'a> Context<'a> {
27802780
}
27812781
}
27822782

2783-
/// Attempts to directly hook up the `id` import in the wasm module with
2783+
/// Attempts to directly hook up the `id` import in the Wasm module with
27842784
/// the `instrs` specified.
27852785
///
27862786
/// If this succeeds it returns `Ok(true)`, otherwise if it cannot be
@@ -2845,15 +2845,15 @@ impl<'a> Context<'a> {
28452845

28462846
// If there's no field projection happening here and this is a direct
28472847
// import from an ES-looking module, then we can actually just hook this
2848-
// up directly in the wasm file itself. Note that this is covered in the
2848+
// up directly in the Wasm file itself. Note that this is covered in the
28492849
// various output formats as well:
28502850
//
2851-
// * `bundler` - they think wasm is an ES module anyway
2851+
// * `bundler` - they think Wasm is an ES module anyway
28522852
// * `web` - we're sure to emit more `import` directives during
28532853
// `gen_init` and we update the import object accordingly.
2854-
// * `nodejs` - the polyfill we have for requiring a wasm file as a node
2854+
// * `nodejs` - the polyfill we have for requiring a Wasm file as a node
28552855
// module will naturally emit `require` directives for the module
2856-
// listed on each wasm import.
2856+
// listed on each Wasm import.
28572857
// * `no-modules` - imports aren't allowed here anyway from other
28582858
// modules and an error is generated.
28592859
if js.fields.is_empty() {
@@ -2928,11 +2928,11 @@ impl<'a> Context<'a> {
29282928
// needed.
29292929
CallAdapter(_) => saw_call = true,
29302930

2931-
// Conversions to wasm integers are always supported since
2931+
// Conversions to Wasm integers are always supported since
29322932
// they're coerced into i32/f32/f64 appropriately.
29332933
IntToWasm { .. } => {}
29342934

2935-
// Converts from wasm to JS, however, only supports most
2935+
// Converts from Wasm to JS, however, only supports most
29362936
// integers. Converting into a u32 isn't supported because we
29372937
// need to generate glue to change the sign.
29382938
WasmToInt {
@@ -3993,7 +3993,7 @@ impl<'a> Context<'a> {
39933993
let stack_pointer = match self.aux.stack_pointer {
39943994
Some(s) => s,
39953995
// In theory this shouldn't happen since malloc is included in
3996-
// most wasm binaries (and may be gc'd out) and that almost
3996+
// most Wasm binaries (and may be gc'd out) and that almost
39973997
// always pulls in a stack pointer. We can try to synthesize
39983998
// something here later if necessary.
39993999
None => bail!("failed to find stack pointer"),

0 commit comments

Comments
 (0)