Skip to content

Commit

Permalink
upgrade to latest neon
Browse files Browse the repository at this point in the history
  • Loading branch information
amilajack committed Feb 3, 2020
1 parent b9d385d commit cee86be
Show file tree
Hide file tree
Showing 5 changed files with 798 additions and 22 deletions.
132 changes: 132 additions & 0 deletions native/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions native/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
[package]
name = "neon-hello"
name = "hello-world"
version = "0.1.0"
authors = ["Dave Herman <dherman@mozilla.com>"]
license = "MIT"
build = "build.rs"
edition = "2018"

[lib]
name = "neon_hello"
crate-type = ["dylib"]
name = "hello_world"
crate-type = ["cdylib"]

[build-dependencies]
neon-build = "0.1.15"
neon-build = "0.3.3"

[dependencies]
neon = "0.1.15"
neon = "0.3.3"
16 changes: 5 additions & 11 deletions native/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
#[macro_use]
extern crate neon;
use neon::prelude::*;
use neon::register_module;

use neon::vm::{Call, JsResult};
use neon::js::JsString;

fn hello(call: Call) -> JsResult<JsString> {
let scope = call.scope;
Ok(JsString::new(scope, "Hello from Neon!").unwrap())
fn hello_world(mut cx: FunctionContext) -> JsResult<JsString> {
Ok(cx.string("hello world!"))
}

register_module!(m, {
m.export("hello", hello)
});
register_module!(mut m, { m.export_function("helloWorld", hello_world) });
Loading

0 comments on commit cee86be

Please sign in to comment.