Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update babel/parser to v7.12.17 #10345

Merged
merged 22 commits into from Feb 25, 2021
Merged

Conversation

public b();
protected c();
static d();
e();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sosukesuzuki sosukesuzuki marked this pull request as ready for review February 21, 2021 01:40
function bar(x = await 2) {}
}

async (x = await 2) => {};
Copy link
Sponsor Member

@fisker fisker Feb 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also test this? (Note that flow parse this differently.)

Prettier pr-10345
Playground link

--parser babel

Input:

async function foo() {
  function bar(x = await (2)) {}
}

async (x = await (2)) => {};

Output:

async function foo() {
  function bar(x = await(2)) {}
}

async (x = await 2) => {};

p = await 0;
}

await 0;
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flow typescript babel all parse them differently.

Prettier pr-10345
Playground link

--parser typescript

Input:

export class C {
  p = await (0);
}

await (0);

Output:

export class C {
  p = await(0);
}

await 0;

Copy link
Sponsor Member

@fisker fisker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add parenthesized await for all those cases in this PR, we don't need care how it formatted, just to have a snapshot record.

5 | class A { s: string }
6 | }
7 |"
"Unexpected token, expected \\"{\\" (9:12)
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move code of module Y3 a separate file?

@sosukesuzuki
Copy link
Member Author

sosukesuzuki commented Feb 25, 2021

@fisker Have we the way to test with only typescript parser(not babel-ts)?

EDIT: I tried it at 2e59c34, if you know the better way please tell me.

@fisker
Copy link
Sponsor Member

fisker commented Feb 25, 2021

I think your solution is the best.

@fisker
Copy link
Sponsor Member

fisker commented Feb 25, 2021

@sosukesuzuki The AST compare tests are failing.

Copy link
Sponsor Member

@fisker fisker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job!

@fisker
Copy link
Sponsor Member

fisker commented Feb 25, 2021

@sosukesuzuki You already print declare and readonly in ClassMethod, can you check if this still needed?

// TODO: Remove this when fixing #9760
if (ast.type === "ClassMethod") {
delete newObj.declare;
delete newObj.readonly;
}

@sosukesuzuki
Copy link
Member Author

@fisker Maybe we can remove it. But somehow all tests are passed without it in even main branch.

@fisker
Copy link
Sponsor Member

fisker commented Feb 25, 2021

IDK, I added in #9768 because tests failed.

@fisker fisker changed the title Update babel/parser to 7.12.17 Update babel/parser to v7.12.17 Feb 25, 2021
@fisker fisker merged commit feacf82 into prettier:main Feb 25, 2021
@sosukesuzuki sosukesuzuki deleted the bump-babel-parser branch February 25, 2021 10:37
thorn0 pushed a commit to sosukesuzuki/prettier that referenced this pull request Feb 28, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants