Struct swc_ecma_transforms_testing::Tester
source · [−]pub struct Tester<'a> {
pub cm: Lrc<SourceMap>,
pub handler: &'a Handler,
pub comments: Rc<SingleThreadedComments>,
}
Fields
cm: Lrc<SourceMap>
handler: &'a Handler
comments: Rc<SingleThreadedComments>
Implementations
sourceimpl<'a> Tester<'a>
impl<'a> Tester<'a>
pub fn run<F, Ret>(op: F) -> Ret where
F: FnOnce(&mut Tester<'_>) -> Result<Ret, ()>,
pub fn with_parser<F, T>(
&mut self,
file_name: &str,
syntax: Syntax,
src: &str,
op: F
) -> Result<T, ()> where
F: FnOnce(&mut Parser<Lexer<'_, StringInput<'_>>>) -> Result<T, Error>,
pub fn parse_module(&mut self, file_name: &str, src: &str) -> Result<Module, ()>
pub fn parse_stmts(
&mut self,
file_name: &str,
src: &str
) -> Result<Vec<Stmt>, ()>
pub fn parse_stmt(&mut self, file_name: &str, src: &str) -> Result<Stmt, ()>
pub fn apply_transform<T: Fold>(
&mut self,
tr: T,
name: &str,
syntax: Syntax,
src: &str
) -> Result<Module, ()>
pub fn print(
&mut self,
module: &Module,
comments: &Rc<SingleThreadedComments>
) -> String
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Tester<'a>
impl<'a> !Send for Tester<'a>
impl<'a> !Sync for Tester<'a>
impl<'a> Unpin for Tester<'a>
impl<'a> !UnwindSafe for Tester<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more