private String getSourceName() { return sourceFile == null ? null : sourceFile.getName(); }
public final boolean isFromExterns() { StaticSourceFile file = getStaticSourceFile(); return file == null ? false : file.isExtern(); }
/** Whether the source kind is STRONG. */ default boolean isStrong() { return getKind() == SourceKind.STRONG; }
public int getSourceOffset() { StaticSourceFile file = getStaticSourceFile(); if (file == null) { return -1; } int lineno = getLineno(); if (lineno == -1) { return -1; } return file.getLineOffset(lineno) + getCharno(); }
@Override public void process(Node externs, Node root) { for (Node script = root.getFirstChild(); script != null; script = script.getNext()) { Preconditions.checkState(script.isScript()); if (script.getStaticSourceFile().isWeak()) { // Keep the file but remove the contents, since some users expect the number of input and // output files to be the same. NodeUtil.deleteChildren(script, compiler); } } } }
public int getSourceOffset() { StaticSourceFile file = getStaticSourceFile(); if (file == null) { return -1; } int lineno = getLineno(); if (lineno == -1) { return -1; } return file.getLineOffset(lineno) + getCharno(); }
@Override public String getPackageName(StaticSourceFile source) { // The package name of a source file is its file path. String name = source.getName(); int lastSlash = name.lastIndexOf('/'); return lastSlash == -1 ? "" : name.substring(0, lastSlash); }
private static boolean isInExternFile(Node n) { return NodeUtil.getSourceFile(n).isExtern(); }
/** Whether the source kind is EXTERN. */ default boolean isExtern() { return getKind() == SourceKind.EXTERN; }
@Override public String getPackageName(StaticSourceFile source) { // The package name of a source file is its file path. String name = source.getName(); int lastSlash = name.lastIndexOf('/'); return lastSlash == -1 ? "" : name.substring(0, lastSlash); }
public boolean isFromExterns() { StaticSourceFile file = getStaticSourceFile(); return file == null ? false : file.isExtern(); }
/** Whether the source kind is WEAK. */ default boolean isWeak() { return getKind() == SourceKind.WEAK; }
@Nullable public String getSourceFileName() { StaticSourceFile file = getStaticSourceFile(); return file == null ? null : file.getName(); }
if (result != null && !result.getDeclarationNode().getStaticSourceFile().isExtern()) { result = null;
if (symbol.getDeclarationNode() == null || symbol.getDeclarationNode().getStaticSourceFile() == null || !symbol.getDeclarationNode().getStaticSourceFile().isExtern()) { continue;
private String getSourceName() { StaticSourceFile sourceFile = getSourceFile(); return sourceFile == null ? null : sourceFile.getName(); }
if (sourceFile == null || sourceFile.isExtern()) { return IR.call( jsCode("externClassChecker"),
public String getSourceFileName() { StaticSourceFile file = getStaticSourceFile(); return file == null ? null : file.getName(); }
if (sourceFile == null || sourceFile.isExtern()) { return IR.call(jsCode("externClassChecker"), IR.string(refName));