id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
23,900
google/closure-compiler
src/com/google/javascript/jscomp/AngularPass.java
AngularPass.createDependenciesList
private List<Node> createDependenciesList(Node n) { checkArgument(n.isFunction()); Node params = NodeUtil.getFunctionParameters(n); if (params != null) { return createStringsFromParamList(params); } return new ArrayList<>(); }
java
private List<Node> createDependenciesList(Node n) { checkArgument(n.isFunction()); Node params = NodeUtil.getFunctionParameters(n); if (params != null) { return createStringsFromParamList(params); } return new ArrayList<>(); }
[ "private", "List", "<", "Node", ">", "createDependenciesList", "(", "Node", "n", ")", "{", "checkArgument", "(", "n", ".", "isFunction", "(", ")", ")", ";", "Node", "params", "=", "NodeUtil", ".", "getFunctionParameters", "(", "n", ")", ";", "if", "(", ...
Given a FUNCTION node returns array of STRING nodes representing function parameters. @param n the FUNCTION node. @return STRING nodes.
[ "Given", "a", "FUNCTION", "node", "returns", "array", "of", "STRING", "nodes", "representing", "function", "parameters", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AngularPass.java#L168-L175
23,901
google/closure-compiler
src/com/google/javascript/jscomp/AngularPass.java
AngularPass.createStringsFromParamList
private List<Node> createStringsFromParamList(Node params) { Node param = params.getFirstChild(); ArrayList<Node> names = new ArrayList<>(); while (param != null) { if (param.isName()) { names.add(IR.string(param.getString()).srcref(param)); } else if (param.isDestructuringPattern()) { ...
java
private List<Node> createStringsFromParamList(Node params) { Node param = params.getFirstChild(); ArrayList<Node> names = new ArrayList<>(); while (param != null) { if (param.isName()) { names.add(IR.string(param.getString()).srcref(param)); } else if (param.isDestructuringPattern()) { ...
[ "private", "List", "<", "Node", ">", "createStringsFromParamList", "(", "Node", "params", ")", "{", "Node", "param", "=", "params", ".", "getFirstChild", "(", ")", ";", "ArrayList", "<", "Node", ">", "names", "=", "new", "ArrayList", "<>", "(", ")", ";",...
Given a PARAM_LIST node creates an array of corresponding STRING nodes. @param params PARAM_LIST node. @return array of STRING nodes.
[ "Given", "a", "PARAM_LIST", "node", "creates", "an", "array", "of", "corresponding", "STRING", "nodes", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AngularPass.java#L182-L200
23,902
google/closure-compiler
src/com/google/javascript/jscomp/AngularPass.java
AngularPass.addNode
private void addNode(Node n) { Node target = null; Node fn = null; String name = null; switch (n.getToken()) { // handles assignment cases like: // a = function() {} // a = b = c = function() {} case ASSIGN: if (!n.getFirstChild().isQualifiedName()) { compiler....
java
private void addNode(Node n) { Node target = null; Node fn = null; String name = null; switch (n.getToken()) { // handles assignment cases like: // a = function() {} // a = b = c = function() {} case ASSIGN: if (!n.getFirstChild().isQualifiedName()) { compiler....
[ "private", "void", "addNode", "(", "Node", "n", ")", "{", "Node", "target", "=", "null", ";", "Node", "fn", "=", "null", ";", "String", "name", "=", "null", ";", "switch", "(", "n", ".", "getToken", "(", ")", ")", "{", "// handles assignment cases like...
Add node to the list of injectables. @param n node to add.
[ "Add", "node", "to", "the", "list", "of", "injectables", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AngularPass.java#L215-L308
23,903
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.isOutputInJson
@GwtIncompatible("Unnecessary") private boolean isOutputInJson() { return config.jsonStreamMode == JsonStreamMode.OUT || config.jsonStreamMode == JsonStreamMode.BOTH; }
java
@GwtIncompatible("Unnecessary") private boolean isOutputInJson() { return config.jsonStreamMode == JsonStreamMode.OUT || config.jsonStreamMode == JsonStreamMode.BOTH; }
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "boolean", "isOutputInJson", "(", ")", "{", "return", "config", ".", "jsonStreamMode", "==", "JsonStreamMode", ".", "OUT", "||", "config", ".", "jsonStreamMode", "==", "JsonStreamMode", ".", "BOTH", ...
Returns whether output should be a JSON stream.
[ "Returns", "whether", "output", "should", "be", "a", "JSON", "stream", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L269-L273
23,904
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.createInputs
@GwtIncompatible("Unnecessary") private List<SourceFile> createInputs( List<FlagEntry<JsSourceType>> files, boolean allowStdIn, List<JsModuleSpec> jsModuleSpecs) throws IOException { return createInputs(files, /* jsonFiles= */ null, allowStdIn, jsModuleSpecs); }
java
@GwtIncompatible("Unnecessary") private List<SourceFile> createInputs( List<FlagEntry<JsSourceType>> files, boolean allowStdIn, List<JsModuleSpec> jsModuleSpecs) throws IOException { return createInputs(files, /* jsonFiles= */ null, allowStdIn, jsModuleSpecs); }
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "List", "<", "SourceFile", ">", "createInputs", "(", "List", "<", "FlagEntry", "<", "JsSourceType", ">", ">", "files", ",", "boolean", "allowStdIn", ",", "List", "<", "JsModuleSpec", ">", "jsModul...
Creates inputs from a list of files. @param files A list of flag entries indicates js and zip file names. @param allowStdIn Whether '-' is allowed appear as a filename to represent stdin. If true, '-' is only allowed to appear once. @param jsModuleSpecs A list js module specs. @return An array of inputs
[ "Creates", "inputs", "from", "a", "list", "of", "files", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L559-L564
23,905
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.createInputs
@GwtIncompatible("Unnecessary") private List<SourceFile> createInputs( List<FlagEntry<JsSourceType>> files, List<JsonFileSpec> jsonFiles, List<JsModuleSpec> jsModuleSpecs) throws IOException { return createInputs(files, jsonFiles, /* allowStdIn= */ false, jsModuleSpecs); }
java
@GwtIncompatible("Unnecessary") private List<SourceFile> createInputs( List<FlagEntry<JsSourceType>> files, List<JsonFileSpec> jsonFiles, List<JsModuleSpec> jsModuleSpecs) throws IOException { return createInputs(files, jsonFiles, /* allowStdIn= */ false, jsModuleSpecs); }
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "List", "<", "SourceFile", ">", "createInputs", "(", "List", "<", "FlagEntry", "<", "JsSourceType", ">", ">", "files", ",", "List", "<", "JsonFileSpec", ">", "jsonFiles", ",", "List", "<", "JsMo...
Creates inputs from a list of source files and json files. @param files A list of flag entries indicates js and zip file names. @param jsonFiles A list of json encoded files. @param jsModuleSpecs A list js module specs. @return An array of inputs
[ "Creates", "inputs", "from", "a", "list", "of", "source", "files", "and", "json", "files", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L574-L581
23,906
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.createSourceInputs
@GwtIncompatible("Unnecessary") private List<SourceFile> createSourceInputs( List<JsModuleSpec> jsModuleSpecs, List<FlagEntry<JsSourceType>> files, List<JsonFileSpec> jsonFiles, List<String> moduleRoots) throws IOException { if (isInTestMode()) { return inputsSupplierForTesting...
java
@GwtIncompatible("Unnecessary") private List<SourceFile> createSourceInputs( List<JsModuleSpec> jsModuleSpecs, List<FlagEntry<JsSourceType>> files, List<JsonFileSpec> jsonFiles, List<String> moduleRoots) throws IOException { if (isInTestMode()) { return inputsSupplierForTesting...
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "List", "<", "SourceFile", ">", "createSourceInputs", "(", "List", "<", "JsModuleSpec", ">", "jsModuleSpecs", ",", "List", "<", "FlagEntry", "<", "JsSourceType", ">", ">", "files", ",", "List", "<...
Creates JS source code inputs from a list of files.
[ "Creates", "JS", "source", "code", "inputs", "from", "a", "list", "of", "files", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L787-L816
23,907
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.createExternInputs
@GwtIncompatible("Unnecessary") private List<SourceFile> createExternInputs(List<String> files) throws IOException { List<FlagEntry<JsSourceType>> externFiles = new ArrayList<>(); for (String file : files) { externFiles.add(new FlagEntry<JsSourceType>(JsSourceType.EXTERN, file)); } try { r...
java
@GwtIncompatible("Unnecessary") private List<SourceFile> createExternInputs(List<String> files) throws IOException { List<FlagEntry<JsSourceType>> externFiles = new ArrayList<>(); for (String file : files) { externFiles.add(new FlagEntry<JsSourceType>(JsSourceType.EXTERN, file)); } try { r...
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "List", "<", "SourceFile", ">", "createExternInputs", "(", "List", "<", "String", ">", "files", ")", "throws", "IOException", "{", "List", "<", "FlagEntry", "<", "JsSourceType", ">>", "externFiles",...
Creates JS extern inputs from a list of files.
[ "Creates", "JS", "extern", "inputs", "from", "a", "list", "of", "files", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L819-L830
23,908
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.createJsModules
public static List<JSModule> createJsModules(List<JsModuleSpec> specs, List<SourceFile> inputs) throws IOException { checkState(specs != null); checkState(!specs.isEmpty()); checkState(inputs != null); List<String> moduleNames = new ArrayList<>(specs.size()); Map<String, JSModule> modulesByNa...
java
public static List<JSModule> createJsModules(List<JsModuleSpec> specs, List<SourceFile> inputs) throws IOException { checkState(specs != null); checkState(!specs.isEmpty()); checkState(inputs != null); List<String> moduleNames = new ArrayList<>(specs.size()); Map<String, JSModule> modulesByNa...
[ "public", "static", "List", "<", "JSModule", ">", "createJsModules", "(", "List", "<", "JsModuleSpec", ">", "specs", ",", "List", "<", "SourceFile", ">", "inputs", ")", "throws", "IOException", "{", "checkState", "(", "specs", "!=", "null", ")", ";", "chec...
Creates module objects from a list of js module specifications. @param specs A list of js module specifications, not null or empty. @param inputs A list of JS file paths, not null @return An array of module objects
[ "Creates", "module", "objects", "from", "a", "list", "of", "js", "module", "specifications", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L839-L931
23,909
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.parseModuleWrappers
public static Map<String, String> parseModuleWrappers( List<String> specs, Iterable<JSModule> chunks) { checkState(specs != null); Map<String, String> wrappers = new HashMap<>(); // Prepopulate the map with module names. for (JSModule c : chunks) { wrappers.put(c.getName(), ""); } ...
java
public static Map<String, String> parseModuleWrappers( List<String> specs, Iterable<JSModule> chunks) { checkState(specs != null); Map<String, String> wrappers = new HashMap<>(); // Prepopulate the map with module names. for (JSModule c : chunks) { wrappers.put(c.getName(), ""); } ...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "parseModuleWrappers", "(", "List", "<", "String", ">", "specs", ",", "Iterable", "<", "JSModule", ">", "chunks", ")", "{", "checkState", "(", "specs", "!=", "null", ")", ";", "Map", "<", "S...
Parses module wrapper specifications. @param specs A list of module wrapper specifications, not null. The spec format is: <code> name:wrapper</code>. Wrappers. @param chunks The JS chunks whose wrappers are specified @return A map from module name to module wrapper. Modules with no wrapper will have the empty string a...
[ "Parses", "module", "wrapper", "specifications", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L954-L988
23,910
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.maybeCreateDirsForPath
@GwtIncompatible("Unnecessary") private static void maybeCreateDirsForPath(String pathPrefix) { if (!Strings.isNullOrEmpty(pathPrefix)) { String dirName = pathPrefix.charAt(pathPrefix.length() - 1) == File.separatorChar ? pathPrefix.substring(0, pathPrefix.length() - 1) ...
java
@GwtIncompatible("Unnecessary") private static void maybeCreateDirsForPath(String pathPrefix) { if (!Strings.isNullOrEmpty(pathPrefix)) { String dirName = pathPrefix.charAt(pathPrefix.length() - 1) == File.separatorChar ? pathPrefix.substring(0, pathPrefix.length() - 1) ...
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "static", "void", "maybeCreateDirsForPath", "(", "String", "pathPrefix", ")", "{", "if", "(", "!", "Strings", ".", "isNullOrEmpty", "(", "pathPrefix", ")", ")", "{", "String", "dirName", "=", "pat...
Creates any directories necessary to write a file that will have a given path prefix.
[ "Creates", "any", "directories", "necessary", "to", "write", "a", "file", "that", "will", "have", "a", "given", "path", "prefix", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1083-L1094
23,911
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.processResults
@GwtIncompatible("Unnecessary") int processResults(Result result, List<JSModule> modules, B options) throws IOException { if (config.printPassGraph) { if (compiler.getRoot() == null) { return 1; } else { Appendable jsOutput = createDefaultOutput(); jsOutput.append( ...
java
@GwtIncompatible("Unnecessary") int processResults(Result result, List<JSModule> modules, B options) throws IOException { if (config.printPassGraph) { if (compiler.getRoot() == null) { return 1; } else { Appendable jsOutput = createDefaultOutput(); jsOutput.append( ...
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "int", "processResults", "(", "Result", "result", ",", "List", "<", "JSModule", ">", "modules", ",", "B", "options", ")", "throws", "IOException", "{", "if", "(", "config", ".", "printPassGraph", ")", "{",...
Processes the results of the compile job, and returns an error code.
[ "Processes", "the", "results", "of", "the", "compile", "job", "and", "returns", "an", "error", "code", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1340-L1431
23,912
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.createJsonFile
@GwtIncompatible("Unnecessary") JsonFileSpec createJsonFile(B options, String outputMarker, Function<String, String> escaper) throws IOException { Appendable jsOutput = new StringBuilder(); writeOutput( jsOutput, compiler, (JSModule) null, config.outputWrapper, outputMarker, escaper); ...
java
@GwtIncompatible("Unnecessary") JsonFileSpec createJsonFile(B options, String outputMarker, Function<String, String> escaper) throws IOException { Appendable jsOutput = new StringBuilder(); writeOutput( jsOutput, compiler, (JSModule) null, config.outputWrapper, outputMarker, escaper); ...
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "JsonFileSpec", "createJsonFile", "(", "B", "options", ",", "String", "outputMarker", ",", "Function", "<", "String", ",", "String", ">", "escaper", ")", "throws", "IOException", "{", "Appendable", "jsOutput", ...
Save the compiler output to a JsonFileSpec to be later written to stdout
[ "Save", "the", "compiler", "output", "to", "a", "JsonFileSpec", "to", "be", "later", "written", "to", "stdout" ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1463-L1482
23,913
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.createJsonFileFromModule
@GwtIncompatible("Unnecessary") private JsonFileSpec createJsonFileFromModule(JSModule module) throws IOException { compiler.resetAndIntitializeSourceMap(); StringBuilder output = new StringBuilder(); writeModuleOutput(output, module); JsonFileSpec jsonFile = new JsonFileSpec(output.toString(), ...
java
@GwtIncompatible("Unnecessary") private JsonFileSpec createJsonFileFromModule(JSModule module) throws IOException { compiler.resetAndIntitializeSourceMap(); StringBuilder output = new StringBuilder(); writeModuleOutput(output, module); JsonFileSpec jsonFile = new JsonFileSpec(output.toString(), ...
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "JsonFileSpec", "createJsonFileFromModule", "(", "JSModule", "module", ")", "throws", "IOException", "{", "compiler", ".", "resetAndIntitializeSourceMap", "(", ")", ";", "StringBuilder", "output", "=", "n...
Given an output module, convert it to a JSONFileSpec with associated sourcemap
[ "Given", "an", "output", "module", "convert", "it", "to", "a", "JSONFileSpec", "with", "associated", "sourcemap" ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1557-L1575
23,914
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.getInputCharset
@GwtIncompatible("Unnecessary") private Charset getInputCharset() { if (!config.charset.isEmpty()) { if (!Charset.isSupported(config.charset)) { throw new FlagUsageException(config.charset + " is not a valid charset name."); } return Charset.forName(config.charset); } ...
java
@GwtIncompatible("Unnecessary") private Charset getInputCharset() { if (!config.charset.isEmpty()) { if (!Charset.isSupported(config.charset)) { throw new FlagUsageException(config.charset + " is not a valid charset name."); } return Charset.forName(config.charset); } ...
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "Charset", "getInputCharset", "(", ")", "{", "if", "(", "!", "config", ".", "charset", ".", "isEmpty", "(", ")", ")", "{", "if", "(", "!", "Charset", ".", "isSupported", "(", "config", ".", ...
Query the flag for the input charset, and return a Charset object representing the selection. @return Charset to use when reading inputs @throws FlagUsageException if flag is not a valid Charset name.
[ "Query", "the", "flag", "for", "the", "input", "charset", "and", "return", "a", "Charset", "object", "representing", "the", "selection", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1583-L1593
23,915
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.getLegacyOutputCharset
@GwtIncompatible("Unnecessary") private Charset getLegacyOutputCharset() { if (!config.charset.isEmpty()) { if (!Charset.isSupported(config.charset)) { throw new FlagUsageException(config.charset + " is not a valid charset name."); } return Charset.forName(config.charset); } retu...
java
@GwtIncompatible("Unnecessary") private Charset getLegacyOutputCharset() { if (!config.charset.isEmpty()) { if (!Charset.isSupported(config.charset)) { throw new FlagUsageException(config.charset + " is not a valid charset name."); } return Charset.forName(config.charset); } retu...
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "Charset", "getLegacyOutputCharset", "(", ")", "{", "if", "(", "!", "config", ".", "charset", ".", "isEmpty", "(", ")", ")", "{", "if", "(", "!", "Charset", ".", "isSupported", "(", "config", ...
Query the flag for the output charset. <p>Let the outputCharset be the same as the input charset... except if we're reading in UTF-8 by default. By tradition, we've always output ASCII to avoid various hiccups with different browsers, proxies and firewalls. @return Name of the charset to use when writing outputs. Gua...
[ "Query", "the", "flag", "for", "the", "output", "charset", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1605-L1614
23,916
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.shouldGenerateMapPerModule
@GwtIncompatible("Unnecessary") private boolean shouldGenerateMapPerModule(B options) { return options.sourceMapOutputPath != null && options.sourceMapOutputPath.contains("%outname%"); }
java
@GwtIncompatible("Unnecessary") private boolean shouldGenerateMapPerModule(B options) { return options.sourceMapOutputPath != null && options.sourceMapOutputPath.contains("%outname%"); }
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "boolean", "shouldGenerateMapPerModule", "(", "B", "options", ")", "{", "return", "options", ".", "sourceMapOutputPath", "!=", "null", "&&", "options", ".", "sourceMapOutputPath", ".", "contains", "(", ...
Returns true if and only if a source map file should be generated for each module, as opposed to one unified map. This is specified by having the source map pattern include the %outname% variable.
[ "Returns", "true", "if", "and", "only", "if", "a", "source", "map", "file", "should", "be", "generated", "for", "each", "module", "as", "opposed", "to", "one", "unified", "map", ".", "This", "is", "specified", "by", "having", "the", "source", "map", "pat...
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1643-L1647
23,917
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.openExternExportsStream
@GwtIncompatible("Unnecessary") private Writer openExternExportsStream(B options, String path) throws IOException { if (options.externExportsPath == null) { return null; } String exPath = options.externExportsPath; if (!exPath.contains(File.separator)) { File outputFile = new File(path);...
java
@GwtIncompatible("Unnecessary") private Writer openExternExportsStream(B options, String path) throws IOException { if (options.externExportsPath == null) { return null; } String exPath = options.externExportsPath; if (!exPath.contains(File.separator)) { File outputFile = new File(path);...
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "Writer", "openExternExportsStream", "(", "B", "options", ",", "String", "path", ")", "throws", "IOException", "{", "if", "(", "options", ".", "externExportsPath", "==", "null", ")", "{", "return", ...
Returns a stream for outputting the generated externs file. @param options The options to the Compiler. @param path The path of the generated JS source file. @return The stream or null if no extern-ed exports are being generated.
[ "Returns", "a", "stream", "for", "outputting", "the", "generated", "externs", "file", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1656-L1670
23,918
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.expandCommandLinePath
@GwtIncompatible("Unnecessary") private String expandCommandLinePath(String path, JSModule forModule) { String sub; if (forModule != null) { sub = config.moduleOutputPathPrefix + forModule.getName() + ".js"; } else if (!config.module.isEmpty()) { sub = config.moduleOutputPathPrefix; } else...
java
@GwtIncompatible("Unnecessary") private String expandCommandLinePath(String path, JSModule forModule) { String sub; if (forModule != null) { sub = config.moduleOutputPathPrefix + forModule.getName() + ".js"; } else if (!config.module.isEmpty()) { sub = config.moduleOutputPathPrefix; } else...
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "String", "expandCommandLinePath", "(", "String", "path", ",", "JSModule", "forModule", ")", "{", "String", "sub", ";", "if", "(", "forModule", "!=", "null", ")", "{", "sub", "=", "config", ".",...
Expand a file path specified on the command-line. <p>Most file paths on the command-line allow an %outname% placeholder. The placeholder will expand to a different value depending on the current output mode. There are three scenarios: <p>1) Single JS output, single extra output: sub in jsOutputPath. 2) Multiple JS ou...
[ "Expand", "a", "file", "path", "specified", "on", "the", "command", "-", "line", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1685-L1696
23,919
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.expandSourceMapPath
@VisibleForTesting @GwtIncompatible("Unnecessary") String expandSourceMapPath(B options, JSModule forModule) { if (Strings.isNullOrEmpty(options.sourceMapOutputPath)) { return null; } return expandCommandLinePath(options.sourceMapOutputPath, forModule); }
java
@VisibleForTesting @GwtIncompatible("Unnecessary") String expandSourceMapPath(B options, JSModule forModule) { if (Strings.isNullOrEmpty(options.sourceMapOutputPath)) { return null; } return expandCommandLinePath(options.sourceMapOutputPath, forModule); }
[ "@", "VisibleForTesting", "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "String", "expandSourceMapPath", "(", "B", "options", ",", "JSModule", "forModule", ")", "{", "if", "(", "Strings", ".", "isNullOrEmpty", "(", "options", ".", "sourceMapOutputPath", ")"...
Expansion function for source map.
[ "Expansion", "function", "for", "source", "map", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1699-L1706
23,920
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.filenameToOutputStream
@GwtIncompatible("Unnecessary") protected OutputStream filenameToOutputStream(String fileName) throws IOException { if (fileName == null){ return null; } return new FileOutputStream(fileName); }
java
@GwtIncompatible("Unnecessary") protected OutputStream filenameToOutputStream(String fileName) throws IOException { if (fileName == null){ return null; } return new FileOutputStream(fileName); }
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "protected", "OutputStream", "filenameToOutputStream", "(", "String", "fileName", ")", "throws", "IOException", "{", "if", "(", "fileName", "==", "null", ")", "{", "return", "null", ";", "}", "return", "new", ...
Converts a file name into a Outputstream. Returns null if the file name is null.
[ "Converts", "a", "file", "name", "into", "a", "Outputstream", ".", "Returns", "null", "if", "the", "file", "name", "is", "null", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1741-L1747
23,921
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.streamToLegacyOutputWriter
@GwtIncompatible("Unnecessary") private Writer streamToLegacyOutputWriter(OutputStream stream) throws IOException { if (legacyOutputCharset == null) { return new BufferedWriter(new OutputStreamWriter(stream, UTF_8)); } else { return new BufferedWriter( new OutputStreamWriter(stream, lega...
java
@GwtIncompatible("Unnecessary") private Writer streamToLegacyOutputWriter(OutputStream stream) throws IOException { if (legacyOutputCharset == null) { return new BufferedWriter(new OutputStreamWriter(stream, UTF_8)); } else { return new BufferedWriter( new OutputStreamWriter(stream, lega...
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "Writer", "streamToLegacyOutputWriter", "(", "OutputStream", "stream", ")", "throws", "IOException", "{", "if", "(", "legacyOutputCharset", "==", "null", ")", "{", "return", "new", "BufferedWriter", "("...
Create a writer with the legacy output charset.
[ "Create", "a", "writer", "with", "the", "legacy", "output", "charset", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1750-L1758
23,922
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.streamToOutputWriter2
@GwtIncompatible("Unnecessary") private Writer streamToOutputWriter2(OutputStream stream) { if (outputCharset2 == null) { return new BufferedWriter(new OutputStreamWriter(stream, UTF_8)); } else { return new BufferedWriter( new OutputStreamWriter(stream, outputCharset2)); } }
java
@GwtIncompatible("Unnecessary") private Writer streamToOutputWriter2(OutputStream stream) { if (outputCharset2 == null) { return new BufferedWriter(new OutputStreamWriter(stream, UTF_8)); } else { return new BufferedWriter( new OutputStreamWriter(stream, outputCharset2)); } }
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "Writer", "streamToOutputWriter2", "(", "OutputStream", "stream", ")", "{", "if", "(", "outputCharset2", "==", "null", ")", "{", "return", "new", "BufferedWriter", "(", "new", "OutputStreamWriter", "(...
Create a writer with the newer output charset.
[ "Create", "a", "writer", "with", "the", "newer", "output", "charset", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1761-L1769
23,923
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.outputSourceMap
@GwtIncompatible("Unnecessary") private void outputSourceMap(B options, String associatedName) throws IOException { if (Strings.isNullOrEmpty(options.sourceMapOutputPath) || options.sourceMapOutputPath.equals("/dev/null")) { return; } String outName = expandSourceMapPath(options, null); ...
java
@GwtIncompatible("Unnecessary") private void outputSourceMap(B options, String associatedName) throws IOException { if (Strings.isNullOrEmpty(options.sourceMapOutputPath) || options.sourceMapOutputPath.equals("/dev/null")) { return; } String outName = expandSourceMapPath(options, null); ...
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "void", "outputSourceMap", "(", "B", "options", ",", "String", "associatedName", ")", "throws", "IOException", "{", "if", "(", "Strings", ".", "isNullOrEmpty", "(", "options", ".", "sourceMapOutputPat...
Outputs the source map found in the compiler to the proper path if one exists. @param options The options to the Compiler.
[ "Outputs", "the", "source", "map", "found", "in", "the", "compiler", "to", "the", "proper", "path", "if", "one", "exists", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1776-L1788
23,924
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.outputNameMaps
@GwtIncompatible("Unnecessary") private void outputNameMaps() throws IOException { String propertyMapOutputPath = null; String variableMapOutputPath = null; // Check the create_name_map_files FLAG. if (config.createNameMapFiles) { String basePath = getMapPath(config.jsOutputFile); prope...
java
@GwtIncompatible("Unnecessary") private void outputNameMaps() throws IOException { String propertyMapOutputPath = null; String variableMapOutputPath = null; // Check the create_name_map_files FLAG. if (config.createNameMapFiles) { String basePath = getMapPath(config.jsOutputFile); prope...
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "void", "outputNameMaps", "(", ")", "throws", "IOException", "{", "String", "propertyMapOutputPath", "=", "null", ";", "String", "variableMapOutputPath", "=", "null", ";", "// Check the create_name_map_file...
Outputs the variable and property name maps for the specified compiler if the proper FLAGS are set.
[ "Outputs", "the", "variable", "and", "property", "name", "maps", "for", "the", "specified", "compiler", "if", "the", "proper", "FLAGS", "are", "set", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1835-L1876
23,925
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.createDefineOrTweakReplacements
@VisibleForTesting public static void createDefineOrTweakReplacements( List<String> definitions, CompilerOptions options, boolean tweaks) { // Parse the definitions for (String override : definitions) { String[] assignment = override.split("=", 2); String defName = assignment[0]; if (...
java
@VisibleForTesting public static void createDefineOrTweakReplacements( List<String> definitions, CompilerOptions options, boolean tweaks) { // Parse the definitions for (String override : definitions) { String[] assignment = override.split("=", 2); String defName = assignment[0]; if (...
[ "@", "VisibleForTesting", "public", "static", "void", "createDefineOrTweakReplacements", "(", "List", "<", "String", ">", "definitions", ",", "CompilerOptions", "options", ",", "boolean", "tweaks", ")", "{", "// Parse the definitions", "for", "(", "String", "override"...
Create a map of constant names to constant values from a textual description of the map. @param definitions A list of overriding definitions for defines in the form {@code <name>[=<val>]}, where {@code <val>} is a number, boolean, or single-quoted string without single quotes.
[ "Create", "a", "map", "of", "constant", "names", "to", "constant", "values", "from", "a", "textual", "description", "of", "the", "map", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1903-L1971
23,926
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.shouldGenerateOutputPerModule
@GwtIncompatible("Unnecessary") private boolean shouldGenerateOutputPerModule(String output) { return !config.module.isEmpty() && output != null && output.contains("%outname%"); }
java
@GwtIncompatible("Unnecessary") private boolean shouldGenerateOutputPerModule(String output) { return !config.module.isEmpty() && output != null && output.contains("%outname%"); }
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "boolean", "shouldGenerateOutputPerModule", "(", "String", "output", ")", "{", "return", "!", "config", ".", "module", ".", "isEmpty", "(", ")", "&&", "output", "!=", "null", "&&", "output", ".", ...
Returns true if and only if a manifest or bundle should be generated for each module, as opposed to one unified manifest.
[ "Returns", "true", "if", "and", "only", "if", "a", "manifest", "or", "bundle", "should", "be", "generated", "for", "each", "module", "as", "opposed", "to", "one", "unified", "manifest", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L1977-L1981
23,927
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.outputModuleGraphJson
@GwtIncompatible("Unnecessary") private void outputModuleGraphJson() throws IOException { if (config.outputModuleDependencies != null && config.outputModuleDependencies.length() != 0) { try (Writer out = fileNameToOutputWriter2(config.outputModuleDependencies)) { printModuleGraphJsonTo(out);...
java
@GwtIncompatible("Unnecessary") private void outputModuleGraphJson() throws IOException { if (config.outputModuleDependencies != null && config.outputModuleDependencies.length() != 0) { try (Writer out = fileNameToOutputWriter2(config.outputModuleDependencies)) { printModuleGraphJsonTo(out);...
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "void", "outputModuleGraphJson", "(", ")", "throws", "IOException", "{", "if", "(", "config", ".", "outputModuleDependencies", "!=", "null", "&&", "config", ".", "outputModuleDependencies", ".", "length...
Creates a file containing the current module graph in JSON serialization.
[ "Creates", "a", "file", "containing", "the", "current", "module", "graph", "in", "JSON", "serialization", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L2039-L2047
23,928
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.printModuleGraphJsonTo
@VisibleForTesting @GwtIncompatible("Unnecessary") void printModuleGraphJsonTo(Appendable out) throws IOException { out.append(compiler.getModuleGraph().toJson().toString()); }
java
@VisibleForTesting @GwtIncompatible("Unnecessary") void printModuleGraphJsonTo(Appendable out) throws IOException { out.append(compiler.getModuleGraph().toJson().toString()); }
[ "@", "VisibleForTesting", "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "void", "printModuleGraphJsonTo", "(", "Appendable", "out", ")", "throws", "IOException", "{", "out", ".", "append", "(", "compiler", ".", "getModuleGraph", "(", ")", ".", "toJson", "...
Prints the current module graph as JSON.
[ "Prints", "the", "current", "module", "graph", "as", "JSON", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L2050-L2054
23,929
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.printModuleGraphManifestOrBundleTo
@VisibleForTesting @GwtIncompatible("Unnecessary") void printModuleGraphManifestOrBundleTo(JSModuleGraph graph, Appendable out, boolean isManifest) throws IOException { Joiner commas = Joiner.on(","); boolean requiresNewline = false; for (JSModule module : graph.getAllModules()) { if (requir...
java
@VisibleForTesting @GwtIncompatible("Unnecessary") void printModuleGraphManifestOrBundleTo(JSModuleGraph graph, Appendable out, boolean isManifest) throws IOException { Joiner commas = Joiner.on(","); boolean requiresNewline = false; for (JSModule module : graph.getAllModules()) { if (requir...
[ "@", "VisibleForTesting", "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "void", "printModuleGraphManifestOrBundleTo", "(", "JSModuleGraph", "graph", ",", "Appendable", "out", ",", "boolean", "isManifest", ")", "throws", "IOException", "{", "Joiner", "commas", "...
Prints a set of modules to the manifest or bundle file.
[ "Prints", "a", "set", "of", "modules", "to", "the", "manifest", "or", "bundle", "file", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L2057-L2082
23,930
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
AbstractCommandLineRunner.constructRootRelativePathsMap
@GwtIncompatible("Unnecessary") private Map<String, String> constructRootRelativePathsMap() { Map<String, String> rootRelativePathsMap = new LinkedHashMap<>(); for (String mapString : config.manifestMaps) { int colonIndex = mapString.indexOf(':'); checkState(colonIndex > 0); String execPath ...
java
@GwtIncompatible("Unnecessary") private Map<String, String> constructRootRelativePathsMap() { Map<String, String> rootRelativePathsMap = new LinkedHashMap<>(); for (String mapString : config.manifestMaps) { int colonIndex = mapString.indexOf(':'); checkState(colonIndex > 0); String execPath ...
[ "@", "GwtIncompatible", "(", "\"Unnecessary\"", ")", "private", "Map", "<", "String", ",", "String", ">", "constructRootRelativePathsMap", "(", ")", "{", "Map", "<", "String", ",", "String", ">", "rootRelativePathsMap", "=", "new", "LinkedHashMap", "<>", "(", ...
Construct and return the input root path map. The key is the exec path of each input file, and the value is the corresponding root relative path.
[ "Construct", "and", "return", "the", "input", "root", "path", "map", ".", "The", "key", "is", "the", "exec", "path", "of", "each", "input", "file", "and", "the", "value", "is", "the", "corresponding", "root", "relative", "path", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java#L2154-L2166
23,931
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectValidTypeofName
void expectValidTypeofName(Node n, String found) { report(JSError.make(n, UNKNOWN_TYPEOF_VALUE, found)); }
java
void expectValidTypeofName(Node n, String found) { report(JSError.make(n, UNKNOWN_TYPEOF_VALUE, found)); }
[ "void", "expectValidTypeofName", "(", "Node", "n", ",", "String", "found", ")", "{", "report", "(", "JSError", ".", "make", "(", "n", ",", "UNKNOWN_TYPEOF_VALUE", ",", "found", ")", ")", ";", "}" ]
a warning and attempt to correct the mismatch, when possible.
[ "a", "warning", "and", "attempt", "to", "correct", "the", "mismatch", "when", "possible", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L239-L241
23,932
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectObject
boolean expectObject(Node n, JSType type, String msg) { if (!type.matchesObjectContext()) { mismatch(n, msg, type, OBJECT_TYPE); return false; } return true; }
java
boolean expectObject(Node n, JSType type, String msg) { if (!type.matchesObjectContext()) { mismatch(n, msg, type, OBJECT_TYPE); return false; } return true; }
[ "boolean", "expectObject", "(", "Node", "n", ",", "JSType", "type", ",", "String", "msg", ")", "{", "if", "(", "!", "type", ".", "matchesObjectContext", "(", ")", ")", "{", "mismatch", "(", "n", ",", "msg", ",", "type", ",", "OBJECT_TYPE", ")", ";", ...
Expect the type to be an object, or a type convertible to object. If the expectation is not met, issue a warning at the provided node's source code position. @return True if there was no warning, false if there was a mismatch.
[ "Expect", "the", "type", "to", "be", "an", "object", "or", "a", "type", "convertible", "to", "object", ".", "If", "the", "expectation", "is", "not", "met", "issue", "a", "warning", "at", "the", "provided", "node", "s", "source", "code", "position", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L249-L255
23,933
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectActualObject
void expectActualObject(Node n, JSType type, String msg) { if (!type.isObject()) { mismatch(n, msg, type, OBJECT_TYPE); } }
java
void expectActualObject(Node n, JSType type, String msg) { if (!type.isObject()) { mismatch(n, msg, type, OBJECT_TYPE); } }
[ "void", "expectActualObject", "(", "Node", "n", ",", "JSType", "type", ",", "String", "msg", ")", "{", "if", "(", "!", "type", ".", "isObject", "(", ")", ")", "{", "mismatch", "(", "n", ",", "msg", ",", "type", ",", "OBJECT_TYPE", ")", ";", "}", ...
Expect the type to be an object. Unlike expectObject, a type convertible to object is not acceptable.
[ "Expect", "the", "type", "to", "be", "an", "object", ".", "Unlike", "expectObject", "a", "type", "convertible", "to", "object", "is", "not", "acceptable", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L261-L265
23,934
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectAnyObject
void expectAnyObject(Node n, JSType type, String msg) { JSType anyObjectType = getNativeType(NO_OBJECT_TYPE); if (!anyObjectType.isSubtypeOf(type) && !type.isEmptyType()) { mismatch(n, msg, type, anyObjectType); } }
java
void expectAnyObject(Node n, JSType type, String msg) { JSType anyObjectType = getNativeType(NO_OBJECT_TYPE); if (!anyObjectType.isSubtypeOf(type) && !type.isEmptyType()) { mismatch(n, msg, type, anyObjectType); } }
[ "void", "expectAnyObject", "(", "Node", "n", ",", "JSType", "type", ",", "String", "msg", ")", "{", "JSType", "anyObjectType", "=", "getNativeType", "(", "NO_OBJECT_TYPE", ")", ";", "if", "(", "!", "anyObjectType", ".", "isSubtypeOf", "(", "type", ")", "&&...
Expect the type to contain an object sometimes. If the expectation is not met, issue a warning at the provided node's source code position.
[ "Expect", "the", "type", "to", "contain", "an", "object", "sometimes", ".", "If", "the", "expectation", "is", "not", "met", "issue", "a", "warning", "at", "the", "provided", "node", "s", "source", "code", "position", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L271-L276
23,935
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectAutoboxesToIterable
boolean expectAutoboxesToIterable(Node n, JSType type, String msg) { // Note: we don't just use JSType.autobox() here because that removes null and undefined. // We want to keep null and undefined around. if (type.isUnionType()) { for (JSType alt : type.toMaybeUnionType().getAlternates()) { al...
java
boolean expectAutoboxesToIterable(Node n, JSType type, String msg) { // Note: we don't just use JSType.autobox() here because that removes null and undefined. // We want to keep null and undefined around. if (type.isUnionType()) { for (JSType alt : type.toMaybeUnionType().getAlternates()) { al...
[ "boolean", "expectAutoboxesToIterable", "(", "Node", "n", ",", "JSType", "type", ",", "String", "msg", ")", "{", "// Note: we don't just use JSType.autobox() here because that removes null and undefined.", "// We want to keep null and undefined around.", "if", "(", "type", ".", ...
Expect the type to autobox to be an Iterable. @return True if there was no warning, false if there was a mismatch.
[ "Expect", "the", "type", "to", "autobox", "to", "be", "an", "Iterable", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L282-L302
23,936
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectAutoboxesToIterableOrAsyncIterable
Optional<JSType> expectAutoboxesToIterableOrAsyncIterable(Node n, JSType type, String msg) { MaybeBoxedIterableOrAsyncIterable maybeBoxed = JsIterables.maybeBoxIterableOrAsyncIterable(type, typeRegistry); if (maybeBoxed.isMatch()) { return Optional.of(maybeBoxed.getTemplatedType()); } mi...
java
Optional<JSType> expectAutoboxesToIterableOrAsyncIterable(Node n, JSType type, String msg) { MaybeBoxedIterableOrAsyncIterable maybeBoxed = JsIterables.maybeBoxIterableOrAsyncIterable(type, typeRegistry); if (maybeBoxed.isMatch()) { return Optional.of(maybeBoxed.getTemplatedType()); } mi...
[ "Optional", "<", "JSType", ">", "expectAutoboxesToIterableOrAsyncIterable", "(", "Node", "n", ",", "JSType", "type", ",", "String", "msg", ")", "{", "MaybeBoxedIterableOrAsyncIterable", "maybeBoxed", "=", "JsIterables", ".", "maybeBoxIterableOrAsyncIterable", "(", "type...
Expect the type to autobox to be an Iterable or AsyncIterable. @return The unwrapped variants of the iterable(s), or empty if not iterable.
[ "Expect", "the", "type", "to", "autobox", "to", "be", "an", "Iterable", "or", "AsyncIterable", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L309-L320
23,937
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectGeneratorSupertype
void expectGeneratorSupertype(Node n, JSType type, String msg) { if (!getNativeType(GENERATOR_TYPE).isSubtypeOf(type)) { mismatch(n, msg, type, GENERATOR_TYPE); } }
java
void expectGeneratorSupertype(Node n, JSType type, String msg) { if (!getNativeType(GENERATOR_TYPE).isSubtypeOf(type)) { mismatch(n, msg, type, GENERATOR_TYPE); } }
[ "void", "expectGeneratorSupertype", "(", "Node", "n", ",", "JSType", "type", ",", "String", "msg", ")", "{", "if", "(", "!", "getNativeType", "(", "GENERATOR_TYPE", ")", ".", "isSubtypeOf", "(", "type", ")", ")", "{", "mismatch", "(", "n", ",", "msg", ...
Expect the type to be a Generator or supertype of Generator.
[ "Expect", "the", "type", "to", "be", "a", "Generator", "or", "supertype", "of", "Generator", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L323-L327
23,938
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectAsyncGeneratorSupertype
void expectAsyncGeneratorSupertype(Node n, JSType type, String msg) { if (!getNativeType(ASYNC_GENERATOR_TYPE).isSubtypeOf(type)) { mismatch(n, msg, type, ASYNC_GENERATOR_TYPE); } }
java
void expectAsyncGeneratorSupertype(Node n, JSType type, String msg) { if (!getNativeType(ASYNC_GENERATOR_TYPE).isSubtypeOf(type)) { mismatch(n, msg, type, ASYNC_GENERATOR_TYPE); } }
[ "void", "expectAsyncGeneratorSupertype", "(", "Node", "n", ",", "JSType", "type", ",", "String", "msg", ")", "{", "if", "(", "!", "getNativeType", "(", "ASYNC_GENERATOR_TYPE", ")", ".", "isSubtypeOf", "(", "type", ")", ")", "{", "mismatch", "(", "n", ",", ...
Expect the type to be a AsyncGenerator or supertype of AsyncGenerator.
[ "Expect", "the", "type", "to", "be", "a", "AsyncGenerator", "or", "supertype", "of", "AsyncGenerator", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L330-L334
23,939
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectValidAsyncReturnType
void expectValidAsyncReturnType(Node n, JSType type) { if (promiseOfUnknownType.isSubtypeOf(type)) { return; } JSError err = JSError.make(n, INVALID_ASYNC_RETURN_TYPE, type.toString()); registerMismatch(type, promiseOfUnknownType, err); report(err); }
java
void expectValidAsyncReturnType(Node n, JSType type) { if (promiseOfUnknownType.isSubtypeOf(type)) { return; } JSError err = JSError.make(n, INVALID_ASYNC_RETURN_TYPE, type.toString()); registerMismatch(type, promiseOfUnknownType, err); report(err); }
[ "void", "expectValidAsyncReturnType", "(", "Node", "n", ",", "JSType", "type", ")", "{", "if", "(", "promiseOfUnknownType", ".", "isSubtypeOf", "(", "type", ")", ")", "{", "return", ";", "}", "JSError", "err", "=", "JSError", ".", "make", "(", "n", ",", ...
Expect the type to be a supertype of `Promise`. <p>`Promise` is the <em>lower</em> bound of the declared return type, since that's what async functions always return; the user can't return an instance of a more specific type.
[ "Expect", "the", "type", "to", "be", "a", "supertype", "of", "Promise", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L342-L350
23,940
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectITemplateArraySupertype
void expectITemplateArraySupertype(Node n, JSType type, String msg) { if (!getNativeType(I_TEMPLATE_ARRAY_TYPE).isSubtypeOf(type)) { mismatch(n, msg, type, I_TEMPLATE_ARRAY_TYPE); } }
java
void expectITemplateArraySupertype(Node n, JSType type, String msg) { if (!getNativeType(I_TEMPLATE_ARRAY_TYPE).isSubtypeOf(type)) { mismatch(n, msg, type, I_TEMPLATE_ARRAY_TYPE); } }
[ "void", "expectITemplateArraySupertype", "(", "Node", "n", ",", "JSType", "type", ",", "String", "msg", ")", "{", "if", "(", "!", "getNativeType", "(", "I_TEMPLATE_ARRAY_TYPE", ")", ".", "isSubtypeOf", "(", "type", ")", ")", "{", "mismatch", "(", "n", ",",...
Expect the type to be an ITemplateArray or supertype of ITemplateArray.
[ "Expect", "the", "type", "to", "be", "an", "ITemplateArray", "or", "supertype", "of", "ITemplateArray", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L353-L357
23,941
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectString
void expectString(Node n, JSType type, String msg) { if (!type.matchesStringContext()) { mismatch(n, msg, type, STRING_TYPE); } }
java
void expectString(Node n, JSType type, String msg) { if (!type.matchesStringContext()) { mismatch(n, msg, type, STRING_TYPE); } }
[ "void", "expectString", "(", "Node", "n", ",", "JSType", "type", ",", "String", "msg", ")", "{", "if", "(", "!", "type", ".", "matchesStringContext", "(", ")", ")", "{", "mismatch", "(", "n", ",", "msg", ",", "type", ",", "STRING_TYPE", ")", ";", "...
Expect the type to be a string, or a type convertible to string. If the expectation is not met, issue a warning at the provided node's source code position.
[ "Expect", "the", "type", "to", "be", "a", "string", "or", "a", "type", "convertible", "to", "string", ".", "If", "the", "expectation", "is", "not", "met", "issue", "a", "warning", "at", "the", "provided", "node", "s", "source", "code", "position", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L363-L367
23,942
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectNumber
void expectNumber(Node n, JSType type, String msg) { if (!type.matchesNumberContext()) { mismatch(n, msg, type, NUMBER_TYPE); } else { expectNumberStrict(n, type, msg); } }
java
void expectNumber(Node n, JSType type, String msg) { if (!type.matchesNumberContext()) { mismatch(n, msg, type, NUMBER_TYPE); } else { expectNumberStrict(n, type, msg); } }
[ "void", "expectNumber", "(", "Node", "n", ",", "JSType", "type", ",", "String", "msg", ")", "{", "if", "(", "!", "type", ".", "matchesNumberContext", "(", ")", ")", "{", "mismatch", "(", "n", ",", "msg", ",", "type", ",", "NUMBER_TYPE", ")", ";", "...
Expect the type to be a number, or a type convertible to number. If the expectation is not met, issue a warning at the provided node's source code position.
[ "Expect", "the", "type", "to", "be", "a", "number", "or", "a", "type", "convertible", "to", "number", ".", "If", "the", "expectation", "is", "not", "met", "issue", "a", "warning", "at", "the", "provided", "node", "s", "source", "code", "position", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L373-L379
23,943
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectNumberStrict
void expectNumberStrict(Node n, JSType type, String msg) { if (!type.isSubtypeOf(getNativeType(NUMBER_TYPE))) { registerMismatchAndReport( n, INVALID_OPERAND_TYPE, msg, type, getNativeType(NUMBER_TYPE), null, null); } }
java
void expectNumberStrict(Node n, JSType type, String msg) { if (!type.isSubtypeOf(getNativeType(NUMBER_TYPE))) { registerMismatchAndReport( n, INVALID_OPERAND_TYPE, msg, type, getNativeType(NUMBER_TYPE), null, null); } }
[ "void", "expectNumberStrict", "(", "Node", "n", ",", "JSType", "type", ",", "String", "msg", ")", "{", "if", "(", "!", "type", ".", "isSubtypeOf", "(", "getNativeType", "(", "NUMBER_TYPE", ")", ")", ")", "{", "registerMismatchAndReport", "(", "n", ",", "...
Expect the type to be a number or a subtype.
[ "Expect", "the", "type", "to", "be", "a", "number", "or", "a", "subtype", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L384-L389
23,944
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectNumberOrSymbol
void expectNumberOrSymbol(Node n, JSType type, String msg) { if (!type.matchesNumberContext() && !type.matchesSymbolContext()) { mismatch(n, msg, type, NUMBER_SYMBOL); } }
java
void expectNumberOrSymbol(Node n, JSType type, String msg) { if (!type.matchesNumberContext() && !type.matchesSymbolContext()) { mismatch(n, msg, type, NUMBER_SYMBOL); } }
[ "void", "expectNumberOrSymbol", "(", "Node", "n", ",", "JSType", "type", ",", "String", "msg", ")", "{", "if", "(", "!", "type", ".", "matchesNumberContext", "(", ")", "&&", "!", "type", ".", "matchesSymbolContext", "(", ")", ")", "{", "mismatch", "(", ...
Expect the type to be a number or string, or a type convertible to a number or symbol. If the expectation is not met, issue a warning at the provided node's source code position.
[ "Expect", "the", "type", "to", "be", "a", "number", "or", "string", "or", "a", "type", "convertible", "to", "a", "number", "or", "symbol", ".", "If", "the", "expectation", "is", "not", "met", "issue", "a", "warning", "at", "the", "provided", "node", "s...
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L413-L417
23,945
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectStringOrSymbol
void expectStringOrSymbol(Node n, JSType type, String msg) { if (!type.matchesStringContext() && !type.matchesSymbolContext()) { mismatch(n, msg, type, STRING_SYMBOL); } }
java
void expectStringOrSymbol(Node n, JSType type, String msg) { if (!type.matchesStringContext() && !type.matchesSymbolContext()) { mismatch(n, msg, type, STRING_SYMBOL); } }
[ "void", "expectStringOrSymbol", "(", "Node", "n", ",", "JSType", "type", ",", "String", "msg", ")", "{", "if", "(", "!", "type", ".", "matchesStringContext", "(", ")", "&&", "!", "type", ".", "matchesSymbolContext", "(", ")", ")", "{", "mismatch", "(", ...
Expect the type to be a string or symbol, or a type convertible to a string. If the expectation is not met, issue a warning at the provided node's source code position.
[ "Expect", "the", "type", "to", "be", "a", "string", "or", "symbol", "or", "a", "type", "convertible", "to", "a", "string", ".", "If", "the", "expectation", "is", "not", "met", "issue", "a", "warning", "at", "the", "provided", "node", "s", "source", "co...
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L423-L427
23,946
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectNotNullOrUndefined
boolean expectNotNullOrUndefined( NodeTraversal t, Node n, JSType type, String msg, JSType expectedType) { if (!type.isNoType() && !type.isUnknownType() && type.isSubtypeOf(nullOrUndefined) && !containsForwardDeclaredUnresolvedName(type)) { // There's one edge case right now that we don...
java
boolean expectNotNullOrUndefined( NodeTraversal t, Node n, JSType type, String msg, JSType expectedType) { if (!type.isNoType() && !type.isUnknownType() && type.isSubtypeOf(nullOrUndefined) && !containsForwardDeclaredUnresolvedName(type)) { // There's one edge case right now that we don...
[ "boolean", "expectNotNullOrUndefined", "(", "NodeTraversal", "t", ",", "Node", "n", ",", "JSType", "type", ",", "String", "msg", ",", "JSType", "expectedType", ")", "{", "if", "(", "!", "type", ".", "isNoType", "(", ")", "&&", "!", "type", ".", "isUnknow...
Expect the type to be anything but the null or void type. If the expectation is not met, issue a warning at the provided node's source code position. Note that a union type that includes the void type and at least one other type meets the expectation. @return Whether the expectation was met.
[ "Expect", "the", "type", "to", "be", "anything", "but", "the", "null", "or", "void", "type", ".", "If", "the", "expectation", "is", "not", "met", "issue", "a", "warning", "at", "the", "provided", "node", "s", "source", "code", "position", ".", "Note", ...
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L480-L505
23,947
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectSwitchMatchesCase
void expectSwitchMatchesCase(Node n, JSType switchType, JSType caseType) { // ECMA-262, page 68, step 3 of evaluation of CaseBlock, // but allowing extra autoboxing. // TODO(user): remove extra conditions when type annotations // in the code base have adapted to the change in the compiler. if (!swit...
java
void expectSwitchMatchesCase(Node n, JSType switchType, JSType caseType) { // ECMA-262, page 68, step 3 of evaluation of CaseBlock, // but allowing extra autoboxing. // TODO(user): remove extra conditions when type annotations // in the code base have adapted to the change in the compiler. if (!swit...
[ "void", "expectSwitchMatchesCase", "(", "Node", "n", ",", "JSType", "switchType", ",", "JSType", "caseType", ")", "{", "// ECMA-262, page 68, step 3 of evaluation of CaseBlock,", "// but allowing extra autoboxing.", "// TODO(user): remove extra conditions when type annotations", "// ...
Expect that the type of a switch condition matches the type of its case condition.
[ "Expect", "that", "the", "type", "of", "a", "switch", "condition", "matches", "the", "type", "of", "its", "case", "condition", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L519-L533
23,948
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectIndexMatch
void expectIndexMatch(Node n, JSType objType, JSType indexType) { checkState(n.isGetElem() || n.isComputedProp(), n); Node indexNode = n.isGetElem() ? n.getLastChild() : n.getFirstChild(); if (indexType.isSymbolValueType()) { // For now, allow symbols definitions/access on any type. In the future only...
java
void expectIndexMatch(Node n, JSType objType, JSType indexType) { checkState(n.isGetElem() || n.isComputedProp(), n); Node indexNode = n.isGetElem() ? n.getLastChild() : n.getFirstChild(); if (indexType.isSymbolValueType()) { // For now, allow symbols definitions/access on any type. In the future only...
[ "void", "expectIndexMatch", "(", "Node", "n", ",", "JSType", "objType", ",", "JSType", "indexType", ")", "{", "checkState", "(", "n", ".", "isGetElem", "(", ")", "||", "n", ".", "isComputedProp", "(", ")", ",", "n", ")", ";", "Node", "indexNode", "=", ...
Expect that the first type can be addressed with GETELEM syntax and that the second type is the right type for an index into the first type. @param t The node traversal. @param n The GETELEM or COMPUTED_PROP node to issue warnings on. @param objType The type we're indexing into (the left side of the GETELEM). @param i...
[ "Expect", "that", "the", "first", "type", "can", "be", "addressed", "with", "GETELEM", "syntax", "and", "that", "the", "second", "type", "is", "the", "right", "type", "for", "an", "index", "into", "the", "first", "type", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L544-L582
23,949
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectArgumentMatchesParameter
void expectArgumentMatchesParameter( Node n, JSType argType, JSType paramType, Node callNode, int ordinal) { if (!argType.isSubtypeOf(paramType)) { mismatch( n, SimpleFormat.format( "actual parameter %d of %s does not match formal parameter", ordinal, type...
java
void expectArgumentMatchesParameter( Node n, JSType argType, JSType paramType, Node callNode, int ordinal) { if (!argType.isSubtypeOf(paramType)) { mismatch( n, SimpleFormat.format( "actual parameter %d of %s does not match formal parameter", ordinal, type...
[ "void", "expectArgumentMatchesParameter", "(", "Node", "n", ",", "JSType", "argType", ",", "JSType", "paramType", ",", "Node", "callNode", ",", "int", "ordinal", ")", "{", "if", "(", "!", "argType", ".", "isSubtypeOf", "(", "paramType", ")", ")", "{", "mis...
Expect that the type of an argument matches the type of the parameter that it's fulfilling. @param t The node traversal. @param n The node to issue warnings on. @param argType The type of the argument. @param paramType The type of the parameter. @param callNode The call node, to help with the warning message. @param o...
[ "Expect", "that", "the", "type", "of", "an", "argument", "matches", "the", "type", "of", "the", "parameter", "that", "it", "s", "fulfilling", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L655-L669
23,950
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectSuperType
void expectSuperType(Node n, ObjectType superObject, ObjectType subObject) { FunctionType subCtor = subObject.getConstructor(); ObjectType implicitProto = subObject.getImplicitPrototype(); ObjectType declaredSuper = implicitProto == null ? null : implicitProto.getImplicitPrototype(); if (declare...
java
void expectSuperType(Node n, ObjectType superObject, ObjectType subObject) { FunctionType subCtor = subObject.getConstructor(); ObjectType implicitProto = subObject.getImplicitPrototype(); ObjectType declaredSuper = implicitProto == null ? null : implicitProto.getImplicitPrototype(); if (declare...
[ "void", "expectSuperType", "(", "Node", "n", ",", "ObjectType", "superObject", ",", "ObjectType", "subObject", ")", "{", "FunctionType", "subCtor", "=", "subObject", ".", "getConstructor", "(", ")", ";", "ObjectType", "implicitProto", "=", "subObject", ".", "get...
Expect that the first type is the direct superclass of the second type. @param t The node traversal. @param n The node where warnings should point to. @param superObject The expected super instance type. @param subObject The sub instance type.
[ "Expect", "that", "the", "first", "type", "is", "the", "direct", "superclass", "of", "the", "second", "type", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L679-L705
23,951
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectExtends
void expectExtends(Node n, FunctionType subCtor, FunctionType astSuperCtor) { if (astSuperCtor == null || (!astSuperCtor.isConstructor() && !astSuperCtor.isInterface())) { // toMaybeFunctionType failed, or we've got a loose type. Let it go for now. return; } if (astSuperCtor.isConstructor() != ...
java
void expectExtends(Node n, FunctionType subCtor, FunctionType astSuperCtor) { if (astSuperCtor == null || (!astSuperCtor.isConstructor() && !astSuperCtor.isInterface())) { // toMaybeFunctionType failed, or we've got a loose type. Let it go for now. return; } if (astSuperCtor.isConstructor() != ...
[ "void", "expectExtends", "(", "Node", "n", ",", "FunctionType", "subCtor", ",", "FunctionType", "astSuperCtor", ")", "{", "if", "(", "astSuperCtor", "==", "null", "||", "(", "!", "astSuperCtor", ".", "isConstructor", "(", ")", "&&", "!", "astSuperCtor", ".",...
Expect that an ES6 class's extends clause is actually a supertype of the given class. Compares the registered supertype, which is taken from the JSDoc if present, otherwise from the AST, with the type in the extends node of the AST. @param n The node where warnings should point to. @param subCtor The sub constructor t...
[ "Expect", "that", "an", "ES6", "class", "s", "extends", "clause", "is", "actually", "a", "supertype", "of", "the", "given", "class", ".", "Compares", "the", "registered", "supertype", "which", "is", "taken", "from", "the", "JSDoc", "if", "present", "otherwis...
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L716-L746
23,952
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectCanAssignToPrototype
void expectCanAssignToPrototype(JSType ownerType, Node node, JSType rightType) { if (ownerType.isFunctionType()) { FunctionType functionType = ownerType.toMaybeFunctionType(); if (functionType.isConstructor()) { expectObject(node, rightType, "cannot override prototype with non-object"); } ...
java
void expectCanAssignToPrototype(JSType ownerType, Node node, JSType rightType) { if (ownerType.isFunctionType()) { FunctionType functionType = ownerType.toMaybeFunctionType(); if (functionType.isConstructor()) { expectObject(node, rightType, "cannot override prototype with non-object"); } ...
[ "void", "expectCanAssignToPrototype", "(", "JSType", "ownerType", ",", "Node", "node", ",", "JSType", "rightType", ")", "{", "if", "(", "ownerType", ".", "isFunctionType", "(", ")", ")", "{", "FunctionType", "functionType", "=", "ownerType", ".", "toMaybeFunctio...
Expect that it's valid to assign something to a given type's prototype. <p>Most of these checks occur during TypedScopeCreator, so we just handle very basic cases here <p>For example, assuming `Foo` is a constructor, `Foo.prototype = 3;` will warn because `3` is not an object. @param ownerType The type of the object...
[ "Expect", "that", "it", "s", "valid", "to", "assign", "something", "to", "a", "given", "type", "s", "prototype", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L760-L767
23,953
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectCanCast
void expectCanCast(Node n, JSType targetType, JSType sourceType) { if (!sourceType.canCastTo(targetType)) { registerMismatch( sourceType, targetType, report(JSError.make(n, INVALID_CAST, sourceType.toString(), targetType.toString()))); } else if (!sourceType.isSubtypeWithoutS...
java
void expectCanCast(Node n, JSType targetType, JSType sourceType) { if (!sourceType.canCastTo(targetType)) { registerMismatch( sourceType, targetType, report(JSError.make(n, INVALID_CAST, sourceType.toString(), targetType.toString()))); } else if (!sourceType.isSubtypeWithoutS...
[ "void", "expectCanCast", "(", "Node", "n", ",", "JSType", "targetType", ",", "JSType", "sourceType", ")", "{", "if", "(", "!", "sourceType", ".", "canCastTo", "(", "targetType", ")", ")", "{", "registerMismatch", "(", "sourceType", ",", "targetType", ",", ...
Expect that the first type can be cast to the second type. The first type must have some relationship with the second. @param t The node traversal. @param n The node where warnings should point. @param targetType The type being cast to. @param sourceType The type being cast from.
[ "Expect", "that", "the", "first", "type", "can", "be", "cast", "to", "the", "second", "type", ".", "The", "first", "type", "must", "have", "some", "relationship", "with", "the", "second", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L778-L788
23,954
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectUndeclaredVariable
TypedVar expectUndeclaredVariable(String sourceName, CompilerInput input, Node n, Node parent, TypedVar var, String variableName, JSType newType) { TypedVar newVar = var; JSType varType = var.getType(); // Only report duplicate declarations that have types. Other duplicates // will be reported by...
java
TypedVar expectUndeclaredVariable(String sourceName, CompilerInput input, Node n, Node parent, TypedVar var, String variableName, JSType newType) { TypedVar newVar = var; JSType varType = var.getType(); // Only report duplicate declarations that have types. Other duplicates // will be reported by...
[ "TypedVar", "expectUndeclaredVariable", "(", "String", "sourceName", ",", "CompilerInput", "input", ",", "Node", "n", ",", "Node", "parent", ",", "TypedVar", "var", ",", "String", "variableName", ",", "JSType", "newType", ")", "{", "TypedVar", "newVar", "=", "...
Expect that the given variable has not been declared with a type. @param sourceName The name of the source file we're in. @param n The node where warnings should point to. @param parent The parent of {@code n}. @param var The variable that we're checking. @param variableName The name of the variable. @param newType Th...
[ "Expect", "that", "the", "given", "variable", "has", "not", "been", "declared", "with", "a", "type", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L804-L871
23,955
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectAllInterfaceProperties
void expectAllInterfaceProperties(Node n, FunctionType type) { ObjectType instance = type.getInstanceType(); for (ObjectType implemented : type.getAllImplementedInterfaces()) { if (implemented.getImplicitPrototype() != null) { for (String prop : implemented.getImplicitPrototype().getO...
java
void expectAllInterfaceProperties(Node n, FunctionType type) { ObjectType instance = type.getInstanceType(); for (ObjectType implemented : type.getAllImplementedInterfaces()) { if (implemented.getImplicitPrototype() != null) { for (String prop : implemented.getImplicitPrototype().getO...
[ "void", "expectAllInterfaceProperties", "(", "Node", "n", ",", "FunctionType", "type", ")", "{", "ObjectType", "instance", "=", "type", ".", "getInstanceType", "(", ")", ";", "for", "(", "ObjectType", "implemented", ":", "type", ".", "getAllImplementedInterfaces",...
Expect that all properties on interfaces that this type implements are implemented and correctly typed.
[ "Expect", "that", "all", "properties", "on", "interfaces", "that", "this", "type", "implements", "are", "implemented", "and", "correctly", "typed", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L877-L887
23,956
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectInterfaceProperty
private void expectInterfaceProperty( Node n, ObjectType instance, ObjectType implementedInterface, String prop) { StaticTypedSlot propSlot = instance.getSlot(prop); if (propSlot == null) { // Not implemented String sourceName = n.getSourceFileName(); sourceName = nullToEmpty(sourceName)...
java
private void expectInterfaceProperty( Node n, ObjectType instance, ObjectType implementedInterface, String prop) { StaticTypedSlot propSlot = instance.getSlot(prop); if (propSlot == null) { // Not implemented String sourceName = n.getSourceFileName(); sourceName = nullToEmpty(sourceName)...
[ "private", "void", "expectInterfaceProperty", "(", "Node", "n", ",", "ObjectType", "instance", ",", "ObjectType", "implementedInterface", ",", "String", "prop", ")", "{", "StaticTypedSlot", "propSlot", "=", "instance", ".", "getSlot", "(", "prop", ")", ";", "if"...
Expect that the property in an interface that this type implements is implemented and correctly typed.
[ "Expect", "that", "the", "property", "in", "an", "interface", "that", "this", "type", "implements", "is", "implemented", "and", "correctly", "typed", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L893-L948
23,957
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectAbstractMethodsImplemented
void expectAbstractMethodsImplemented(Node n, FunctionType ctorType) { checkArgument(ctorType.isConstructor()); Map<String, ObjectType> abstractMethodSuperTypeMap = new LinkedHashMap<>(); FunctionType currSuperCtor = ctorType.getSuperClassConstructor(); if (currSuperCtor == null || !currSuperCtor.isAbs...
java
void expectAbstractMethodsImplemented(Node n, FunctionType ctorType) { checkArgument(ctorType.isConstructor()); Map<String, ObjectType> abstractMethodSuperTypeMap = new LinkedHashMap<>(); FunctionType currSuperCtor = ctorType.getSuperClassConstructor(); if (currSuperCtor == null || !currSuperCtor.isAbs...
[ "void", "expectAbstractMethodsImplemented", "(", "Node", "n", ",", "FunctionType", "ctorType", ")", "{", "checkArgument", "(", "ctorType", ".", "isConstructor", "(", ")", ")", ";", "Map", "<", "String", ",", "ObjectType", ">", "abstractMethodSuperTypeMap", "=", ...
For a concrete class, expect that all abstract methods that haven't been implemented by any of the super classes on the inheritance chain are implemented.
[ "For", "a", "concrete", "class", "expect", "that", "all", "abstract", "methods", "that", "haven", "t", "been", "implemented", "by", "any", "of", "the", "super", "classes", "on", "the", "inheritance", "chain", "are", "implemented", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L954-L997
23,958
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.registerMismatchAndReport
private void registerMismatchAndReport( Node n, DiagnosticType diagnostic, String msg, JSType found, JSType required, Set<String> missing, Set<String> mismatch) { String foundRequiredFormatted = formatFoundRequired(msg, found, required, missing, mismatch); JSError err =...
java
private void registerMismatchAndReport( Node n, DiagnosticType diagnostic, String msg, JSType found, JSType required, Set<String> missing, Set<String> mismatch) { String foundRequiredFormatted = formatFoundRequired(msg, found, required, missing, mismatch); JSError err =...
[ "private", "void", "registerMismatchAndReport", "(", "Node", "n", ",", "DiagnosticType", "diagnostic", ",", "String", "msg", ",", "JSType", "found", ",", "JSType", "required", ",", "Set", "<", "String", ">", "missing", ",", "Set", "<", "String", ">", "mismat...
Used both for TYPE_MISMATCH_WARNING and INVALID_OPERAND_TYPE.
[ "Used", "both", "for", "TYPE_MISMATCH_WARNING", "and", "INVALID_OPERAND_TYPE", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L1037-L1049
23,959
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.registerMismatch
private void registerMismatch(JSType found, JSType required, JSError error) { TypeMismatch.registerMismatch( this.mismatches, this.implicitInterfaceUses, found, required, error); }
java
private void registerMismatch(JSType found, JSType required, JSError error) { TypeMismatch.registerMismatch( this.mismatches, this.implicitInterfaceUses, found, required, error); }
[ "private", "void", "registerMismatch", "(", "JSType", "found", ",", "JSType", "required", ",", "JSError", "error", ")", "{", "TypeMismatch", ".", "registerMismatch", "(", "this", ".", "mismatches", ",", "this", ".", "implicitInterfaceUses", ",", "found", ",", ...
Registers a type mismatch into the universe of mismatches owned by this pass.
[ "Registers", "a", "type", "mismatch", "into", "the", "universe", "of", "mismatches", "owned", "by", "this", "pass", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L1052-L1055
23,960
google/closure-compiler
src/com/google/javascript/jscomp/OptimizeParameters.java
OptimizeParameters.tryEliminateOptionalArgs
private void tryEliminateOptionalArgs(ArrayList<Node> refs) { // Count the maximum number of arguments passed into this function all // all points of the program. int maxArgs = -1; for (Node n : refs) { if (ReferenceMap.isCallOrNewTarget(n)) { int numArgs = 0; Node firstArg = Refe...
java
private void tryEliminateOptionalArgs(ArrayList<Node> refs) { // Count the maximum number of arguments passed into this function all // all points of the program. int maxArgs = -1; for (Node n : refs) { if (ReferenceMap.isCallOrNewTarget(n)) { int numArgs = 0; Node firstArg = Refe...
[ "private", "void", "tryEliminateOptionalArgs", "(", "ArrayList", "<", "Node", ">", "refs", ")", "{", "// Count the maximum number of arguments passed into this function all", "// all points of the program.", "int", "maxArgs", "=", "-", "1", ";", "for", "(", "Node", "n", ...
Removes any optional parameters if no callers specifies it as an argument.
[ "Removes", "any", "optional", "parameters", "if", "no", "callers", "specifies", "it", "as", "an", "argument", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/OptimizeParameters.java#L461-L488
23,961
google/closure-compiler
src/com/google/javascript/jscomp/OptimizeParameters.java
OptimizeParameters.tryEliminateConstantArgs
private void tryEliminateConstantArgs(ArrayList<Node> refs) { List<Parameter> parameters = findFixedArguments(refs); if (parameters == null) { return; } ImmutableListMultimap<Node, Node> fns = ReferenceMap.getFunctionNodes(refs); if (fns.size() > 1) { // TODO(johnlenz): support moving s...
java
private void tryEliminateConstantArgs(ArrayList<Node> refs) { List<Parameter> parameters = findFixedArguments(refs); if (parameters == null) { return; } ImmutableListMultimap<Node, Node> fns = ReferenceMap.getFunctionNodes(refs); if (fns.size() > 1) { // TODO(johnlenz): support moving s...
[ "private", "void", "tryEliminateConstantArgs", "(", "ArrayList", "<", "Node", ">", "refs", ")", "{", "List", "<", "Parameter", ">", "parameters", "=", "findFixedArguments", "(", "refs", ")", ";", "if", "(", "parameters", "==", "null", ")", "{", "return", "...
Eliminate parameters if they are always constant. function foo(a, b) {...} foo(1,2); foo(1,3) becomes function foo(b) { var a = 1 ... } foo(2); foo(3); @param refs A list of references to the symbol (name or property) as vetted by #isCandidate.
[ "Eliminate", "parameters", "if", "they", "are", "always", "constant", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/OptimizeParameters.java#L504-L534
23,962
google/closure-compiler
src/com/google/javascript/jscomp/OptimizeParameters.java
OptimizeParameters.findFixedParameters
private boolean findFixedParameters(List<Parameter> parameters, Node cur) { boolean anyMovable = false; int index = 0; while (cur != null) { Parameter p; if (index >= parameters.size()) { p = new Parameter(cur, false); parameters.add(p); setParameterSideEffectInfo(p, cur)...
java
private boolean findFixedParameters(List<Parameter> parameters, Node cur) { boolean anyMovable = false; int index = 0; while (cur != null) { Parameter p; if (index >= parameters.size()) { p = new Parameter(cur, false); parameters.add(p); setParameterSideEffectInfo(p, cur)...
[ "private", "boolean", "findFixedParameters", "(", "List", "<", "Parameter", ">", "parameters", ",", "Node", "cur", ")", "{", "boolean", "anyMovable", "=", "false", ";", "int", "index", "=", "0", ";", "while", "(", "cur", "!=", "null", ")", "{", "Paramete...
Determine which parameters use the same expression. @return Whether any parameter was found that can be updated.
[ "Determine", "which", "parameters", "use", "the", "same", "expression", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/OptimizeParameters.java#L680-L710
23,963
google/closure-compiler
src/com/google/javascript/jscomp/OptimizeParameters.java
OptimizeParameters.eliminateParamsAfter
private void eliminateParamsAfter(Node fnNode, int argIndex) { Node formalArgPtr = NodeUtil.getFunctionParameters(fnNode).getFirstChild(); while (argIndex != 0 && formalArgPtr != null) { formalArgPtr = formalArgPtr.getNext(); argIndex--; } eliminateParamsAfter(fnNode, formalArgPtr); }
java
private void eliminateParamsAfter(Node fnNode, int argIndex) { Node formalArgPtr = NodeUtil.getFunctionParameters(fnNode).getFirstChild(); while (argIndex != 0 && formalArgPtr != null) { formalArgPtr = formalArgPtr.getNext(); argIndex--; } eliminateParamsAfter(fnNode, formalArgPtr); }
[ "private", "void", "eliminateParamsAfter", "(", "Node", "fnNode", ",", "int", "argIndex", ")", "{", "Node", "formalArgPtr", "=", "NodeUtil", ".", "getFunctionParameters", "(", "fnNode", ")", ".", "getFirstChild", "(", ")", ";", "while", "(", "argIndex", "!=", ...
Removes all formal parameters starting at argIndex.
[ "Removes", "all", "formal", "parameters", "starting", "at", "argIndex", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/OptimizeParameters.java#L936-L943
23,964
google/closure-compiler
src/com/google/javascript/jscomp/OptimizeParameters.java
OptimizeParameters.eliminateCallTargetArgAt
private void eliminateCallTargetArgAt(Node ref, int argIndex) { Node callArgNode = ReferenceMap.getArgumentForCallOrNewOrDotCall(ref, argIndex); if (callArgNode != null) { NodeUtil.deleteNode(callArgNode, compiler); } }
java
private void eliminateCallTargetArgAt(Node ref, int argIndex) { Node callArgNode = ReferenceMap.getArgumentForCallOrNewOrDotCall(ref, argIndex); if (callArgNode != null) { NodeUtil.deleteNode(callArgNode, compiler); } }
[ "private", "void", "eliminateCallTargetArgAt", "(", "Node", "ref", ",", "int", "argIndex", ")", "{", "Node", "callArgNode", "=", "ReferenceMap", ".", "getArgumentForCallOrNewOrDotCall", "(", "ref", ",", "argIndex", ")", ";", "if", "(", "callArgNode", "!=", "null...
Eliminates the parameter from a function call. @param definitionFinder The definition and use sites index. @param p @param call The function call node @param argIndex The index of the argument to remove.
[ "Eliminates", "the", "parameter", "from", "a", "function", "call", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/OptimizeParameters.java#L975-L980
23,965
google/closure-compiler
src/com/google/javascript/jscomp/FunctionTypeBuilder.java
FunctionTypeBuilder.maybeUseNativeClassTemplateNames
private boolean maybeUseNativeClassTemplateNames(JSDocInfo info) { // TODO(b/74253232): maybeGetNativeTypesOfBuiltin should also handle cases where a local type // declaration shadows a templatized native type. ImmutableList<TemplateType> nativeKeys = typeRegistry.maybeGetTemplateTypesOfBuiltin(fnName); ...
java
private boolean maybeUseNativeClassTemplateNames(JSDocInfo info) { // TODO(b/74253232): maybeGetNativeTypesOfBuiltin should also handle cases where a local type // declaration shadows a templatized native type. ImmutableList<TemplateType> nativeKeys = typeRegistry.maybeGetTemplateTypesOfBuiltin(fnName); ...
[ "private", "boolean", "maybeUseNativeClassTemplateNames", "(", "JSDocInfo", "info", ")", "{", "// TODO(b/74253232): maybeGetNativeTypesOfBuiltin should also handle cases where a local type", "// declaration shadows a templatized native type.", "ImmutableList", "<", "TemplateType", ">", "...
Clobber the templateTypeNames from the JSDoc with builtin ones for native types.
[ "Clobber", "the", "templateTypeNames", "from", "the", "JSDoc", "with", "builtin", "ones", "for", "native", "types", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/FunctionTypeBuilder.java#L402-L413
23,966
google/closure-compiler
src/com/google/javascript/jscomp/FunctionTypeBuilder.java
FunctionTypeBuilder.inferParameterTypes
FunctionTypeBuilder inferParameterTypes(JSDocInfo info) { // Create a fake args parent. Node lp = IR.paramList(); for (String name : info.getParameterNames()) { lp.addChildToBack(IR.name(name)); } return inferParameterTypes(lp, info); }
java
FunctionTypeBuilder inferParameterTypes(JSDocInfo info) { // Create a fake args parent. Node lp = IR.paramList(); for (String name : info.getParameterNames()) { lp.addChildToBack(IR.name(name)); } return inferParameterTypes(lp, info); }
[ "FunctionTypeBuilder", "inferParameterTypes", "(", "JSDocInfo", "info", ")", "{", "// Create a fake args parent.", "Node", "lp", "=", "IR", ".", "paramList", "(", ")", ";", "for", "(", "String", "name", ":", "info", ".", "getParameterNames", "(", ")", ")", "{"...
Infer the parameter types from the doc info alone.
[ "Infer", "the", "parameter", "types", "from", "the", "doc", "info", "alone", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/FunctionTypeBuilder.java#L560-L568
23,967
google/closure-compiler
src/com/google/javascript/jscomp/FunctionTypeBuilder.java
FunctionTypeBuilder.inferConstructorParameters
FunctionTypeBuilder inferConstructorParameters(FunctionType superCtor) { inferImplicitConstructorParameters(superCtor.getParametersNode().cloneTree()); // Look for template parameters in superCtor that are missing from its instance type. setConstructorTemplateTypeNames(superCtor.getConstructorOnlyTemplateP...
java
FunctionTypeBuilder inferConstructorParameters(FunctionType superCtor) { inferImplicitConstructorParameters(superCtor.getParametersNode().cloneTree()); // Look for template parameters in superCtor that are missing from its instance type. setConstructorTemplateTypeNames(superCtor.getConstructorOnlyTemplateP...
[ "FunctionTypeBuilder", "inferConstructorParameters", "(", "FunctionType", "superCtor", ")", "{", "inferImplicitConstructorParameters", "(", "superCtor", ".", "getParametersNode", "(", ")", ".", "cloneTree", "(", ")", ")", ";", "// Look for template parameters in superCtor tha...
Infer constructor parameters from the superclass constructor.
[ "Infer", "constructor", "parameters", "from", "the", "superclass", "constructor", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/FunctionTypeBuilder.java#L694-L701
23,968
google/closure-compiler
src/com/google/javascript/jscomp/FunctionTypeBuilder.java
FunctionTypeBuilder.addParameter
private boolean addParameter(FunctionParamBuilder builder, JSType paramType, boolean warnedAboutArgList, boolean isOptional, boolean isVarArgs) { boolean emittedWarning = false; if (isOptional) { // Remembering that an optional parameter has been encountered // so that if a non optional ...
java
private boolean addParameter(FunctionParamBuilder builder, JSType paramType, boolean warnedAboutArgList, boolean isOptional, boolean isVarArgs) { boolean emittedWarning = false; if (isOptional) { // Remembering that an optional parameter has been encountered // so that if a non optional ...
[ "private", "boolean", "addParameter", "(", "FunctionParamBuilder", "builder", ",", "JSType", "paramType", ",", "boolean", "warnedAboutArgList", ",", "boolean", "isOptional", ",", "boolean", "isVarArgs", ")", "{", "boolean", "emittedWarning", "=", "false", ";", "if",...
Add a parameter to the param list. @param builder A builder. @param paramType The parameter type. @param warnedAboutArgList Whether we've already warned about arg ordering issues (like if optional args appeared before required ones). @param isOptional Is this an optional parameter? @param isVarArgs Is this a var args p...
[ "Add", "a", "parameter", "to", "the", "param", "list", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/FunctionTypeBuilder.java#L810-L840
23,969
google/closure-compiler
src/com/google/javascript/jscomp/FunctionTypeBuilder.java
FunctionTypeBuilder.provideDefaultReturnType
private void provideDefaultReturnType() { if (contents.getSourceNode() != null && contents.getSourceNode().isAsyncGeneratorFunction()) { // Set the return type of a generator function to: // @return {!AsyncGenerator<?>} ObjectType generatorType = typeRegistry.getNativeObjectType(ASYNC_GENERATOR_...
java
private void provideDefaultReturnType() { if (contents.getSourceNode() != null && contents.getSourceNode().isAsyncGeneratorFunction()) { // Set the return type of a generator function to: // @return {!AsyncGenerator<?>} ObjectType generatorType = typeRegistry.getNativeObjectType(ASYNC_GENERATOR_...
[ "private", "void", "provideDefaultReturnType", "(", ")", "{", "if", "(", "contents", ".", "getSourceNode", "(", ")", "!=", "null", "&&", "contents", ".", "getSourceNode", "(", ")", ".", "isAsyncGeneratorFunction", "(", ")", ")", "{", "// Set the return type of a...
Sets the returnType for this function using very basic type inference.
[ "Sets", "the", "returnType", "for", "this", "function", "using", "very", "basic", "type", "inference", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/FunctionTypeBuilder.java#L843-L888
23,970
google/closure-compiler
src/com/google/javascript/jscomp/FunctionTypeBuilder.java
FunctionTypeBuilder.buildAndRegister
FunctionType buildAndRegister() { if (returnType == null) { provideDefaultReturnType(); checkNotNull(returnType); } if (parametersNode == null) { throw new IllegalStateException( "All Function types must have params and a return type"); } FunctionType fnType; if (is...
java
FunctionType buildAndRegister() { if (returnType == null) { provideDefaultReturnType(); checkNotNull(returnType); } if (parametersNode == null) { throw new IllegalStateException( "All Function types must have params and a return type"); } FunctionType fnType; if (is...
[ "FunctionType", "buildAndRegister", "(", ")", "{", "if", "(", "returnType", "==", "null", ")", "{", "provideDefaultReturnType", "(", ")", ";", "checkNotNull", "(", "returnType", ")", ";", "}", "if", "(", "parametersNode", "==", "null", ")", "{", "throw", "...
Builds the function type, and puts it in the registry.
[ "Builds", "the", "function", "type", "and", "puts", "it", "in", "the", "registry", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/FunctionTypeBuilder.java#L893-L937
23,971
google/closure-compiler
src/com/google/javascript/jscomp/FunctionTypeBuilder.java
FunctionTypeBuilder.isFunctionTypeDeclaration
static boolean isFunctionTypeDeclaration(JSDocInfo info) { return info.getParameterCount() > 0 || info.hasReturnType() || info.hasThisType() || info.isConstructor() || info.isInterface() || info.isAbstract(); }
java
static boolean isFunctionTypeDeclaration(JSDocInfo info) { return info.getParameterCount() > 0 || info.hasReturnType() || info.hasThisType() || info.isConstructor() || info.isInterface() || info.isAbstract(); }
[ "static", "boolean", "isFunctionTypeDeclaration", "(", "JSDocInfo", "info", ")", "{", "return", "info", ".", "getParameterCount", "(", ")", ">", "0", "||", "info", ".", "hasReturnType", "(", ")", "||", "info", ".", "hasThisType", "(", ")", "||", "info", "....
Determines whether the given JsDoc info declares a function type.
[ "Determines", "whether", "the", "given", "JsDoc", "info", "declares", "a", "function", "type", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/FunctionTypeBuilder.java#L1065-L1072
23,972
google/closure-compiler
src/com/google/javascript/jscomp/FunctionTypeBuilder.java
FunctionTypeBuilder.getScopeDeclaredIn
private TypedScope getScopeDeclaredIn() { if (declarationScope != null) { return declarationScope; } int dotIndex = fnName.indexOf('.'); if (dotIndex != -1) { String rootVarName = fnName.substring(0, dotIndex); TypedVar rootVar = enclosingScope.getVar(rootVarName); if (rootVar !...
java
private TypedScope getScopeDeclaredIn() { if (declarationScope != null) { return declarationScope; } int dotIndex = fnName.indexOf('.'); if (dotIndex != -1) { String rootVarName = fnName.substring(0, dotIndex); TypedVar rootVar = enclosingScope.getVar(rootVarName); if (rootVar !...
[ "private", "TypedScope", "getScopeDeclaredIn", "(", ")", "{", "if", "(", "declarationScope", "!=", "null", ")", "{", "return", "declarationScope", ";", "}", "int", "dotIndex", "=", "fnName", ".", "indexOf", "(", "'", "'", ")", ";", "if", "(", "dotIndex", ...
The scope that we should declare this function in, if it needs to be declared in a scope. Notice that TypedScopeCreator takes care of most scope-declaring.
[ "The", "scope", "that", "we", "should", "declare", "this", "function", "in", "if", "it", "needs", "to", "be", "declared", "in", "a", "scope", ".", "Notice", "that", "TypedScopeCreator", "takes", "care", "of", "most", "scope", "-", "declaring", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/FunctionTypeBuilder.java#L1079-L1093
23,973
google/closure-compiler
src/com/google/javascript/jscomp/FunctionTypeBuilder.java
FunctionTypeBuilder.hasMoreTagsToResolve
private static boolean hasMoreTagsToResolve(ObjectType objectType) { checkArgument(objectType.isUnknownType()); FunctionType ctor = objectType.getConstructor(); if (ctor != null) { // interface extends interfaces for (ObjectType interfaceType : ctor.getExtendedInterfaces()) { if (!interf...
java
private static boolean hasMoreTagsToResolve(ObjectType objectType) { checkArgument(objectType.isUnknownType()); FunctionType ctor = objectType.getConstructor(); if (ctor != null) { // interface extends interfaces for (ObjectType interfaceType : ctor.getExtendedInterfaces()) { if (!interf...
[ "private", "static", "boolean", "hasMoreTagsToResolve", "(", "ObjectType", "objectType", ")", "{", "checkArgument", "(", "objectType", ".", "isUnknownType", "(", ")", ")", ";", "FunctionType", "ctor", "=", "objectType", ".", "getConstructor", "(", ")", ";", "if"...
Check whether a type is resolvable in the future If this has a supertype that hasn't been resolved yet, then we can assume this type will be OK once the super type resolves. @param objectType @return true if objectType is resolvable in the future
[ "Check", "whether", "a", "type", "is", "resolvable", "in", "the", "future", "If", "this", "has", "a", "supertype", "that", "hasn", "t", "been", "resolved", "yet", "then", "we", "can", "assume", "this", "type", "will", "be", "OK", "once", "the", "super", ...
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/FunctionTypeBuilder.java#L1102-L1118
23,974
google/closure-compiler
src/com/google/javascript/jscomp/VariableReferenceCheck.java
VariableReferenceCheck.checkForUnusedLocalVar
private void checkForUnusedLocalVar(Var v, Reference unusedAssignment) { if (!v.isLocal()) { return; } JSDocInfo jsDoc = NodeUtil.getBestJSDocInfo(unusedAssignment.getNode()); if (jsDoc != null && jsDoc.hasTypedefType()) { return; } boolean inGoogScope = false; Scope s = v.getSc...
java
private void checkForUnusedLocalVar(Var v, Reference unusedAssignment) { if (!v.isLocal()) { return; } JSDocInfo jsDoc = NodeUtil.getBestJSDocInfo(unusedAssignment.getNode()); if (jsDoc != null && jsDoc.hasTypedefType()) { return; } boolean inGoogScope = false; Scope s = v.getSc...
[ "private", "void", "checkForUnusedLocalVar", "(", "Var", "v", ",", "Reference", "unusedAssignment", ")", "{", "if", "(", "!", "v", ".", "isLocal", "(", ")", ")", "{", "return", ";", "}", "JSDocInfo", "jsDoc", "=", "NodeUtil", ".", "getBestJSDocInfo", "(", ...
that we can run it after goog.scope processing, and get rid of the inGoogScope check.
[ "that", "we", "can", "run", "it", "after", "goog", ".", "scope", "processing", "and", "get", "rid", "of", "the", "inGoogScope", "check", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/VariableReferenceCheck.java#L438-L478
23,975
google/closure-compiler
src/com/google/javascript/jscomp/BranchCoverageInstrumentationCallback.java
BranchCoverageInstrumentationCallback.instrumentBranchCoverage
private void instrumentBranchCoverage(NodeTraversal traversal, FileInstrumentationData data) { int maxLine = data.maxBranchPresentLine(); int branchCoverageOffset = 0; for (int lineIdx = 1; lineIdx <= maxLine; ++lineIdx) { Integer numBranches = data.getNumBranches(lineIdx); if (numBranches != nu...
java
private void instrumentBranchCoverage(NodeTraversal traversal, FileInstrumentationData data) { int maxLine = data.maxBranchPresentLine(); int branchCoverageOffset = 0; for (int lineIdx = 1; lineIdx <= maxLine; ++lineIdx) { Integer numBranches = data.getNumBranches(lineIdx); if (numBranches != nu...
[ "private", "void", "instrumentBranchCoverage", "(", "NodeTraversal", "traversal", ",", "FileInstrumentationData", "data", ")", "{", "int", "maxLine", "=", "data", ".", "maxBranchPresentLine", "(", ")", ";", "int", "branchCoverageOffset", "=", "0", ";", "for", "(",...
Add instrumentation code for branch coverage. For each block that correspond to a branch, insert an assignment of the branch coverage data to the front of the block.
[ "Add", "instrumentation", "code", "for", "branch", "coverage", ".", "For", "each", "block", "that", "correspond", "to", "a", "branch", "insert", "an", "assignment", "of", "the", "branch", "coverage", "data", "to", "the", "front", "of", "the", "block", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/BranchCoverageInstrumentationCallback.java#L123-L138
23,976
google/closure-compiler
src/com/google/javascript/jscomp/BranchCoverageInstrumentationCallback.java
BranchCoverageInstrumentationCallback.newBranchInstrumentationNode
private Node newBranchInstrumentationNode(NodeTraversal traversal, Node node, int idx) { String arrayName = createArrayName(traversal); // Create instrumentation Node Node getElemNode = IR.getelem(IR.name(arrayName), IR.number(idx)); // Make line number 0-based Node exprNode = IR.exprResult(IR.assign(g...
java
private Node newBranchInstrumentationNode(NodeTraversal traversal, Node node, int idx) { String arrayName = createArrayName(traversal); // Create instrumentation Node Node getElemNode = IR.getelem(IR.name(arrayName), IR.number(idx)); // Make line number 0-based Node exprNode = IR.exprResult(IR.assign(g...
[ "private", "Node", "newBranchInstrumentationNode", "(", "NodeTraversal", "traversal", ",", "Node", "node", ",", "int", "idx", ")", "{", "String", "arrayName", "=", "createArrayName", "(", "traversal", ")", ";", "// Create instrumentation Node", "Node", "getElemNode", ...
Create an assignment to the branch coverage data for the given index into the array. @return the newly constructed assignment node.
[ "Create", "an", "assignment", "to", "the", "branch", "coverage", "data", "for", "the", "given", "index", "into", "the", "array", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/BranchCoverageInstrumentationCallback.java#L145-L158
23,977
google/closure-compiler
src/com/google/javascript/jscomp/BranchCoverageInstrumentationCallback.java
BranchCoverageInstrumentationCallback.processBranchInfo
private void processBranchInfo(Node branchNode, FileInstrumentationData data, List<Node> blocks) { int lineNumber = branchNode.getLineno(); data.setBranchPresent(lineNumber); // Instrument for each block int numBranches = 0; for (Node child : blocks) { data.putBranchNode(lineNumber, numBranch...
java
private void processBranchInfo(Node branchNode, FileInstrumentationData data, List<Node> blocks) { int lineNumber = branchNode.getLineno(); data.setBranchPresent(lineNumber); // Instrument for each block int numBranches = 0; for (Node child : blocks) { data.putBranchNode(lineNumber, numBranch...
[ "private", "void", "processBranchInfo", "(", "Node", "branchNode", ",", "FileInstrumentationData", "data", ",", "List", "<", "Node", ">", "blocks", ")", "{", "int", "lineNumber", "=", "branchNode", ".", "getLineno", "(", ")", ";", "data", ".", "setBranchPresen...
Add branch instrumentation information for each block.
[ "Add", "branch", "instrumentation", "information", "for", "each", "block", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/BranchCoverageInstrumentationCallback.java#L161-L172
23,978
google/closure-compiler
src/com/google/javascript/jscomp/modules/ClosureRequireProcessor.java
ClosureRequireProcessor.getAllRequires
static ImmutableList<Require> getAllRequires(Node nameDeclaration) { Node rhs = nameDeclaration.getFirstChild().isDestructuringLhs() ? nameDeclaration.getFirstChild().getSecondChild() : nameDeclaration.getFirstFirstChild(); // This may be a require, requireType, or forwardDeclare...
java
static ImmutableList<Require> getAllRequires(Node nameDeclaration) { Node rhs = nameDeclaration.getFirstChild().isDestructuringLhs() ? nameDeclaration.getFirstChild().getSecondChild() : nameDeclaration.getFirstFirstChild(); // This may be a require, requireType, or forwardDeclare...
[ "static", "ImmutableList", "<", "Require", ">", "getAllRequires", "(", "Node", "nameDeclaration", ")", "{", "Node", "rhs", "=", "nameDeclaration", ".", "getFirstChild", "(", ")", ".", "isDestructuringLhs", "(", ")", "?", "nameDeclaration", ".", "getFirstChild", ...
Returns all Require built from the given statement, or null if it is not a require @param nameDeclaration a VAR, LET, or CONST @return all Requires contained in this declaration
[ "Returns", "all", "Require", "built", "from", "the", "given", "statement", "or", "null", "if", "it", "is", "not", "a", "require" ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/modules/ClosureRequireProcessor.java#L66-L78
23,979
google/closure-compiler
src/com/google/javascript/jscomp/DiagnosticGroups.java
DiagnosticGroups.setWarningLevel
public void setWarningLevel(CompilerOptions options, String name, CheckLevel level) { DiagnosticGroup group = forName(name); Preconditions.checkNotNull(group, "No warning class for name: %s", name); options.setWarningLevel(group, level); }
java
public void setWarningLevel(CompilerOptions options, String name, CheckLevel level) { DiagnosticGroup group = forName(name); Preconditions.checkNotNull(group, "No warning class for name: %s", name); options.setWarningLevel(group, level); }
[ "public", "void", "setWarningLevel", "(", "CompilerOptions", "options", ",", "String", "name", ",", "CheckLevel", "level", ")", "{", "DiagnosticGroup", "group", "=", "forName", "(", "name", ")", ";", "Preconditions", ".", "checkNotNull", "(", "group", ",", "\"...
Adds warning levels by name.
[ "Adds", "warning", "levels", "by", "name", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DiagnosticGroups.java#L737-L741
23,980
google/closure-compiler
src/com/google/javascript/jscomp/CrossChunkReferenceCollector.java
CrossChunkReferenceCollector.process
@Override public void process(Node externs, Node root) { checkState(topLevelStatements.isEmpty(), "process() called more than once"); NodeTraversal t = new NodeTraversal(compiler, this, scopeCreator); t.traverseRoots(externs, root); }
java
@Override public void process(Node externs, Node root) { checkState(topLevelStatements.isEmpty(), "process() called more than once"); NodeTraversal t = new NodeTraversal(compiler, this, scopeCreator); t.traverseRoots(externs, root); }
[ "@", "Override", "public", "void", "process", "(", "Node", "externs", ",", "Node", "root", ")", "{", "checkState", "(", "topLevelStatements", ".", "isEmpty", "(", ")", ",", "\"process() called more than once\"", ")", ";", "NodeTraversal", "t", "=", "new", "Nod...
Convenience method for running this pass over a tree with this class as a callback.
[ "Convenience", "method", "for", "running", "this", "pass", "over", "a", "tree", "with", "this", "class", "as", "a", "callback", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CrossChunkReferenceCollector.java#L75-L80
23,981
google/closure-compiler
src/com/google/javascript/rhino/TokenUtil.java
TokenUtil.isStrWhiteSpaceChar
public static TernaryValue isStrWhiteSpaceChar(int c) { switch (c) { case '\u000B': // <VT> return TernaryValue.UNKNOWN; // IE says "no", ECMAScript says "yes" case ' ': // <SP> case '\n': // <LF> case '\r': // <CR> case '\t': // <TAB> case '\u00A0': // <NBSP> case...
java
public static TernaryValue isStrWhiteSpaceChar(int c) { switch (c) { case '\u000B': // <VT> return TernaryValue.UNKNOWN; // IE says "no", ECMAScript says "yes" case ' ': // <SP> case '\n': // <LF> case '\r': // <CR> case '\t': // <TAB> case '\u00A0': // <NBSP> case...
[ "public", "static", "TernaryValue", "isStrWhiteSpaceChar", "(", "int", "c", ")", "{", "switch", "(", "c", ")", "{", "case", "'", "'", ":", "// <VT>", "return", "TernaryValue", ".", "UNKNOWN", ";", "// IE says \"no\", ECMAScript says \"yes\"", "case", "'", "'", ...
Copied from Rhino's ScriptRuntime
[ "Copied", "from", "Rhino", "s", "ScriptRuntime" ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/TokenUtil.java#L83-L101
23,982
google/closure-compiler
src/com/google/javascript/jscomp/DeadAssignmentsElimination.java
DeadAssignmentsElimination.isRemovableAssign
boolean isRemovableAssign(Node n) { return (NodeUtil.isAssignmentOp(n) && n.getFirstChild().isName()) || n.isInc() || n.isDec(); }
java
boolean isRemovableAssign(Node n) { return (NodeUtil.isAssignmentOp(n) && n.getFirstChild().isName()) || n.isInc() || n.isDec(); }
[ "boolean", "isRemovableAssign", "(", "Node", "n", ")", "{", "return", "(", "NodeUtil", ".", "isAssignmentOp", "(", "n", ")", "&&", "n", ".", "getFirstChild", "(", ")", ".", "isName", "(", ")", ")", "||", "n", ".", "isInc", "(", ")", "||", "n", ".",...
will already remove variables that are initialized but unused.
[ "will", "already", "remove", "variables", "that", "are", "initialized", "but", "unused", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DeadAssignmentsElimination.java#L137-L139
23,983
google/closure-compiler
src/com/google/javascript/jscomp/DeadAssignmentsElimination.java
DeadAssignmentsElimination.tryRemoveDeadAssignments
private void tryRemoveDeadAssignments(NodeTraversal t, ControlFlowGraph<Node> cfg, Map<String, Var> allVarsInFn) { Iterable<DiGraphNode<Node, Branch>> nodes = cfg.getDirectedGraphNodes(); for (DiGraphNode<Node, Branch> cfgNode : nodes) { FlowState<LiveVariableLattice> state = cfgNod...
java
private void tryRemoveDeadAssignments(NodeTraversal t, ControlFlowGraph<Node> cfg, Map<String, Var> allVarsInFn) { Iterable<DiGraphNode<Node, Branch>> nodes = cfg.getDirectedGraphNodes(); for (DiGraphNode<Node, Branch> cfgNode : nodes) { FlowState<LiveVariableLattice> state = cfgNod...
[ "private", "void", "tryRemoveDeadAssignments", "(", "NodeTraversal", "t", ",", "ControlFlowGraph", "<", "Node", ">", "cfg", ",", "Map", "<", "String", ",", "Var", ">", "allVarsInFn", ")", "{", "Iterable", "<", "DiGraphNode", "<", "Node", ",", "Branch", ">", ...
Try to remove useless assignments from a control flow graph that has been annotated with liveness information. @param t The node traversal. @param cfg The control flow graph of the program annotated with liveness information.
[ "Try", "to", "remove", "useless", "assignments", "from", "a", "control", "flow", "graph", "that", "has", "been", "annotated", "with", "liveness", "information", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DeadAssignmentsElimination.java#L149-L189
23,984
google/closure-compiler
src/com/google/javascript/jscomp/DeadAssignmentsElimination.java
DeadAssignmentsElimination.isVariableStillLiveWithinExpression
private boolean isVariableStillLiveWithinExpression( Node n, Node exprRoot, String variable) { while (n != exprRoot) { VariableLiveness state = VariableLiveness.MAYBE_LIVE; switch (n.getParent().getToken()) { case OR: case AND: // If the currently node is the first child ...
java
private boolean isVariableStillLiveWithinExpression( Node n, Node exprRoot, String variable) { while (n != exprRoot) { VariableLiveness state = VariableLiveness.MAYBE_LIVE; switch (n.getParent().getToken()) { case OR: case AND: // If the currently node is the first child ...
[ "private", "boolean", "isVariableStillLiveWithinExpression", "(", "Node", "n", ",", "Node", "exprRoot", ",", "String", "variable", ")", "{", "while", "(", "n", "!=", "exprRoot", ")", "{", "VariableLiveness", "state", "=", "VariableLiveness", ".", "MAYBE_LIVE", "...
Given a variable, node n in the tree and a sub-tree denoted by exprRoot as the root, this function returns true if there exists a read of that variable before a write to that variable that is on the right side of n. For example, suppose the node is x = 1: y = 1, x = 1; // false, there is no reads at all. y = 1, x = 1...
[ "Given", "a", "variable", "node", "n", "in", "the", "tree", "and", "a", "sub", "-", "tree", "denoted", "by", "exprRoot", "as", "the", "root", "this", "function", "returns", "true", "if", "there", "exists", "a", "read", "of", "that", "variable", "before",...
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DeadAssignmentsElimination.java#L349-L397
23,985
google/closure-compiler
src/com/google/javascript/jscomp/DeadAssignmentsElimination.java
DeadAssignmentsElimination.isVariableReadBeforeKill
private VariableLiveness isVariableReadBeforeKill( Node n, String variable) { if (ControlFlowGraph.isEnteringNewCfgNode(n)) { // Not a FUNCTION return VariableLiveness.MAYBE_LIVE; } if (n.isName() && variable.equals(n.getString())) { if (NodeUtil.isNameDeclOrSimpleAssignLhs(n, n.getParent...
java
private VariableLiveness isVariableReadBeforeKill( Node n, String variable) { if (ControlFlowGraph.isEnteringNewCfgNode(n)) { // Not a FUNCTION return VariableLiveness.MAYBE_LIVE; } if (n.isName() && variable.equals(n.getString())) { if (NodeUtil.isNameDeclOrSimpleAssignLhs(n, n.getParent...
[ "private", "VariableLiveness", "isVariableReadBeforeKill", "(", "Node", "n", ",", "String", "variable", ")", "{", "if", "(", "ControlFlowGraph", ".", "isEnteringNewCfgNode", "(", "n", ")", ")", "{", "// Not a FUNCTION", "return", "VariableLiveness", ".", "MAYBE_LIVE...
Give an expression and a variable. It returns READ, if the first reference of that variable is a read. It returns KILL, if the first reference of that variable is an assignment. It returns MAY_LIVE otherwise.
[ "Give", "an", "expression", "and", "a", "variable", ".", "It", "returns", "READ", "if", "the", "first", "reference", "of", "that", "variable", "is", "a", "read", ".", "It", "returns", "KILL", "if", "the", "first", "reference", "of", "that", "variable", "...
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DeadAssignmentsElimination.java#L411-L472
23,986
google/closure-compiler
src/com/google/javascript/rhino/jstype/ObjectType.java
ObjectType.getNormalizedReferenceName
@Nullable public final String getNormalizedReferenceName() { String name = getReferenceName(); if (name != null) { int start = name.indexOf('('); if (start != -1) { int end = name.lastIndexOf(')'); String prefix = name.substring(0, start); return end + 1 % name.length() == ...
java
@Nullable public final String getNormalizedReferenceName() { String name = getReferenceName(); if (name != null) { int start = name.indexOf('('); if (start != -1) { int end = name.lastIndexOf(')'); String prefix = name.substring(0, start); return end + 1 % name.length() == ...
[ "@", "Nullable", "public", "final", "String", "getNormalizedReferenceName", "(", ")", "{", "String", "name", "=", "getReferenceName", "(", ")", ";", "if", "(", "name", "!=", "null", ")", "{", "int", "start", "=", "name", ".", "indexOf", "(", "'", "'", ...
Due to the complexity of some of our internal type systems, sometimes we have different types constructed by the same constructor. In other parts of the type system, these are called delegates. We construct these types by appending suffixes to the constructor name. The normalized reference name does not have these suf...
[ "Due", "to", "the", "complexity", "of", "some", "of", "our", "internal", "type", "systems", "sometimes", "we", "have", "different", "types", "constructed", "by", "the", "same", "constructor", ".", "In", "other", "parts", "of", "the", "type", "system", "these...
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/ObjectType.java#L231-L243
23,987
google/closure-compiler
src/com/google/javascript/rhino/jstype/ObjectType.java
ObjectType.defineDeclaredProperty
public final boolean defineDeclaredProperty(String propertyName, JSType type, Node propertyNode) { boolean result = defineProperty(propertyName, type, false, propertyNode); // All property definitions go through this method // or defineInferredProperty. Because the properties defined an an // obje...
java
public final boolean defineDeclaredProperty(String propertyName, JSType type, Node propertyNode) { boolean result = defineProperty(propertyName, type, false, propertyNode); // All property definitions go through this method // or defineInferredProperty. Because the properties defined an an // obje...
[ "public", "final", "boolean", "defineDeclaredProperty", "(", "String", "propertyName", ",", "JSType", "type", ",", "Node", "propertyNode", ")", "{", "boolean", "result", "=", "defineProperty", "(", "propertyName", ",", "type", ",", "false", ",", "propertyNode", ...
Defines a property whose type is explicitly declared by the programmer. @param propertyName the property's name @param type the type @param propertyNode the node corresponding to the declaration of property which might later be accessed using {@code getPropertyNode}.
[ "Defines", "a", "property", "whose", "type", "is", "explicitly", "declared", "by", "the", "programmer", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/ObjectType.java#L369-L378
23,988
google/closure-compiler
src/com/google/javascript/rhino/jstype/ObjectType.java
ObjectType.defineSynthesizedProperty
public final boolean defineSynthesizedProperty(String propertyName, JSType type, Node propertyNode) { return defineProperty(propertyName, type, false, propertyNode); }
java
public final boolean defineSynthesizedProperty(String propertyName, JSType type, Node propertyNode) { return defineProperty(propertyName, type, false, propertyNode); }
[ "public", "final", "boolean", "defineSynthesizedProperty", "(", "String", "propertyName", ",", "JSType", "type", ",", "Node", "propertyNode", ")", "{", "return", "defineProperty", "(", "propertyName", ",", "type", ",", "false", ",", "propertyNode", ")", ";", "}"...
Defines a property whose type is on a synthesized object. These objects don't actually exist in the user's program. They're just used for bookkeeping in the type system.
[ "Defines", "a", "property", "whose", "type", "is", "on", "a", "synthesized", "object", ".", "These", "objects", "don", "t", "actually", "exist", "in", "the", "user", "s", "program", ".", "They", "re", "just", "used", "for", "bookkeeping", "in", "the", "t...
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/ObjectType.java#L385-L388
23,989
google/closure-compiler
src/com/google/javascript/rhino/jstype/ObjectType.java
ObjectType.defineInferredProperty
public final boolean defineInferredProperty(String propertyName, JSType type, Node propertyNode) { if (hasProperty(propertyName)) { if (isPropertyTypeDeclared(propertyName)) { // We never want to hide a declared property with an inferred property. return true; } JSType origin...
java
public final boolean defineInferredProperty(String propertyName, JSType type, Node propertyNode) { if (hasProperty(propertyName)) { if (isPropertyTypeDeclared(propertyName)) { // We never want to hide a declared property with an inferred property. return true; } JSType origin...
[ "public", "final", "boolean", "defineInferredProperty", "(", "String", "propertyName", ",", "JSType", "type", ",", "Node", "propertyNode", ")", "{", "if", "(", "hasProperty", "(", "propertyName", ")", ")", "{", "if", "(", "isPropertyTypeDeclared", "(", "property...
Defines a property whose type is inferred. @param propertyName the property's name @param type the type @param propertyNode the node corresponding to the inferred definition of property that might later be accessed using {@code getPropertyNode}.
[ "Defines", "a", "property", "whose", "type", "is", "inferred", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/ObjectType.java#L397-L418
23,990
google/closure-compiler
src/com/google/javascript/rhino/jstype/ObjectType.java
ObjectType.getOwnPropertyJSDocInfo
public final JSDocInfo getOwnPropertyJSDocInfo(String propertyName) { Property p = getOwnSlot(propertyName); return p == null ? null : p.getJSDocInfo(); }
java
public final JSDocInfo getOwnPropertyJSDocInfo(String propertyName) { Property p = getOwnSlot(propertyName); return p == null ? null : p.getJSDocInfo(); }
[ "public", "final", "JSDocInfo", "getOwnPropertyJSDocInfo", "(", "String", "propertyName", ")", "{", "Property", "p", "=", "getOwnSlot", "(", "propertyName", ")", ";", "return", "p", "==", "null", "?", "null", ":", "p", ".", "getJSDocInfo", "(", ")", ";", "...
Gets the docInfo on the specified property on this type. This should not be implemented recursively, as you generally need to know exactly on which type in the prototype chain the JSDocInfo exists.
[ "Gets", "the", "docInfo", "on", "the", "specified", "property", "on", "this", "type", ".", "This", "should", "not", "be", "implemented", "recursively", "as", "you", "generally", "need", "to", "know", "exactly", "on", "which", "type", "in", "the", "prototype"...
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/ObjectType.java#L481-L484
23,991
google/closure-compiler
src/com/google/javascript/rhino/jstype/ObjectType.java
ObjectType.getPropertyType
public JSType getPropertyType(String propertyName) { StaticTypedSlot slot = getSlot(propertyName); if (slot == null) { if (isNoResolvedType() || isCheckedUnknownType()) { return getNativeType(JSTypeNative.CHECKED_UNKNOWN_TYPE); } else if (isEmptyType()) { return getNativeType(JSTypeN...
java
public JSType getPropertyType(String propertyName) { StaticTypedSlot slot = getSlot(propertyName); if (slot == null) { if (isNoResolvedType() || isCheckedUnknownType()) { return getNativeType(JSTypeNative.CHECKED_UNKNOWN_TYPE); } else if (isEmptyType()) { return getNativeType(JSTypeN...
[ "public", "JSType", "getPropertyType", "(", "String", "propertyName", ")", "{", "StaticTypedSlot", "slot", "=", "getSlot", "(", "propertyName", ")", ";", "if", "(", "slot", "==", "null", ")", "{", "if", "(", "isNoResolvedType", "(", ")", "||", "isCheckedUnkn...
Gets the property type of the property whose name is given. If the underlying object does not have this property, the Unknown type is returned to indicate that no information is available on this property. This gets overridden by FunctionType for lazily-resolved call() and bind() functions. @return the property's typ...
[ "Gets", "the", "property", "type", "of", "the", "property", "whose", "name", "is", "given", ".", "If", "the", "underlying", "object", "does", "not", "have", "this", "property", "the", "Unknown", "type", "is", "returned", "to", "indicate", "that", "no", "in...
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/ObjectType.java#L522-L533
23,992
google/closure-compiler
src/com/google/javascript/rhino/jstype/ObjectType.java
ObjectType.getOwnPropertyKind
public final HasPropertyKind getOwnPropertyKind(String propertyName) { return getOwnSlot(propertyName) != null ? HasPropertyKind.KNOWN_PRESENT : HasPropertyKind.ABSENT; }
java
public final HasPropertyKind getOwnPropertyKind(String propertyName) { return getOwnSlot(propertyName) != null ? HasPropertyKind.KNOWN_PRESENT : HasPropertyKind.ABSENT; }
[ "public", "final", "HasPropertyKind", "getOwnPropertyKind", "(", "String", "propertyName", ")", "{", "return", "getOwnSlot", "(", "propertyName", ")", "!=", "null", "?", "HasPropertyKind", ".", "KNOWN_PRESENT", ":", "HasPropertyKind", ".", "ABSENT", ";", "}" ]
Checks whether the property whose name is given is present directly on the object. Returns false even if it is declared on a supertype.
[ "Checks", "whether", "the", "property", "whose", "name", "is", "given", "is", "present", "directly", "on", "the", "object", ".", "Returns", "false", "even", "if", "it", "is", "declared", "on", "a", "supertype", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/ObjectType.java#L545-L549
23,993
google/closure-compiler
src/com/google/javascript/rhino/jstype/ObjectType.java
ObjectType.isPropertyTypeDeclared
public final boolean isPropertyTypeDeclared(String propertyName) { StaticTypedSlot slot = getSlot(propertyName); return slot == null ? false : !slot.isTypeInferred(); }
java
public final boolean isPropertyTypeDeclared(String propertyName) { StaticTypedSlot slot = getSlot(propertyName); return slot == null ? false : !slot.isTypeInferred(); }
[ "public", "final", "boolean", "isPropertyTypeDeclared", "(", "String", "propertyName", ")", "{", "StaticTypedSlot", "slot", "=", "getSlot", "(", "propertyName", ")", ";", "return", "slot", "==", "null", "?", "false", ":", "!", "slot", ".", "isTypeInferred", "(...
Checks whether the property's type is declared.
[ "Checks", "whether", "the", "property", "s", "type", "is", "declared", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/ObjectType.java#L582-L585
23,994
google/closure-compiler
src/com/google/javascript/rhino/jstype/ObjectType.java
ObjectType.isPropertyInExterns
public final boolean isPropertyInExterns(String propertyName) { Property p = getSlot(propertyName); return p == null ? false : p.isFromExterns(); }
java
public final boolean isPropertyInExterns(String propertyName) { Property p = getSlot(propertyName); return p == null ? false : p.isFromExterns(); }
[ "public", "final", "boolean", "isPropertyInExterns", "(", "String", "propertyName", ")", "{", "Property", "p", "=", "getSlot", "(", "propertyName", ")", ";", "return", "p", "==", "null", "?", "false", ":", "p", ".", "isFromExterns", "(", ")", ";", "}" ]
Checks whether the property was defined in the externs.
[ "Checks", "whether", "the", "property", "was", "defined", "in", "the", "externs", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/ObjectType.java#L601-L604
23,995
google/closure-compiler
src/com/google/javascript/rhino/jstype/ObjectType.java
ObjectType.getPropertyNames
public final Set<String> getPropertyNames() { Set<String> props = new TreeSet<>(); collectPropertyNames(props); return props; }
java
public final Set<String> getPropertyNames() { Set<String> props = new TreeSet<>(); collectPropertyNames(props); return props; }
[ "public", "final", "Set", "<", "String", ">", "getPropertyNames", "(", ")", "{", "Set", "<", "String", ">", "props", "=", "new", "TreeSet", "<>", "(", ")", ";", "collectPropertyNames", "(", "props", ")", ";", "return", "props", ";", "}" ]
Returns a list of properties defined or inferred on this type and any of its supertypes.
[ "Returns", "a", "list", "of", "properties", "defined", "or", "inferred", "on", "this", "type", "and", "any", "of", "its", "supertypes", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/ObjectType.java#L717-L721
23,996
google/closure-compiler
src/com/google/javascript/rhino/jstype/ObjectType.java
ObjectType.isImplicitPrototype
@SuppressWarnings("ReferenceEquality") final boolean isImplicitPrototype(ObjectType prototype) { for (ObjectType current = this; current != null; current = current.getImplicitPrototype()) { if (current.isTemplatizedType()) { current = current.toMaybeTemplatizedType().getReferencedType(); } ...
java
@SuppressWarnings("ReferenceEquality") final boolean isImplicitPrototype(ObjectType prototype) { for (ObjectType current = this; current != null; current = current.getImplicitPrototype()) { if (current.isTemplatizedType()) { current = current.toMaybeTemplatizedType().getReferencedType(); } ...
[ "@", "SuppressWarnings", "(", "\"ReferenceEquality\"", ")", "final", "boolean", "isImplicitPrototype", "(", "ObjectType", "prototype", ")", "{", "for", "(", "ObjectType", "current", "=", "this", ";", "current", "!=", "null", ";", "current", "=", "current", ".", ...
Checks that the prototype is an implicit prototype of this object. Since each object has an implicit prototype, an implicit prototype's implicit prototype is also this implicit prototype's. @param prototype any prototype based object @return {@code true} if {@code prototype} is {@code equal} to any object in this obje...
[ "Checks", "that", "the", "prototype", "is", "an", "implicit", "prototype", "of", "this", "object", ".", "Since", "each", "object", "has", "an", "implicit", "prototype", "an", "implicit", "prototype", "s", "implicit", "prototype", "is", "also", "this", "implici...
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/ObjectType.java#L748-L766
23,997
google/closure-compiler
src/com/google/javascript/rhino/jstype/ObjectType.java
ObjectType.isUnknownType
@Override public boolean isUnknownType() { // If the object is unknown now, check the supertype again, // because it might have been resolved since the last check. if (unknown) { ObjectType implicitProto = getImplicitPrototype(); if (implicitProto == null || implicitProto.isNativeObjectType())...
java
@Override public boolean isUnknownType() { // If the object is unknown now, check the supertype again, // because it might have been resolved since the last check. if (unknown) { ObjectType implicitProto = getImplicitPrototype(); if (implicitProto == null || implicitProto.isNativeObjectType())...
[ "@", "Override", "public", "boolean", "isUnknownType", "(", ")", "{", "// If the object is unknown now, check the supertype again,", "// because it might have been resolved since the last check.", "if", "(", "unknown", ")", "{", "ObjectType", "implicitProto", "=", "getImplicitPro...
We treat this as the unknown type if any of its implicit prototype properties is unknown.
[ "We", "treat", "this", "as", "the", "unknown", "type", "if", "any", "of", "its", "implicit", "prototype", "properties", "is", "unknown", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/ObjectType.java#L792-L811
23,998
google/closure-compiler
src/com/google/javascript/rhino/jstype/ObjectType.java
ObjectType.getPropertyTypeMap
public Map<String, JSType> getPropertyTypeMap() { ImmutableMap.Builder<String, JSType> propTypeMap = ImmutableMap.builder(); for (String name : this.getPropertyNames()) { propTypeMap.put(name, this.getPropertyType(name)); } return propTypeMap.build(); }
java
public Map<String, JSType> getPropertyTypeMap() { ImmutableMap.Builder<String, JSType> propTypeMap = ImmutableMap.builder(); for (String name : this.getPropertyNames()) { propTypeMap.put(name, this.getPropertyType(name)); } return propTypeMap.build(); }
[ "public", "Map", "<", "String", ",", "JSType", ">", "getPropertyTypeMap", "(", ")", "{", "ImmutableMap", ".", "Builder", "<", "String", ",", "JSType", ">", "propTypeMap", "=", "ImmutableMap", ".", "builder", "(", ")", ";", "for", "(", "String", "name", "...
get the map of properties to types covered in an object type @return a Map that maps the property's name to the property's type
[ "get", "the", "map", "of", "properties", "to", "types", "covered", "in", "an", "object", "type" ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/ObjectType.java#L878-L884
23,999
google/closure-compiler
src/com/google/javascript/jscomp/CheckConstPrivateProperties.java
CheckConstPrivateProperties.reportMissingConst
private void reportMissingConst(NodeTraversal t) { for (Node n : candidates) { String propName = n.getLastChild().getString(); if (!modified.contains(propName)) { t.report(n, MISSING_CONST_PROPERTY, propName); } } candidates.clear(); modified.clear(); }
java
private void reportMissingConst(NodeTraversal t) { for (Node n : candidates) { String propName = n.getLastChild().getString(); if (!modified.contains(propName)) { t.report(n, MISSING_CONST_PROPERTY, propName); } } candidates.clear(); modified.clear(); }
[ "private", "void", "reportMissingConst", "(", "NodeTraversal", "t", ")", "{", "for", "(", "Node", "n", ":", "candidates", ")", "{", "String", "propName", "=", "n", ".", "getLastChild", "(", ")", ".", "getString", "(", ")", ";", "if", "(", "!", "modifie...
Reports the property definitions that should use the @const annotation.
[ "Reports", "the", "property", "definitions", "that", "should", "use", "the" ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CheckConstPrivateProperties.java#L59-L68