Support passing booleans back and forth

This commit is contained in:
Alex Crichton
2017-12-20 10:22:18 -08:00
parent 730ef1926e
commit 294c5e147b
6 changed files with 87 additions and 3 deletions

View File

@ -33,6 +33,7 @@ pub enum Type {
RawConstPtr(syn::Ident),
JsObject,
JsObjectRef,
Boolean,
}
pub struct Struct {
@ -271,6 +272,7 @@ impl Type {
"f64" => {
Type::Integer(ident)
}
"bool" => Type::Boolean,
"String" => Type::String,
"JsObject" => Type::JsObject,
_ => Type::ByValue(ident),
@ -292,6 +294,7 @@ impl Type {
Type::ByMutRef(n) => shared::Type::ByMutRef(n.to_string()),
Type::JsObject => shared::Type::JsObject,
Type::JsObjectRef => shared::Type::JsObjectRef,
Type::Boolean => shared::Type::Boolean,
}
}
}