Implement duk_is_error.

This commit is contained in:
envis10n 2019-01-29 20:56:55 -06:00
parent 79eed41f2e
commit 4c6593faaf

View file

@ -38,6 +38,14 @@ extern "C" {
message: *const i8) -> duk_idx_t; message: *const i8) -> duk_idx_t;
} }
extern "C" {
/// Returns 1 if value at idx inherits from Error, otherwise returns 0. If idx is invalid, also returns 0.
pub fn duk_is_error(
ctx: *mut duk_context,
idx: duk_idx_t
) -> duk_bool_t;
}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
#[test] #[test]