Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix remaining TypedArray bugs #3186

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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