turbo
bdc40cb3 - fix(ecmascript): collect recoverable error after parse (#7073)

Commit
1 year ago
fix(ecmascript): collect recoverable error after parse (#7073) ### Description Turbopack in next.js does not report parse errors for the input like ``` function xyz() { ... ``` which expects to report ``` Expected '}', got '<eof>' ``` Comparing upstream swc, the only difference is turbopack collect recoveable error eagerly _before_ actual parsing, and then parse returns a parsed program. (ref: https://github.com/swc-project/swc/blob/979061f6babbbf855027b13eb574c5f3f7e24727/crates/swc_compiler_base/src/lib.rs#L62-L77) PR fixes ordering of error collection as same as swc does. Confirmed next.js with this change now reports expected error. (Note: doesn't mean tests are actually fixed, the output is not matching with snapshot still) Closes PACK-2274
Author
Parents
Loading