Skip to content

Add support for ES2022 StaticBlock#120

Open
willdurand wants to merge 1 commit into
estools:masterfrom
willdurand:static-block
Open

Add support for ES2022 StaticBlock#120
willdurand wants to merge 1 commit into
estools:masterfrom
willdurand:static-block

Conversation

@willdurand
Copy link
Copy Markdown

@willdurand willdurand commented Apr 4, 2022

This is similar to eslint/eslint-visitor-keys#29.

@willdurand
Copy link
Copy Markdown
Author

cc @michaelficarra, thanks

@connor4312
Copy link
Copy Markdown

Hit this today, would love to see this merged.

Example syntax:

class Foo {
  static {
    
  }
}

Associated estree:

{
  "type": "Program",
  "start": 0,
  "end": 33,
  "body": [
    {
      "type": "ClassDeclaration",
      "start": 0,
      "end": 33,
      "id": {
        "type": "Identifier",
        "start": 6,
        "end": 9,
        "name": "Foo"
      },
      "superClass": null,
      "body": {
        "type": "ClassBody",
        "start": 10,
        "end": 33,
        "body": [
          {
            "type": "StaticBlock",
            "start": 14,
            "end": 31,
            "body": []
          }
        ]
      }
    }
  ],
  "sourceType": "module"
}

connor4312 added a commit to microsoft/vscode-extension-test-runner that referenced this pull request Oct 27, 2023
Fixes parsing failing in copilot due to a lack of static blocks (estools/estraverse#120)
@xPaw
Copy link
Copy Markdown

xPaw commented Jun 26, 2024

@michaelficarra can we have a new release with this merged please.

@connor4312
Copy link
Copy Markdown

Fyi I since moved to eslint-visitor-keys which is maintained and pretty easy to use to build transversal

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.

3 participants