From d75e2cb36b537924200ab93b9c5c73230b166830 Mon Sep 17 00:00:00 2001 From: Haled Odat Date: Mon, 10 Apr 2023 02:04:50 +0200 Subject: [PATCH] Fix `ThrowTypeError` intrinsic --- boa_engine/src/builtins/error/type.rs | 3 ++- boa_engine/src/object/mod.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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)>, }