pub trait WriteJs {
Show 17 methods fn target(&self) -> EsVersion;
fn increase_indent(&mut self) -> Result;
fn decrease_indent(&mut self) -> Result;
fn write_semi(&mut self, span: Option<Span>) -> Result;
fn write_space(&mut self) -> Result;
fn write_keyword(&mut self, span: Option<Span>, s: &'static str) -> Result;
fn write_operator(&mut self, span: Option<Span>, s: &str) -> Result;
fn write_param(&mut self, s: &str) -> Result;
fn write_property(&mut self, s: &str) -> Result;
fn write_line(&mut self) -> Result;
fn write_lit(&mut self, span: Span, s: &str) -> Result;
fn write_comment(&mut self, span: Span, s: &str) -> Result;
fn write_str_lit(&mut self, span: Span, s: &str) -> Result;
fn write_str(&mut self, s: &str) -> Result;
fn write_symbol(&mut self, span: Span, s: &str) -> Result;
fn write_punct(&mut self, span: Option<Span>, s: &'static str) -> Result;
fn care_about_srcmap(&self) -> bool;
}
Expand description

Ecmascript writer.

Ported from EmitWriteJs.

Required methods

Returns javascript target which should be used while generating code.

This defaults to EsVersion::Es2020 because it preserves input as much as possible.

Implementor should return same value regardless how much time it is called.

This may write semicolon.

Implementations on Foreign Types

Implementors