mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-25 19:11:45 +03: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,
|
||||
) -> Self {
|
||||
#(#cast_clauses else)* {
|
||||
wasm_bindgen::throw("invalid enum value passed")
|
||||
::wasm_bindgen::throw("invalid enum value passed")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,12 +52,18 @@ fn c_style_enum_with_custom_values() {
|
||||
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
pub mod inner {
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub enum Color {
|
||||
Green = 21,
|
||||
Yellow = 34,
|
||||
Red,
|
||||
}
|
||||
}
|
||||
|
||||
use inner::Color;
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn cycle(color: Color) -> Color {
|
||||
|
Loading…
Reference in New Issue
Block a user