/// <summary>Transforms the tree into a lower-level IR suitable for codegen.</summary> /// <remarks> /// Transforms the tree into a lower-level IR suitable for codegen. /// Optionally generates the encoded source. /// </remarks> public ScriptNode TransformTree(AstRoot root) { currentScriptOrFn = root; this.inUseStrictDirective = root.IsInStrictMode(); int sourceStartOffset = decompiler.GetCurrentOffset(); ScriptNode script = (ScriptNode)Transform(root); int sourceEndOffset = decompiler.GetCurrentOffset(); script.SetEncodedSourceBounds(sourceStartOffset, sourceEndOffset); if (compilerEnv.IsGeneratingSource()) { script.SetEncodedSource(decompiler.GetEncodedSource()); } decompiler = null; return script; }