Add a test

This commit is contained in:
Anton Danilkin 2018-08-05 18:05:20 +03:00 committed by Alex Crichton
parent ebab7d9fc8
commit 5b66045aff
3 changed files with 17 additions and 0 deletions

View File

@ -87,6 +87,12 @@ global.Unforgeable = class Unforgeable {
}
};
global.GlobalMethod = class GlobalMethod {
constructor() {
this.m = () => 123;
}
};
global.PartialInterface = class PartialInterface {
get un() {
return 1;

View File

@ -62,6 +62,12 @@ fn optional_method() {
assert!(f.opt(None) == None);
}
#[wasm_bindgen_test]
fn global_method() {
let f = GlobalMethod::new().unwrap();
assert!(f.m() == 123);
}
#[wasm_bindgen_test]
fn unforgeable_is_structural() {
let f = Unforgeable::new().unwrap();

View File

@ -35,6 +35,11 @@ interface OptionalMethod {
octet? opt(short? a);
};
[Global=GlobalMethod, Constructor()]
interface GlobalMethod {
octet m();
};
[Constructor()]
interface Unforgeable {
[Unforgeable] readonly attribute short uno;