|
18 | 18 | {
|
19 | 19 | /// Test whether this JS value is an instance of the type `T`.
|
20 | 20 | ///
|
21 |
| - /// This commit performs a dynamic check (at runtime) using the JS |
| 21 | + /// This method performs a dynamic check (at runtime) using the JS |
22 | 22 | /// `instanceof` operator. This method returns `self instanceof T`.
|
23 | 23 | fn is_instance_of<T>(&self) -> bool
|
24 | 24 | where
|
|
32 | 32 | ///
|
33 | 33 | /// This method will return `Err(self)` is `self.is_instance_of::<T>()`
|
34 | 34 | /// returns `false`, and otherwise it will return `Ok(T)` manufactured with
|
35 |
| - /// an unchecked cast (verified safe via the `instanceof` operation). |
| 35 | + /// an unchecked cast (verified correct via the `instanceof` operation). |
36 | 36 | fn dyn_into<T>(self) -> Result<T, Self>
|
37 | 37 | where
|
38 | 38 | T: JsCast,
|
|
49 | 49 | ///
|
50 | 50 | /// This method will return `None` is `self.is_instance_of::<T>()`
|
51 | 51 | /// returns `false`, and otherwise it will return `Some(&T)` manufactured
|
52 |
| - /// with an unchecked cast (verified safe via the `instanceof` operation). |
| 52 | + /// with an unchecked cast (verified correct via the `instanceof` operation). |
53 | 53 | fn dyn_ref<T>(&self) -> Option<&T>
|
54 | 54 | where
|
55 | 55 | T: JsCast,
|
|
66 | 66 | ///
|
67 | 67 | /// This method will return `None` is `self.is_instance_of::<T>()`
|
68 | 68 | /// returns `false`, and otherwise it will return `Some(&mut T)`
|
69 |
| - /// manufactured with an unchecked cast (verified safe via the `instanceof` |
70 |
| - /// operation). |
| 69 | + /// manufactured with an unchecked cast (verified correct via the |
| 70 | + /// `instanceof` operation). |
71 | 71 | fn dyn_mut<T>(&mut self) -> Option<&mut T>
|
72 | 72 | where
|
73 | 73 | T: JsCast,
|
|
85 | 85 | /// `self` and `T` are simple wrappers around `JsValue`. This method **does
|
86 | 86 | /// not check whether `self` is an instance of `T`**. If used incorrectly
|
87 | 87 | /// then this method may cause runtime exceptions in both Rust and JS, this
|
88 |
| - /// shoudl be used with caution. |
| 88 | + /// should be used with caution. |
89 | 89 | fn unchecked_into<T>(self) -> T
|
90 | 90 | where
|
91 | 91 | T: JsCast,
|
|
0 commit comments