Skip to content

fix: js.object.create corrupts AST when value has type property#1082

Merged
jycouet merged 1 commit intomainfrom
using-js-object-create-with-an-object-containing-t
May 7, 2026
Merged

fix: js.object.create corrupts AST when value has type property#1082
jycouet merged 1 commit intomainfrom
using-js-object-create-with-an-object-containing-t

Conversation

@jycouet
Copy link
Copy Markdown
Contributor

@jycouet jycouet commented May 5, 2026

Closes #1079

Description

js.object.create treated any object value with a type property as a raw AST node, corrupting output for plain data like { type: 'select' }. Now only known estree Expression types are treated as AST nodes.

Checklist

  • Update snapshots (if applicable)
  • Add a changeset (if applicable)
  • Allow maintainers to edit this PR
  • I care about what I'm doing, no matter the tool I use (Notepad, Sublime, VSCode, AI...)

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 5, 2026

🦋 Changeset detected

Latest commit: bafb873

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@sveltejs/sv-utils Patch
sv Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 5, 2026

Open in StackBlitz

npx https://pkg.pr.new/svelte-migrate@1082
npx https://pkg.pr.new/sv@1082
npx https://pkg.pr.new/@sveltejs/sv-utils@1082

commit: bafb873

@svelte-docs-bot
Copy link
Copy Markdown

@jycouet jycouet merged commit 2917f88 into main May 7, 2026
8 checks passed
@jycouet jycouet deleted the using-js-object-create-with-an-object-containing-t branch May 7, 2026 20:15
@github-actions github-actions Bot mentioned this pull request May 7, 2026
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.

Using js.object.create with an object containing type property corrupts AST (sv-utils)

1 participant