Class SecureCompiler

java.lang.Object
com.google.javascript.jscomp.jsonml.SecureCompiler

public class SecureCompiler extends Object
Compilation of JavaScript code which guarantees that all security capabilities are preserved after the process. In particular, it can be safely applied to cajoled source. JS Compiler is used for code analysis and optimization. It runs a series of passes which try to improve the code. For safety reasons, only a subset of local passes, which are provided by JS Compiler, are processed. Currently it includes: - elimination of temporary variables Using SecureCompiler is quite straightforward. A user just needs to create a new instance and call compile() method. Currently the only input which is supported is JsonML.
  • Constructor Details

    • SecureCompiler

      public SecureCompiler()
  • Method Details

    • getJsonML

      public JsonML getJsonML()
      Returns compiled source in JsonML format.
    • getString

      public String getString()
      Returns compiled source as a JavaScript.
    • getReport

      public SecureCompiler.Report getReport()
      Returns report from the last compilation.
    • compile

      public void compile(JsonML source)
    • enableFoldConstant

      public void enableFoldConstant()