-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18bf892
commit 5e6d12a
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
fn good1() -> String { | ||
wasm_bindgen::link_to!(inline_js = "console.log('Hello world!');") | ||
} | ||
|
||
fn good2() -> String { | ||
wasm_bindgen::link_to!(raw_module = "package/foo.js") | ||
} | ||
|
||
fn bad1() -> String { | ||
wasm_bindgen::link_to!(module = "/src/not-found.js") | ||
} | ||
|
||
fn bad2() -> String { | ||
wasm_bindgen::link_to!() | ||
} | ||
|
||
fn bad3() -> String { | ||
wasm_bindgen::link_to!( | ||
inline_js = "console.log('Hello world!');", | ||
js_namespace = foo | ||
) | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error: failed to read file `$WORKSPACE/target/tests/wasm-bindgen-macro/src/not-found.js`: No such file or directory (os error 2) | ||
--> ui-tests/link-to.rs:10:37 | ||
| | ||
10 | wasm_bindgen::link_to!(module = "/src/not-found.js") | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: `link_to!` requires a module. | ||
--> ui-tests/link-to.rs:14:5 | ||
| | ||
14 | wasm_bindgen::link_to!() | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in the macro `wasm_bindgen::link_to` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: unused #[wasm_bindgen] attribute | ||
--> ui-tests/link-to.rs:20:9 | ||
| | ||
20 | js_namespace = foo | ||
| ^^^^^^^^^^^^ |