Skip to content

Commit

Permalink
Merge c6329ee into be20b65
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat authored Sep 1, 2020
2 parents be20b65 + c6329ee commit 24bf086
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions boa/src/builtins/object/gcobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand All @@ -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")
}
Expand Down Expand Up @@ -97,6 +99,7 @@ impl GcObject {
/// Panics if the object is currently mutably borrowed.
// <https://tc39.es/ecma262/#sec-prepareforordinarycall>
// <https://tc39.es/ecma262/#sec-ecmascript-function-objects-call-thisargument-argumentslist>
#[track_caller]
pub fn call(&self, this: &Value, args: &[Value], ctx: &mut Interpreter) -> Result<Value> {
let this_function_object = self.clone();
let object = self.borrow();
Expand Down Expand Up @@ -172,6 +175,7 @@ impl GcObject {
///# Panics
/// Panics if the object is currently mutably borrowed.
// <https://tc39.es/ecma262/#sec-ecmascript-function-objects-construct-argumentslist-newtarget>
#[track_caller]
pub fn construct(&self, args: &[Value], ctx: &mut Interpreter) -> Result<Value> {
let this = Object::create(self.borrow().get(&PROTOTYPE.into())).into();

Expand Down

0 comments on commit 24bf086

Please sign in to comment.