| Index: third_party/WebKit/Source/devtools/scripts/jsdoc_validator/src/org/chromium/devtools/jsdoc/checks/DisallowedGlobalPropertiesChecker.java
|
| diff --git a/third_party/WebKit/Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/DisallowedGlobalPropertiesChecker.java b/third_party/WebKit/Source/devtools/scripts/jsdoc_validator/src/org/chromium/devtools/jsdoc/checks/DisallowedGlobalPropertiesChecker.java
|
| similarity index 82%
|
| rename from third_party/WebKit/Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/DisallowedGlobalPropertiesChecker.java
|
| rename to third_party/WebKit/Source/devtools/scripts/jsdoc_validator/src/org/chromium/devtools/jsdoc/checks/DisallowedGlobalPropertiesChecker.java
|
| index 7f89947861fafd655badd56c234404d213d29a22..b6c78383698ca55074037f8845c5cf14300660fb 100644
|
| --- a/third_party/WebKit/Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/DisallowedGlobalPropertiesChecker.java
|
| +++ b/third_party/WebKit/Source/devtools/scripts/jsdoc_validator/src/org/chromium/devtools/jsdoc/checks/DisallowedGlobalPropertiesChecker.java
|
| @@ -13,7 +13,6 @@ import java.util.Map;
|
| import java.util.Set;
|
|
|
| public final class DisallowedGlobalPropertiesChecker extends ContextTrackingChecker {
|
| -
|
| private static final Set<String> GLOBAL_OBJECT_NAMES = new HashSet<>();
|
| private static final Set<String> DISALLOWED_PROPERTIES = new HashSet<>();
|
| static {
|
| @@ -35,33 +34,33 @@ public final class DisallowedGlobalPropertiesChecker extends ContextTrackingChec
|
| @Override
|
| protected void enterNode(Node node) {
|
| switch (node.getType()) {
|
| - case Token.VAR:
|
| - handleVar(node);
|
| - break;
|
| - case Token.NAME:
|
| - handleName(node);
|
| - break;
|
| - case Token.STRING:
|
| - handleString(node);
|
| - break;
|
| - case Token.FUNCTION:
|
| - case Token.SCRIPT:
|
| - enterFunctionOrScript();
|
| - break;
|
| - default:
|
| - break;
|
| + case Token.VAR:
|
| + handleVar(node);
|
| + break;
|
| + case Token.NAME:
|
| + handleName(node);
|
| + break;
|
| + case Token.STRING:
|
| + handleString(node);
|
| + break;
|
| + case Token.FUNCTION:
|
| + case Token.SCRIPT:
|
| + enterFunctionOrScript();
|
| + break;
|
| + default:
|
| + break;
|
| }
|
| }
|
|
|
| @Override
|
| protected void leaveNode(Node node) {
|
| switch (node.getType()) {
|
| - case Token.FUNCTION:
|
| - case Token.SCRIPT:
|
| - leaveFunctionOrScript();
|
| - break;
|
| - default:
|
| - break;
|
| + case Token.FUNCTION:
|
| + case Token.SCRIPT:
|
| + leaveFunctionOrScript();
|
| + break;
|
| + default:
|
| + break;
|
| }
|
| }
|
|
|
| @@ -85,8 +84,9 @@ public final class DisallowedGlobalPropertiesChecker extends ContextTrackingChec
|
| for (Node node : nodes) {
|
| String name = getContext().getNodeText(node);
|
| if (!functionHasVisibleIdentifier(function, name)) {
|
| - reportErrorAtNodeStart(node, String.format(
|
| - "Access to \"%s\" property of global object is disallowed", name));
|
| + reportErrorAtNodeStart(node,
|
| + String.format(
|
| + "Access to \"%s\" property of global object is disallowed", name));
|
| }
|
| }
|
| }
|
| @@ -134,8 +134,8 @@ public final class DisallowedGlobalPropertiesChecker extends ContextTrackingChec
|
| }
|
|
|
| Node objectNode = parent.getFirstChild();
|
| - boolean isGlobalObjectAccess =
|
| - objectNode != null && isGlobalObject(objectNode) && objectNode.getNext() == stringNode;
|
| + boolean isGlobalObjectAccess = objectNode != null && isGlobalObject(objectNode)
|
| + && objectNode.getNext() == stringNode;
|
| if (isGlobalObjectAccess) {
|
| globalPropertyAccessNodes.get(getCurrentFunction()).add(stringNode);
|
| }
|
| @@ -152,7 +152,7 @@ public final class DisallowedGlobalPropertiesChecker extends ContextTrackingChec
|
| return false;
|
| }
|
| return node.getType() == Token.NAME
|
| - && !functionHasVisibleIdentifier(getCurrentFunction(), name);
|
| + && !functionHasVisibleIdentifier(getCurrentFunction(), name);
|
| }
|
|
|
| private boolean functionHasVisibleIdentifier(FunctionRecord function, String name) {
|
| @@ -168,6 +168,6 @@ public final class DisallowedGlobalPropertiesChecker extends ContextTrackingChec
|
|
|
| private boolean functionHasLocalIdentifier(FunctionRecord function, String name) {
|
| return function.parameterNames.contains(name)
|
| - || declaredLocalVariables.get(function).contains(name);
|
| + || declaredLocalVariables.get(function).contains(name);
|
| }
|
| }
|
|
|