Skip to content

Commit

Permalink
fix(codegen): improve typescript codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Jun 17, 2024
1 parent 139adfe commit 466c91e
Show file tree
Hide file tree
Showing 9 changed files with 4,850 additions and 4,859 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,3 @@ tasks/coverage/babel/
tasks/coverage/test262/
tasks/coverage/typescript/
tasks/prettier_conformance/prettier/

# Ignore the failures directory, which is used to store the results of the codegen coverage tests
tasks/coverage/failures/
10 changes: 8 additions & 2 deletions crates/oxc_ast/src/precedence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use oxc_syntax::precedence::{GetPrecedence, Precedence};
use crate::ast::{
match_member_expression, ArrowFunctionExpression, AssignmentExpression, AwaitExpression,
BinaryExpression, CallExpression, ConditionalExpression, Expression, ImportExpression,
LogicalExpression, MemberExpression, NewExpression, SequenceExpression, UnaryExpression,
UpdateExpression, YieldExpression,
LogicalExpression, MemberExpression, NewExpression, SequenceExpression, TSTypeAssertion,
UnaryExpression, UpdateExpression, YieldExpression,
};

impl<'a> GetPrecedence for Expression<'a> {
Expand Down Expand Up @@ -119,3 +119,9 @@ impl<'a> GetPrecedence for MemberExpression<'a> {
Precedence::Member
}
}

impl<'a> GetPrecedence for TSTypeAssertion<'a> {
fn precedence(&self) -> Precedence {
Precedence::lowest()
}
}
Loading

0 comments on commit 466c91e

Please sign in to comment.