Add support and tests for EvalError

This commit is contained in:
Andrew Chin
2018-08-09 19:21:06 -04:00
parent 9a1147d61b
commit 70406fe18a
3 changed files with 73 additions and 0 deletions
crates/js-sys

@ -627,6 +627,23 @@ extern "C" {
pub fn to_string(this: &Error) -> JsString;
}
// EvalError
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(extends = Object, extends = Error)]
#[derive(Clone, Debug)]
pub type EvalError;
/// The EvalError object indicates an error regarding the global eval() function. This
/// exception is not thrown by JavaScript anymore, however the EvalError object remains for
/// compatibility.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError
#[wasm_bindgen(constructor)]
pub fn new(message: &str) -> EvalError;
}
// Float32Array
#[wasm_bindgen]
extern "C" {