bindings for Generator.throw()

This commit is contained in:
Alexander Kryvomaz
2018-07-03 23:48:54 +03:00
parent 39d79eb037
commit b797bbc39c
2 changed files with 53 additions and 0 deletions

View File

@ -386,6 +386,13 @@ extern {
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator/next
#[wasm_bindgen(method, structural)]
pub fn next(this: &Generator, value: &JsValue) -> JsValue;
/// The throw() method resumes the execution of a generator by throwing an error into it
/// and returns an object with two properties done and value.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator/throw
#[wasm_bindgen(method, structural)]
pub fn throw(this: &Generator, error: &Error) -> JsValue;
}
// Map