/// <summary>Decompile a JavaScript Function.</summary> /// <remarks> /// Decompile a JavaScript Function. /// <p> /// Decompiles a previously compiled JavaScript function object to /// canonical source. /// <p> /// Returns function body of '[native code]' if no decompilation /// information is available. /// </remarks> /// <param name="fun">the JavaScript function to decompile</param> /// <param name="indent">the number of spaces to indent the result</param> /// <returns>a string representing the function source</returns> public string DecompileFunction(Function fun, int indent) { if (fun is BaseFunction) { return ((BaseFunction)fun).Decompile(indent, 0); } else { return "function " + fun.GetClassName() + "() {\n\t[native code]\n}\n"; } }