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 1e75fd0 commit 687a616
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 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 @@ -127,12 +127,13 @@ impl IntrinsicObject for ThrowTypeError {

let obj = BuiltInBuilder::with_intrinsic::<Self>(realm)
.prototype(realm.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::new(
FunctionKind::Native {
function: NativeFunction::from_fn_ptr(throw_type_error),
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 @@ -125,7 +125,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
2 changes: 1 addition & 1 deletion test262
Submodule test262 updated 667 files

0 comments on commit 687a616

Please sign in to comment.