public class SyntacticScopeCreator
extends java.lang.Object
This implementation is not thread-safe.
Modifier and Type | Class and Description |
---|---|
static interface |
SyntacticScopeCreator.ScopeFactory
A simple API for injecting the use of alternative Scope classes
|
Modifier and Type | Field and Description |
---|---|
static com.google.javascript.jscomp.ScopeCreator |
ASSERT_NO_SCOPES_CREATED
A scope creator that can be provided to NodeTraversal to ensure that no scopes are actually
ever created.
|
static com.google.javascript.jscomp.SyntacticScopeCreator.RedeclarationHandler |
DEFAULT_REDECLARATION_HANDLER |
Constructor and Description |
---|
SyntacticScopeCreator(AbstractCompiler compiler) |
SyntacticScopeCreator(AbstractCompiler compiler,
SyntacticScopeCreator.ScopeFactory scopeFactory) |
Modifier and Type | Method and Description |
---|---|
Scope |
createScope(Node n,
AbstractScope<?,?> parent)
Creates a
Scope object. |
boolean |
hasBlockScope() |
public static final com.google.javascript.jscomp.SyntacticScopeCreator.RedeclarationHandler DEFAULT_REDECLARATION_HANDLER
public static final com.google.javascript.jscomp.ScopeCreator ASSERT_NO_SCOPES_CREATED
public SyntacticScopeCreator(AbstractCompiler compiler)
public SyntacticScopeCreator(AbstractCompiler compiler, SyntacticScopeCreator.ScopeFactory scopeFactory)
public boolean hasBlockScope()
public Scope createScope(Node n, AbstractScope<?,?> parent)
Scope
object.n
- the root node (either a FUNCTION node, a SCRIPT node, or a
synthetic block node whose children are all SCRIPT nodes)parent
- the parent Scope object (may be null)Copyright © 2009-2019 Google. All Rights Reserved.