Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
---
Modify the link targets to the writing issues
for each yet unwritten docs in temporary.
  • Loading branch information
usagi committed Mar 22, 2020
1 parent 2430822 commit 578b106
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ fn thread_count(mut cx: FunctionContext) -> JsResult<JsNumber> {
A few more things to note about this code:

- The `cx` argument to `thread_count`: this contains information about the function call, such as the arguments and the value of `this`.
- The [`JsResult`](https://docs.rs/neon/*/neon/result/type.JsResult.html) output type: this is a Rust [`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) type that indicates whether the function returned (`Ok`) or threw a JavaScript exception (`Err`). You can learn more in the [Handling Errors](../handling-errors) guide. It also tracks the lifetime of the returned _handle_. You can read more about handles in the [Handles and Memory](../handles-and-memory/) guide.
- The `cx.number()` function tells the JavaScript garbage collector that we need to keep the value we allocate alive long enough to return it to the caller of `thread_count`. You can learn more about memory management in the [Handles and Memory](../handles-and-memory/) guide.
- The [`JsResult`](https://docs.rs/neon/*/neon/result/type.JsResult.html) output type: this is a Rust [`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) type that indicates whether the function returned (`Ok`) or threw a JavaScript exception (`Err`). You can learn more in the [Handling Errors](https://github.com/neon-bindings/website/issues/125) guide. It also tracks the lifetime of the returned _handle_. You can read more about handles in the [Handles and Memory](https://github.com/neon-bindings/website/issues/78) guide.
- The `cx.number()` function tells the JavaScript garbage collector that we need to keep the value we allocate alive long enough to return it to the caller of `thread_count`. You can learn more about memory management in the [Handles and Memory](https://github.com/neon-bindings/website/issues/78) guide.

Finally, we'll modify the code that `neon new` created for us to set up the module exports with this function instead of the initial "hello world" function it created for us:

Expand Down

0 comments on commit 578b106

Please sign in to comment.