diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2021-10-19 17:26:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-19 18:26:45 +0200 |
commit | e8ee5da459f6addd15b726ff5860cfb148c2c60f (patch) | |
tree | ad5b1d2878d70a4fc4a8904ef0ae0fc1eca608b7 /core/bindings.rs | |
parent | d6062b265331b88efcbe740741bd93714ec11026 (diff) |
fix(core/bindings): use is_instance_of_error() instead of is_native_error() (#12479)
Diffstat (limited to 'core/bindings.rs')
-rw-r--r-- | core/bindings.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/bindings.rs b/core/bindings.rs index 2fc6b5092..08ae1c655 100644 --- a/core/bindings.rs +++ b/core/bindings.rs @@ -1,5 +1,6 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +use crate::error::is_instance_of_error; use crate::error::AnyError; use crate::modules::ModuleMap; use crate::resolve_url_or_path; @@ -238,7 +239,7 @@ pub extern "C" fn host_import_module_dynamically_callback( args: v8::FunctionCallbackArguments, _rv: v8::ReturnValue| { let arg = args.get(0); - if arg.is_native_error() { + if is_instance_of_error(scope, arg) { let message = v8::Exception::create_message(scope, arg); if message.get_stack_trace(scope).unwrap().get_frame_count() == 0 { let arg: v8::Local<v8::Object> = arg.try_into().unwrap(); @@ -512,7 +513,7 @@ fn eval_context( None, Some(ErrInfo { thrown: exception.into(), - is_native_error: exception.is_native_error(), + is_native_error: is_instance_of_error(tc_scope, exception), is_compile_error: true, }), ); @@ -529,7 +530,7 @@ fn eval_context( None, Some(ErrInfo { thrown: exception.into(), - is_native_error: exception.is_native_error(), + is_native_error: is_instance_of_error(tc_scope, exception), is_compile_error: false, }), ); |