Browse Source

Fixed Array.of panic with a non-conforming type error (#1520)

pull/1525/head
Iban Eguia 3 years ago committed by GitHub
parent
commit
aa087a421d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      boa/src/builtins/array/mod.rs

4
boa/src/builtins/array/mod.rs

@ -464,7 +464,9 @@ impl Array {
Some(object) if object.is_constructable() => object Some(object) if object.is_constructable() => object
.construct(&[len.into()], this, context)? .construct(&[len.into()], this, context)?
.as_object() .as_object()
.unwrap(), .ok_or_else(|| {
context.construct_type_error("object constructor didn't return an object")
})?,
_ => Array::array_create(len, None, context)?, _ => Array::array_create(len, None, context)?,
}; };

Loading…
Cancel
Save