Spelling tests web

Closes https://github.com/dart-lang/sdk/pull/50879

TEST=only changes to spelling to comments and internal string messages
GitOrigin-RevId: 3fa4104fa17054ea2247118a1b6213c62f2749e0
Change-Id: I776120bb2492c662dd32612dd2f6a670b5891e42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278060
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
diff --git a/benchmarks/Iterators/dart/Iterators.dart b/benchmarks/Iterators/dart/Iterators.dart
index 3c3d961..d31f041 100644
--- a/benchmarks/Iterators/dart/Iterators.dart
+++ b/benchmarks/Iterators/dart/Iterators.dart
@@ -337,7 +337,7 @@
   // have growable and const lists at the same use-site (e.g. the const coming
   // from a default argument).
   //
-  // Ideally some combination of the class heirarchy or compiler tricks would
+  // Ideally some combination of the class hierarchy or compiler tricks would
   // ensure there is little cost of having this gentle polymorphism.
   BenchmarkListIntSystem1(int size)
       : _list1 = List.generate(size, (i) => i),
@@ -364,7 +364,7 @@
   // have fixed-length and const lists at the same use-site (e.g. the const
   // coming from a default argument).
   //
-  // Ideally some combination of the class heirarchy or compiler tricks would
+  // Ideally some combination of the class hierarchy or compiler tricks would
   // ensure there is little cost of having this gentle polymorphism.
   BenchmarkListIntSystem2(int size)
       : _list1 = List.generate(size, (i) => i, growable: false),
diff --git a/pkg/compiler/lib/src/deferred_load/entity_data_info.dart b/pkg/compiler/lib/src/deferred_load/entity_data_info.dart
index 8096e32..8945c79 100644
--- a/pkg/compiler/lib/src/deferred_load/entity_data_info.dart
+++ b/pkg/compiler/lib/src/deferred_load/entity_data_info.dart
@@ -552,7 +552,7 @@
   void visitTypeLiteral(ir.TypeLiteral node) {
     // Type literals may be [ir.TypeParameterType] or contain TypeParameterType
     // variables nested within (e.g. in a generic type literals). As such,
-    // we can't assume that all type literals are constnat.
+    // we can't assume that all type literals are constant.
     add(node, requireConstant: false);
   }
 
diff --git a/pkg/compiler/lib/src/inferrer/types.dart b/pkg/compiler/lib/src/inferrer/types.dart
index 6b4fa97..6ca363e 100644
--- a/pkg/compiler/lib/src/inferrer/types.dart
+++ b/pkg/compiler/lib/src/inferrer/types.dart
@@ -322,7 +322,7 @@
         failedAt(
             member,
             "unexpected input: ConstructorBodyElements are created"
-            " after global type inference, no data is avaiable for them."));
+            " after global type inference, no data is available for them."));
     // TODO(sigmund,johnniwinther): Make it an error to query for results that
     // don't exist..
     /*assert(memberResults.containsKey(member) || member is JSignatureMethod,
diff --git a/pkg/compiler/lib/src/inferrer_experimental/types.dart b/pkg/compiler/lib/src/inferrer_experimental/types.dart
index 57ce6b6..c67108e 100644
--- a/pkg/compiler/lib/src/inferrer_experimental/types.dart
+++ b/pkg/compiler/lib/src/inferrer_experimental/types.dart
@@ -345,7 +345,7 @@
         failedAt(
             member,
             "unexpected input: ConstructorBodyElements are created"
-            " after global type inference, no data is avaiable for them."));
+            " after global type inference, no data is available for them."));
     // TODO(sigmund,johnniwinther): Make it an error to query for results that
     // don't exist..
     /*assert(memberResults.containsKey(member) || member is JSignatureMethod,
diff --git a/pkg/compiler/lib/src/ir/scope_visitor.dart b/pkg/compiler/lib/src/ir/scope_visitor.dart
index ef0b038..5752156 100644
--- a/pkg/compiler/lib/src/ir/scope_visitor.dart
+++ b/pkg/compiler/lib/src/ir/scope_visitor.dart
@@ -941,7 +941,7 @@
     // user-defined `get:hashCode` or `operator==`.
     //
     // TODO(45681): Improve the analysis. (1) Use static type of the [key]
-    // expression. (2) Use information about the class heirarchy and overloading
+    // expression. (2) Use information about the class hierarchy and overloading
     // of `get:hashCode` to detect safe implementations. This will pick up a lot
     // of enum and enum-like classes.
     if (key is ir.ConstantExpression) {
diff --git a/runtime/vm/app_snapshot.cc b/runtime/vm/app_snapshot.cc
index 0624188..4d0f3e4 100644
--- a/runtime/vm/app_snapshot.cc
+++ b/runtime/vm/app_snapshot.cc
@@ -1100,7 +1100,7 @@
   }
   code_index -= base;
 
-  // At this point code_index is refering to a code object which is either
+  // At this point code_index is referring to a code object which is either
   // discarded or exists in the Code cluster. Non-discarded Code objects
   // are associated with the tail of the instruction table and have the
   // same order there and in the Code cluster. This means that
diff --git a/runtime/vm/compiler/backend/il.h b/runtime/vm/compiler/backend/il.h
index 5cdf3d4..817a07a 100644
--- a/runtime/vm/compiler/backend/il.h
+++ b/runtime/vm/compiler/backend/il.h
@@ -5468,7 +5468,7 @@
   explicit MakeTempInstr(Zone* zone)
       : null_(new (zone) ConstantInstr(Object::ZoneHandle())) {
     // Note: We put ConstantInstr inside MakeTemp to simplify code generation:
-    // having ConstantInstr allows us to use Location::Contant(null_) as an
+    // having ConstantInstr allows us to use Location::Constant(null_) as an
     // output location for this instruction.
   }
 
diff --git a/runtime/vm/scopes.h b/runtime/vm/scopes.h
index 32fa79a..28cfaa3 100644
--- a/runtime/vm/scopes.h
+++ b/runtime/vm/scopes.h
@@ -27,7 +27,7 @@
 //
 // There are generally 4 different kinds of [LocalVariable]s:
 //
-//    a) [LocalVariable]s refering to a parameter: The indices for those
+//    a) [LocalVariable]s referring to a parameter: The indices for those
 //       variables are assigned by the flow graph builder. Parameter n gets
 //       assigned the index (function.num_parameters - n - 1). I.e. the last
 //       parameter has index 1.
diff --git a/sdk/lib/_internal/js_shared/lib/rti.dart b/sdk/lib/_internal/js_shared/lib/rti.dart
index b1c6be8..65e1290 100644
--- a/sdk/lib/_internal/js_shared/lib/rti.dart
+++ b/sdk/lib/_internal/js_shared/lib/rti.dart
@@ -2354,8 +2354,8 @@
 /// type is passed without creating a 1-tuple object. This means that the
 /// interface Rti for, say, `Map<num,dynamic>` serves as two environments with
 /// different shapes. It is a class environment (K=num, V=dynamic) and a simple
-/// 1-tuple environment. This is supported by index '0' refering to the whole
-/// type, and '1 and '2' refering to K and V positionally:
+/// 1-tuple environment. This is supported by index '0' referring to the whole
+/// type, and '1 and '2' referring to K and V positionally:
 ///
 ///     interface("Map", [num,dynamic])
 ///     0                 1   2
diff --git a/tests/web/deferred/default_arg_is_tearoff_test.dart b/tests/web/deferred/default_arg_is_tearoff_test.dart
index 64c0c20..77efb95 100644
--- a/tests/web/deferred/default_arg_is_tearoff_test.dart
+++ b/tests/web/deferred/default_arg_is_tearoff_test.dart
@@ -6,7 +6,7 @@
 ///
 /// The compiler used to keep all metadata (other than type information) in one
 /// global table that was shipped with the main output unit.  For most metadata
-/// this was OK because it was refering to strings and other simple constants.
+/// this was OK because it was referring to strings and other simple constants.
 /// However, we also allow to refer to tear-offs of top-level functions. When
 /// that top-level function was assigned to a deferred fragment, the metadata
 /// initialization would simply fail.
diff --git a/tests/web/deferred/shadowed_types/lib_shared.dart b/tests/web/deferred/shadowed_types/lib_shared.dart
index ee8202f..a07d9e9 100644
--- a/tests/web/deferred/shadowed_types/lib_shared.dart
+++ b/tests/web/deferred/shadowed_types/lib_shared.dart
@@ -12,7 +12,7 @@
 // unit.
 class C_Parent {}
 
-// Classes D through F represent a simple heirarchy.
+// Classes D through F represent a simple hierarchy.
 // D's type is used in liba.
 // F is instantiated, but unused in libb.
 class D {}
diff --git a/tests/web/internal/deferred/load_in_correct_order_test.dart b/tests/web/internal/deferred/load_in_correct_order_test.dart
index 989ebfa..24f1558 100644
--- a/tests/web/internal/deferred/load_in_correct_order_test.dart
+++ b/tests/web/internal/deferred/load_in_correct_order_test.dart
@@ -118,7 +118,7 @@
   req.send();
 };
 
-// Note that a new hunk is already avaiable to be loaded, wait until all
+// Note that a new hunk is already available to be loaded, wait until all
 // expected hunks are available and then evaluate their contents to actually
 // load them.
 self.increment = function() {
diff --git a/tests/web/js_array_index_error_test.dart b/tests/web/js_array_index_error_test.dart
index 9998762..6f31672 100644
--- a/tests/web/js_array_index_error_test.dart
+++ b/tests/web/js_array_index_error_test.dart
@@ -163,7 +163,7 @@
     return a;
   }
 
-  compare('coinstant index-set on empty list', fault1, fault2, fault3);
+  compare('constant index-set on empty list', fault1, fault2, fault3);
 }
 
 constantIndexSetNonempty() {
diff --git a/tests/web_2/deferred/default_arg_is_tearoff_test.dart b/tests/web_2/deferred/default_arg_is_tearoff_test.dart
index 7e3d96c..2341f44 100644
--- a/tests/web_2/deferred/default_arg_is_tearoff_test.dart
+++ b/tests/web_2/deferred/default_arg_is_tearoff_test.dart
@@ -8,7 +8,7 @@
 ///
 /// The compiler used to keep all metadata (other than type information) in one
 /// global table that was shipped with the main output unit.  For most metadata
-/// this was OK because it was refering to strings and other simple constants.
+/// this was OK because it was referring to strings and other simple constants.
 /// However, we also allow to refer to tear-offs of top-level functions. When
 /// that top-level function was assigned to a deferred fragment, the metadata
 /// initialization would simply fail.
diff --git a/tests/web_2/internal/deferred/load_in_correct_order_test.dart b/tests/web_2/internal/deferred/load_in_correct_order_test.dart
index 9bbf5f9..55be33f 100644
--- a/tests/web_2/internal/deferred/load_in_correct_order_test.dart
+++ b/tests/web_2/internal/deferred/load_in_correct_order_test.dart
@@ -89,7 +89,7 @@
   req.send();
 };
 
-// Note that a new hunk is already avaiable to be loaded, wait until all
+// Note that a new hunk is already available to be loaded, wait until all
 // expected hunks are available and then evaluate their contents to actually
 // load them.
 self.increment = function() {
diff --git a/tests/web_2/js_array_index_error_test.dart b/tests/web_2/js_array_index_error_test.dart
index 5975a0b..689dc26 100644
--- a/tests/web_2/js_array_index_error_test.dart
+++ b/tests/web_2/js_array_index_error_test.dart
@@ -165,7 +165,7 @@
     return a;
   }
 
-  compare('coinstant index-set on empty list', fault1, fault2, fault3);
+  compare('constant index-set on empty list', fault1, fault2, fault3);
 }
 
 constantIndexSetNonempty() {