Skip to content

Commit

Permalink
Make is_native_error reentrant for error formatting (#968)
Browse files Browse the repository at this point in the history
  • Loading branch information
littledivy authored Nov 19, 2024
1 parent d82bf9d commit 6284399
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/ops_builtin_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub fn op_is_module_namespace_object(value: &v8::Value) -> bool {
value.is_module_namespace_object()
}

#[op2(fast, no_side_effects)]
#[op2(fast, reentrant)] // may be invoked by `format_exception_cb`
pub fn op_is_native_error(value: &v8::Value) -> bool {
value.is_native_error()
}
Expand Down
1 change: 1 addition & 0 deletions core/runtime/tests/jsrealm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ fn test_set_format_exception_callback_realms() {
format!(
r#"
Deno.core.ops.op_set_format_exception_callback((error) => {{
Deno.core.isNativeError(error); // test reentrancy
return `{realm_name} / ${{error}}`;
}});
"#
Expand Down

0 comments on commit 6284399

Please sign in to comment.