Skip to content

Commit

Permalink
refactor: move StaticBlock definition to core
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Oct 8, 2021
1 parent ce2876e commit 35f4384
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
13 changes: 13 additions & 0 deletions packages/babel-types/src/definitions/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2196,3 +2196,16 @@ defineType("PrivateName", {
},
},
});

defineType("StaticBlock", {
visitor: ["body"],
fields: {
body: {
validate: chain(
assertValueType("array"),
assertEach(assertNodeType("Statement")),
),
},
},
aliases: ["Scopable", "BlockParent"],
});
14 changes: 0 additions & 14 deletions packages/babel-types/src/definitions/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,6 @@ defineType("DecimalLiteral", {
aliases: ["Expression", "Pureish", "Literal", "Immutable"],
});

// https://github.com/tc39/proposal-class-static-block
defineType("StaticBlock", {
visitor: ["body"],
fields: {
body: {
validate: chain(
assertValueType("array"),
assertEach(assertNodeType("Statement")),
),
},
},
aliases: ["Scopable", "BlockParent"],
});

// https://github.com/tc39/proposal-js-module-blocks
defineType("ModuleExpression", {
visitor: ["body"],
Expand Down

0 comments on commit 35f4384

Please sign in to comment.