-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reproduce rustwasm/wasm-bindgen#1191
- Loading branch information
Showing
1 changed file
with
14 additions
and
5 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 |
---|---|---|
@@ -1,7 +1,16 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
#[test] | ||
fn it_works() { | ||
assert_eq!(2 + 2, 4); | ||
#[cfg(feature = "bindings")] | ||
extern crate wasm_bindgen; | ||
#[cfg(feature = "bindings")] | ||
use wasm_bindgen::prelude::*; | ||
|
||
#[cfg_attr(feature = "bindings", wasm_bindgen)] | ||
pub struct Foo { | ||
} | ||
|
||
#[cfg_attr(feature = "bindings", wasm_bindgen)] | ||
impl Foo { | ||
#[cfg_attr(feature = "bindings", wasm_bindgen(constructor))] | ||
pub fn new() -> Foo { | ||
Foo {} | ||
} | ||
} |