frostney / frostney/GocciaScript
Support throw expressions
Nobody has claimed this yet.
- Dominant language
- Pascal
- Stars
- 20
- Forks
- 3
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 45
Description
Summary
Implement the Stage 2 TC39 proposal: https://github.com/tc39/proposal-throw-expressions
Implement the current throw-expression grammar, precedence, early errors, single operand evaluation, and thrown completion propagation.
Why
This proposal fits GocciaScript's modern ECMAScript surface and the 0.13.0 proposal roadmap. It should extend the engine's existing architecture rather than arrive as a userland shim.
Current behavior
throw is only a statement, forcing block bodies or helpers in expression branches.
Expected behavior
Implement the current throw-expression grammar, precedence, early errors, single operand evaluation, and thrown completion propagation.
Scope notes
Reuse existing thrown-completion machinery and target bytecode after #875. Verify arrows, conditional/logical expressions, parameters, nested forms, and existing throw statements. Additive syntax: no flag.
Related bytecode roadmap: #871 and #875. Update the relevant language/built-in documentation and Goccia proposal inventory. Use the proposal repository and its current specification at implementation time; add focused project tests and matching pinned Test262/proposal coverage without regressions.
Acceptance criteria
- Parser/API surface, descriptors, evaluation order, errors, and observable protocol behavior match the current proposal.
- Implementation uses the identified shared engine seam without a duplicate compatibility shim.
- Focused positive, negative, abrupt-completion, and edge-case tests cover the proposal.
- Relevant project suites, pinned Test262 cases, formatting, and documentation checks pass.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the parser/API surface and the shared thrown-completion machinery, then inspect the bytecode work tracked by #875. Use the current TC39 proposal to define grammar, precedence, early errors, and evaluation behavior; add focused project tests and pinned Test262/proposal coverage, with relevant documentation updates, until the listed suites and checks pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100