mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-31 01:11:06 +00:00
Enums are numbers
This commit is contained in:
parent
3a270b6510
commit
71880b8a83
@ -1054,15 +1054,7 @@ impl<'a, 'b> SubContext<'a, 'b> {
|
|||||||
passed_args.push_str(arg);
|
passed_args.push_str(arg);
|
||||||
};
|
};
|
||||||
match *arg {
|
match *arg {
|
||||||
shared::TYPE_ENUM => {
|
shared::TYPE_ENUM | shared::TYPE_NUMBER => {
|
||||||
dst_ts.push_str(&format!(": {}", "any"));
|
|
||||||
if self.cx.config.debug {
|
|
||||||
self.cx.expose_assert_num();
|
|
||||||
arg_conversions.push_str(&format!("_assertNum({});\n", name));
|
|
||||||
}
|
|
||||||
pass(&name)
|
|
||||||
}
|
|
||||||
shared::TYPE_NUMBER => {
|
|
||||||
dst_ts.push_str(": number");
|
dst_ts.push_str(": number");
|
||||||
if self.cx.config.debug {
|
if self.cx.config.debug {
|
||||||
self.cx.expose_assert_num();
|
self.cx.expose_assert_num();
|
||||||
@ -1168,7 +1160,7 @@ impl<'a, 'b> SubContext<'a, 'b> {
|
|||||||
format!("return ret;")
|
format!("return ret;")
|
||||||
}
|
}
|
||||||
Some(shared::TYPE_ENUM) => {
|
Some(shared::TYPE_ENUM) => {
|
||||||
dst_ts.push_str(": any");
|
dst_ts.push_str(": number");
|
||||||
format!("return ret;")
|
format!("return ret;")
|
||||||
}
|
}
|
||||||
Some(shared::TYPE_NUMBER) => {
|
Some(shared::TYPE_NUMBER) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user