Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1304)

Unified Diff: Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/FunctionRecord.java

Issue 659973003: [DevTools] Disallow use of global property "document". (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/FunctionRecord.java
diff --git a/Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/FunctionRecord.java b/Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/FunctionRecord.java
index a546ec5925161a65b50639f6a92b0e1b5f0d6f71..516c0adf788699752263aa873d59fe910dae8e67 100644
--- a/Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/FunctionRecord.java
+++ b/Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/FunctionRecord.java
@@ -4,23 +4,37 @@ import com.google.javascript.jscomp.NodeUtil;
import com.google.javascript.rhino.JSDocInfo;
import com.google.javascript.rhino.Node;
+import java.util.ArrayList;
+import java.util.List;
+
public class FunctionRecord {
final Node functionNode;
final JSDocInfo info;
final String name;
+ final List<String> parameterNames;
final TypeRecord enclosingType;
final FunctionRecord enclosingFunctionRecord;
public FunctionRecord(Node functionNode, String name,
- TypeRecord parentType,
+ List<String> parameterNames, TypeRecord parentType,
FunctionRecord enclosingFunctionRecord) {
this.functionNode = functionNode;
this.info = NodeUtil.getBestJSDocInfo(functionNode);
this.name = name;
+ this.parameterNames = parameterNames;
this.enclosingType = parentType;
this.enclosingFunctionRecord = enclosingFunctionRecord;
}
+ public FunctionRecord() {
+ this.functionNode = null;
+ this.info = null;
+ this.name = "";
+ this.parameterNames = new ArrayList<>();
+ this.enclosingType = null;
+ this.enclosingFunctionRecord = null;
+ }
+
public boolean isConstructor() {
return info != null && info.isConstructor();
}
@@ -41,6 +55,11 @@ public class FunctionRecord {
return info != null && info.getOriginalCommentString().contains("@suppressReceiverCheck");
}
+ public boolean suppressesGlobalPropertiesCheck() {
+ return info != null
+ && info.getOriginalCommentString().contains("@suppressGlobalPropertiesCheck");
+ }
+
@Override
public String toString() {
return (info == null ? "" : info.getOriginalCommentString() + "\n") +

Powered by Google App Engine
This is Rietveld 408576698