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

Side by Side Diff: tests/language/parameter_types_specialization_test.dart

Issue 12743005: Revert "Remove Expect from core library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload (first upload failed). Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/language/parameter_name_conflict_test.dart ('k') | tests/language/parse_types_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // Test that we invalidate parameter type optimization in the presence 4 // Test that we invalidate parameter type optimization in the presence
5 // of optional parameters. 5 // of optional parameters.
6 6
7 import "package:expect/expect.dart";
8
9 class A { 7 class A {
10 void foo(bool firstInvocation, [a = 42, b = 'foo']) { 8 void foo(bool firstInvocation, [a = 42, b = 'foo']) {
11 if (firstInvocation) { 9 if (firstInvocation) {
12 Expect.isTrue(a is String); 10 Expect.isTrue(a is String);
13 Expect.isTrue(b is int); 11 Expect.isTrue(b is int);
14 } else { 12 } else {
15 Expect.isTrue(a is int); 13 Expect.isTrue(a is int);
16 Expect.isTrue(b is String); 14 Expect.isTrue(b is String);
17 } 15 }
18 } 16 }
19 } 17 }
20 18
21 test() { 19 test() {
22 // This call to [A.foo] will be in the queue after [A.foo] has been 20 // This call to [A.foo] will be in the queue after [A.foo] has been
23 // compiled with the optimistic type assumptions. 21 // compiled with the optimistic type assumptions.
24 new A().foo(false); 22 new A().foo(false);
25 } 23 }
26 24
27 main() { 25 main() {
28 test(); 26 test();
29 // This call to [A.foo] will be the first in the queue, and dart2js 27 // This call to [A.foo] will be the first in the queue, and dart2js
30 // will optimize the method with these parameter types. 28 // will optimize the method with these parameter types.
31 new A().foo(true, 'bar', 42); 29 new A().foo(true, 'bar', 42);
32 } 30 }
OLDNEW
« no previous file with comments | « tests/language/parameter_name_conflict_test.dart ('k') | tests/language/parse_types_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698