Skip to content

Conversation

@kateinoigakukun
Copy link
Member

Mitigate #512

return statements
statements.append("_swift_js_push_i32(Int32(\(accessor).count))")
let parsed: CodeBlockItemListSyntax = "\(raw: statements.joined(separator: "\n"))"
return Array(parsed)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant copy here? Could this return some Sequence<CodeBlockItemSyntax> instead of you want it to avoid leaking CodeBlockItemListSyntax as a return type?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just because the rest of StackCodegen expects [CodeBlockItemSyntax] now. This is unfortunate but it will be removed once we get rid of SwiftSyntax-based node construction at all.

return statements
statements.append("_swift_js_push_i32(__bjs_isSome_\(varPrefix) ? 1 : 0)")
let parsed: CodeBlockItemListSyntax = "\(raw: statements.joined(separator: "\n"))"
return Array(parsed)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Member

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunate that the diff is huge and there's unnecessary Array copying, but if it fixes the original issue, we can accept this as a temporary measure before subsequent optimizations are applied

@kateinoigakukun kateinoigakukun merged commit dd1cb58 into main Feb 11, 2026
11 checks passed
@kateinoigakukun kateinoigakukun deleted the yt/remove-basicformat branch February 11, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants