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

Unified Diff: tests/language/null_hashcode_optimized_vm_test.dart

Issue 12330113: null value can be the receiver of methods on Object (e.g. hashCode). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « runtime/vm/il_printer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/null_hashcode_optimized_vm_test.dart
diff --git a/tests/language/null_no_such_method_test.dart b/tests/language/null_hashcode_optimized_vm_test.dart
similarity index 54%
copy from tests/language/null_no_such_method_test.dart
copy to tests/language/null_hashcode_optimized_vm_test.dart
index adfab894f71803f7455b6211b07fa2067da4a05a..27906ca25e9cf25e41fe528059a2c83d783c6197 100644
--- a/tests/language/null_no_such_method_test.dart
+++ b/tests/language/null_hashcode_optimized_vm_test.dart
@@ -1,11 +1,13 @@
// 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.
-
-var array = [1];
+// Test that optimized Object.hashCode works for the null receiver.
+// VMOptions=--optimization_counter_threshold=100
main() {
- Expect.throws(() => -null, (e) => e is NoSuchMethodError);
- // Make sure we have an untyped call to operator-.
- print(-array[0]);
+ for (int i = 0; i < 200; i++) {
+ foo(null);
+ }
}
+
+foo(a) => a.hashCode;
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698