From 687a61651adf32e9e7ca14d9eb86ef6b95b81377 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 +- test262 | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/boa_engine/src/builtins/error/type.rs b/boa_engine/src/builtins/error/type.rs index d480170e516..b94786c9e5f 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 7b5f149fa85..7f38e20fa64 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)>, } diff --git a/test262 b/test262 index f756ff63c8c..be0abd93cd7 160000 --- a/test262 +++ b/test262 @@ -1 +1 @@ -Subproject commit f756ff63c8cbf4119c9e9dbad456b9b474538318 +Subproject commit be0abd93cd799a758714b5707fa87c9048fc38ce