Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when typescript with TSAsExpression #691

Open
mqliutie opened this issue Apr 23, 2023 · 1 comment
Open

error when typescript with TSAsExpression #691

mqliutie opened this issue Apr 23, 2023 · 1 comment

Comments

@mqliutie
Copy link

mqliutie commented Apr 23, 2023

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
        }
    }
}
@Scipion
Copy link
Contributor

Scipion commented Jan 13, 2024

It does work with @babel/parser if you select typescript plugin and unselect flow.
error when typescript with TSAsExpression #691

Please close issue

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

No branches or pull requests

2 participants