From 3b5c406a99a0231dea75f1e7666dce69148fd8f3 Mon Sep 17 00:00:00 2001 From: lharker Date: Wed, 11 Oct 2017 16:27:54 -0700 Subject: [PATCH] Fix typos. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=171892466 --- src/com/google/javascript/jscomp/CheckJSDoc.java | 6 +++--- src/com/google/javascript/jscomp/CodePrinter.java | 2 +- src/com/google/javascript/jscomp/Compiler.java | 2 +- src/com/google/javascript/jscomp/CoverageUtil.java | 2 +- .../jscomp/DeadPropertyAssignmentElimination.java | 2 +- .../google/javascript/jscomp/CollapsePropertiesTest.java | 2 +- test/com/google/javascript/jscomp/CompilerTestCase.java | 2 +- .../google/javascript/jscomp/ControlFlowAnalysisTest.java | 5 ++--- .../javascript/jscomp/ConvertToTypedInterfaceTest.java | 8 ++++---- .../jscomp/DeadPropertyAssignmentEliminationTest.java | 2 +- 10 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/com/google/javascript/jscomp/CheckJSDoc.java b/src/com/google/javascript/jscomp/CheckJSDoc.java index 2f0fc8efc70..808beaa1699 100644 --- a/src/com/google/javascript/jscomp/CheckJSDoc.java +++ b/src/com/google/javascript/jscomp/CheckJSDoc.java @@ -168,11 +168,11 @@ private Node getFunctionDecl(Node n) { private boolean isClassDecl(Node n) { return isClass(n) || (n.isAssign() && isClass(n.getLastChild())) - || (NodeUtil.isNameDeclaration(n) && isNameIntializeWithClass(n.getFirstChild())) - || isNameIntializeWithClass(n); + || (NodeUtil.isNameDeclaration(n) && isNameInitializeWithClass(n.getFirstChild())) + || isNameInitializeWithClass(n); } - private boolean isNameIntializeWithClass(Node n) { + private boolean isNameInitializeWithClass(Node n) { return n != null && n.isName() && n.hasChildren() && isClass(n.getFirstChild()); } diff --git a/src/com/google/javascript/jscomp/CodePrinter.java b/src/com/google/javascript/jscomp/CodePrinter.java index b20b5ab5718..589f686ad1f 100644 --- a/src/com/google/javascript/jscomp/CodePrinter.java +++ b/src/com/google/javascript/jscomp/CodePrinter.java @@ -242,7 +242,7 @@ private static List computeLineLengths(String code) { /** * Adjusts end position of a mapping. End position points to a column *after* the last character - * that is covered by a mapping. And if it's end of the line there are 2 possibilites: either + * that is covered by a mapping. And if it's end of the line there are 2 possibilities: either * point to the non-existent character after the last char on a line or point to the first * character on the next line. In some cases we end up with 2 mappings which should have the * same end position, but they use different styles as described above it leads to invalid diff --git a/src/com/google/javascript/jscomp/Compiler.java b/src/com/google/javascript/jscomp/Compiler.java index 4ae0acebf07..1db53a488fa 100644 --- a/src/com/google/javascript/jscomp/Compiler.java +++ b/src/com/google/javascript/jscomp/Compiler.java @@ -170,7 +170,7 @@ public class Compiler extends AbstractCompiler implements ErrorHandler, SourceFi private transient IncrementalScopeCreator scopeCreator = null; /** - * Subclasses are responsible for loading soures that were not provided as explicit inputs to the + * Subclasses are responsible for loading sources that were not provided as explicit inputs to the * compiler. For example, looking up sources referenced within sourcemaps. */ public static class ExternalSourceLoader { diff --git a/src/com/google/javascript/jscomp/CoverageUtil.java b/src/com/google/javascript/jscomp/CoverageUtil.java index 1ebe0e9021b..b229a5c62e1 100644 --- a/src/com/google/javascript/jscomp/CoverageUtil.java +++ b/src/com/google/javascript/jscomp/CoverageUtil.java @@ -29,7 +29,7 @@ private CoverageUtil() {} /** * Returns a string with all non-alphanumeric characters in the given string - * replaced with underscrores. This is to create a valid identifier based on + * replaced with underscores. This is to create a valid identifier based on * the given text. * @param inputText the text to create an identifier from * @return the new string that can be used as in identifier diff --git a/src/com/google/javascript/jscomp/DeadPropertyAssignmentElimination.java b/src/com/google/javascript/jscomp/DeadPropertyAssignmentElimination.java index bc24b4a7fc4..8f2a76e0811 100644 --- a/src/com/google/javascript/jscomp/DeadPropertyAssignmentElimination.java +++ b/src/com/google/javascript/jscomp/DeadPropertyAssignmentElimination.java @@ -494,7 +494,7 @@ public void visit(NodeTraversal t, Node n, Node parent) { if (!n.getChildAtIndex(2).isString() && !n.getLastChild().isObjectLit()) { unknownGetterSetterPresent = true; } else if (!n.getLastChild().isObjectLit()) { - // If know the property name but not what it's being assigned to then we need to blackist + // If know the property name but not what it's being assigned to then we need to blacklist // the property name. propNames.add(n.getChildAtIndex(2).getString()); } diff --git a/test/com/google/javascript/jscomp/CollapsePropertiesTest.java b/test/com/google/javascript/jscomp/CollapsePropertiesTest.java index 7c3bda312d1..10be111a59d 100644 --- a/test/com/google/javascript/jscomp/CollapsePropertiesTest.java +++ b/test/com/google/javascript/jscomp/CollapsePropertiesTest.java @@ -1687,7 +1687,7 @@ public void testComputedPropertyNames() { "var bar = new Bar()", "bar.foo();")); - // Computed property method name in class - no concatination + // Computed property method name in class - no concatenation testSame( LINE_JOINER.join( "class Bar {", diff --git a/test/com/google/javascript/jscomp/CompilerTestCase.java b/test/com/google/javascript/jscomp/CompilerTestCase.java index 45d6c8aee25..b610ca63a11 100644 --- a/test/com/google/javascript/jscomp/CompilerTestCase.java +++ b/test/com/google/javascript/jscomp/CompilerTestCase.java @@ -120,7 +120,7 @@ public abstract class CompilerTestCase extends TestCase { private boolean polymerPass; - /** Whether the tranpilation passes runs before pass being tested. */ + /** Whether the transpilation passes run before the pass being tested. */ private boolean transpileEnabled; /** Whether we run InferConsts before checking. */ diff --git a/test/com/google/javascript/jscomp/ControlFlowAnalysisTest.java b/test/com/google/javascript/jscomp/ControlFlowAnalysisTest.java index 67505f9c5d8..3a4b57e9881 100644 --- a/test/com/google/javascript/jscomp/ControlFlowAnalysisTest.java +++ b/test/com/google/javascript/jscomp/ControlFlowAnalysisTest.java @@ -94,11 +94,10 @@ private static List> getAllEdges( return edges; } - private static boolean isAncestor(Node n, Node maybeDescendent) { + private static boolean isAncestor(Node n, Node maybeDescendant) { for (Node current = n.getFirstChild(); current != null; current = current.getNext()) { - if (current == maybeDescendent || - isAncestor(current, maybeDescendent)) { + if (current == maybeDescendant || isAncestor(current, maybeDescendant)) { return true; } } diff --git a/test/com/google/javascript/jscomp/ConvertToTypedInterfaceTest.java b/test/com/google/javascript/jscomp/ConvertToTypedInterfaceTest.java index a010ad9ffd1..410ab4e6f3d 100644 --- a/test/com/google/javascript/jscomp/ConvertToTypedInterfaceTest.java +++ b/test/com/google/javascript/jscomp/ConvertToTypedInterfaceTest.java @@ -498,12 +498,12 @@ public void testGoogModules() { LINE_JOINER.join( "goog.module('a.b.c');", "/** @constructor */ function Foo() {}", - "Foo.prototoype.display = function() {};", + "Foo.prototype.display = function() {};", "exports = Foo;"), LINE_JOINER.join( "goog.module('x.y.z');", "/** @constructor */ function Foo() {}", - "Foo.prototoype.display = function() {};", + "Foo.prototype.display = function() {};", "exports = Foo;"), }); @@ -511,11 +511,11 @@ public void testGoogModules() { new String[] { LINE_JOINER.join( "/** @constructor */ function Foo() {}", - "Foo.prototoype.display = function() {};"), + "Foo.prototype.display = function() {};"), LINE_JOINER.join( "goog.module('x.y.z');", "/** @constructor */ function Foo() {}", - "Foo.prototoype.display = function() {};", + "Foo.prototype.display = function() {};", "exports = Foo;"), }); diff --git a/test/com/google/javascript/jscomp/DeadPropertyAssignmentEliminationTest.java b/test/com/google/javascript/jscomp/DeadPropertyAssignmentEliminationTest.java index 49bc46f4261..a3822796e47 100644 --- a/test/com/google/javascript/jscomp/DeadPropertyAssignmentEliminationTest.java +++ b/test/com/google/javascript/jscomp/DeadPropertyAssignmentEliminationTest.java @@ -662,7 +662,7 @@ public void testGetPropContainsNonQualifiedNames() { "}")); } - public void testEs6Constrcutor() { + public void testEs6Constructor() { testSame( LINE_JOINER.join( "class Foo {",