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

can' parse class static method code #9199

Open
brookate opened this issue Aug 29, 2024 · 0 comments
Open

can' parse class static method code #9199

brookate opened this issue Aug 29, 2024 · 0 comments

Comments

@brookate
Copy link

class C {
  static {
    let x;
    let x;
  }
}

Flow version: current HEAD and 0.244.0

Expected behavior

Actual behavior

dell➜ bin git:(main) ./flow ast 1.js --pretty
{
"errors":[
{
"loc":{"source":"1.js","start":{"line":2,"column":9},"end":{"line":2,"column":10}},
"message":"Unexpected token {, expected an identifier"
},
{
"loc":{"source":"1.js","start":{"line":3,"column":8},"end":{"line":3,"column":9}},
"message":"Unexpected identifier, expected the token ("
},
{
"loc":{"source":"1.js","start":{"line":3,"column":9},"end":{"line":3,"column":10}},
"message":"Unexpected token ;, expected an identifier"
},
{
"loc":{"source":"1.js","start":{"line":4,"column":4},"end":{"line":4,"column":7}},
"message":"Unexpected token let, expected the token ,"
},
{
"loc":{"source":"1.js","start":{"line":4,"column":9},"end":{"line":4,"column":10}},
"message":"Unexpected token ;, expected the token ,"
},
{
"loc":{"source":"1.js","start":{"line":5,"column":2},"end":{"line":5,"column":3}},
"message":"Unexpected token }, expected an identifier"
},
{
"loc":{"source":"1.js","start":{"line":6,"column":0},"end":{"line":6,"column":1}},
"message":"Unexpected token }, expected the token ,"
},
{
"loc":{"source":"1.js","start":{"line":8,"column":0},"end":{"line":8,"column":0}},
"message":"Rest parameter must be final parameter of an argument list"
},
{
"loc":{"source":"1.js","start":{"line":8,"column":0},"end":{"line":8,"column":0}},
"message":"Unexpected end of input, expected the token )"
},
{
"loc":{"source":"1.js","start":{"line":8,"column":0},"end":{"line":8,"column":0}},
"message":"Unexpected end of input, expected the token {"
},
{
"loc":{"source":"1.js","start":{"line":8,"column":0},"end":{"line":8,"column":0}},
"message":"Unexpected end of input, expected the token }"
},
{
"loc":{"source":"1.js","start":{"line":5,"column":2},"end":{"line":5,"column":3}},
"message":"Strict mode function may not have duplicate parameter names"
}
],

in my program is file "src/parser/parser_flow.ml", line 509,

  • Link to Try-Flow or Github repo:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant