mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-28 12:32:37 +03:00
Merge pull request #723 from mstallmo/add-extends-to-js-sys
Add extends attributes for js_sys:Generator
This commit is contained in:
commit
3697ddf4c0
@ -885,6 +885,7 @@ impl Function {
|
|||||||
// Generator
|
// Generator
|
||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
extern {
|
extern {
|
||||||
|
#[wasm_bindgen(extends = Object)]
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub type Generator;
|
pub type Generator;
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
use wasm_bindgen_test::*;
|
use wasm_bindgen_test::*;
|
||||||
|
use wasm_bindgen::JsCast;
|
||||||
use js_sys::*;
|
use js_sys::*;
|
||||||
|
|
||||||
#[wasm_bindgen(module = "tests/wasm/Generator.js")]
|
#[wasm_bindgen(module = "tests/wasm/Generator.js")]
|
||||||
@ -56,3 +57,10 @@ fn throw() {
|
|||||||
assert!(next.value().is_undefined());
|
assert!(next.value().is_undefined());
|
||||||
assert!(next.done());
|
assert!(next.done());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[wasm_bindgen_test]
|
||||||
|
fn generator_inheritance() {
|
||||||
|
let gen = dummy_generator();
|
||||||
|
|
||||||
|
assert!(gen.is_instance_of::<Object>());
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user