diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-04-19 16:22:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-19 16:22:41 +0200 |
commit | 5a77bb884416753b85f2acecd4895c75f1c53187 (patch) | |
tree | 1c8e569abed59c3b89cbd79342330142ce08c8b1 /core/runtime.rs | |
parent | 36cfb2fdbb721c9d97e7785908d3d0ab27bd51b6 (diff) |
refactor(core): return better error for non-existent async ops (#18772)
Diffstat (limited to 'core/runtime.rs')
-rw-r--r-- | core/runtime.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/runtime.rs b/core/runtime.rs index dd4d55f82..27fd82496 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -4644,6 +4644,21 @@ Deno.core.opAsync("op_async_serialize_object_with_numbers_as_keys", { .unwrap(); } + #[test] + fn test_non_existent_async_op_error() { + // Verify that "resizable ArrayBuffer" is disabled + let mut runtime = JsRuntime::new(Default::default()); + let err = runtime + .execute_script_static( + "test_rab.js", + r#"Deno.core.opAsync("this_op_doesnt_exist");"#, + ) + .unwrap_err(); + assert!(err + .to_string() + .contains("this_op_doesnt_exist is not a registered op")); + } + #[tokio::test] async fn cant_load_internal_module_when_snapshot_is_loaded_and_not_snapshotting( ) { |