Skip to content

Commit 466c91e

Browse files
committed
fix(codegen): improve typescript codegen
1 parent 139adfe commit 466c91e

File tree

9 files changed

+4850
-4859
lines changed

9 files changed

+4850
-4859
lines changed

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,3 @@ tasks/coverage/babel/
2727
tasks/coverage/test262/
2828
tasks/coverage/typescript/
2929
tasks/prettier_conformance/prettier/
30-
31-
# Ignore the failures directory, which is used to store the results of the codegen coverage tests
32-
tasks/coverage/failures/

crates/oxc_ast/src/precedence.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use oxc_syntax::precedence::{GetPrecedence, Precedence};
33
use crate::ast::{
44
match_member_expression, ArrowFunctionExpression, AssignmentExpression, AwaitExpression,
55
BinaryExpression, CallExpression, ConditionalExpression, Expression, ImportExpression,
6-
LogicalExpression, MemberExpression, NewExpression, SequenceExpression, UnaryExpression,
7-
UpdateExpression, YieldExpression,
6+
LogicalExpression, MemberExpression, NewExpression, SequenceExpression, TSTypeAssertion,
7+
UnaryExpression, UpdateExpression, YieldExpression,
88
};
99

1010
impl<'a> GetPrecedence for Expression<'a> {
@@ -119,3 +119,9 @@ impl<'a> GetPrecedence for MemberExpression<'a> {
119119
Precedence::Member
120120
}
121121
}
122+
123+
impl<'a> GetPrecedence for TSTypeAssertion<'a> {
124+
fn precedence(&self) -> Precedence {
125+
Precedence::lowest()
126+
}
127+
}

0 commit comments

Comments
 (0)