Class: If
Generic conditional If statements. Nested else if need to be desugared into else { if ... }
Example
ts
if (condition) { ... } else { ... }Constructors
Constructor
new If(
condition,then,elseExpr,loc?):If
Parameters
| Parameter | Type |
|---|---|
condition | Expression |
then | Expression |
elseExpr | Expression |
loc? | SourceLocation |
Returns
If
Overrides
ASTNode.constructor
Methods
getMetadata()
getMetadata<
T>(key):T
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
T
Inherited from
ASTNode.getMetadata
hasMetadata()
hasMetadata(
key):boolean
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
boolean
Inherited from
ASTNode.hasMetadata
setMetadata()
setMetadata(
key,value):void
Parameters
| Parameter | Type |
|---|---|
key | string |
value | any |
Returns
void
Inherited from
ASTNode.setMetadata