class SanityCheck extends java.lang.Object implements CompilerPass
Modifier and Type | Field and Description |
---|---|
private AstValidator |
astValidator |
(package private) static DiagnosticType |
CANNOT_PARSE_GENERATED_CODE |
private AbstractCompiler |
compiler |
(package private) static DiagnosticType |
EXTERN_PROPERTIES_CHANGED |
(package private) static DiagnosticType |
GENERATED_BAD_CODE |
Constructor and Description |
---|
SanityCheck(AbstractCompiler compiler) |
Modifier and Type | Method and Description |
---|---|
void |
process(Node externs,
Node root)
Process the JS with root node root.
|
private void |
sanityCheckAst(Node externs,
Node root)
Sanity check the AST is structurally accurate.
|
private Node |
sanityCheckCodeGeneration(Node root)
Sanity checks code generation by performing it once, parsing the result,
then generating code from the second parse tree to verify that it matches
the code generated from the first parse tree.
|
private void |
sanityCheckExternProperties(Node externs) |
private void |
sanityCheckNormalization(Node externs,
Node root)
Sanity checks the AST.
|
private void |
sanityCheckVars(Node externs,
Node root) |
static final DiagnosticType CANNOT_PARSE_GENERATED_CODE
static final DiagnosticType GENERATED_BAD_CODE
static final DiagnosticType EXTERN_PROPERTIES_CHANGED
private final AbstractCompiler compiler
private final AstValidator astValidator
SanityCheck(AbstractCompiler compiler)
public void process(Node externs, Node root)
CompilerPass
process
in interface CompilerPass
externs
- Top of external JS treeroot
- Top of JS treeprivate void sanityCheckAst(Node externs, Node root)
private Node sanityCheckCodeGeneration(Node root)
private void sanityCheckNormalization(Node externs, Node root)
private void sanityCheckExternProperties(Node externs)