Skip to main content

SwitchCase AST Object

The SwitchCase object matches a switch case in a switch statement.

The astType value for this node is switchcase.

Code Pattern

This object catches switch case statements in most languages. For example, in JavaScript, it matches the following code:


case x:
// code block
break;

Attributes

  • condition (type AstElement): instructions in the try block
  • content (type AstElement): instructions in the finally block