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

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

Issue 2990933002: Migrate block 43. (Closed)
Patch Set: Update tests and status file. Created 3 years, 4 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
« no previous file with comments | « tests/language/bailout2_test.dart ('k') | tests/language/bailout4_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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import "package:expect/expect.dart";
6
7 // Test that the return type of a method is being registered for both
8 // its bailout and optimized version in dart2js.
9
10 var a;
11
12 bar() {
13 if (a[0] == 0) {
14 // Force bailout version.
15 bar();
16 // Avoid inlining.
17 throw 0;
18 }
19 for (int i = 0; i < 10; i++) {
20 a[0] = 42;
21 }
22 // This return should say that bar can return an array or unknown.
23 return a;
24 }
25
26 foo() {
27 if (a[0] == 0) {
28 // Avoid inlining.
29 throw 0;
30 }
31 var b = bar();
32 // This check used to fail because dart2js was assuming [b] was an
33 // array.
34 Expect.equals(1, b.length);
35 }
36
37 main() {
38 a = new Map();
39 bar();
40 foo();
41 }
OLDNEW
« no previous file with comments | « tests/language/bailout2_test.dart ('k') | tests/language/bailout4_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698