reluxscript 0.1.4

Write AST transformations once. Compile to Babel, SWC, and beyond.
Documentation
1
2
3
4
5
6
7
8
9
10
11
/// Minimal test for .unwrap_or() codegen issue in Babel
/// Issue: Generates .??() instead of proper JavaScript

plugin TestUnwrapOr {

    fn visit_identifier(node: &mut Identifier, ctx: &Context) {
        // Test unwrap_or on Option type
        let maybe_name: Option<Str> = Some("test".into());
        let name = maybe_name.unwrap_or("default".into());
    }
}