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

feat: compatible with assertions #31

Merged
merged 1 commit into from
Mar 26, 2024
Merged

feat: compatible with assertions #31

merged 1 commit into from
Mar 26, 2024

Conversation

ahabhgk
Copy link
Contributor

@ahabhgk ahabhgk commented Mar 23, 2024

resolve #30

Copy link
Owner

@xtuc xtuc left a comment

Choose a reason for hiding this comment

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

Tests are passing locally.

Nice one, thanks!

@xtuc xtuc merged commit 7535198 into xtuc:main Mar 26, 2024
0 of 3 checks passed
@ahabhgk ahabhgk deleted the compat-assert branch March 27, 2024 00:51
@alexander-akait
Copy link

@ahabhgk Thank you ❤️


_getProperty() {
if (isWithOrAssertKeyword) {
return this.type === this.withToken ? "attributes" : "assertions";

Choose a reason for hiding this comment

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

@ahabhgk I think there is a bug, logs:

console.log(this.type);
console.log(this.withToken);
 TokenType {
        label: ';',
        keyword: undefined,
        beforeExpr: true,
        startsExpr: false,
        isLoop: false,
        isAssign: false,
        prefix: false,
        postfix: false,
        binop: null,
        updateContext: null
      }

      at Parser._getProperty (node_modules/acorn-import-attributes/lib/index.js:68:13)

    console.log
      TokenType {
        label: 'with',
        keyword: undefined,
        beforeExpr: false,
        startsExpr: false,
        isLoop: false,
        isAssign: false,
        prefix: false,
        postfix: false,
        binop: null,
        updateContext: null
      }

      at Parser._getProperty (node_modules/acorn-import-attributes/lib/index.js:69:13)

So it is always assertions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't notice there is a this.next().. #33 should fix it

Choose a reason for hiding this comment

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

Thank 👍

Copy link
Owner

Choose a reason for hiding this comment

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

merged and published acorn-import-attributes@1.9.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allow to customize keyword
3 participants