Skip to content

Commit baaadfe

Browse files
author
Mayank Raj
authored
fix(docs): fix typos and doc link formatting in documentation #5092 (#5093)
This Pull Request fixes/closes #5092. It changes the following: - **core/parser/src/parser/statement/declaration/mod.rs** — Put the `[spec]` doc link on its own line so it is no longer concatenated with `mod export;`. - **core/runtime/src/fetch/request.rs** — Add missing space in doc link: `[mdn]:https://` → `[mdn]: https://` for CommonMark compliance. - **docs/vm.md** — Fix typo: "binarys" → "binaries" in the VM debugging documentation. - **core/engine/src/vm/call_frame/mod.rs** — Fix grammar: "a integer" → "an integer" in unreachable messages (2 places). - **core/engine/src/vm/runtime_limits.rs** — Fix grammar: "throw and error" → "throw an error" in doc comments (2 places). All changes are documentation and comments only; no behavior changes.
1 parent 965f38c commit baaadfe

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

core/engine/src/vm/call_frame/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,10 @@ impl JsValue {
256256
0 => return GeneratorResumeKind::Normal,
257257
1 => return GeneratorResumeKind::Throw,
258258
2 => return GeneratorResumeKind::Return,
259-
_ => unreachable!("generator kind must be a integer between 1..=2, got {value}"),
259+
_ => unreachable!("generator kind must be an integer between 1..=2, got {value}"),
260260
}
261261
}
262262

263-
unreachable!("generator kind must be a integer type")
263+
unreachable!("generator kind must be an integer type")
264264
}
265265
}

core/engine/src/vm/runtime_limits.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl Default for RuntimeLimits {
2929
impl RuntimeLimits {
3030
/// Return the loop iteration limit.
3131
///
32-
/// If the limit is exceeded in a loop it will throw and error.
32+
/// If the limit is exceeded in a loop it will throw an error.
3333
///
3434
/// The limit value [`u64::MAX`] means that there is no limit.
3535
#[inline]
@@ -40,7 +40,7 @@ impl RuntimeLimits {
4040

4141
/// Set the loop iteration limit.
4242
///
43-
/// If the limit is exceeded in a loop it will throw and error.
43+
/// If the limit is exceeded in a loop it will throw an error.
4444
///
4545
/// Setting the limit to [`u64::MAX`] means that there is no limit.
4646
#[inline]

core/parser/src/parser/statement/declaration/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! - [ECMAScript specification][spec]
66
//!
77
//! [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements#Declarations
8-
//! [spec]:https://tc39.es/ecma262/#sec-declarations-and-the-variable-statement
8+
//! [spec]: https://tc39.es/ecma262/#sec-declarations-and-the-variable-statement
99
1010
mod export;
1111
mod hoistable;

core/runtime/src/fetch/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type VecOrMap<K, V> = Either<Vec<(K, V)>, BTreeMap<K, V>>;
4646
/// A [RequestInit][mdn] object. This is a JavaScript object (not a
4747
/// class) that can be used as options for creating a [`JsRequest`].
4848
///
49-
/// [mdn]:https://developer.mozilla.org/en-US/docs/Web/API/RequestInit
49+
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/API/RequestInit
5050
// TODO: This class does not contain all fields that are defined in the spec.
5151
#[derive(Debug, Clone, TryFromJs, Trace, Finalize)]
5252
pub struct RequestInit {

docs/vm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ The above output contains the following information:
394394

395395
### Comparing Bytecode output
396396

397-
If you wanted another engine's bytecode output for the same JS, SpiderMonkey's bytecode output is the best to use. You can follow the setup [here](https://udn.realityripple.com/docs/Mozilla/Projects/SpiderMonkey/Introduction_to_the_JavaScript_shell). You will need to build from source because the pre-built binarys don't include the debugging utilities which we need.
397+
If you wanted another engine's bytecode output for the same JS, SpiderMonkey's bytecode output is the best to use. You can follow the setup [here](https://udn.realityripple.com/docs/Mozilla/Projects/SpiderMonkey/Introduction_to_the_JavaScript_shell). You will need to build from source because the pre-built binaries don't include the debugging utilities which we need.
398398

399399
I named the binary `js_shell` as `js` conflicts with NodeJS. Once up and running you should be able to use `js_shell -f tests/js/test.js`. You will get no output to begin with, this is because you need to run `dis()` or `dis([func])` in the code. Once you've done that you should get some output like so:
400400

0 commit comments

Comments
 (0)