type

JsNode

src abstract class JsNode : Obj

JsNode

constructors

fields

methods

c
checkJsSafety
curType
err
fieldToJs

Get the name that should be used for the generated field in JS code.

isJsType
isPrimitive
js
loc
methodParams

generates (p1, p2, ...pn)

methodToJs

Get the name that should be used for the generated method in JS code.

nameToJs

Return the JS identifier name to use for the given Fantom name.

node
qnameToJs

Get the module-qualified name for this CType.

resolveType
toLoc
uniqName

return a unique id name

warn
write
writeBlock
writeExpr
writeStmt

Slot Details

c

checkJsSafety

src Bool checkJsSafety(CType ctype, Loc? loc)

curType

src TypeDef? curType()

err

src CompilerErr err(Str msg, Loc? loc := null)

fieldToJs

src static Str fieldToJs(Obj name)

Get the name that should be used for the generated field in JS code. A field is always private so we do not need to swizzle its name.

isJsType

src Bool isJsType(TypeDef def)

isPrimitive

src Bool isPrimitive(CType ctype)

js

src JsWriter js()

loc

src virtual Loc? loc()

make

src new make(CompileEsPlugin plugin, Node? node := null)

methodParams

src Str methodParams(CParam[] params)

generates (p1, p2, ...pn)

methodToJs

src static Str methodToJs(Str name)

Get the name that should be used for the generated method in JS code. It turns out we don't need to swizzle method names.

nameToJs

src Str nameToJs(Str name)

Return the JS identifier name to use for the given Fantom name. This should be used to get names for local variable declarations and method/func parameters.

Note - use fieldJs for generating field names since we have a lot of special handling for fields Note - use methodJs for generating method names

node

src virtual Node? node()

plugin

src CompileEsPlugin plugin { private set }

pmap

src const Str:Bool pmap := ...

qnameToJs

src Str qnameToJs(CType ctype)

Get the module-qualified name for this CType. If the type is in the this pod, it does not need to be qualified

resolveType

src CType resolveType(CType ctype)

toLoc

src static Loc? toLoc(Obj obj)

uniqName

src Str uniqName(Str name := "u")

return a unique id name

warn

src CompilerErr warn(Str msg, Loc? loc := null)

write

src abstract Void write()

writeBlock

src Void writeBlock(Block? block)

writeExpr

src Void writeExpr(Expr? expr)

writeStmt

src Void writeStmt(Stmt? stmt)