|
|
@ -196,6 +196,18 @@ pub enum Node { |
|
|
|
|
|
|
|
|
|
|
|
/// A 'while {...}' node. [More information](./iteration/struct.WhileLoop.html).
|
|
|
|
/// A 'while {...}' node. [More information](./iteration/struct.WhileLoop.html).
|
|
|
|
WhileLoop(WhileLoop), |
|
|
|
WhileLoop(WhileLoop), |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// A empty node.
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// Empty statement do nothing, just return undefined.
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// More information:
|
|
|
|
|
|
|
|
/// - [ECMAScript reference][spec]
|
|
|
|
|
|
|
|
/// - [MDN documentation][mdn]
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// [spec]: https://tc39.es/ecma262/#prod-EmptyStatement
|
|
|
|
|
|
|
|
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/Empty
|
|
|
|
|
|
|
|
Empty, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl Display for Node { |
|
|
|
impl Display for Node { |
|
|
@ -274,6 +286,7 @@ impl Node { |
|
|
|
Self::AsyncFunctionDecl(ref decl) => decl.display(f, indentation), |
|
|
|
Self::AsyncFunctionDecl(ref decl) => decl.display(f, indentation), |
|
|
|
Self::AsyncFunctionExpr(ref expr) => expr.display(f, indentation), |
|
|
|
Self::AsyncFunctionExpr(ref expr) => expr.display(f, indentation), |
|
|
|
Self::AwaitExpr(ref expr) => expr.display(f, indentation), |
|
|
|
Self::AwaitExpr(ref expr) => expr.display(f, indentation), |
|
|
|
|
|
|
|
Self::Empty => write!(f, ";"), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -338,6 +351,7 @@ impl Executable for Node { |
|
|
|
Node::Try(ref try_node) => try_node.run(context), |
|
|
|
Node::Try(ref try_node) => try_node.run(context), |
|
|
|
Node::Break(ref break_node) => break_node.run(context), |
|
|
|
Node::Break(ref break_node) => break_node.run(context), |
|
|
|
Node::Continue(ref continue_node) => continue_node.run(context), |
|
|
|
Node::Continue(ref continue_node) => continue_node.run(context), |
|
|
|
|
|
|
|
Node::Empty => Ok(Value::Undefined), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|