From c6329eebd7ed43ea21ac35c2218e5bae4915570d Mon Sep 17 00:00:00 2001 From: HalidOdat Date: Wed, 2 Sep 2020 00:44:37 +0200 Subject: [PATCH] Added `#[track_caller]` to `GcObject` methods that can panic --- boa/src/builtins/object/gcobject.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boa/src/builtins/object/gcobject.rs b/boa/src/builtins/object/gcobject.rs index 15b1d7d12fa..f91a15aa053 100644 --- a/boa/src/builtins/object/gcobject.rs +++ b/boa/src/builtins/object/gcobject.rs @@ -47,6 +47,7 @@ impl GcObject { ///# Panics /// Panics if the object is currently mutably borrowed. #[inline] + #[track_caller] pub fn borrow(&self) -> Ref<'_> { self.try_borrow().expect("Object already mutably borrowed") } @@ -59,6 +60,7 @@ impl GcObject { ///# Panics /// Panics if the object is currently borrowed. #[inline] + #[track_caller] pub fn borrow_mut(&self) -> RefMut<'_> { self.try_borrow_mut().expect("Object already borrowed") } @@ -97,6 +99,7 @@ impl GcObject { /// Panics if the object is currently mutably borrowed. // // + #[track_caller] pub fn call(&self, this: &Value, args: &[Value], ctx: &mut Interpreter) -> Result { let this_function_object = self.clone(); let object = self.borrow(); @@ -172,6 +175,7 @@ impl GcObject { ///# Panics /// Panics if the object is currently mutably borrowed. // + #[track_caller] pub fn construct(&self, args: &[Value], ctx: &mut Interpreter) -> Result { let this = Object::create(self.borrow().get(&PROTOTYPE.into())).into();