Skip to content

Commit 0a28b7a

Browse files
authored
perf: use Object::with_prototype_and_properties for CallSite (denoland#859)
1 parent 5766495 commit 0a28b7a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,8 +1020,8 @@ fn make_patched_callsite<'s>(
10201020
callsite: v8::Local<'s, v8::Object>,
10211021
prototype: v8::Local<'s, v8::Object>,
10221022
) -> v8::Local<'s, v8::Object> {
1023-
let out_obj = Object::new(scope);
1024-
out_obj.set_prototype(scope, prototype.into());
1023+
let out_obj =
1024+
Object::with_prototype_and_properties(scope, prototype.into(), &[], &[]);
10251025
let orig_key = original_call_site_key(scope);
10261026
out_obj.set_private(scope, orig_key, callsite.into());
10271027
out_obj

0 commit comments

Comments
 (0)