Skip to content

Fix REPL executor illegal return parse issue - #178

Open
epi13 wants to merge 1 commit into
mainfrom
codex/fix-illegal-return-statement-error
Open

Fix REPL executor illegal return parse issue#178
epi13 wants to merge 1 commit into
mainfrom
codex/fix-illegal-return-statement-error

Conversation

@epi13

@epi13 epi13 commented Mar 30, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Bundlers or tooling that strip top-level export declarations could remove export function createReplExecutor(...) and leave a stray top-level return, producing Uncaught SyntaxError: Illegal return statement at runtime.
  • The change ensures the executor function remains present even if export lines are removed by a build step.

Description

  • Replaced export function createReplExecutor(...) with a regular function createReplExecutor(...) declaration in src/REPLCalc/assets/js/repl-executor.js.
  • Added an explicit named export export { createReplExecutor }; and kept the existing alias export const createExecutor = createReplExecutor; so imports remain compatible.
  • The change is limited to the single file src/REPLCalc/assets/js/repl-executor.js and preserves existing API shape.

Testing

  • Ran node --check src/REPLCalc/assets/js/repl-executor.js which completed successfully.
  • Ran node --check src/REPLCalc/assets/js/repl-core.js which completed successfully.

Codex Task

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