diff --git a/boa_engine/src/builtins/error/type.rs b/boa_engine/src/builtins/error/type.rs index d480170e51..b94786c9e5 100644 --- a/boa_engine/src/builtins/error/type.rs +++ b/boa_engine/src/builtins/error/type.rs @@ -127,12 +127,13 @@ impl IntrinsicObject for ThrowTypeError { let obj = BuiltInBuilder::with_intrinsic::(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), diff --git a/boa_engine/src/object/mod.rs b/boa_engine/src/object/mod.rs index 7b5f149fa8..7f38e20fa6 100644 --- a/boa_engine/src/object/mod.rs +++ b/boa_engine/src/object/mod.rs @@ -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)>, }