Skip to content

error when typescript with TSAsExpression #691

@mqliutie

Description

@mqliutie

Describe the bug
Missing semicolon. (2:10)

To Reproduce
Steps to reproduce the behavior:

  1. Go to astexplorer
  2. select language javascript and parser @babel/parser
  3. paste code
function t(a:any):boolean{
  return a as boolean
}

Expected behavior
work correctly

Screenshots
image

Browser (please complete the following information):

  • OS: macOs
  • Browser : Chrome
  • Version : 112.0.5615.137(正式版本) (x86_64)

astexplorer settings:

  • Selected parser: @babel/parser
  • Selected transformer (if applicable): none
  • Contents of the local storage key explorerSettingsV1 (code can be removed if you don't want it to be public)
{
    "showTransformPanel": false,
    "parserSettings": {},
    "parserPerCategory": {},
    "workbench": {
        "parser": "acorn",
        "code": "/**\n * Paste or drop some JavaScript here and explore\n * the syntax tree created by chosen parser.\n * You can use all the cool new features from ES6\n * and even more. Enjoy!\n */\n\nlet tips = [\n  \"Click on any AST node with a '+' to expand it\",\n\n  \"Hovering over a node highlights the \\\n   corresponding location in the source code\",\n\n  \"Shift click on an AST node to expand the whole subtree\"\n];\n\nfunction printTips() {\n  tips.forEach((tip, i) => console.log(`Tip ${i}:` + tip));\n}\n",
        "keyMap": "default",
        "transform": {
            "code": "",
            "transformer": null
        }
    }
}

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