Skip to content

JavaScript Formatter accepts clearly invalid syntax without an error #350

Description

@baixiangcpp

Summary

JavaScript Formatter accepts clearly invalid JavaScript and presents it as output instead of showing a syntax error. The page's own guidance says syntax errors should prevent formatting.

Affected route: https://byteflow.tools/en/javascript-formatter

Reproduction

  1. Enter this input:

    const = ;
    
  2. Click Format.

Expected:

  • show a syntax/parse error;
  • clear or invalidate the output;
  • do not enable Copy/Download for invalid formatted code.

Actual:

  • no error is shown;
  • the output is the same invalid text: const = ;;
  • Copy Output remains enabled.

A second malformed sample, function (, was also accepted and returned as function( without an error.

Control case

A valid input such as function add(a,b){return a+b;}const value=add(1,2); formatted correctly and copied correctly. The issue is the missing rejection/error path for malformed syntax.

Environment

  • Browser: Chrome via cloud browser
  • Tested: 2026-08-18

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions