-
Notifications
You must be signed in to change notification settings - Fork 287
Closed
Description
pub struct Greeter {
greeting: String
}
declare_types! {
pub class JsGreeter for Greeter {
init(call) {
Ok(Greeter {
greeting: String::default()
})
}
method hello(call) {
Ok(JsNull::new().as_value(call.scope))
}
}
}
register_module!(m, {
let scope = m.scope;
let class = try!(JsGreeter::class(scope));
let constructor = try!(class.constructor(scope));
try!(m.exports.set("JsGreeter", constructor));
Ok(())
});Code like that gives me
$ node -p "require('./native')"
(node) v8::ObjectTemplate::Set() with non-primitive values is deprecated
(node) and will stop working in the next major release.
and stack traces.
Googling a little bit show up nodejs/node#6228 and it seems that same thing as in NODE_SET_METHOD in src/node.h need to be done in NeonSys_Class_AddMethod in neon/crates/neon-sys/src/neon.cc - Setting FunctionTemplate to prototype instead of Function.
Metadata
Metadata
Assignees
Labels
No labels