diff --git a/boa_engine/src/builtins/error/type.rs b/boa_engine/src/builtins/error/type.rs index 6a82717bf24..17a78203fad 100644 --- a/boa_engine/src/builtins/error/type.rs +++ b/boa_engine/src/builtins/error/type.rs @@ -109,12 +109,13 @@ impl IntrinsicObject for ThrowTypeError { let obj = BuiltInBuilder::with_intrinsic::(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, diff --git a/boa_engine/src/object/mod.rs b/boa_engine/src/object/mod.rs index dd862edbdf4..80f644e7921 100644 --- a/boa_engine/src/object/mod.rs +++ b/boa_engine/src/object/mod.rs @@ -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)>, }