-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port babel-parser changes from 2022-10-26 to 2022-12-22 (#785)
Instructions: https://github.com/alangpierce/sucrase/wiki/Porting-changes-from-Babel's-parser dfc4b61856 Parse import reflection (#14926) ✅ Implemented a basic version with tests, without any attempt at CJS support or type import support since the behavior appears unspecified at this point. 83009601f4 Parse `using` declaration (explicit resource management) (#14968) ✅ Implemented in a similar way with some simplifications since error handling isn't necessary. 04509a3be6 v7.20.0 🚫 Release only. 292e5d6b67 fix: parse `a satisfies b` as left value (#15096) ✅ Already worked, but added a test. 283720d252 fix: Parse re-declare var in class static body (#15102) 🚫 Error handling bug that didn't affect Sucrase. cfc453276a Fix(estree): Reset export's start after decorator (#15107) 🚫 estree not relevant to Sucrase. 1893249b67 v7.20.1 🚫 Release only. b5a6931c23 fix: `parser` typings for plugins (#15094) 🚫 Babel-internal change. 12a58cb58c v7.20.2 🚫 Release only. ce09a269d8 fix: support await as for-of-lhs (#15134) 🚫 Sucrase assumes modules, and `await` is a reserved word in modules. 7c9a8015fe v7.20.3 🚫 Release only. 5fde28b37e fix: Babel 8 types (#15109) 🚫 Babel-internal change. 4dedd57f64 fix: parse `import module, ...` (#15198) ✅ Fixed in implementation above. f6546d79d4 Bump typescript to 4.9.3 (#15202) 🚫 Babel-internal change. 4c59d9fb2c Export `ParseResult` type (#15207) 🚫 Babel-internal change. 4369b33100 Parse `using[foo]` as computed member expression (#15225) ✅ Fixed with a simpler lookahead approach. 29a97b8ea2 v7.20.5 🚫 Release only. f543b61bab refactor: remove ModuleDeclaration usage (#15236) 🚫 AST only. 362451b764 chore: Enable eslint rule `no-unnecessary-type-assertion` (#15260) 🚫 Babel-internal change. 1203f1858d chore: Clean up `parser` comments (#15252) 🚫 Babel-internal change. 3a71c79a56 fix: Support auto accessors with TypeScript annotations (#15209) ✅ This was already working in Sucrase, but added a test. d414940e4c v7.20.7 🚫 Release only.
- Loading branch information
1 parent
bf0af52
commit c65dd7b
Showing
8 changed files
with
257 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,7 @@ const CONTEXTUAL_KEYWORDS = [ | |
"symbol", | ||
"type", | ||
"unique", | ||
"using", | ||
]; | ||
|
||
const CODE = `\ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,5 @@ export enum ContextualKeyword { | |
_symbol, | ||
_type, | ||
_unique, | ||
_using, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.