mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-05-30 06:01:21 +00:00
Fix enums defined in submodules
This commit is contained in:
parent
6c28e5f273
commit
4304a262c6
@ -763,7 +763,7 @@ impl ToTokens for ast::Enum {
|
|||||||
_extra: &mut ::wasm_bindgen::convert::Stack,
|
_extra: &mut ::wasm_bindgen::convert::Stack,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
#(#cast_clauses else)* {
|
#(#cast_clauses else)* {
|
||||||
wasm_bindgen::throw("invalid enum value passed")
|
::wasm_bindgen::throw("invalid enum value passed")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,13 +52,19 @@ fn c_style_enum_with_custom_values() {
|
|||||||
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
|
||||||
#[wasm_bindgen]
|
pub mod inner {
|
||||||
pub enum Color {
|
use wasm_bindgen::prelude::*;
|
||||||
Green = 21,
|
|
||||||
Yellow = 34,
|
#[wasm_bindgen]
|
||||||
Red,
|
pub enum Color {
|
||||||
|
Green = 21,
|
||||||
|
Yellow = 34,
|
||||||
|
Red,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use inner::Color;
|
||||||
|
|
||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
pub fn cycle(color: Color) -> Color {
|
pub fn cycle(color: Color) -> Color {
|
||||||
match color {
|
match color {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user