Skip to content
Merged
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
2 changes: 1 addition & 1 deletion crates/oxc_parser/src/js/arrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl<'a, C: Config> ParserImpl<'a, C> {
match self.is_parenthesized_arrow_function_expression() {
Tristate::False => None,
Tristate::True => Some(self.parse_parenthesized_arrow_function_expression(
/* allow_return_type_in_arrow_function */ true,
allow_return_type_in_arrow_function,
)),
Tristate::Maybe => self.parse_possible_parenthesized_arrow_function_expression(
allow_return_type_in_arrow_function,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const formErrors = { foo: 'bar' };

type Form = { id: number; errors: Record<string, boolean> };

type Errors<T extends Form> = Pick<T, 'errors'>;

type FooBarForm = Form & { tag: 'foobarform' };

const getFormError =
typeof formErrors !== 'object'
? () => ({})
: (index: number): Errors<FooBarForm> => {
return {
errors: { a: true, b: false },
};
};
4 changes: 2 additions & 2 deletions tasks/coverage/snapshots/codegen_misc.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
codegen_misc Summary:
AST Parsed : 64/64 (100.00%)
Positive Passed: 64/64 (100.00%)
AST Parsed : 65/65 (100.00%)
Positive Passed: 65/65 (100.00%)
4 changes: 2 additions & 2 deletions tasks/coverage/snapshots/formatter_misc.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
formatter_misc Summary:
AST Parsed : 64/64 (100.00%)
Positive Passed: 64/64 (100.00%)
AST Parsed : 65/65 (100.00%)
Positive Passed: 65/65 (100.00%)
4 changes: 2 additions & 2 deletions tasks/coverage/snapshots/parser_misc.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parser_misc Summary:
AST Parsed : 64/64 (100.00%)
Positive Passed: 64/64 (100.00%)
AST Parsed : 65/65 (100.00%)
Positive Passed: 65/65 (100.00%)
Negative Passed: 134/134 (100.00%)

× Cannot assign to 'arguments' in strict mode
Expand Down
9 changes: 7 additions & 2 deletions tasks/coverage/snapshots/semantic_misc.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
semantic_misc Summary:
AST Parsed : 64/64 (100.00%)
Positive Passed: 51/64 (79.69%)
AST Parsed : 65/65 (100.00%)
Positive Passed: 51/65 (78.46%)
semantic Error: tasks/coverage/misc/pass/conditional-arrow-alternate-return-type.ts
Unresolved references mismatch:
after transform: ["Pick", "Record"]
rebuilt : []

semantic Error: tasks/coverage/misc/pass/declare-let-private.ts
Bindings mismatch:
after transform: ScopeId(0): ["private"]
Expand Down
4 changes: 2 additions & 2 deletions tasks/coverage/snapshots/transformer_misc.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
transformer_misc Summary:
AST Parsed : 64/64 (100.00%)
Positive Passed: 64/64 (100.00%)
AST Parsed : 65/65 (100.00%)
Positive Passed: 65/65 (100.00%)
Loading