Skip to content

feat: Add syntax support for destructuring, labels, and generators#52

Open
nyariv wants to merge 5 commits intomainfrom
feat/syntax-support-3
Open

feat: Add syntax support for destructuring, labels, and generators#52
nyariv wants to merge 5 commits intomainfrom
feat/syntax-support-3

Conversation

@nyariv
Copy link
Copy Markdown
Owner

@nyariv nyariv commented Apr 5, 2026

What changed

This branch expands SandboxJS support for several missing JavaScript language features and brings the runtime behavior closer to native JS.

  • added variable destructuring support
  • added argument destructuring and default function parameter support
  • added labelled statement support
  • added generator and async generator support, including resumed next(value) flow, yield expression values, delegation behavior, and constructor shims in the eval context
  • updated docs and TODO notes to reflect the new support surface
  • added and expanded eval/runtime/security tests for the new syntax and runtime behavior

Why

SandboxJS was still missing a set of common language features that show up in ordinary application code. This branch closes those gaps so more real-world JavaScript can run inside the sandbox without workarounds.

Impact

Users can now evaluate a broader set of JavaScript patterns inside the sandbox, especially around function parameters, destructuring, labels, and generator control flow. The test suite also gets much better coverage around those semantics.

Validation

  • npm test -- --runInBand
  • npm run lint

@nyariv nyariv changed the title [codex] Add syntax support for destructuring, labels, and generators feat: Add syntax support for destructuring, labels, and generators Apr 5, 2026
@nyariv nyariv marked this pull request as ready for review April 5, 2026 22:46
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.

1 participant