Browse Source

Fix GcObject to_json mutable borrow panic (#1284)

pull/1286/head
0x7D2B 4 years ago committed by GitHub
parent
commit
81ef87b7f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      boa/src/object/gcobject.rs

3
boa/src/object/gcobject.rs

@ -412,7 +412,8 @@ impl GcObject {
} else { } else {
let mut new_obj = Map::new(); let mut new_obj = Map::new();
let this = Value::from(self.clone()); 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 key = k.clone();
let value = this.get_field(k.to_string(), context)?; let value = this.get_field(k.to_string(), context)?;
if let Some(value) = value.to_json(context)? { if let Some(value) = value.to_json(context)? {

Loading…
Cancel
Save