Skip to content

Commit

Permalink
Fix ThrowTypeError intrinsic
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat committed Apr 10, 2023
1 parent 928d67b commit d75e2cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion boa_engine/src/builtins/error/type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,13 @@ impl IntrinsicObject for ThrowTypeError {

let obj = BuiltInBuilder::with_intrinsic::<Self>(intrinsics)
.prototype(intrinsics.constructors().function().prototype())
.static_property(utf16!("name"), "ThrowTypeError", Attribute::empty())
.static_property(utf16!("length"), 0, Attribute::empty())
.static_property(utf16!("name"), "", Attribute::empty())
.build();

let mut obj = obj.borrow_mut();

obj.extensible = false;
obj.data = ObjectData::function(Function::Native {
function: NativeFunction::from_fn_ptr(throw_type_error),
constructor: None,
Expand Down
2 changes: 1 addition & 1 deletion boa_engine/src/object/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ pub struct Object {
/// Instance prototype `__proto__`.
prototype: JsPrototype,
/// Whether it can have new properties added to it.
extensible: bool,
pub(crate) extensible: bool,
/// The `[[PrivateElements]]` internal slot.
private_elements: ThinVec<(PrivateName, PrivateElement)>,
}
Expand Down

0 comments on commit d75e2cb

Please sign in to comment.