pub struct WithStmt<'a> {
pub keyword: Slice<'a>,
pub open_paren: Slice<'a>,
pub object: Expr<'a>,
pub close_paren: Slice<'a>,
pub body: Box<Stmt<'a>>,
}
Expand description
A with statement, this puts one object at the top of the identifier search tree.
note: this cannot be used in a strict context
function random() {
return 0;
}
let rand;
with (Math) {
rand = floor(random() * 100) + 1;
}
//rand !== 0
Fields
keyword: Slice<'a>
open_paren: Slice<'a>
object: Expr<'a>
close_paren: Slice<'a>
body: Box<Stmt<'a>>
Trait Implementations
sourceimpl<'a> PartialEq<WithStmt<'a>> for WithStmt<'a>
impl<'a> PartialEq<WithStmt<'a>> for WithStmt<'a>
impl<'a> StructuralPartialEq for WithStmt<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for WithStmt<'a>
impl<'a> Send for WithStmt<'a>
impl<'a> Sync for WithStmt<'a>
impl<'a> Unpin for WithStmt<'a>
impl<'a> UnwindSafe for WithStmt<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more