Skip to content

Commit

Permalink
exit early
Browse files Browse the repository at this point in the history
  • Loading branch information
n14little committed May 20, 2020
1 parent 35cc9b0 commit 62ed4ac
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions boa/src/builtins/json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,15 @@ pub fn stringify(_: &mut Value, args: &[Value], interpreter: &mut Interpreter) -
let borrowed_derefed_replacer = derefed_obj.borrow();
if borrowed_derefed_replacer.kind == ObjectKind::Array {
for (key, value) in borrowed_derefed_replacer.properties.iter() {
if key == "length" {
continue;
}

if let Some(Value(x)) = &value.value {
if key != "length" {
object_to_return.set_property(
x.to_string(),
object.get_property(&x.to_string()).unwrap(),
);
}
object_to_return.set_property(
x.to_string(),
object.get_property(&x.to_string()).unwrap(),
);
}
}
} else if borrowed_derefed_replacer.kind == ObjectKind::Function {
Expand Down

0 comments on commit 62ed4ac

Please sign in to comment.