| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 | 4 |
| 5 // Regression test for a crash in dart2js. | 5 // Regression test for a crash in dart2js. |
| 6 | 6 |
| 7 part of crash_6725; |
| 8 |
| 7 class Fisk { | 9 class Fisk { |
| 8 it1(x) { | 10 it1(x) { |
| 9 // "key" is unresolved and caused a crash in dart2js. | 11 // "key" is unresolved and caused a crash in dart2js. |
| 10 // This is the original example the user reported. | 12 // This is the original example the user reported. |
| 11 for (key in x) { | 13 for (key in x) { |
| 12 print(key); | 14 print(key); |
| 13 } | 15 } |
| 14 } | 16 } |
| 15 | 17 |
| 16 it2(x) { | 18 it2(x) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 28 } | 30 } |
| 29 } | 31 } |
| 30 } | 32 } |
| 31 | 33 |
| 32 class SubFisk extends Fisk { | 34 class SubFisk extends Fisk { |
| 33 var key; | 35 var key; |
| 34 var length; | 36 var length; |
| 35 var fisk; | 37 var fisk; |
| 36 } | 38 } |
| 37 | 39 |
| 38 main() { | 40 test() { |
| 39 Fisk f = new SubFisk(); | 41 Fisk f = new SubFisk(); |
| 40 var m = (x) { | 42 var m = (x) { |
| 41 for (undeclared in x) { | 43 for (undeclared in x) { |
| 42 print(undeclared); | 44 print(undeclared); |
| 43 } | 45 } |
| 44 }; | 46 }; |
| 45 if (new DateTime.now().millisecondsSinceEpoch == 42) { | 47 if (new DateTime.now().millisecondsSinceEpoch == 42) { |
| 46 f = null; | 48 f = null; |
| 47 m = (x) {}; | 49 m = (x) {}; |
| 48 } | 50 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 62 throw 'f.fisk != 42 (${f.fisk})'; | 64 throw 'f.fisk != 42 (${f.fisk})'; |
| 63 } | 65 } |
| 64 | 66 |
| 65 try { | 67 try { |
| 66 m([87, 42]); | 68 m([87, 42]); |
| 67 throw 'NoSuchMethodError expected'; | 69 throw 'NoSuchMethodError expected'; |
| 68 } on NoSuchMethodError { | 70 } on NoSuchMethodError { |
| 69 // Expected. | 71 // Expected. |
| 70 } | 72 } |
| 71 } | 73 } |
| OLD | NEW |