From dfae564fdeb673e06696e1c58e3a81b03d1df65c Mon Sep 17 00:00:00 2001 From: 0x7D2B <0x7D2B@protonmail.com> Date: Tue, 25 May 2021 13:45:42 +0000 Subject: [PATCH] Fix GcObject to_json mutable borrow panic --- boa/src/object/gcobject.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boa/src/object/gcobject.rs b/boa/src/object/gcobject.rs index 5a7a0d05876..9973fa030b0 100644 --- a/boa/src/object/gcobject.rs +++ b/boa/src/object/gcobject.rs @@ -412,7 +412,8 @@ impl GcObject { } else { let mut new_obj = Map::new(); let this = Value::from(self.clone()); - for k in self.borrow().keys() { + let keys: Vec = self.borrow().keys().collect(); + for k in keys { let key = k.clone(); let value = this.get_field(k.to_string(), context)?; if let Some(value) = value.to_json(context)? {