Skip to content

Commit

Permalink
Fix GcObject to_json mutable borrow panic (#1284)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x7D2B authored May 26, 2021
1 parent 23e5936 commit 81ef87b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion boa/src/object/gcobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PropertyKey> = 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)? {
Expand Down

0 comments on commit 81ef87b

Please sign in to comment.