class compilerJs::JsPodClosures
sys::Obj compilerJs::JsNode compilerJs::JsPodClosures
Utility for working with JS closures. Shared by JsPod and JsClosureExpr for writing javascript related to closures.
Every closure in JS requires that we create a fan.sys.Func
. The Func requires a ClosureFuncSpec$
object that represents the closure specification for the Func.This class analyzes all closures for the pod and creates a static field for each unique ClosureFuncSpec it identifies.Then, when the actual closure Func is created and called, it uses that static field instead of creating a new one every time the closure is called.
- make
-
new make(JsCompilerSupport s)
- write
-
virtual override Void write(JsWriter out)
Write the unique closure specification fields for this pod (JsPod)
- writeClosure
-
Void writeClosure(ClosureExpr ce, JsWriter out)
Write the actual closure Func (JsClosureExpr)