summaryrefslogtreecommitdiff
path: root/core/bindings.rs
diff options
context:
space:
mode:
Diffstat (limited to 'core/bindings.rs')
-rw-r--r--core/bindings.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/bindings.rs b/core/bindings.rs
index 8ad3948a5..46b6c622c 100644
--- a/core/bindings.rs
+++ b/core/bindings.rs
@@ -206,12 +206,15 @@ fn op_ctx_function<'s>(
) -> v8::Local<'s, v8::Function> {
let op_ctx_ptr = op_ctx as *const OpCtx as *const c_void;
let external = v8::External::new(scope, op_ctx_ptr as *mut c_void);
+ let v8name =
+ v8::String::new_external_onebyte_static(scope, op_ctx.decl.name.as_bytes())
+ .unwrap();
let builder: v8::FunctionBuilder<v8::FunctionTemplate> =
v8::FunctionTemplate::builder_raw(op_ctx.decl.v8_fn_ptr)
.data(external.into())
.length(op_ctx.decl.arg_count as i32);
- let templ = if let Some(fast_function) = &op_ctx.decl.fast_fn {
+ let template = if let Some(fast_function) = &op_ctx.decl.fast_fn {
builder.build_fast(
scope,
fast_function,
@@ -222,7 +225,10 @@ fn op_ctx_function<'s>(
} else {
builder.build(scope)
};
- templ.get_function(scope).unwrap()
+
+ let v8fn = template.get_function(scope).unwrap();
+ v8fn.set_name(v8name);
+ v8fn
}
pub extern "C" fn wasm_async_resolve_promise_callback(