File tree 2 files changed +4
-5
lines changed
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -712,12 +712,11 @@ fn instruction(
712
712
} => {
713
713
let enum_val = js. pop ( ) ;
714
714
let enum_val_expr = string_enum_to_wasm ( name, * invalid, & enum_val) ;
715
+ js. cx . expose_is_like_none ( ) ;
715
716
716
- // e.g. someEnumVal == undefined ? 4 : (string_enum_to_wasm(someEnumVal))
717
- // |
718
- // double equals here in case it's null
717
+ // e.g. isLikeNone(someEnumVal) ? 4 : (string_enum_to_wasm(someEnumVal))
719
718
js. push ( format ! (
720
- "{enum_val} == undefined ? {hole} : ({enum_val_expr})"
719
+ "isLikeNone( {enum_val}) ? {hole} : ({enum_val_expr})"
721
720
) )
722
721
}
723
722
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ export function get_name(color) {
58
58
* @returns {any | undefined }
59
59
*/
60
60
export function option_string_enum_echo ( color ) {
61
- const ret = wasm . option_string_enum_echo ( color == undefined ? 4 : ( ( __wbindgen_enum_ColorName . indexOf ( color ) + 1 || 4 ) - 1 ) ) ;
61
+ const ret = wasm . option_string_enum_echo ( isLikeNone ( color ) ? 4 : ( ( __wbindgen_enum_ColorName . indexOf ( color ) + 1 || 4 ) - 1 ) ) ;
62
62
return __wbindgen_enum_ColorName [ ret ] ;
63
63
}
64
64
You can’t perform that action at this time.
0 commit comments