-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
29 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,5 @@ fn main() -> Result<(), Error> { | |
json_args!(1, 2).to_vec(), | ||
)?; | ||
assert_eq!(result, 3); | ||
|
||
worker.stop() | ||
Ok(()) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,25 @@ | ||
pub mod example_extension; | ||
/// | ||
/// This example shows the definition of a simple extension exposing one op | ||
/// Also see example_extension.js | ||
/// | ||
/// Extensions like the one below allow you to let JS code call functions | ||
/// in rust | ||
/// | ||
/// Extensions consist of a set of #[op2] functions, an extension! macro, | ||
/// and one or more optional JS modules. | ||
/// | ||
/// | ||
use rustyscript::deno_core::{extension, op2}; | ||
|
||
#[op2(fast)] | ||
#[bigint] | ||
fn op_add_example(#[bigint] a: i64, #[bigint] b: i64) -> i64 { | ||
a + b | ||
} | ||
|
||
extension!( | ||
example_extension, | ||
ops = [op_add_example], | ||
esm_entry_point = "ext:example_extension/example_extension.js", | ||
esm = [ dir "examples/example_extension", "example_extension.js" ], | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters