Skip to content

Commit

Permalink
fix some typos
Browse files Browse the repository at this point in the history
Closes #34738
#34738

GitOrigin-RevId: d211bba
Change-Id: If690e6d378e543b300e1f6a353ceae73e39c29db
Reviewed-on: https://dart-review.googlesource.com/c/78900
Reviewed-by: Alexander Thomas <athom@google.com>
  • Loading branch information
zoechi authored and athomas committed Oct 10, 2018
1 parent 34f6aea commit 2da0b9f
Show file tree
Hide file tree
Showing 42 changed files with 75 additions and 75 deletions.
2 changes: 1 addition & 1 deletion pkg/analysis_server/tool/spec/codegen_java.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class CodegenJavaVisitor extends HierarchicalApiVisitor with CodeGenerator {
bool isDeclaredInSpec(TypeDecl type) {
// TypeReference resolvedType = super.resolveTypeReferenceChain(type);
// if(resolvedType is TypeObject) {
// return truye;
// return true;
// }
if (type is TypeReference) {
return api.types.containsKey(type.typeName) && javaType(type) != 'String';
Expand Down
2 changes: 1 addition & 1 deletion pkg/analyzer/lib/src/dart/ast/ast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7350,7 +7350,7 @@ class LocalVariableInfo {
new Set<VariableElement>();

/**
* The set of local variables and parameters that are potentiall mutated
* The set of local variables and parameters that are potentially mutated
* within the scope of their declarations.
*/
final Set<VariableElement> potentiallyMutatedInScope =
Expand Down
8 changes: 4 additions & 4 deletions pkg/analyzer/lib/src/task/strong/checker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ class _OverrideChecker {
/// Finds implicit casts that we need on parameters and type formals to
/// ensure soundness of covariant generics, and records them on the [node].
///
/// The parameter checks can be retrived using [getClassCovariantParameters]
/// The parameter checks can be retrieved using [getClassCovariantParameters]
/// and [getSuperclassCovariantParameters].
///
/// For each member of this class and non-overridden inherited member, we
Expand Down Expand Up @@ -1404,7 +1404,7 @@ class _OverrideChecker {
/// }
///
/// We've already found `C<Object>` is a potentially unsafe covariant generic
/// supertpe, and we call this method to see if any members need a check
/// supertype, and we call this method to see if any members need a check
/// because of `C<Object>`.
///
/// In this example, we will call this method with:
Expand All @@ -1418,7 +1418,7 @@ class _OverrideChecker {
/// - get the type of `C<Object>.m`: `(Object) -> *`
/// - get the type of `C<T>.m`: `(T) -> *`
/// - perform a subtype check `(T) -> * <: (Object) -> *`,
/// and record any parameters/type formals that violate soundess.
/// and record any parameters/type formals that violate soundness.
/// - that checks `Object <: T`, which is false, thus we need a check on
/// parameter `t` of `C<T>.m`
///
Expand All @@ -1427,7 +1427,7 @@ class _OverrideChecker {
/// - get the type of `D.g`: `<R extends num>() -> *`
/// - perform a subtype check
/// `<S extends Object>() -> * <: <R extends num>() -> *`,
/// and record any parameters/type formals that violate soundess.
/// and record any parameters/type formals that violate soundness.
/// - that checks the type formal bound of `S` and `R` asserting
/// `Object <: num`, which is false, thus we need a check on type formal `R`
/// of `D.g`.
Expand Down
2 changes: 1 addition & 1 deletion pkg/compiler/lib/src/js_backend/backend_impact.dart
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ class BackendImpacts {

BackendImpact get nativeTypeCheck {
return _nativeTypeCheck ??= new BackendImpact(staticUses: [
// We will neeed to add the "$is" and "$as" properties on the
// We will need to add the "$is" and "$as" properties on the
// JavaScript object prototype, so we make sure
// [:defineProperty:] is compiled.
_commonElements.defineProperty
Expand Down
2 changes: 1 addition & 1 deletion pkg/compiler/lib/src/js_model/closure_visitors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CapturedScopeBuilder extends ir.Visitor {
/// A map of each visited call node with the associated information about what
/// variables are captured/used. Each ir.Node key corresponds to a scope that
/// was encountered while visiting a closure (initially called through
/// [translateLazyIntializer] or [translateConstructorOrProcedure]).
/// [translateLazyInitializer] or [translateConstructorOrProcedure]).
Map<ir.Node, KernelCapturedScope> get _scopesCapturedInClosureMap =>
_model.capturedScopesMap;

Expand Down
2 changes: 1 addition & 1 deletion pkg/compiler/lib/src/ssa/codegen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
!node.isInterceptedCall) {
// A direct (i.e. non-interceptor) native call is the result of
// optimization. The optimization ensures any type checks or
// conversions have been satisified.
// conversions have been satisfied.
methodName = _nativeData.getFixedBackendName(target);
}
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/compiler/lib/src/ssa/codegen_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class SsaInstructionSelection extends HBaseVisitor {
//
// where the interceptor calling convention is used come from recognizing
// that 'a' is a 'self-interceptor'. If the selector matches only methods
// that ignore the explicit receiver parameter, replace occurences of the
// that ignore the explicit receiver parameter, replace occurrences of the
// receiver argument with a dummy receiver '0':
//
// a.foo$1(a, x) ---> a.foo$1(0, x)
Expand Down Expand Up @@ -861,7 +861,7 @@ class SsaShareRegionConstants extends HBaseVisitor {
}
}

// Not all occurences should be replaced with a local variable cache, so we
// Not all occurrences should be replaced with a local variable cache, so we
// filter the uses.
int _countCacheableUses(
HInstruction node, bool Function(HInstruction) cacheable) {
Expand Down Expand Up @@ -943,7 +943,7 @@ class SsaShareRegionConstants extends HBaseVisitor {
// JavaScript `x == null` is more efficient than `x == _null`.
if (instruction is HIdentity) return false;

// TODO(sra): Deterimine if other uses result in faster JavaScript code.
// TODO(sra): Determine if other uses result in faster JavaScript code.
return false;
}

Expand Down Expand Up @@ -971,7 +971,7 @@ class SsaShareRegionConstants extends HBaseVisitor {
// Foreign code templates may use literals in ways that are beneficial.
if (instruction is HForeignCode) return false;

// TODO(sra): Deterimine if other uses result in faster JavaScript code.
// TODO(sra): Determine if other uses result in faster JavaScript code.
return false;
}

Expand Down Expand Up @@ -1001,7 +1001,7 @@ class SsaShareRegionConstants extends HBaseVisitor {
// TODO(sra): Check if a.x="s" can avoid or specialize a write barrier.
if (instruction is HFieldSet) return true;

// TODO(sra): Deterimine if other uses result in faster JavaScript code.
// TODO(sra): Determine if other uses result in faster JavaScript code.
return false;
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/compiler/lib/src/universe/class_set.dart
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ class ClassHierarchyNode {
/// A -> [C, D, F]
///
/// The subtypes `B` and `E` are not directly modeled because they are implied
/// by their subclass relation to `A` and `D`, repectively. This can be seen
/// by their subclass relation to `A` and `D`, respectively. This can be seen
/// if we expand the subclass subtrees:
///
/// A -> [C, D, F]
Expand Down Expand Up @@ -968,15 +968,15 @@ typedef IterationStep ForEachFunction(ClassEntity cls);
/// Singleton map implemented as a field on the key.
class ClassHierarchyNodesMap extends MapBase<ClassEntity, ClassHierarchyNode> {
ClassHierarchyNode operator [](Object cls) {
// TOOD(sra): Change the key type to `covariant ClassHierarchyNodesMapKey`.
// TODO(sra): Change the key type to `covariant ClassHierarchyNodesMapKey`.
if (cls is ClassHierarchyNodesMapKey) {
return cls._classHierarchyNode;
}
throw new UnimplementedError('ClassHierarchyNodesMap for $cls');
}

operator []=(Object cls, ClassHierarchyNode node) {
// TOOD(sra): Change the key type to `covariant ClassHierarchyNodesMapKey`.
// TODO(sra): Change the key type to `covariant ClassHierarchyNodesMapKey`.
if (cls is ClassHierarchyNodesMapKey) {
cls._classHierarchyNode = node;
return;
Expand Down
12 changes: 6 additions & 6 deletions pkg/dev_compiler/lib/src/analyzer/code_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2878,7 +2878,7 @@ class CodeGenerator extends Object
FunctionBody body, ExecutableElement element) {
var block = body.accept(this) as JS.Block;
if (element.parameters.isNotEmpty) {
// Handle shadowing of parameters by local varaibles, which is allowed in
// Handle shadowing of parameters by local variables, which is allowed in
// Dart but not in JS.
//
// We need this for all function types, including generator-based ones
Expand Down Expand Up @@ -5103,7 +5103,7 @@ class CodeGenerator extends Object
///
/// For example, `expr1[expr2]++` can be transformed to this:
///
/// // psuedocode mix of Scheme and JS:
/// // pseudocode mix of Scheme and JS:
/// (let* (x1=expr1, x2=expr2, t=expr1[expr2]) { x1[x2] = t + 1; t })
///
/// The [JS.MetaLet] nodes automatically simplify themselves if they can.
Expand Down Expand Up @@ -6324,19 +6324,19 @@ class CodeGenerator extends Object
@override
visitConfiguration(node) => _unreachable(node);

/// Unusued, see [_emitConstructor].
/// Unused, see [_emitConstructor].
@override
visitConstructorDeclaration(node) => _unreachable(node);

/// Unusued, see [_emitFieldInitializers].
/// Unused, see [_emitFieldInitializers].
@override
visitConstructorFieldInitializer(node) => _unreachable(node);

/// Unusued, see [_emitRedirectingConstructor].
/// Unused, see [_emitRedirectingConstructor].
@override
visitRedirectingConstructorInvocation(node) => _unreachable(node);

/// Unusued. Handled in [visitForEachStatement].
/// Unused. Handled in [visitForEachStatement].
@override
visitDeclaredIdentifier(node) => _unreachable(node);

Expand Down
12 changes: 6 additions & 6 deletions pkg/dev_compiler/lib/src/js_ast/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ TemplateManager templateManager = TemplateManager();

/**
[js] is a singleton instace of JsBuilder. JsBuilder is a set of conveniences
[js] is a singleton instance of JsBuilder. JsBuilder is a set of conveniences
for constructing JavaScript ASTs.
[string] and [number] are used to create leaf AST nodes:
Expand Down Expand Up @@ -60,7 +60,7 @@ still has one semicolon:
return 123;
If the placeholder is not followed by a semicolon, it is part of an expression.
Here the paceholder is in the position of the function in a function call:
Here the placeholder is in the position of the function in a function call:
var vFoo = new Identifier('foo');
js.statement('if (happy) #("Happy!")', vFoo)
Expand All @@ -71,7 +71,7 @@ Here the paceholder is in the position of the function in a function call:
Generally, a placeholder in an expression position requires an Expression AST as
an argument and a placeholder in a statement position requires a Statement AST.
An expression will be converted to a Statement if needed by creating an
ExpessionStatement. A String argument will be converted into a Identifier and
ExpressionStatement. A String argument will be converted into a Identifier and
requires that the string is a JavaScript identifier.
js('# + 1', vFoo) --> foo + 1
Expand Down Expand Up @@ -146,7 +146,7 @@ bool argument, which selects the then-part or else-part of the if-statement:
js.statement('if (#) return;', eTrue) --> if (true) return;
Combined with block splicing, if-statement condition context placeholders allows
the creation of tenplates that select code depending on variables.
the creation of templates that select code depending on variables.
js.statement('{ 1; if (#) 2; else { 3; 4; } 5;}', true)
--> { 1; 2; 5; }
Expand All @@ -168,10 +168,10 @@ for `a["b"]`:
js('a.#', 'x') --> a.x (i.e. a["x"])
(Question - should `.#` be restricted to permit only String arguments? The
template should probably be writted with `[]` if non-strings are accepted.)
template should probably be written with `[]` if non-strings are accepted.)
Object initialiers allow placeholders in the key property name position:
Object initializers allow placeholders in the key property name position:
js('{#:1, #:2}', [s, 'bye']) --> {hello: 1, bye: 2}
Expand Down
8 changes: 4 additions & 4 deletions pkg/dev_compiler/lib/src/kernel/analyzer_to_kernel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class AnalyzerToKernel {
// Compute the superclass to use for the next iteration of this loop.
//
// Any type arguments are in terms of the original class type parameters.
// This allows us to perform consistent subsititions and have the correct
// This allows us to perform consistent substitutions and have the correct
// type arguments for the final supertype (that we return).
supertype = Supertype(
c,
Expand Down Expand Up @@ -349,9 +349,9 @@ class AnalyzerToKernel {
// TODO(jmesserly): CFE does not respect the synthetic bit on constructors
// so we set a bogus offset. This causes CFE to treat it as not synthetic.
//
// (The bug is in DillMemberBuilder.isSythetic. Sythetic constructors have
// different semantics/optimizations in some cases, so it is important
// that the constructor is correctly marked.)
// (The bug is in DillMemberBuilder.isSynthetic. Synthetic constructors
// have different semantics/optimizations in some cases, so it is
// important that the constructor is correctly marked.)
result.fileOffset = 1;
}
_visitAnnotations(e.metadata, result.addAnnotation);
Expand Down
2 changes: 1 addition & 1 deletion pkg/dev_compiler/tool/input_sdk/private/annotations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class NoReifyGeneric {
const NoReifyGeneric();
}

/// Enables/disables reificiation of functions within the body of this function.
/// Enables/disables reification of functions within the body of this function.
/// ****CAUTION******
/// This is currently unchecked, and hence should be used very carefully for
/// internal SDK APIs only.
Expand Down
2 changes: 1 addition & 1 deletion pkg/expect/lib/async_minitest.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ R Function(A, B) expectAsync2<R, A, B>(R Function(A, B) f, {int count = 1}) {
}

Function expectAsync(Function f, {int count = 1}) {
var f2 = f; // Avoid type-promoting f, we want dynamic invoations.
var f2 = f; // Avoid type-promoting f, we want dynamic invocations.
var test = _currentTest;
if (f2 is Function(Null, Null, Null, Null, Null)) {
test.asyncWait(count);
Expand Down
2 changes: 1 addition & 1 deletion pkg/front_end/lib/src/api_unstable/bazel_worker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Future<List<int>> compile(InitializedCompilerState compilerState,
if (!inputs.contains(lib.importUri)) {
// Excluding the library also means that their canonical names will not
// be computed as part of serialization, so we need to do that
// preemtively here to avoid errors when serializing references to
// preemptively here to avoid errors when serializing references to
// elements of these libraries.
component.root.getChildFromUri(lib.importUri).bindTo(lib.reference);
lib.computeCanonicalNames();
Expand Down
6 changes: 3 additions & 3 deletions pkg/front_end/lib/src/fasta/kernel/body_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
}
}
// No-such-method forwarders get their bodies injected during outline
// buliding, so we should skip them here.
// building, so we should skip them here.
bool isNoSuchMethodForwarder = (builder.function.parent is Procedure &&
(builder.function.parent as Procedure).isNoSuchMethodForwarder);
if (!builder.isExternal && !isNoSuchMethodForwarder) {
Expand Down Expand Up @@ -1145,7 +1145,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
// treat -n differently from -(n). If the expression occurs in a double
// context, -n is a double literal and -(n) is an application of unary- to
// an integer literal. And in any other context, '-' is part of the
// syntax of -n, i.e., -9223372036854775808 is OK and it is the minimun
// syntax of -n, i.e., -9223372036854775808 is OK and it is the minimum
// 64-bit integer, and '-' is an application of unary- in -(n), i.e.,
// -(9223372036854775808) is an error because the literal does not fit in
// 64-bits.
Expand Down Expand Up @@ -2910,7 +2910,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
pushQualifiedReference(start, periodBeforeName);
}

/// A qualfied reference is something that matches one of:
/// A qualified reference is something that matches one of:
///
/// identifier
/// identifier typeArguments? '.' identifier
Expand Down
4 changes: 2 additions & 2 deletions pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ abstract class AbstractScanner implements Scanner {
int currentAsUnicode(int next);

/**
* Returns the character at the next poisition. Like in [advance], the
* Returns the character at the next position. Like in [advance], the
* [Utf8BytesScanner] returns a UTF-8 byte, while the [StringScanner] returns
* a UTF-16 code unit.
*/
Expand Down Expand Up @@ -906,7 +906,7 @@ abstract class AbstractScanner implements Scanner {
commentsTail = null;
} else {
// It is the responsibility of the caller to construct the token
// being appended with preceeding comments if any
// being appended with preceding comments if any
assert(comments == null || token.isSynthetic || token is ErrorToken);
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/front_end/testcases/check_deferred_before_args2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'deferred_lib.dart' deferred as lib;
main() {}

test() async {
// The current evaluation order will triger the check of lib.m before the
// The current evaluation order will trigger the check of lib.m before the
// loadLibrary call.
lib.m(await lib.loadLibrary());
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// when inferring the type of the constructor.
//
// The compiler should generate an error message and it should be properly
// formatted including offset and lenght of the constructor.
// formatted including offset and length of the constructor.
var x = new C._circular(null);

class C {
Expand Down
2 changes: 1 addition & 1 deletion pkg/front_end/tool/_fasta/bulk_compile_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ testCompiler() async {
await compiler.compile("main() { print('Hello, World!'); }");
await compiler.compile(
// This example is a regression test of lazy loading of FunctionNode
// which would break when this is preceeded by hello-world.
// which would break when this is preceded by hello-world.
"main() { [].map(); }");
await compiler.compile("main() { print('Hello, Brave New World!'); }");
await compiler.compile("import 'package';");
Expand Down
Loading

0 comments on commit 2da0b9f

Please sign in to comment.