summaryrefslogtreecommitdiff
path: root/core/ops_builtin.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-05-03 19:45:57 +0200
committerGitHub <noreply@github.com>2022-05-03 19:45:57 +0200
commit3f08a40412d89bd54222ad51fc1aaeb508e2e5e7 (patch)
tree61c8cac3376e4ef7f842dd3267bfd7ada31806c3 /core/ops_builtin.rs
parent5ddb83a4c2a5622d0ea173c0798550ae76e1fd69 (diff)
refactor: add core.formatLocationFilename, remove op_format_filename (#14474)
This commit moves "op_format_location" to "core/ops_builtin.rs" and removes "Deno.core.createPrepareStackTrace" in favor of "Deno.core.prepareStackTrace". Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
Diffstat (limited to 'core/ops_builtin.rs')
-rw-r--r--core/ops_builtin.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/ops_builtin.rs b/core/ops_builtin.rs
index 4b566e916..23837bbb7 100644
--- a/core/ops_builtin.rs
+++ b/core/ops_builtin.rs
@@ -1,3 +1,4 @@
+use crate::error::format_file_name;
use crate::error::type_error;
use crate::include_js_files;
use crate::ops_metrics::OpMetrics;
@@ -34,6 +35,7 @@ pub(crate) fn init_builtins() -> Extension {
op_write::decl(),
op_shutdown::decl(),
op_metrics::decl(),
+ op_format_file_name::decl(),
])
.build()
}
@@ -183,3 +185,8 @@ async fn op_shutdown(
let resource = state.borrow().resource_table.get_any(rid)?;
resource.shutdown().await
}
+
+#[op]
+fn op_format_file_name(file_name: String) -> Result<String, Error> {
+ Ok(format_file_name(&file_name))
+}