mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-27 03:55:20 +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
|
||||
#[wasm_bindgen]
|
||||
extern {
|
||||
#[wasm_bindgen(extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type Generator;
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
use wasm_bindgen::prelude::*;
|
||||
use wasm_bindgen_test::*;
|
||||
use wasm_bindgen::JsCast;
|
||||
use js_sys::*;
|
||||
|
||||
#[wasm_bindgen(module = "tests/wasm/Generator.js")]
|
||||
@ -56,3 +57,10 @@ fn throw() {
|
||||
assert!(next.value().is_undefined());
|
||||
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