diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2021-11-08 16:02:40 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-08 16:02:40 +0900 |
commit | 8e010b6844b339ab138b4d9e40148c60d44d197a (patch) | |
tree | 8ad367d0b7bfc81b22dc2307a20efc2b57bb1363 /core/bindings.rs | |
parent | 3828a7eb11de2beeb545e464550249337ca5618a (diff) |
feat(compat): add .code to dyn import error (#12633)
Diffstat (limited to 'core/bindings.rs')
-rw-r--r-- | core/bindings.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/bindings.rs b/core/bindings.rs index d1b01c2d9..10daee27a 100644 --- a/core/bindings.rs +++ b/core/bindings.rs @@ -244,6 +244,11 @@ pub extern "C" fn host_import_module_dynamically_callback( let message = arg.get(scope, message_key.into()).unwrap(); let exception = v8::Exception::type_error(scope, message.try_into().unwrap()); + let code_key = v8::String::new(scope, "code").unwrap(); + let code_value = + v8::String::new(scope, "ERR_MODULE_NOT_FOUND").unwrap(); + let exception_obj = exception.to_object(scope).unwrap(); + exception_obj.set(scope, code_key.into(), code_value.into()); scope.throw_exception(exception); return; } |