Extract JS runtime eval logic into packages/jsEval workspace with tests#170
Draft
Extract JS runtime eval logic into packages/jsEval workspace with tests#170
packages/jsEval workspace with tests#170Conversation
…tests Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
my-code | 8af7d3b | Commit Preview URL Branch Preview URL |
Feb 24 2026, 08:28 PM |
Copilot
AI
changed the title
[WIP] Refactor JavaScript runtime tests for better clarity
Extract JS runtime eval logic into Feb 24, 2026
packages/jsEval workspace with tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The JavaScript REPL logic (
replLikeEval,checkSyntax) lived inline in a web worker with no test coverage, despite having non-trivial behavior aroundconst/let→varrewriting, class hoisting, object-vs-block disambiguation, and syntax completeness detection.Changes
packages/jsEval/src/index.ts– ExtractsreplLikeEval()andcheckSyntax()from the worker. Uses indirect eval(0, eval)sovardeclarations reach the global scope in both Node.js and browser worker contexts, preserving REPL semantics.packages/jsEval/src/index.test.ts– 28 tests vianode:testcovering:replLikeEval:const/let/var/undeclared assignment, function, class, array, object literal, block-that-looks-like-object,await, error propagationcheckSyntax: complete expressions/blocks, incomplete inputs (if(1){, open brackets), invalid syntaxapp/terminal/worker/jsEval.worker.ts– Removes the two function definitions; imports them from@my-code/js-evalinstead.package.json– Adds"workspaces": ["packages/*"]..github/workflows/node.js.yml– Addstest-js-evalCI job runningnpm test --workspace=packages/jsEval.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.