summaryrefslogtreecommitdiffstats
path: root/vendor/wasm-bindgen-macro/ui-tests/link-to.rs
blob: ce51c128e2e9fba03d720c2cb0766f9c05afbc0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
fn good1() -> String {
    wasm_bindgen::link_to!(inline_js = "console.log('Hello world!');")
}

fn good2() -> String {
    wasm_bindgen::link_to!(raw_module = "./foo.js")
}

fn bad1() -> String {
    wasm_bindgen::link_to!(module = "package/foo.js")
}

fn bad2() -> String {
    wasm_bindgen::link_to!(raw_module = "package/foo.js")
}

fn bad3() -> String {
    wasm_bindgen::link_to!(module = "/src/not-found.js")
}

fn bad4() -> String {
    wasm_bindgen::link_to!()
}

fn bad5() -> String {
    wasm_bindgen::link_to!(
        inline_js = "console.log('Hello world!');",
        js_namespace = foo
    )
}

fn main() {}