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

Add asserts this [is type] parsing support #10677

Merged
merged 9 commits into from Nov 11, 2019

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Nov 7, 2019

Q                       A
Fixed Issues? Fixes #10671
Patch: Bug Fix? Yes, (sort of)
Tests Added + Pass? Yes
License MIT

As a follow-up to #10543, this PR adds asserts this [is type] support. In addition, it also fixes an edge case where asserts keyword contains escaped sequence.

Since we declared TypeScript 3.7 support on 7.7.0, I would expect this PR to be shipped in a patch release.

@JLHwung JLHwung added PR: Bug Fix 🐛 A type of pull request used for our changelog categories pkg: parser area: typescript labels Nov 7, 2019
@JLHwung JLHwung modified the milestones: v7.7.3, TypeScript 3.7 Nov 7, 2019
nicolo-ribaudo
nicolo-ribaudo previously approved these changes Nov 8, 2019
},
"body": [
{
"type": "TSDeclareMethod",
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be wrong

Copy link
Contributor Author

@JLHwung JLHwung Nov 8, 2019

Choose a reason for hiding this comment

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

Yeah it is wrong, it should be ClassMethod, in this example the class method is also finished as TSDeclareMethod. I would suggest we address it in a separate PR.

Copy link
Member

Choose a reason for hiding this comment

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

Well, in that example it's correct because there isn't the method body.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in e6bf63e.

return false;
}

const id = this.parseIdentifier();
if (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is refactor of tsParseTypePredicateAsserts which aims to avoid creating node by parseIdentifier.

@nicolo-ribaudo nicolo-ribaudo dismissed their stale review November 9, 2019 11:18

(I have to review this PR again)

@buildsize
Copy link

buildsize bot commented Nov 9, 2019

File name Previous Size New Size Change
babel-preset-env.js 2.78 MB 2.78 MB 960 bytes (0%)
babel-preset-env.min.js 1.67 MB 1.67 MB 560 bytes (0%)
babel.js 2.96 MB 2.96 MB 960 bytes (0%)
babel.min.js 1.63 MB 1.63 MB 560 bytes (0%)
test262.tap 4.91 MB [deleted]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: typescript outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeScript 3.7 syntax: asserts this
3 participants