-
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.
Merge pull request #1449 from alexcrichton/no-interface-objects
Support [NoInterfaceObject] in `web-sys`
- Loading branch information
Showing
7 changed files
with
121 additions
and
17 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
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 |
---|---|---|
|
@@ -12,3 +12,4 @@ pub mod global; | |
pub mod namespace; | ||
pub mod simple; | ||
pub mod throws; | ||
pub mod no_interface; |
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,8 @@ | ||
global.GetNoInterfaceObject = class { | ||
static get() { | ||
return { | ||
number: 3, | ||
foo: () => {}, | ||
} | ||
} | ||
}; |
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,11 @@ | ||
use js_sys::Object; | ||
use wasm_bindgen_test::*; | ||
|
||
include!(concat!(env!("OUT_DIR"), "/no_interface.rs")); | ||
|
||
#[wasm_bindgen_test] | ||
fn smoke() { | ||
let obj = GetNoInterfaceObject::get(); | ||
assert_eq!(obj.number(), 3.0); | ||
obj.foo(); | ||
} |
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,9 @@ | ||
[NoInterfaceObject] | ||
interface NoInterfaceObject { | ||
readonly attribute double number; | ||
void foo(); | ||
}; | ||
|
||
interface GetNoInterfaceObject { | ||
static NoInterfaceObject get(); | ||
}; |
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
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