Skip to content

Commit

Permalink
Fix typos.
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171892466
  • Loading branch information
lauraharker authored and Tyler Breisacher committed Oct 13, 2017
1 parent 5516f0f commit 3b5c406
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 17 deletions.
6 changes: 3 additions & 3 deletions src/com/google/javascript/jscomp/CheckJSDoc.java
Expand Up @@ -168,11 +168,11 @@ private Node getFunctionDecl(Node n) {
private boolean isClassDecl(Node n) { private boolean isClassDecl(Node n) {
return isClass(n) return isClass(n)
|| (n.isAssign() && isClass(n.getLastChild())) || (n.isAssign() && isClass(n.getLastChild()))
|| (NodeUtil.isNameDeclaration(n) && isNameIntializeWithClass(n.getFirstChild())) || (NodeUtil.isNameDeclaration(n) && isNameInitializeWithClass(n.getFirstChild()))
|| isNameIntializeWithClass(n); || isNameInitializeWithClass(n);
} }


private boolean isNameIntializeWithClass(Node n) { private boolean isNameInitializeWithClass(Node n) {
return n != null && n.isName() && n.hasChildren() && isClass(n.getFirstChild()); return n != null && n.isName() && n.hasChildren() && isClass(n.getFirstChild());
} }


Expand Down
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/CodePrinter.java
Expand Up @@ -242,7 +242,7 @@ private static List<Integer> computeLineLengths(String code) {


/** /**
* Adjusts end position of a mapping. End position points to a column *after* the last character * 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 * 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 * 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 * same end position, but they use different styles as described above it leads to invalid
Expand Down
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/Compiler.java
Expand Up @@ -170,7 +170,7 @@ public class Compiler extends AbstractCompiler implements ErrorHandler, SourceFi
private transient IncrementalScopeCreator scopeCreator = null; 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. * compiler. For example, looking up sources referenced within sourcemaps.
*/ */
public static class ExternalSourceLoader { public static class ExternalSourceLoader {
Expand Down
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/CoverageUtil.java
Expand Up @@ -29,7 +29,7 @@ private CoverageUtil() {}


/** /**
* Returns a string with all non-alphanumeric characters in the given string * 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. * the given text.
* @param inputText the text to create an identifier from * @param inputText the text to create an identifier from
* @return the new string that can be used as in identifier * @return the new string that can be used as in identifier
Expand Down
Expand Up @@ -494,7 +494,7 @@ public void visit(NodeTraversal t, Node n, Node parent) {
if (!n.getChildAtIndex(2).isString() && !n.getLastChild().isObjectLit()) { if (!n.getChildAtIndex(2).isString() && !n.getLastChild().isObjectLit()) {
unknownGetterSetterPresent = true; unknownGetterSetterPresent = true;
} else if (!n.getLastChild().isObjectLit()) { } 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. // the property name.
propNames.add(n.getChildAtIndex(2).getString()); propNames.add(n.getChildAtIndex(2).getString());
} }
Expand Down
Expand Up @@ -1687,7 +1687,7 @@ public void testComputedPropertyNames() {
"var bar = new Bar()", "var bar = new Bar()",
"bar.foo();")); "bar.foo();"));


// Computed property method name in class - no concatination // Computed property method name in class - no concatenation
testSame( testSame(
LINE_JOINER.join( LINE_JOINER.join(
"class Bar {", "class Bar {",
Expand Down
2 changes: 1 addition & 1 deletion test/com/google/javascript/jscomp/CompilerTestCase.java
Expand Up @@ -120,7 +120,7 @@ public abstract class CompilerTestCase extends TestCase {


private boolean polymerPass; 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; private boolean transpileEnabled;


/** Whether we run InferConsts before checking. */ /** Whether we run InferConsts before checking. */
Expand Down
Expand Up @@ -94,11 +94,10 @@ private static List<DiGraphEdge<Node, Branch>> getAllEdges(
return edges; 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; for (Node current = n.getFirstChild(); current != null;
current = current.getNext()) { current = current.getNext()) {
if (current == maybeDescendent || if (current == maybeDescendant || isAncestor(current, maybeDescendant)) {
isAncestor(current, maybeDescendent)) {
return true; return true;
} }
} }
Expand Down
Expand Up @@ -498,24 +498,24 @@ public void testGoogModules() {
LINE_JOINER.join( LINE_JOINER.join(
"goog.module('a.b.c');", "goog.module('a.b.c');",
"/** @constructor */ function Foo() {}", "/** @constructor */ function Foo() {}",
"Foo.prototoype.display = function() {};", "Foo.prototype.display = function() {};",
"exports = Foo;"), "exports = Foo;"),
LINE_JOINER.join( LINE_JOINER.join(
"goog.module('x.y.z');", "goog.module('x.y.z');",
"/** @constructor */ function Foo() {}", "/** @constructor */ function Foo() {}",
"Foo.prototoype.display = function() {};", "Foo.prototype.display = function() {};",
"exports = Foo;"), "exports = Foo;"),
}); });


testSame( testSame(
new String[] { new String[] {
LINE_JOINER.join( LINE_JOINER.join(
"/** @constructor */ function Foo() {}", "/** @constructor */ function Foo() {}",
"Foo.prototoype.display = function() {};"), "Foo.prototype.display = function() {};"),
LINE_JOINER.join( LINE_JOINER.join(
"goog.module('x.y.z');", "goog.module('x.y.z');",
"/** @constructor */ function Foo() {}", "/** @constructor */ function Foo() {}",
"Foo.prototoype.display = function() {};", "Foo.prototype.display = function() {};",
"exports = Foo;"), "exports = Foo;"),
}); });


Expand Down
Expand Up @@ -662,7 +662,7 @@ public void testGetPropContainsNonQualifiedNames() {
"}")); "}"));
} }


public void testEs6Constrcutor() { public void testEs6Constructor() {
testSame( testSame(
LINE_JOINER.join( LINE_JOINER.join(
"class Foo {", "class Foo {",
Expand Down

0 comments on commit 3b5c406

Please sign in to comment.