Skip to content

Commit

Permalink
Fix remaining TypedArray bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
raskad committed Jul 30, 2023
1 parent be055a3 commit 2d5bd18
Show file tree
Hide file tree
Showing 5 changed files with 313 additions and 250 deletions.
18 changes: 17 additions & 1 deletion boa_engine/src/builtins/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ impl IntrinsicObject for Array {
.name("values")
.build();

let to_string_function = BuiltInBuilder::callable_with_object(
realm,
realm
.intrinsics()
.objects()
.array_prototype_to_string()
.into(),
Self::to_string,
)
.name("toString")
.build();

let unscopables_object = Self::unscopables_object();

BuiltInBuilder::from_standard_constructor::<Self>(realm)
Expand Down Expand Up @@ -107,7 +119,11 @@ impl IntrinsicObject for Array {
.method(Self::filter, "filter", 1)
.method(Self::pop, "pop", 0)
.method(Self::join, "join", 1)
.method(Self::to_string, "toString", 0)
.property(
utf16!("toString"),
to_string_function,
Attribute::WRITABLE | Attribute::NON_ENUMERABLE | Attribute::CONFIGURABLE,
)
.method(Self::reverse, "reverse", 0)
.method(Self::shift, "shift", 0)
.method(Self::unshift, "unshift", 1)
Expand Down
Loading

0 comments on commit 2d5bd18

Please sign in to comment.