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 Array.join when the array contains itself #3406

Merged
merged 2 commits into from
Oct 21, 2023
Merged
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions boa_engine/src/builtins/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,8 +1000,8 @@ impl Array {
}
// b. Let element be ? Get(O, ! ToString(𝔽(k))).
let element = o.get(k, context)?;
// c. If element is undefined or null, let next be the empty String; otherwise, let next be ? ToString(element).
let next = if element.is_null_or_undefined() {
// c. If element is undefined, null or the array itself, let next be the empty String; otherwise, let next be ? ToString(element).
let next = if element.is_null_or_undefined() || &element == this {
js_string!()
} else {
element.to_string(context)?
Expand Down
Loading