Closed ttttmr closed 1 year ago
body := []byte("xxx...") var err error ioutil.WriteFile("test.js", body, 0644) _, err = parser.ParseFile(nil, "", body, 0) log.Info(err) // (anonymous): Line 4:3 Unexpected reserved word (and 24 more errors) _, err = parser.ParseFile(nil, "test.js", "", 0) log.Info(err) // <nil>
body is correct js code, but their parsing results are different js file
I want to parse the body but not create the file, how to do it
You can do this with parser.ReadSource
body is correct js code, but their parsing results are different js file