pub trait WriteJs {
Show 19 methods
// Required methods
fn increase_indent(&mut self) -> Result<(), Error>;
fn decrease_indent(&mut self) -> Result<(), Error>;
fn write_semi(&mut self, span: Option<Span>) -> Result<(), Error>;
fn write_space(&mut self) -> Result<(), Error>;
fn write_keyword(
&mut self,
span: Option<Span>,
s: &'static str,
) -> Result<(), Error>;
fn write_operator(
&mut self,
span: Option<Span>,
s: &str,
) -> Result<(), Error>;
fn write_param(&mut self, s: &str) -> Result<(), Error>;
fn write_property(&mut self, s: &str) -> Result<(), Error>;
fn write_line(&mut self) -> Result<(), Error>;
fn write_lit(&mut self, span: Span, s: &str) -> Result<(), Error>;
fn write_comment(&mut self, s: &str) -> Result<(), Error>;
fn write_str_lit(&mut self, span: Span, s: &str) -> Result<(), Error>;
fn write_str(&mut self, s: &str) -> Result<(), Error>;
fn write_symbol(&mut self, span: Span, s: &str) -> Result<(), Error>;
fn write_punct(
&mut self,
span: Option<Span>,
s: &'static str,
) -> Result<(), Error>;
fn care_about_srcmap(&self) -> bool;
fn add_srcmap(&mut self, pos: BytePos) -> Result<(), Error>;
fn commit_pending_semi(&mut self) -> Result<(), Error>;
// Provided method
fn can_ignore_invalid_unicodes(&mut self) -> bool { ... }
}Available on crate features
__ecma and ecma_codegen only.Expand description
Ecmascript writer.
Ported from EmitWriteJs.
Required Methods§
fn increase_indent(&mut self) -> Result<(), Error>
fn decrease_indent(&mut self) -> Result<(), Error>
fn write_space(&mut self) -> Result<(), Error>
fn write_keyword( &mut self, span: Option<Span>, s: &'static str, ) -> Result<(), Error>
fn write_operator(&mut self, span: Option<Span>, s: &str) -> Result<(), Error>
fn write_param(&mut self, s: &str) -> Result<(), Error>
fn write_property(&mut self, s: &str) -> Result<(), Error>
fn write_line(&mut self) -> Result<(), Error>
fn write_lit(&mut self, span: Span, s: &str) -> Result<(), Error>
fn write_comment(&mut self, s: &str) -> Result<(), Error>
fn write_str_lit(&mut self, span: Span, s: &str) -> Result<(), Error>
fn write_str(&mut self, s: &str) -> Result<(), Error>
fn write_symbol(&mut self, span: Span, s: &str) -> Result<(), Error>
fn write_punct( &mut self, span: Option<Span>, s: &'static str, ) -> Result<(), Error>
fn care_about_srcmap(&self) -> bool
fn add_srcmap(&mut self, pos: BytePos) -> Result<(), Error>
fn commit_pending_semi(&mut self) -> Result<(), Error>
Provided Methods§
Sourcefn can_ignore_invalid_unicodes(&mut self) -> bool
fn can_ignore_invalid_unicodes(&mut self) -> bool
If true, the code generator will skip modification of invalid unicode characters.
Defaults to `false``