Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions tasks/coverage/snapshots/formatter_babel.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ commit: 41d96516

formatter_babel Summary:
AST Parsed : 2423/2423 (100.00%)
Positive Passed: 2419/2423 (99.83%)
Positive Passed: 2420/2423 (99.88%)
Mismatch: tasks/coverage/babel/packages/babel-parser/test/fixtures/comments/basic/try-statement/input.js

Mismatch: tasks/coverage/babel/packages/babel-parser/test/fixtures/comments/regression/13750/input.js

Mismatch: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2015/class/division/input.js

Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2022/top-level-await-unambiguous/module/input.js
`await` is only allowed within async functions and at the top levels of modules
6 changes: 1 addition & 5 deletions tasks/coverage/snapshots/formatter_typescript.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ commit: 261630d6

formatter_typescript Summary:
AST Parsed : 8816/8816 (100.00%)
Positive Passed: 8788/8816 (99.68%)
Positive Passed: 8790/8816 (99.71%)
Mismatch: tasks/coverage/typescript/tests/cases/compiler/amdLikeInputDeclarationEmit.ts

Expect to Parse: tasks/coverage/typescript/tests/cases/compiler/arrayFromAsync.ts
`await` is only allowed within async functions and at the top levels of modules`await` is only allowed within async functions and at the top levels of modules`await` is only allowed within async functions and at the top levels of modules`await` is only allowed within async functions and at the top levels of modules`await` is only allowed within async functions and at the top levels of modules`await` is only allowed within async functions and at the top levels of modules`await` is only allowed within async functions and at the top levels of modules`await` is only allowed within async functions and at the top levels of modules`await` is only allowed within async functions and at the top levels of modules`await` is only allowed within async functions and at the top levels of modules`await` is only allowed within async functions and at the top levels of modules
Mismatch: tasks/coverage/typescript/tests/cases/compiler/callOfConditionalTypeWithConcreteBranches.ts

Mismatch: tasks/coverage/typescript/tests/cases/compiler/coAndContraVariantInferences3.ts
Expand Down Expand Up @@ -39,8 +37,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/tryStatementInternalCom

Mismatch: tasks/coverage/typescript/tests/cases/compiler/unionSignaturesWithThisParameter.ts

Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts
Classes may not have a static property named prototypeClasses may not have a static property named prototypeClasses may not have a static property named prototypeClasses may not have a static property named prototypeClasses may not have a static property named prototypeClasses may not have a static property named prototype
Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowAssignmentPatternOrder.ts
An implementation cannot be declared in ambient contexts.
Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/expressions/elementAccess/letIdentifierInElementAccess01.ts
Expand Down
9 changes: 8 additions & 1 deletion tasks/coverage/src/tools/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@ fn get_result(source_text: &str, source_type: SourceType) -> TestResult {
// `oxc_formatter` expects this to be false
preserve_parens: false,
};
let ParserReturn { program, .. } =

let ParserReturn { program, errors, .. } =
Parser::new(&allocator, source_text, source_type).with_options(parse_options).parse();

// If the input has parse errors, we skip the test.
if !errors.is_empty() {
return TestResult::Passed;
}

let source_text1 = Formatter::new(&allocator, options.clone()).build(&program);

let allocator = Allocator::default();
Expand Down
Loading