Skip to content

Commit

Permalink
guide: Update untyped JS values section to handle fallibility of Refl…
Browse files Browse the repository at this point in the history
…ect::* APIs
  • Loading branch information
fitzgen committed Sep 25, 2018
1 parent f410f0e commit f75419b
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -18,7 +18,7 @@ A function that returns the value of a property.
#### Rust Usage

```rust
let value = js_sys::Reflect::get(&target, &property_key);
let value = js_sys::Reflect::get(&target, &property_key)?;
```

#### JavaScript Equivalent
Expand All @@ -37,7 +37,7 @@ the update was successful.
#### Rust Usage

```rust
js_sys::Reflect::set(&target, &property_key, &value);
js_sys::Reflect::set(&target, &property_key, &value)?;
```

#### JavaScript Equivalent
Expand All @@ -56,7 +56,7 @@ an own or inherited property exists on the target.
#### Rust Usage

```rust
if js_sys::Reflect::has(&target, &property_key) {
if js_sys::Reflect::has(&target, &property_key)? {
// ...
} else {
// ...
Expand Down

0 comments on commit f75419b

Please sign in to comment.