Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Unified Diff: tests/compiler/dart2js/type_mask_test_helper.dart

Issue 165143004: Move TypeMask.simplify to a test helper. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/type_combination_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/type_mask_test_helper.dart
diff --git a/tests/compiler/dart2js/type_mask_test_helper.dart b/tests/compiler/dart2js/type_mask_test_helper.dart
new file mode 100644
index 0000000000000000000000000000000000000000..88f234da64c95cbdfd23b2b3d6df1cc12132c58c
--- /dev/null
+++ b/tests/compiler/dart2js/type_mask_test_helper.dart
@@ -0,0 +1,19 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library type_mask_test_helper;
+
+import '../../../sdk/lib/_internal/compiler/implementation/types/types.dart';
+import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart'
+ show Compiler;
+
+TypeMask simplify(TypeMask mask, Compiler compiler) {
+ if (mask is ForwardingTypeMask) {
+ return simplify(mask.forwardTo, compiler);
+ } else if (mask is UnionTypeMask) {
+ return UnionTypeMask.flatten(mask.disjointMasks, compiler);
+ } else {
+ return mask;
+ }
+}
« no previous file with comments | « tests/compiler/dart2js/type_combination_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698